Merge lp:~xnox/ubuntu-cdimage/branded-vanilla into lp:ubuntu-cdimage

Proposed by Dimitri John Ledkov
Status: Needs review
Proposed branch: lp:~xnox/ubuntu-cdimage/branded-vanilla
Merge into: lp:ubuntu-cdimage
Diff against target: 117 lines (+29/-26)
1 file modified
lib/cdimage/tree.py (+29/-26)
To merge this branch: bzr merge lp:~xnox/ubuntu-cdimage/branded-vanilla
Reviewer Review Type Date Requested Status
Ubuntu CD Image Team Pending
Review via email: mp+365883@code.launchpad.net

Commit message

Branded vanilla

Restructure per-project assets a bit more, to ease branding.

Still todo favicons.

Assets for lubuntu are ready, need to tweak assets for kubuntu still.

a live demo, generated using this code (plus tweak urls for the unpublished assets) is at:

https://people.canonical.com/~xnox/lubuntu/

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

What's the status of branding web indexes?

Unmerged revisions

1798. By Dimitri John Ledkov

HEADER.html make vanilla easier to brand, on per-project basis

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/cdimage/tree.py'
--- lib/cdimage/tree.py 2019-03-22 15:55:28 +0000
+++ lib/cdimage/tree.py 2019-04-11 22:13:38 +0000
@@ -366,6 +366,7 @@
366 self.project = self.config.project366 self.project = self.config.project
367 self.image_type = image_type367 self.image_type = image_type
368 self.prefmsg_emitted = False368 self.prefmsg_emitted = False
369 self.webassets = self.assetincludes()
369370
370 # Keep this in sync with _guess_image_type below.371 # Keep this in sync with _guess_image_type below.
371 @property372 @property
@@ -437,14 +438,24 @@
437 else:438 else:
438 return ""439 return ""
439440
440 def cssincludes(self):441 def assetincludes(self):
442 p = "https://assets.ubuntu.com/v1/"
443 c = "//cdimage.ubuntu.com/include/"
444 assets = {
445 "css": p + "vanilla-framework-version-1.8.0.min.css",
446 "lockup": p + "411e1474-releases-lockup.svg",
447 "bg": p + "775cc62b-vanilla-grad-background.png",
448 "header_href": "https://www.ubuntu.com/",
449 }
450 if self.project in ("lubuntu", "lubuntu-next"):
451 assets["lockup"] = c + "lubuntu/lockup.png"
452 assets["bg"] = c + "lubuntu/background.png"
453 assets["header_href"] = "https://lubuntu.me/"
441 if self.project == "kubuntu":454 if self.project == "kubuntu":
442 return ["//releases.ubuntu.com/include/kubuntu.css"]455 assets["lockup"] = c + "kubuntu/lockup.png"
443 if self.project in ("lubuntu", "lubuntu-next"):456 assets["bg"] = c + "kubuntu/background.png"
444 return ["//cdimage.ubuntu.com/include/lubuntu/style.css"]457 aseets["header_href"] = "https://kubuntu.org/"
445 else:458 return assets
446 return ["https://assets.ubuntu.com/v1/" +
447 "vanilla-framework-version-1.8.0.min.css"]
448459
449 def cdtypestr(self, publish_type, image_format):460 def cdtypestr(self, publish_type, image_format):
450 if image_format in ("tar.gz", "tar.xz", "custom.tar.gz"):461 if image_format in ("tar.gz", "tar.xz", "custom.tar.gz"):
@@ -1100,22 +1111,21 @@
1100 with AtomicFile(header_path) as header, \1111 with AtomicFile(header_path) as header, \
1101 AtomicFile(footer_path) as footer, \1112 AtomicFile(footer_path) as footer, \
1102 AtomicFile(htaccess_path) as htaccess:1113 AtomicFile(htaccess_path) as htaccess:
1103 heading = self.web_heading(base_prefix)1114 self.webassets["heading"] = self.web_heading(base_prefix)
1104 print(1115 print(
1105 dedent("""\1116 dedent("""\
1106 <!doctype html>1117 <!doctype html>
1107 <html lang="en">1118 <html lang="en">
1108 <head>1119 <head>
1109 <title>%s</title>1120 <title>{heading}</title>
1110 <meta charset="UTF-8" />1121 <meta charset="UTF-8" />
1111 <meta name="description" content="CD images for %s" />1122 <meta name="description" content="CD images for {heading}" />
1112 <meta name="author" content="Canonical" />1123 <meta name="author" content="Canonical" />
1113 <meta name="viewport" content="width=device-width, initial-scale=1" />1124 <meta name="viewport" content="width=device-width, initial-scale=1" />
1114 <!-- Main style sheets for CSS2 capable browsers -->1125 <!-- Main style sheets for CSS2 capable browsers -->
1115 <style type="text/css" media="screen">""") % (heading, heading),1126 <style type="text/css" media="screen">
1116 file=header)1127 @import url({css});
1117 for css in self.cssincludes():1128 """.format(**self.webassets)), file=header)
1118 print(" @import url(%s);" % css, file=header)
1119 print(dedent("""\1129 print(dedent("""\
1120 .p-table-wrapper {1130 .p-table-wrapper {
1121 overflow-x: scroll;1131 overflow-x: scroll;
@@ -1171,11 +1181,6 @@
1171 "<link rel=\"icon\" type=\"image/png\" "1181 "<link rel=\"icon\" type=\"image/png\" "
1172 "href=\"http://cdimage.ubuntu.com/include/lubuntu/"1182 "href=\"http://cdimage.ubuntu.com/include/lubuntu/"
1173 "favicon.png\" />", file=header)1183 "favicon.png\" />", file=header)
1174 header_href = 'https://lubuntu.me/'
1175 else:
1176 header_href = 'http://www.ubuntu.com/'
1177
1178 assets = 'https://assets.ubuntu.com/v1/'
1179 print(dedent("""\1184 print(dedent("""\
1180 </head>1185 </head>
1181 <body>1186 <body>
@@ -1185,8 +1190,7 @@
1185 <div class="p-navigation__logo">1190 <div class="p-navigation__logo">
1186 <a class="p-navigation__link" href="/">1191 <a class="p-navigation__link" href="/">
1187 <img class="p-navigation__image"1192 <img class="p-navigation__image"
1188 src=" """ + assets1193 src="{lockup}"
1189 + """411e1474-releases-lockup.svg"
1190 alt="">1194 alt="">
1191 </a>1195 </a>
1192 </div>1196 </div>
@@ -1199,18 +1203,17 @@
1199 </div>1203 </div>
1200 </header>1204 </header>
1201 <section class="p-strip--image is-dark"1205 <section class="p-strip--image is-dark"
1202 style="background-image: url('""" + assets1206 style="background-image: url('{bg}');
1203 + """775cc62b-vanilla-grad-background.png');
1204 background-position: 75% 50%;">1207 background-position: 75% 50%;">
1205 <div class="row">1208 <div class="row">
1206 <div id="header"><a href="%s"></a></div>1209 <div id="header"><a href="{header_href}"></a></div>
1207 <h1 class="u-no-margin--bottom">%s</h1>1210 <h1 class="u-no-margin--bottom">{heading}</h1>
1208 </div>1211 </div>
1209 </section>1212 </section>
1210 <div id="pageWrapper" class="p-strip">1213 <div id="pageWrapper" class="p-strip">
1211 <div class="row">1214 <div class="row">
1212 <div id="main">1215 <div id="main">
1213 """) % (header_href, heading), file=header)1216 """.format(**self.webassets)), file=header)
12141217
1215 mirrors_url = "http://www.ubuntu.com/getubuntu/downloadmirrors"1218 mirrors_url = "http://www.ubuntu.com/getubuntu/downloadmirrors"
1216 reldir = os.path.realpath(directory)1219 reldir = os.path.realpath(directory)

Subscribers

People subscribed via source and target branches