Merge lp:~l3on/ubuntu-packaging-guide/new-sidebar into lp:ubuntu-packaging-guide
- new-sidebar
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 104 |
Proposed branch: | lp:~l3on/ubuntu-packaging-guide/new-sidebar |
Merge into: | lp:ubuntu-packaging-guide |
Diff against target: |
312 lines (+165/-38) 7 files modified
BORROWED-CODE (+3/-0) Makefile (+3/-1) debian/control (+2/-2) themes/ubuntu/layout.html (+4/-35) themes/ubuntu/sidebar.html (+55/-0) themes/ubuntu/static/home.css (+77/-0) themes/ubuntu/static/main.js (+21/-0) |
To merge this branch: | bzr merge lp:~l3on/ubuntu-packaging-guide/new-sidebar |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Holbach (community) | Approve | ||
Review via email: mp+105360@code.launchpad.net |
Commit message
Description of the change
This patch tries to provide a new Sidebar for ubuntu-
A build-test can be found here:
http://
What I used:
* Images/icons come from Humanity icon theme.
* Jquery (added to the "_static" dir, of course we should use instead
jquery lib shipped with with Ubuntu, but I do not know how I can do
it)
Have a great day.
Leo.
- 89. By Leo Iannacone
-
Revert LANGS reset
- 90. By Leo Iannacone
-
Added information where new icons come from
Leo Iannacone (l3on) wrote : | # |
> Thanks a lot for your work on this Leon!
You're welcome Daniel!
> I have a few questions:
>
> - Why do you reset LANGS? I'm not sure I understand what's going on. :-)
That was a push mistake, I mean: I reset LANGS for speed up test builds and I forgot to revert before propose the merge. [fixed]
> - Do we specifically need jquery 1.6.1? Or is anything >= 1.6.1 fine? If so,
> we could rely on the system jquery, which has been >= 1.6.1 since oneiric.
I checked if everything works fine also with jquery 1.7.1, and it does... So, no problem with jquery >= 1.6.1
> - Could you document in BORROWED-CODE where you got the icons from?
Yes, of course! [done]
> Thanks again for your great work! This is great!
Thank you! :)
Daniel Holbach (dholbach) wrote : | # |
Please let me know if the changes in https:/
Daniel Holbach (dholbach) wrote : | # |
- 91. By Leo Iannacone
-
Merged from dholbach
Daniel Holbach (dholbach) wrote : | # |
Great work, Leo! Grazie mille!
I have two small issues still:
- there's a merge conflict in BORROWED-CODE - do you think
you could fix it? (It looks pretty easy to fix)
- this seems not to work for the singlehtml view, where
"jump to top" would be superhelpful to have
Thanks again.
- 92. By Leo Iannacone
-
Fix javascript location in singlehtml
- 93. By Leo Iannacone
-
Fix toc in singlehtml mode
- 94. By Leo Iannacone
-
Prevent toc to being half showed in "fixed-mode" when the windows is not
enough big. This fixes toc style for singlehtml specially, where toc is
very long. - 95. By Leo Iannacone
-
Fixed path for new images
- 96. By Leo Iannacone
-
Merging with original tree.
Leo Iannacone (l3on) wrote : | # |
Hi Daniel!
How are you? :)
I worked a bit on those issues..
- BORROWED-CODE should be fixed (I think)
- I worked a bit on singlehtml, toc now is fixed.
Anyway I found there a new problem regarding toc and "if the browser window is not enough big", more precisely: if windows.height < toc.height, you'll see only a part of the entire toc.
I think the best way to fix it is avoid this behaviour if the window is too small (that's what I did).
Anyway, if we could "split" theme for singlehtml and html version, we would be able to make the JUMP_TO_TOP link smarter for this case...
Best,
Leo.
- 97. By Leo Iannacone
-
Revert Makefile to revision 96
http://bazaar. launchpad. net/~ubuntu- packaging- guide-team/ ubuntu- packaging- guide/trunk/ revision/ 96
Daniel Holbach (dholbach) wrote : | # |
This looks great to me. For some reason though when I scroll down (or use cursor down), the ToC jumps quite a bit, sometimes it shows, then it's gone, then it shows again, etc.
Do we have any idea why this is? Can anyone try this and see if it fails for you as well?
Leo Iannacone (l3on) wrote : | # |
Hi Daniel,
you're completely right.
For some reason, I did not see that "flickering" before commit last changes.
Anyway, I think I fixed it in the rev98.
Can you check if everything works fine now?
Leo.
- 98. By Leo Iannacone
-
Fix flickering when add/remove class .fixed to sidebar
- 99. By Leo Iannacone
-
Use variable instead of static name in main.js
Daniel Holbach (dholbach) wrote : | # |
Great work Leo! Merged and updated debian/copyright accordingly.
Preview Diff
1 | === modified file 'BORROWED-CODE' |
2 | --- BORROWED-CODE 2012-05-10 22:37:51 +0000 |
3 | +++ BORROWED-CODE 2012-05-24 16:25:47 +0000 |
4 | @@ -2,6 +2,9 @@ |
5 | themes/ubuntu/static/images/{background-header-home.png,background-footer.png,sec-nav-hover.gif} |
6 | From lp:ubuntudeveloperportal |
7 | |
8 | +themes/ubuntu/static/images/{go-home.png,go-next.png,go-previous.png} |
9 | + From lp:humanity |
10 | + |
11 | themes/ubuntu/static/960.css |
12 | Derived from: https://github.com/nathansmith/960-grid-system/ |
13 | By way of: lp:ubuntudeveloperportal |
14 | |
15 | === modified file 'Makefile' |
16 | --- Makefile 2012-05-11 18:36:36 +0000 |
17 | +++ Makefile 2012-05-24 16:25:47 +0000 |
18 | @@ -15,7 +15,7 @@ |
19 | PODIR = po |
20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . |
21 | #LANGS = $(basename $(notdir $(wildcard $(PODIR)/*.po))) |
22 | -LANGS = |
23 | +LANGS= |
24 | |
25 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext locale |
26 | |
27 | @@ -51,6 +51,7 @@ |
28 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html |
29 | mv $(BUILDDIR)/html/ubuntu-packaging-guide/*html $(BUILDDIR)/html/ |
30 | sed -i 's/href="..\//href=".\//g' $(BUILDDIR)/html/*html |
31 | + sed -i 's/src="..\/_static/src=".\/_static/g' $(BUILDDIR)/html/*html |
32 | sed -i 's/..\/_images/.\/_images/g' $(BUILDDIR)/html/*html |
33 | @echo |
34 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html" |
35 | @@ -77,6 +78,7 @@ |
36 | sed -i 's/href="..\//href=".\//g' $(BUILDDIR)/singlehtml/index.html |
37 | sed -i 's/ubuntu-packaging-guide\/index/index/g' $(BUILDDIR)/singlehtml/index.html |
38 | sed -i 's/..\/..\/_images/.\/_images/g' $(BUILDDIR)/singlehtml/index.html |
39 | + sed -i 's/src="..\/_static/src=".\/_static/g' $(BUILDDIR)/singlehtml/index.html |
40 | @echo |
41 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml" |
42 | singlehtml-%: locale |
43 | |
44 | === modified file 'debian/control' |
45 | --- debian/control 2012-05-10 17:20:03 +0000 |
46 | +++ debian/control 2012-05-24 16:25:47 +0000 |
47 | @@ -22,7 +22,7 @@ |
48 | ubuntu-packaging-guide-html. |
49 | |
50 | Package: ubuntu-packaging-guide-html |
51 | -Depends: ${misc:Depends}, libjs-underscore, libjs-jquery |
52 | +Depends: ${misc:Depends}, libjs-underscore, libjs-jquery (>= 1.6.1) |
53 | Architecture: all |
54 | Description: Ubuntu Packaging Guide - HTML guide |
55 | The Ubuntu Packaging Guide is a set of articles that should help you to get |
56 | @@ -46,7 +46,7 @@ |
57 | This package contains the PDF version of the guide. |
58 | |
59 | Package: ubuntu-packaging-guide-epub |
60 | -Depends: ${misc:Depends}, libjs-underscore, libjs-jquery |
61 | +Depends: ${misc:Depends}, libjs-underscore, libjs-jquery (>= 1.6.1) |
62 | Architecture: all |
63 | Description: Ubuntu Packaging Guide - EPUB guide |
64 | The Ubuntu Packaging Guide is a set of articles that should help you to get |
65 | |
66 | === modified file 'themes/ubuntu/layout.html' |
67 | --- themes/ubuntu/layout.html 2012-05-11 20:57:21 +0000 |
68 | +++ themes/ubuntu/layout.html 2012-05-24 16:25:47 +0000 |
69 | @@ -17,7 +17,6 @@ |
70 | (sidebars != []) %} |
71 | {%- set url_root = pathto('', 1) %} |
72 | {%- if url_root == '#' %}{% set url_root = '' %}{% endif %} |
73 | - |
74 | |
75 | {%- macro relbar() %} |
76 | <div class="header-content"> |
77 | @@ -48,40 +47,7 @@ |
78 | |
79 | {%- macro sidebar() %} |
80 | {%- if render_sidebar %} |
81 | - <div class="grid-3 omega"> |
82 | - <div class="container-tweet"> |
83 | - {%- block sidebarlogo %} |
84 | - {%- if logo %} |
85 | - <p class="logo"><a href="{{ pathto(master_doc) }}"> |
86 | - <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> |
87 | - </a></p> |
88 | - {%- endif %} |
89 | - {%- endblock %} |
90 | - {%- if sidebars != None %} |
91 | - {#- new style sidebar: explicitly include/exclude templates #} |
92 | - {%- for sidebartemplate in sidebars %} |
93 | - {%- include sidebartemplate %} |
94 | - {%- endfor %} |
95 | - {%- else %} |
96 | - {#- old style sidebars: using blocks -- should be deprecated #} |
97 | - {%- block sidebartoc %} |
98 | - {%- include "localtoc.html" %} |
99 | - {%- endblock %} |
100 | - {%- block sidebarrel %} |
101 | - {%- include "relations.html" %} |
102 | - {%- endblock %} |
103 | - {%- block sidebarsourcelink %} |
104 | - {%- include "sourcelink.html" %} |
105 | - {%- endblock %} |
106 | - {%- if customsidebar %} |
107 | - {%- include customsidebar %} |
108 | - {%- endif %} |
109 | - {%- block sidebarsearch %} |
110 | - {%- include "searchbox.html" %} |
111 | - {%- endblock %} |
112 | - {%- endif %} |
113 | - </div> |
114 | - </div> |
115 | + {%- include "sidebar.html" %} |
116 | {%- endif %} |
117 | {%- endmacro %} |
118 | |
119 | @@ -117,6 +83,8 @@ |
120 | {# %- for scriptfile in script_files %} |
121 | <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> |
122 | {%- endfor % #} |
123 | + <script type="text/javascript" src="{{ pathto('_static/jquery.js', 1) }}"></script> |
124 | + <script type="text/javascript" src="{{ pathto('_static/main.js', 1) }}"></script> |
125 | {%- if use_opensearch %} |
126 | <link rel="search" type="application/opensearchdescription+xml" |
127 | title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}" |
128 | @@ -153,6 +121,7 @@ |
129 | {%- block extrahead %} {% endblock %} |
130 | </head> |
131 | <body class="home"> |
132 | + <a name="top"></a> |
133 | |
134 | <div class="header-navigation"> |
135 | <div> |
136 | |
137 | === added file 'themes/ubuntu/sidebar.html' |
138 | --- themes/ubuntu/sidebar.html 1970-01-01 00:00:00 +0000 |
139 | +++ themes/ubuntu/sidebar.html 2012-05-24 16:25:47 +0000 |
140 | @@ -0,0 +1,55 @@ |
141 | +{# |
142 | + ubuntu/sidebar.html |
143 | + ~~~~~~~~~~~~~~~~~ |
144 | + |
145 | + Ubuntu layout template for Sphinx themes. |
146 | + |
147 | + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. |
148 | + :license: BSD, see LICENSE for details. |
149 | +#} |
150 | + |
151 | + <div id="sidebar" class="grid-3 omega"> |
152 | + <div class="container-tweet"> |
153 | + |
154 | + {%- if logo %} |
155 | + <p class="logo"><a href="{{ pathto(master_doc) }}"> |
156 | + <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> |
157 | + </a></p> |
158 | + {%- endif %} |
159 | + |
160 | + {%- if display_toc %} |
161 | + <h3>{{ _('Table Of Contents') }}</h3> |
162 | + <div class="toc"> |
163 | + {{ toc }} |
164 | + </div> |
165 | + {%- endif %} |
166 | + |
167 | + <div class="browse-guide"> |
168 | + <h3>{{_('Browse The Guide')}}:</h3> |
169 | + <ul> |
170 | + <li class="prev{%- if not prev %} disabled{%- endif %}"> |
171 | + {%- if prev %} |
172 | + <a href="{{ prev.link|e }}" |
173 | + title="{{ _('Previous topic') }}: {{ prev.title }}">Go Previous</a> |
174 | + {%- endif %} |
175 | + </li> |
176 | + |
177 | + <li class="center"> |
178 | + <a title="{{ _('Back to Index') }}" href="{{ pathto(master_doc) }}">Index Guide</a> |
179 | + </li> |
180 | + |
181 | + <li class="next{%- if not next %} disabled{%- endif %}"> |
182 | + {%- if next %} |
183 | + <a href="{{ next.link|e }}" |
184 | + title="{{ _('Next topic') }}: {{ next.title }}">Go Next</a> |
185 | + {%- endif %} |
186 | + </li> |
187 | + </ul> |
188 | + {%- if show_source and has_source and sourcename %} |
189 | + <span>{{ _('This Page') }}:</span> <a href="{{ pathto('_sources/' + sourcename, true)|e }}" |
190 | + rel="nofollow">{{ _('Show Source') }}</a> |
191 | + {%- endif %} |
192 | + </div> |
193 | + </div> |
194 | + <div id="back_top"><a href="#top">{{ _('Back to Top') }}</a></div> |
195 | + </div> |
196 | |
197 | === modified file 'themes/ubuntu/static/home.css' |
198 | --- themes/ubuntu/static/home.css 2012-02-29 14:15:41 +0000 |
199 | +++ themes/ubuntu/static/home.css 2012-05-24 16:25:47 +0000 |
200 | @@ -243,3 +243,80 @@ |
201 | #content *:hover > a.headerlink { |
202 | visibility: visible; |
203 | } |
204 | + |
205 | + |
206 | +/* Start sidebar */ |
207 | +#sidebar { |
208 | + padding-top: 10px; |
209 | + margin-top: -10px; |
210 | +} |
211 | +#sidebar ul { |
212 | + margin-bottom: 10px; |
213 | +} |
214 | + |
215 | +#sidebar .toc ul li ul li { |
216 | + list-style-type: decimal; |
217 | +} |
218 | + |
219 | +#sidebar .toc ul { |
220 | + padding-left: 15px; |
221 | +} |
222 | + |
223 | +#sidebar .toc > ul > li { |
224 | + list-style-type: square; |
225 | + margin-left: 10px; |
226 | +} |
227 | + |
228 | +#sidebar .browse-guide ul { |
229 | + overflow:hidden; |
230 | +} |
231 | + |
232 | +#sidebar .browse-guide li { |
233 | + float: left; |
234 | + margin-left: 68px; |
235 | + width: 16px; |
236 | + height: 16px; |
237 | +} |
238 | + |
239 | +#sidebar .browse-guide li > a { |
240 | + text-indent: -5000px; |
241 | + float: left; |
242 | + width: 16px; |
243 | + height: 16px; |
244 | +} |
245 | + |
246 | +#sidebar .browse-guide .next { |
247 | + background: url(images/go-next.png) no-repeat; |
248 | +} |
249 | + |
250 | +#sidebar .browse-guide .prev { |
251 | + background: url(images/go-previous.png) no-repeat center center; |
252 | + margin-left: 10px; |
253 | +} |
254 | + |
255 | +#sidebar .browse-guide .center { |
256 | + background: url(images/go-home.png) no-repeat; |
257 | +} |
258 | + |
259 | +#sidebar .browse-guide .disabled { |
260 | + background: transparent; |
261 | +} |
262 | + |
263 | +#sidebar #back_top { |
264 | + width: 100%; |
265 | + text-align: center; |
266 | + margin-top: 10px; |
267 | +} |
268 | + |
269 | +#sidebar #back_top a { |
270 | + color: #333333; |
271 | + font-size: 1.2em; |
272 | + text-transform: uppercase; |
273 | +} |
274 | + |
275 | +.fixed#sidebar { |
276 | + position: fixed; |
277 | + width: 220px !important; |
278 | + top:10px; |
279 | +} |
280 | +/* End sidebar */ |
281 | |
282 | === added file 'themes/ubuntu/static/images/go-home.png' |
283 | Binary files themes/ubuntu/static/images/go-home.png 1970-01-01 00:00:00 +0000 and themes/ubuntu/static/images/go-home.png 2012-05-24 16:25:47 +0000 differ |
284 | === added file 'themes/ubuntu/static/images/go-next.png' |
285 | Binary files themes/ubuntu/static/images/go-next.png 1970-01-01 00:00:00 +0000 and themes/ubuntu/static/images/go-next.png 2012-05-24 16:25:47 +0000 differ |
286 | === added file 'themes/ubuntu/static/images/go-previous.png' |
287 | Binary files themes/ubuntu/static/images/go-previous.png 1970-01-01 00:00:00 +0000 and themes/ubuntu/static/images/go-previous.png 2012-05-24 16:25:47 +0000 differ |
288 | === added file 'themes/ubuntu/static/main.js' |
289 | --- themes/ubuntu/static/main.js 1970-01-01 00:00:00 +0000 |
290 | +++ themes/ubuntu/static/main.js 2012-05-24 16:25:47 +0000 |
291 | @@ -0,0 +1,21 @@ |
292 | +$(function() { |
293 | + |
294 | + var toc = "#sidebar"; |
295 | + var offset = $(toc).offset(); |
296 | + |
297 | + $(window).scroll(function() { |
298 | + if ($(window).height() > $(toc).height() && |
299 | + $(window).scrollTop() > offset.top) |
300 | + { |
301 | + $(toc).stop().addClass('fixed'); |
302 | + |
303 | + } else { |
304 | + $(toc).stop().removeClass('fixed'); |
305 | + } |
306 | + }); |
307 | + |
308 | + $('a[href=#top]').click(function(){ |
309 | + $('html, body').animate({scrollTop:0}, 'slow'); |
310 | + return false; |
311 | + }); |
312 | +}); |
Thanks a lot for your work on this Leon!
I have a few questions:
- Why do you reset LANGS? I'm not sure I understand what's going on. :-)
- Do we specifically need jquery 1.6.1? Or is anything >= 1.6.1 fine? If so,
we could rely on the system jquery, which has been >= 1.6.1 since oneiric.
- Could you document in BORROWED-CODE where you got the icons from?
Thanks again for your great work! This is great!