Merge lp:~matiasb/launchpad/updates-for-channels-widget into lp:launchpad

Proposed by Matias Bordese
Status: Merged
Merged at revision: 18340
Proposed branch: lp:~matiasb/launchpad/updates-for-channels-widget
Merge into: lp:launchpad
Diff against target: 71 lines (+26/-12)
2 files modified
lib/lp/snappy/browser/widgets/storechannels.py (+2/-1)
lib/lp/snappy/browser/widgets/templates/storechannels.pt (+24/-11)
To merge this branch: bzr merge lp:~matiasb/launchpad/updates-for-channels-widget
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+321571@code.launchpad.net

Commit message

Reworked how snap store channels widget is displayed.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/snappy/browser/widgets/storechannels.py'
--- lib/lp/snappy/browser/widgets/storechannels.py 2017-03-30 14:08:55 +0000
+++ lib/lp/snappy/browser/widgets/storechannels.py 2017-04-02 01:43:38 +0000
@@ -41,7 +41,6 @@
41class StoreChannelsWidget(BrowserWidget, InputWidget):41class StoreChannelsWidget(BrowserWidget, InputWidget):
4242
43 template = ViewPageTemplateFile("templates/storechannels.pt")43 template = ViewPageTemplateFile("templates/storechannels.pt")
44 display_label = False
45 _separator = channel_components_delimiter44 _separator = channel_components_delimiter
46 _default_track = 'latest'45 _default_track = 'latest'
47 _widgets_set_up = False46 _widgets_set_up = False
@@ -49,6 +48,8 @@
49 def __init__(self, field, value_type, request):48 def __init__(self, field, value_type, request):
50 # We don't use value_type.49 # We don't use value_type.
51 super(StoreChannelsWidget, self).__init__(field, request)50 super(StoreChannelsWidget, self).__init__(field, request)
51 # disable help_text for the global widget
52 self.hint = None
5253
53 def setUpSubWidgets(self):54 def setUpSubWidgets(self):
54 if self._widgets_set_up:55 if self._widgets_set_up:
5556
=== modified file 'lib/lp/snappy/browser/widgets/templates/storechannels.pt'
--- lib/lp/snappy/browser/widgets/templates/storechannels.pt 2017-03-30 14:08:55 +0000
+++ lib/lp/snappy/browser/widgets/templates/storechannels.pt 2017-04-02 01:43:38 +0000
@@ -1,22 +1,35 @@
1<table>1<table>
2 <tr>2 <tr>
3 <td>3 <td>
4 <tal:widget define="widget nocall:view/track_widget">4 <p class="formHelp">Channels to release this snap package to after uploading it to the store.
5 <metal:block5 A channel is defined by a combination of an optional track and a risk, e.g. '2.1/stable', or 'stable'.
6 use-macro="context/@@launchpad_widget_macros/launchpad_widget_row" />
7 </tal:widget>
8 <p class="formHelp">
9 To open a new track, <a href="https://snapcraft.io/community">ask the store admins</a>.
10 </p>6 </p>
11 </td>7 </td>
12 </tr>8 </tr>
13 <tr>9 <tr>
14 <td>10 <td>
15 <tal:widget define="widget nocall:view/risks_widget"11 <table class="subordinate">
16 condition="widget/context/value_type/vocabulary">12 <tr>
17 <metal:block13 <td>
18 use-macro="context/@@launchpad_widget_macros/launchpad_widget_row" />14 <tal:widget define="widget nocall:view/risks_widget"
19 </tal:widget>15 condition="widget/context/value_type/vocabulary">
16 <metal:block
17 use-macro="context/@@launchpad_widget_macros/launchpad_widget_row" />
18 </tal:widget>
19 </td>
20 </tr>
21 <tr>
22 <td>
23 <tal:widget define="widget nocall:view/track_widget">
24 <metal:block
25 use-macro="context/@@launchpad_widget_macros/launchpad_widget_row" />
26 </tal:widget>
27 <p class="formHelp">
28 To open a new track, <a href="https://snapcraft.io/community">ask the store admins</a>.
29 </p>
30 </td>
31 </tr>
32 </table>
20 </td>33 </td>
21 </tr>34 </tr>
22</table>35</table>