diff options
Diffstat (limited to 'js/view')
-rw-r--r-- | js/view/generations.js | 5 | ||||
-rw-r--r-- | js/view/packages.js | 5 | ||||
-rw-r--r-- | js/view/ui.js | 7 |
3 files changed, 9 insertions, 8 deletions
diff --git a/js/view/generations.js b/js/view/generations.js index 0ff52f1..73fbce7 100644 --- a/js/view/generations.js +++ b/js/view/generations.js @@ -18,10 +18,7 @@ (function(generations) { generations.view = function(ctrl) { return guix.withLayout([ - m("h2.header", [ - "Generations", - m("span.badge", ctrl.generations().length) - ]), + guix.ui.headerWithBadge("Generations", ctrl.generations().length), m("table.table.table-bordered", [ m("thead", m("tr", [ m("th", "#"), diff --git a/js/view/packages.js b/js/view/packages.js index a006d29..c2cde74 100644 --- a/js/view/packages.js +++ b/js/view/packages.js @@ -225,10 +225,7 @@ } return guix.withLayout(ctrl.pager().isEmpty() ? spinner : [ - m("h2.header", [ - "Packages", - m("span.badge", ctrl.packageCount()) - ]), + guix.ui.headerWithBadge("Packages", ctrl.packageCount()), renderModal(), renderSearchBox(), renderPackageTable(), diff --git a/js/view/ui.js b/js/view/ui.js index 49b02bc..196406a 100644 --- a/js/view/ui.js +++ b/js/view/ui.js @@ -35,4 +35,11 @@ ])) ]; }; + + ui.headerWithBadge = function(title, badgeText) { + return m("h2.header", [ + title, + m("span.badge", badgeText) + ]); + }; })(); |