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

Proposed by Dimitri John Ledkov
Status: Rejected
Rejected by: Steve Langasek
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
Steve Langasek Needs Resubmitting
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?

Revision history for this message
Steve Langasek (vorlon) wrote :

It is unclear to me whether this three-year-old MP is still needed. We are moving ubuntu-cdimage to git, so if it is, please resubmit there.

review: Needs Resubmitting

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
1=== modified file 'lib/cdimage/tree.py'
2--- lib/cdimage/tree.py 2019-03-22 15:55:28 +0000
3+++ lib/cdimage/tree.py 2019-04-11 22:13:38 +0000
4@@ -366,6 +366,7 @@
5 self.project = self.config.project
6 self.image_type = image_type
7 self.prefmsg_emitted = False
8+ self.webassets = self.assetincludes()
9
10 # Keep this in sync with _guess_image_type below.
11 @property
12@@ -437,14 +438,24 @@
13 else:
14 return ""
15
16- def cssincludes(self):
17+ def assetincludes(self):
18+ p = "https://assets.ubuntu.com/v1/"
19+ c = "//cdimage.ubuntu.com/include/"
20+ assets = {
21+ "css": p + "vanilla-framework-version-1.8.0.min.css",
22+ "lockup": p + "411e1474-releases-lockup.svg",
23+ "bg": p + "775cc62b-vanilla-grad-background.png",
24+ "header_href": "https://www.ubuntu.com/",
25+ }
26+ if self.project in ("lubuntu", "lubuntu-next"):
27+ assets["lockup"] = c + "lubuntu/lockup.png"
28+ assets["bg"] = c + "lubuntu/background.png"
29+ assets["header_href"] = "https://lubuntu.me/"
30 if self.project == "kubuntu":
31- return ["//releases.ubuntu.com/include/kubuntu.css"]
32- if self.project in ("lubuntu", "lubuntu-next"):
33- return ["//cdimage.ubuntu.com/include/lubuntu/style.css"]
34- else:
35- return ["https://assets.ubuntu.com/v1/" +
36- "vanilla-framework-version-1.8.0.min.css"]
37+ assets["lockup"] = c + "kubuntu/lockup.png"
38+ assets["bg"] = c + "kubuntu/background.png"
39+ aseets["header_href"] = "https://kubuntu.org/"
40+ return assets
41
42 def cdtypestr(self, publish_type, image_format):
43 if image_format in ("tar.gz", "tar.xz", "custom.tar.gz"):
44@@ -1100,22 +1111,21 @@
45 with AtomicFile(header_path) as header, \
46 AtomicFile(footer_path) as footer, \
47 AtomicFile(htaccess_path) as htaccess:
48- heading = self.web_heading(base_prefix)
49+ self.webassets["heading"] = self.web_heading(base_prefix)
50 print(
51 dedent("""\
52 <!doctype html>
53 <html lang="en">
54 <head>
55- <title>%s</title>
56+ <title>{heading}</title>
57 <meta charset="UTF-8" />
58- <meta name="description" content="CD images for %s" />
59+ <meta name="description" content="CD images for {heading}" />
60 <meta name="author" content="Canonical" />
61 <meta name="viewport" content="width=device-width, initial-scale=1" />
62 <!-- Main style sheets for CSS2 capable browsers -->
63- <style type="text/css" media="screen">""") % (heading, heading),
64- file=header)
65- for css in self.cssincludes():
66- print(" @import url(%s);" % css, file=header)
67+ <style type="text/css" media="screen">
68+ @import url({css});
69+ """.format(**self.webassets)), file=header)
70 print(dedent("""\
71 .p-table-wrapper {
72 overflow-x: scroll;
73@@ -1171,11 +1181,6 @@
74 "<link rel=\"icon\" type=\"image/png\" "
75 "href=\"http://cdimage.ubuntu.com/include/lubuntu/"
76 "favicon.png\" />", file=header)
77- header_href = 'https://lubuntu.me/'
78- else:
79- header_href = 'http://www.ubuntu.com/'
80-
81- assets = 'https://assets.ubuntu.com/v1/'
82 print(dedent("""\
83 </head>
84 <body>
85@@ -1185,8 +1190,7 @@
86 <div class="p-navigation__logo">
87 <a class="p-navigation__link" href="/">
88 <img class="p-navigation__image"
89- src=" """ + assets
90- + """411e1474-releases-lockup.svg"
91+ src="{lockup}"
92 alt="">
93 </a>
94 </div>
95@@ -1199,18 +1203,17 @@
96 </div>
97 </header>
98 <section class="p-strip--image is-dark"
99- style="background-image: url('""" + assets
100- + """775cc62b-vanilla-grad-background.png');
101+ style="background-image: url('{bg}');
102 background-position: 75% 50%;">
103 <div class="row">
104- <div id="header"><a href="%s"></a></div>
105- <h1 class="u-no-margin--bottom">%s</h1>
106+ <div id="header"><a href="{header_href}"></a></div>
107+ <h1 class="u-no-margin--bottom">{heading}</h1>
108 </div>
109 </section>
110 <div id="pageWrapper" class="p-strip">
111 <div class="row">
112 <div id="main">
113- """) % (header_href, heading), file=header)
114+ """.format(**self.webassets)), file=header)
115
116 mirrors_url = "http://www.ubuntu.com/getubuntu/downloadmirrors"
117 reldir = os.path.realpath(directory)

Subscribers

People subscribed via source and target branches