Changes to the navbar
cover Changes to the navbar
From: Mariano Lopez <[email protected]>
These patches change the design of the navbar.
It makes more clear what is the meaning of the
percentage in there and adds more information.
Mariano Lopez (2):
rrs/views.py: Added percentages for navbar
rrs/base_toplevel.html: Navbar redesign
rrs/static/css/rrs-additional.css | 13 ++++--- rrs/views.py | 71 ++++++++++++++++++++++++++++++--------- templates/rrs/base_toplevel.html | 44 ++++++++++++++---------- 3 files changed, 91 insertions(+), 37 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/2 rrs/views.py: Added percentages for navbar
From: Mariano Lopez <[email protected]>
This adds the percentage for all the recipes types (up-to-date, not updated, unknown, can't be updated) so it can be displayed in the navbar.
This also adds the number of the recipes not updated at the begining of the period and number of recipes updated in the period.
The changes in the frontend are still missing, this just adds the functionality.
--- rrs/views.py | 71 ++++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 55 insertions(+), 16 deletions(-)
rrs/views.py +55 -16
@@ -47,22 +47,8 @@ def _get_milestone_statistics(milestone, maintainer_name=None): ) if maintainer_name is None: - if recipe_upstream_history_first: - recipes_not_upgraded = \ - Raw.get_reup_by_date(recipe_upstream_history_first.id) - if recipes_not_upgraded: - recipes_upgraded = \ - Raw.get_reupg_by_dates_and_recipes( - milestone.start_date, milestone.end_date, recipes_not_upgraded) - milestone_statistics['all'] = \ - float(len(recipes_upgraded))/float(len(recipes_not_upgraded)) - else: - milestone_statistics['all'] = 0 - else: - milestone_statistics['all'] = 0 - - milestone_statistics['percentage'] = "%.0f" % \ - (float(milestone_statistics['all']) * 100.0) + milestone_statistics['all'] = \ + RecipeUpstream.get_all_recipes(recipe_upstream_history).count() milestone_statistics['up_to_date'] = \ RecipeUpstream.get_recipes_up_to_date(recipe_upstream_history).count() milestone_statistics['not_updated'] = \
@@ -71,6 +57,39 @@ def _get_milestone_statistics(milestone, maintainer_name=None): RecipeUpstream.get_recipes_cant_be_updated(recipe_upstream_history).count() milestone_statistics['unknown'] = \ RecipeUpstream.get_recipes_unknown(recipe_upstream_history).count() + milestone_statistics['percentage'] = 0 + milestone_statistics['all_upgraded'] = 0 + milestone_statistics['all_not_upgraded'] = 0 + milestone_statistics['percentage_up_to_date'] = 0 + milestone_statistics['percentage_not_updated'] = 0 + milestone_statistics['percentage_cant_be_updated'] = 0 + milestone_statistics['percentage_unknown'] = 0 + + if recipe_upstream_history_first: + recipes_not_upgraded = \ + Raw.get_reup_by_date(recipe_upstream_history_first.id) + if recipes_not_upgraded: + recipes_upgraded = \ + Raw.get_reupg_by_dates_and_recipes( + milestone.start_date, milestone.end_date, recipes_not_upgraded) + milestone_statistics['percentage'] = "%.0f" % \ + ((float(len(recipes_upgraded)) * 100.0) + /float(len(recipes_not_upgraded))) + milestone_statistics['all_upgraded'] = len(recipes_upgraded) + milestone_statistics['all_not_upgraded'] = len(recipes_not_upgraded) + milestone_statistics['percentage_up_to_date'] = "%.0f" % \ + (float(milestone_statistics['up_to_date']) * 100.0 \ + /float(milestone_statistics['all'])) + milestone_statistics['percentage_not_updated'] = "%.0f" % \ + (float(milestone_statistics['not_updated']) * 100.0 \ + /float(milestone_statistics['all'])) + milestone_statistics['percentage_cant_be_updated'] = "%.0f" % \ + (float(milestone_statistics['cant_be_updated']) * 100.0 \ + /float(milestone_statistics['all'])) + milestone_statistics['percentage_unknown'] = "%.0f" % \ + (float(milestone_statistics['unknown']) * 100.0 + /float(milestone_statistics['all'])) + else: recipe_maintainer_history = Raw.get_remahi_by_end_date( milestone.end_date)
@@ -259,10 +278,20 @@ class RecipeListView(ListView): context['all_milestones'] = Milestone.get_by_release_name(self.release_name) context['recipes_percentage'] = self.milestone_statistics['percentage'] + context['recipes_all_upgraded'] = self.milestone_statistics['all_upgraded'] + context['recipes_all_not_upgraded'] = self.milestone_statistics['all_not_upgraded'] context['recipes_up_to_date'] = self.milestone_statistics['up_to_date'] context['recipes_not_updated'] = self.milestone_statistics['not_updated'] context['recipes_cant_be_updated'] = self.milestone_statistics['cant_be_updated'] context['recipes_unknown'] = self.milestone_statistics['unknown'] + context['recipes_percentage_up_to_date'] = \ + self.milestone_statistics['percentage_up_to_date'] + context['recipes_percentage_not_updated'] = \ + self.milestone_statistics['percentage_not_updated'] + context['recipes_percentage_cant_be_updated'] = \ + self.milestone_statistics['percentage_cant_be_updated'] + context['recipes_percentage_unknown'] = \ + self.milestone_statistics['percentage_unknown'] context['recipe_list_count'] = self.recipe_list_count
@@ -519,10 +548,20 @@ class MaintainerListView(ListView): context['all_milestones'] = Milestone.get_by_release_name(self.release_name) context['recipes_percentage'] = self.milestone_statistics['percentage'] + context['recipes_all_upgraded'] = self.milestone_statistics['all_upgraded'] + context['recipes_all_not_upgraded'] = self.milestone_statistics['all_not_upgraded'] context['recipes_up_to_date'] = self.milestone_statistics['up_to_date'] context['recipes_not_updated'] = self.milestone_statistics['not_updated'] context['recipes_cant_be_updated'] = self.milestone_statistics['cant_be_updated'] context['recipes_unknown'] = self.milestone_statistics['unknown'] + context['recipes_percentage_up_to_date'] = \ + self.milestone_statistics['percentage_up_to_date'] + context['recipes_percentage_not_updated'] = \ + self.milestone_statistics['percentage_not_updated'] + context['recipes_percentage_cant_be_updated'] = \ + self.milestone_statistics['percentage_cant_be_updated'] + context['recipes_percentage_unknown'] = \ + self.milestone_statistics['percentage_unknown'] context['maintainer_count'] = self.maintainer_count context['intervals'] = self.intervals
Signature · 1 line
1.9.1
PATCH 2/2 rrs/base_toplevel.html: Navbar redesign
In reply to [email protected]From: Mariano Lopez <[email protected]>
This provides changes in the front end for the navbar, now it shows the percentage of recipes up-to-date, not update, unknown and can't be updated along with the number of recipes.
This also moves the update percentage to the end and adds clarity to what it means.
This also moves the export list button the the top bar.
--- rrs/static/css/rrs-additional.css | 13 ++++++++---- templates/rrs/base_toplevel.html | 44 ++++++++++++++++++++++++--------------- 2 files changed, 36 insertions(+), 21 deletions(-)
rrs/static/css/rrs-additional.css +9 -4
@@ -43,6 +43,11 @@ margin-top: 40px; } +.nav > li.lead { + margin: 5px 25px 0 5px; +} + + /* Sorting styles */ th > a, th.muted { font-weight: normal;
@@ -71,6 +76,10 @@ th > a, th.muted { margin-bottom: 0; } +.navbar .nav > li > .secondary-info { + font-size:70%; +} + .navbar .badge { margin-top: 10px; margin-right: 10px;
@@ -104,10 +113,6 @@ th > a, th.muted { padding: 8px 14px 8px 14px; } -.nav > li.lead { - margin: 5px 0 0 5px; -} - /* about recipe styles */
templates/rrs/base_toplevel.html +27 -17
58 lines not on this page · raw message
Signature · 1 line
1.9.1