mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
rrs: Frontend improvments
templates/rrs/base_toplevel.html: Disable top functions. templates/rrs/recipedetail.html: Fix class type for different upstream status and better display of recipe info don't display element if no have content. rrs/views.py: Don't display percentages with two decimals and separate filters for set and elements. templates/rrs/recipes.html: Add support for display filters with set and element separation. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
This commit is contained in:
parent
f3f70210af
commit
a3ec4ff11d
17
rrs/views.py
17
rrs/views.py
|
@ -47,7 +47,7 @@ def _get_milestone_statistics(milestone, maintainer_name=None):
|
|||
history = recipe_upstream_history, status = 'N').count()
|
||||
milestone_statistics['unknown'] = milestone_statistics['all'] - \
|
||||
(milestone_statistics['up_to_date'] + milestone_statistics['not_updated'])
|
||||
milestone_statistics['percentage'] = "%.2f" % \
|
||||
milestone_statistics['percentage'] = "%.0f" % \
|
||||
((float(milestone_statistics['up_to_date']) /
|
||||
float(milestone_statistics['all'])) * 100)
|
||||
else:
|
||||
|
@ -75,7 +75,7 @@ def _get_milestone_statistics(milestone, maintainer_name=None):
|
|||
else:
|
||||
milestone_statistics['unknown'] += 1
|
||||
|
||||
milestone_statistics['percentage'] = "%.2f" % \
|
||||
milestone_statistics['percentage'] = "%.0f" % \
|
||||
((float(milestone_statistics['up_to_date']) /
|
||||
float(milestone_statistics['all'])) * 100)
|
||||
|
||||
|
@ -195,17 +195,18 @@ class RecipeListView(ListView):
|
|||
context['recipe_list_count'] = self.recipe_list_count
|
||||
|
||||
context['upstream_status'] = self.upstream_status
|
||||
all_upstream_status = []
|
||||
for us in RecipeUpstream.RECIPE_UPSTREAM_STATUS_CHOICES:
|
||||
if us[0] != 'D': # Downgrade is displayed as Unknown
|
||||
all_upstream_status.append(us[1])
|
||||
context['all_upstream_status'] = all_upstream_status
|
||||
ruch = RecipeUpstream.RECIPE_UPSTREAM_STATUS_CHOICES_DICT
|
||||
context['upstream_status_set_choices'] = [ruch['A']]
|
||||
context['upstream_status_choices'] = [ruch['N'], ruch['Y'], ruch['U']]
|
||||
|
||||
context['maintainer_name'] = self.maintainer_name
|
||||
all_maintainers = ['All']
|
||||
context['set_maintainers'] = ['All', 'No Maintainer']
|
||||
all_maintainers = []
|
||||
for rm in RecipeMaintainer.objects.filter(history =
|
||||
self.recipe_maintainer_history).values(
|
||||
'maintainer__name').distinct().order_by('maintainer__name'):
|
||||
if rm['maintainer__name'] in context['set_maintainers']:
|
||||
continue
|
||||
all_maintainers.append(rm['maintainer__name'])
|
||||
context['all_maintainers'] = all_maintainers
|
||||
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
|
||||
{% endcomment %}
|
||||
|
||||
{% block topfunctions %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<link rel="stylesheet" href="{% static "css/rrs-additional.css" %}" />
|
||||
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
{% block title_append %} - {{ recipe.pn }}{% endblock %}
|
||||
{% endautoescape %}
|
||||
|
||||
{% block topfunctions %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<link rel="stylesheet" href="{% static "css/rrs-additional.css" %}" />
|
||||
{% autoescape on %}
|
||||
|
@ -28,9 +31,17 @@
|
|||
<div class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<ul class="nav">
|
||||
{% if upstream_status == "Up-to-date" %}
|
||||
<li class="lead">Upstream status: <strong class="text-success">{{ upstream_status }}</strong></li>
|
||||
{% elif upstream_status == "Not updated" %}
|
||||
<li class="lead">Upstream status: <strong class="text-error">{{ upstream_status }}</strong></li>
|
||||
{% else %}
|
||||
<li class="lead">Upstream status: <strong class="text-warning">{{ upstream_status }}</strong></li>
|
||||
{% endif %}
|
||||
{% if upstream_status == "Not updated" %}
|
||||
<li class="divider-vertical"></li>
|
||||
<li class="lead">Upstream version: <strong>{{ upstream_version }}</strong></li>
|
||||
{% endif %}
|
||||
<li class="divider-vertical"></li>
|
||||
<li class="lead">Maintainer: <strong><a href="{% url recipes milestone_name %}?maintainer_name={{ maintainer_name|urlencode }}">{{ maintainer_name }}</a></strong></li>
|
||||
<li class="divider-vertical"></li>
|
||||
|
@ -45,7 +56,7 @@
|
|||
<p class="lead">{{ upstream_no_update_reason }}</p>
|
||||
{% endif %}
|
||||
|
||||
<h2>Upgrades</h2>
|
||||
<h2>Updates</h2>
|
||||
{% if recipe_upgrade_detail_count == 0 %}
|
||||
<div class="alert alert-info">
|
||||
There are no updates prior to <strong>{{ milestone_name }}</strong>
|
||||
|
@ -87,6 +98,7 @@
|
|||
|
||||
<div class="span4">
|
||||
<h2>About {{ recipe.pn }}</h2>
|
||||
<div class="well well-transparent">
|
||||
<dl>
|
||||
<dt>Summary</dt>
|
||||
<dd>{{ recipe.summary }}</dd>
|
||||
|
@ -102,14 +114,25 @@
|
|||
{{ recipe.full_path }}
|
||||
{% endif %}
|
||||
</dd>
|
||||
<dt>Source URI</dt>
|
||||
<dd><a href="{{ recipe.src_uri }}">{{ recipe.src_uri }}</a></dd>
|
||||
<dt>Layer</dd>
|
||||
<dd><a href="{{ recipe_layer_branch_url }}">{{ recipe.layerbranch.layer.name }} ({{ recipe.layerbranch.branch.name}} branch)</a></dd>
|
||||
|
||||
{% if recipe.homepage %}
|
||||
<dt>Homepage</dt>
|
||||
<dd>{% if recipe.homepage %}<a href="{{ recipe.homepage }}">{{ recipe.homepage }}</a>{% endif %}</dd>
|
||||
{% endif %}
|
||||
|
||||
{% if recipe.bugtracker %}
|
||||
<dt>Bug tracker</dt>
|
||||
<dd><a href="{{ recipe.bugtracker }}">{{ recipe.bugtracker }}</a></dd>
|
||||
{% endif %}
|
||||
|
||||
{% if recipe.src_uri %}
|
||||
<dt>Source URI</dt>
|
||||
<dd><a href="{{ recipe.src_uri }}">{{ recipe.src_uri }}</a></dd>
|
||||
{% endif %}
|
||||
|
||||
{% if recipe_provides %}
|
||||
<dt>Provides</dt>
|
||||
<dd>
|
||||
<ul class="unstyled">
|
||||
|
@ -118,6 +141,9 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
</dd>
|
||||
{% endif %}
|
||||
|
||||
{% if recipe_depends %}
|
||||
<dt>Depends</dt>
|
||||
<dd>
|
||||
<ul class="unstyled">
|
||||
|
@ -126,6 +152,9 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
</dd>
|
||||
{% endif %}
|
||||
|
||||
{% if recipe_distros %}
|
||||
<dt>Distributions</dt>
|
||||
<dd>
|
||||
<ul class="unstyled">
|
||||
|
@ -134,8 +163,10 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
</dd>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endautoescape %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -29,7 +29,22 @@
|
|||
<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu" id="select-status">
|
||||
{% for us in all_upstream_status %}
|
||||
{% for us in upstream_status_set_choices %}
|
||||
{% if us = upstream_status %}
|
||||
<li class="active">
|
||||
<a href="#">
|
||||
{% else %}
|
||||
<li>
|
||||
<a href="{% url this_url_name milestone_name %}?upstream_status={{ us|urlencode }}&maintainer_name={{ maintainer_name|urlencode }}">
|
||||
{% endif %}
|
||||
{{ us }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
<li class="divider"/>
|
||||
|
||||
{% for us in upstream_status_choices %}
|
||||
{% if us = upstream_status %}
|
||||
<li class="active">
|
||||
<a href="#">
|
||||
|
@ -50,7 +65,24 @@
|
|||
Maintainer: <strong>{{ maintainer_name }}</strong>
|
||||
<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu" id="selected-maintainer">
|
||||
<ul class="dropdown-menu" id="selected-maintainer" style="overflow:scroll;max-height:40em;">
|
||||
{% for m in set_maintainers %}
|
||||
{% if m = maintainer_name %}
|
||||
<li class="active">
|
||||
<a href="#">
|
||||
{% else %}
|
||||
<li>
|
||||
<a href="{% url this_url_name milestone_name %}?upstream_status={{ upstream_status|urlencode }}&maintainer_name={{ m|urlencode }}">
|
||||
{% endif %}
|
||||
|
||||
{{ m }}</a>
|
||||
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
<li class="divider"/>
|
||||
|
||||
{% for m in all_maintainers %}
|
||||
{% if m = maintainer_name %}
|
||||
<li class="active">
|
||||
|
|
Loading…
Reference in New Issue
Block a user