~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/templates/distroseries-localdifferences.pt

  • Committer: Curtis Hovey
  • Date: 2011-08-18 20:56:37 UTC
  • mto: This revision was merged to the branch mainline in revision 13736.
  • Revision ID: curtis.hovey@canonical.com-20110818205637-ae0pf9aexdea2mlb
Cleaned up doctrings and hushed lint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
      <h1 tal:content="view/label">Package differences between ...</h1>
36
36
    </tal:heading>
37
37
 
 
38
 
38
39
    <div class="top-portlet" metal:fill-slot="main"
39
40
      tal:define="differences view/cached_differences;
40
41
                  series_name context/displayname;
41
42
                  can_perform_sync view/canPerformSync;">
42
 
 
43
 
      <div class="beta">
44
 
        <img src="/@@/beta" alt="[BETA]" />
45
 
      </div>
46
 
 
47
43
      <p><tal:replace replace="structure view/explanation/escapedtext" /></p>
48
44
 
49
45
      <metal:package_filter_form
50
 
        use-macro="context/@@+macros/distroseries-localdiff-search-form" />
 
46
        use-macro="context/@@+macros/distroseries-localdiff-search-form" />
 
47
 
51
48
 
52
49
      <div metal:use-macro="context/@@launchpad_form/form">
53
50
 
54
 
      <span tal:replace="nothing">
55
 
      We override the 'buttons' slot because we want the syc button to be
56
 
      disabled by default. The Javascript code running on top of this will
57
 
      enable the button and open a confirmation popup when the button is
58
 
      clicked. This is done because syncing packages is too dangerous without
59
 
      a confirmation.
60
 
      </span>
61
 
      <div metal:fill-slot="buttons">
62
 
        <script type="text/javascript">
63
 
          LPS.use(
64
 
            'node', 'event', 'lp.registry.distroseriesdifferences_details',
65
 
            'lp.app.confirmationoverlay',function(Y) {
66
 
            Y.on('domready', function() {
67
 
              var dsd_details = Y.lp.registry.distroseriesdifferences_details;
68
 
              Y.all('input[name=field.actions.sync]').each(function(button) {
69
 
                // Cleanup the button's title which says the button is disabled if
70
 
                // Javascript is disabled.
71
 
                button.set('title', '');
72
 
                // Create a function to bypass the display of the Confirmation
73
 
                // Overlay if no package has been selected.
74
 
                var has_synced_packages = function() {
75
 
                  return (dsd_details.get_number_of_packages() !== 0);
76
 
                }
77
 
                // Create the Confirmation Overlay.
78
 
                new Y.lp.app.confirmationoverlay.ConfirmationOverlay({
79
 
                  button: button,
80
 
                  display_confirmation_fn: has_synced_packages,
81
 
                  form_content_fn: dsd_details.get_packages_summary,
82
 
                  header_content_fn: dsd_details.get_confirmation_header_number_of_packages
83
 
                });
84
 
              });
85
 
            });
86
 
          });
87
 
        </script>
88
 
        <div id="launchpad-form-actions" class="actions"
89
 
          tal:define="sync view/actions/byname/field.actions.sync|nothing;
90
 
                      upgrade view/actions/byname/field.actions.upgrade|nothing">
91
 
          <input class="button" type="submit" disabled="true"
92
 
              title="Please use a Javascript-enabled browser to sync packages."
93
 
              tal:condition="python:sync and sync.available()"
94
 
              tal:attributes="value sync/label;
95
 
                              name sync/__name__;
96
 
                              id sync/__name__;" />
97
 
          <input class="button" type="submit"
98
 
            tal:condition="python: upgrade and upgrade.available()"
99
 
            tal:attributes="value upgrade/label;
100
 
                            name upgrade/__name__;
101
 
                            id upgrade/__name__;" />
102
 
        </div>
103
 
      </div>
104
 
 
105
51
      <div metal:fill-slot="widgets">
106
52
        <tal:navigation_top
107
53
          replace="structure differences/@@+navigation-links-upper" />
287
233
    </div>
288
234
<script type="text/javascript">
289
235
LPS.use('lp.registry.distroseriesdifferences_details', function(Y) {
 
236
 
290
237
  Y.on('domready', function() {
291
238
    Y.lp.registry.distroseriesdifferences_details.setup();
292
239
  });