Bug 5175: Some styles need subtitles
Jul. 12th, 2013 06:46 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Description:
Some of the older DW styles do not print the page subtitle even though the option is there on the customize style page. Styles that are concerned are the following:
- Brittle, Negatives (doesn't print the title either)
- Skittlish Dreams, Sunday Morning, Transmogrified
Proposed fix:
Edit the layouts concerned to add in the missing feature. Edit the relevant portion of the CSS to make the change as unobtrusive as possible for the user of said styles.
References files:
- Formatted source of core2,
momijizukamori's giant list of core2 variables,
Files edited:
- For each layout, styles/$layoutname/layer.s2 (in either dw-free or dw-nonfree).
Bug Diary:
Read through core2.s2 to find the functions printing the title and subtitle of a page. Subsequently, went through each layer.s2
file to find what each styles does in the header area.
- Brittle
- The header is masked using CSS only. Title and subtitle styling absent.
- FIX: Supplement CSS.
- Negatives
- The style overrides
Page::print
, prints neither title nor subtitle. Styling absent. - FIX: edit
Page::print
inlayer.s2
to add a call toprint_global_title()
andprint_global_subtitle()
. Supplement CSS - Skittlish Dreams
- The style overrides
Page::print
, doesn't print the subtitle. Styling insufficient. - FIX: edit
Page::print
inlayer.s2
to add a call toprint_global_subtitle()
. Supplement CSS. - Sunday Morning
- The style overrides
Page::print
, doesn't print the subtitle. Styling insufficient. - FIX: edit
Page::print
inlayer.s2
to add a call toprint_global_subtitle()
. Supplement CSS. - Transmogrified
- The style overrides
Page::print
, doesn't print the subtitle. Styling insufficient. - FIX: edit
Page::print
inlayer.s2
to add a call toprint_global_subtitle()
. Supplement CSS.
Where necessary edited the layer.s2 files to add calls to print_global_[sub|]title
. Tested the result by updating the database ($LJHOME/bin/upgrading/update-db.pl --run --populate
). Fixed errors and typos until both title and subtitle were displaying on the page.
Tailored the CSS of each new header block in the less intrusive manner possible. Since none of the layout concerned are children of Tabulas Rasa, added any missing core2 variable used in the adequate propgroup
sections (property use $prop_name;
).
Once satisfied with the changes made, made the last commits and pushed the branches to my forks of dw-free
and dw-nonfree
using git push origin BRACH_NAME
. Once that was done, made a pull request using the github web interface.
As suggested by ninetyd, also made list of css rules for a post for
dw_styles explaining what to do to roll back the changes on a per user/layout basis.
- Brittle
#header {display: none;}
- Negatives
#header h1, #header h2 {dislay: none;}
- Skittlish Dreams
#header h2 {display: none;}
- Sunday Morning
.two-columns .module-section-two {top: 8em;}
#header h1 {padding: 1em;}
#header h2 {display: none;}
- Transmogrified
#header h2 {display: none;}
Notes, tips and assorted blooper reels:
Forgot to create a git branch in dw-nonfree before starting work on Sunday Morning and Transmogrified. Since dw-free and dw-nonfree are two different repos, bugs needing work on both require a git branch in both, else changes won't be tracked and it will be impossible to commit part of the changes made. Since I still had the files open in my editor, and had made little alteration to them, I was able to backtrack my changes, save them to their initial state and create the git branch before restoring my changes.
When making styles changes it is a good idea to prepare a post to dw_styles to explain how to revert back the changes on a per user/style basis.
When pushing changes to one's repo, one must:
a. Be at the root of one's local copy of the repo (for ex `~/dw` on a dreamhack)
b. Make sure to be in the branch you want to push (check using `git status` and if needed use `git checkout BRANCH_NAME`
c. Use the following command `git push origin BRANCH_NAME`
When wanting to update my dreamhack I ran into a slight snafu: my script wouldn't run. I asked for help on IRC and geekosaur explained the problem:
geekosaur: The problem is that DOS/Windows and Unix have different conventions for end of line. That
^M
in your error is a symptom of it.
Unix uses control-J, windows uses control-M + control-J so a windows file on unix looks like it has an extra control-M at the end of every line, which if you're lucky is visible as such and if you're not just moves the cursor to the far left of the terminal.
You can convert such files using the command fromdos -b <filepath>
.
I found it useful to keep notes of what I did while working on the bug (answers given in IRC, documents and files I consulted, what I did, especially when I messed up with the solution/fix to that if possible) in a markdown formatted text file. It made writing this entry easier.
Resist the temptation to make changes un related to your bugs. It's hard but it's better to either file a new bug if it doesn't exist, or grab the existing one to work on it later. I kept track of the issues I saw in a separate text file.
Thanks:
I would like to thank the members of #dreamwidth and in particular (but non-exhaustively) sophie,
kaberett,
geekosaur,
momijizukamori and
ninetyd for their coaching, cheering and reassurances as I worked my way through this bug. Y'all are amazing :)
Note: This entry also lives in
dw_dev_training.