~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/javascript/distroseriesdifferences_details.js

  • Committer: Raphael Badin
  • Date: 2011-08-26 16:27:43 UTC
  • mto: This revision was merged to the branch mainline in revision 13829.
  • Revision ID: raphael.badin@canonical.com-20110826162743-hqokyrdz87fpjklx
Refactor the Confirmation Overlay to be easier to use/test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
858
858
};
859
859
 
860
860
/**
861
 
* Get a label to display the number of packages to be synced.
862
 
* (e.g. '1 package', '20 packages')
863
 
*
 
861
* Get a label to display in the header of the overlay confirmation overlay.
 
862
* (e.g. "You're about to sync 1 package. Continue?",
 
863
*       "You're about to sync 20 packages. Continue?")
864
864
*/
865
 
namespace.get_label_number_of_packages = function() {
 
865
namespace.get_confirmation_header_number_of_packages = function() {
866
866
   var nb_selected_packages = namespace.get_number_of_packages();
867
 
   if (nb_selected_packages === 1) {
868
 
        return '1 package';
869
 
    }
870
 
    else {
871
 
        return nb_selected_packages + ' packages';
872
 
    }
 
867
    return [
 
868
        "<h2>You're about to sync ",
 
869
        nb_selected_packages,
 
870
        (nb_selected_packages === 1) ? ' package' : ' packages',
 
871
        ". Continue?</h2>"
 
872
        ].join('');
873
873
};
874
874
 
875
875
// Max number of packages to display in the summary.
886
886
* e.g.
887
887
* package1: version1, version2
888
888
* package2: version1, version2
889
 
* ... and 4 more.
 
889
* ... and 4 more packages.
890
890
*
891
891
*/
892
892
namespace.get_packages_summary = function() {