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()
|
history = recipe_upstream_history, status = 'N').count()
|
||||||
milestone_statistics['unknown'] = milestone_statistics['all'] - \
|
milestone_statistics['unknown'] = milestone_statistics['all'] - \
|
||||||
(milestone_statistics['up_to_date'] + milestone_statistics['not_updated'])
|
(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['up_to_date']) /
|
||||||
float(milestone_statistics['all'])) * 100)
|
float(milestone_statistics['all'])) * 100)
|
||||||
else:
|
else:
|
||||||
|
@ -75,7 +75,7 @@ def _get_milestone_statistics(milestone, maintainer_name=None):
|
||||||
else:
|
else:
|
||||||
milestone_statistics['unknown'] += 1
|
milestone_statistics['unknown'] += 1
|
||||||
|
|
||||||
milestone_statistics['percentage'] = "%.2f" % \
|
milestone_statistics['percentage'] = "%.0f" % \
|
||||||
((float(milestone_statistics['up_to_date']) /
|
((float(milestone_statistics['up_to_date']) /
|
||||||
float(milestone_statistics['all'])) * 100)
|
float(milestone_statistics['all'])) * 100)
|
||||||
|
|
||||||
|
@ -195,17 +195,18 @@ class RecipeListView(ListView):
|
||||||
context['recipe_list_count'] = self.recipe_list_count
|
context['recipe_list_count'] = self.recipe_list_count
|
||||||
|
|
||||||
context['upstream_status'] = self.upstream_status
|
context['upstream_status'] = self.upstream_status
|
||||||
all_upstream_status = []
|
ruch = RecipeUpstream.RECIPE_UPSTREAM_STATUS_CHOICES_DICT
|
||||||
for us in RecipeUpstream.RECIPE_UPSTREAM_STATUS_CHOICES:
|
context['upstream_status_set_choices'] = [ruch['A']]
|
||||||
if us[0] != 'D': # Downgrade is displayed as Unknown
|
context['upstream_status_choices'] = [ruch['N'], ruch['Y'], ruch['U']]
|
||||||
all_upstream_status.append(us[1])
|
|
||||||
context['all_upstream_status'] = all_upstream_status
|
|
||||||
|
|
||||||
context['maintainer_name'] = self.maintainer_name
|
context['maintainer_name'] = self.maintainer_name
|
||||||
all_maintainers = ['All']
|
context['set_maintainers'] = ['All', 'No Maintainer']
|
||||||
|
all_maintainers = []
|
||||||
for rm in RecipeMaintainer.objects.filter(history =
|
for rm in RecipeMaintainer.objects.filter(history =
|
||||||
self.recipe_maintainer_history).values(
|
self.recipe_maintainer_history).values(
|
||||||
'maintainer__name').distinct().order_by('maintainer__name'):
|
'maintainer__name').distinct().order_by('maintainer__name'):
|
||||||
|
if rm['maintainer__name'] in context['set_maintainers']:
|
||||||
|
continue
|
||||||
all_maintainers.append(rm['maintainer__name'])
|
all_maintainers.append(rm['maintainer__name'])
|
||||||
context['all_maintainers'] = all_maintainers
|
context['all_maintainers'] = all_maintainers
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,9 @@
|
||||||
|
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
|
{% block topfunctions %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<link rel="stylesheet" href="{% static "css/rrs-additional.css" %}" />
|
<link rel="stylesheet" href="{% static "css/rrs-additional.css" %}" />
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,9 @@
|
||||||
{% block title_append %} - {{ recipe.pn }}{% endblock %}
|
{% block title_append %} - {{ recipe.pn }}{% endblock %}
|
||||||
{% endautoescape %}
|
{% endautoescape %}
|
||||||
|
|
||||||
|
{% block topfunctions %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<link rel="stylesheet" href="{% static "css/rrs-additional.css" %}" />
|
<link rel="stylesheet" href="{% static "css/rrs-additional.css" %}" />
|
||||||
{% autoescape on %}
|
{% autoescape on %}
|
||||||
|
@ -28,9 +31,17 @@
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<div class="navbar-inner">
|
<div class="navbar-inner">
|
||||||
<ul class="nav">
|
<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>
|
<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="divider-vertical"></li>
|
||||||
<li class="lead">Upstream version: <strong>{{ upstream_version }}</strong></li>
|
<li class="lead">Upstream version: <strong>{{ upstream_version }}</strong></li>
|
||||||
|
{% endif %}
|
||||||
<li class="divider-vertical"></li>
|
<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="lead">Maintainer: <strong><a href="{% url recipes milestone_name %}?maintainer_name={{ maintainer_name|urlencode }}">{{ maintainer_name }}</a></strong></li>
|
||||||
<li class="divider-vertical"></li>
|
<li class="divider-vertical"></li>
|
||||||
|
@ -45,7 +56,7 @@
|
||||||
<p class="lead">{{ upstream_no_update_reason }}</p>
|
<p class="lead">{{ upstream_no_update_reason }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<h2>Upgrades</h2>
|
<h2>Updates</h2>
|
||||||
{% if recipe_upgrade_detail_count == 0 %}
|
{% if recipe_upgrade_detail_count == 0 %}
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
There are no updates prior to <strong>{{ milestone_name }}</strong>
|
There are no updates prior to <strong>{{ milestone_name }}</strong>
|
||||||
|
@ -87,54 +98,74 @@
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h2>About {{ recipe.pn }}</h2>
|
<h2>About {{ recipe.pn }}</h2>
|
||||||
<dl>
|
<div class="well well-transparent">
|
||||||
<dt>Summary</dt>
|
<dl>
|
||||||
<dd>{{ recipe.summary }}</dd>
|
<dt>Summary</dt>
|
||||||
<dt>Section</dt>
|
<dd>{{ recipe.summary }}</dd>
|
||||||
<dd>{{ recipe.section }}</dd>
|
<dt>Section</dt>
|
||||||
<dt>License</dt>
|
<dd>{{ recipe.section }}</dd>
|
||||||
<dd>{{ recipe.license }}</dd>
|
<dt>License</dt>
|
||||||
<dt>Recipe file</dt>
|
<dd>{{ recipe.license }}</dd>
|
||||||
<dd>
|
<dt>Recipe file</dt>
|
||||||
{% if recipe.vcs_web_url %}
|
<dd>
|
||||||
<a href="{{ recipe.vcs_web_url }}">{{ recipe.full_path }}</a>
|
{% if recipe.vcs_web_url %}
|
||||||
{% else %}
|
<a href="{{ recipe.vcs_web_url }}">{{ recipe.full_path }}</a>
|
||||||
{{ recipe.full_path }}
|
{% else %}
|
||||||
{% endif %}
|
{{ recipe.full_path }}
|
||||||
</dd>
|
{% endif %}
|
||||||
<dt>Source URI</dt>
|
</dd>
|
||||||
<dd><a href="{{ recipe.src_uri }}">{{ recipe.src_uri }}</a></dd>
|
<dt>Layer</dd>
|
||||||
<dt>Layer</dd>
|
<dd><a href="{{ recipe_layer_branch_url }}">{{ recipe.layerbranch.layer.name }} ({{ recipe.layerbranch.branch.name}} branch)</a></dd>
|
||||||
<dd><a href="{{ recipe_layer_branch_url }}">{{ recipe.layerbranch.layer.name }} ({{ recipe.layerbranch.branch.name}} branch)</a></dd>
|
|
||||||
<dt>Homepage</dt>
|
{% if recipe.homepage %}
|
||||||
<dd>{% if recipe.homepage %}<a href="{{ recipe.homepage }}">{{ recipe.homepage }}</a>{% endif %}</dd>
|
<dt>Homepage</dt>
|
||||||
<dt>Bug tracker</dt>
|
<dd>{% if recipe.homepage %}<a href="{{ recipe.homepage }}">{{ recipe.homepage }}</a>{% endif %}</dd>
|
||||||
<dd><a href="{{ recipe.bugtracker }}">{{ recipe.bugtracker }}</a></dd>
|
{% endif %}
|
||||||
<dt>Provides</dt>
|
|
||||||
<dd>
|
{% if recipe.bugtracker %}
|
||||||
<ul class="unstyled">
|
<dt>Bug tracker</dt>
|
||||||
{% for p in recipe_provides %}
|
<dd><a href="{{ recipe.bugtracker }}">{{ recipe.bugtracker }}</a></dd>
|
||||||
<li>{{ p }}</li>
|
{% endif %}
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
{% if recipe.src_uri %}
|
||||||
</dd>
|
<dt>Source URI</dt>
|
||||||
<dt>Depends</dt>
|
<dd><a href="{{ recipe.src_uri }}">{{ recipe.src_uri }}</a></dd>
|
||||||
<dd>
|
{% endif %}
|
||||||
<ul class="unstyled">
|
|
||||||
{% for d in recipe_depends %}
|
{% if recipe_provides %}
|
||||||
<li>{{ d }}</li>
|
<dt>Provides</dt>
|
||||||
{% endfor %}
|
<dd>
|
||||||
</ul>
|
<ul class="unstyled">
|
||||||
</dd>
|
{% for p in recipe_provides %}
|
||||||
<dt>Distributions</dt>
|
<li>{{ p }}</li>
|
||||||
<dd>
|
{% endfor %}
|
||||||
<ul class="unstyled">
|
</ul>
|
||||||
{% for d in recipe_distros %}
|
</dd>
|
||||||
<li>{{ d }}</li>
|
{% endif %}
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
{% if recipe_depends %}
|
||||||
</dd>
|
<dt>Depends</dt>
|
||||||
</dl>
|
<dd>
|
||||||
|
<ul class="unstyled">
|
||||||
|
{% for d in recipe_depends %}
|
||||||
|
<li>{{ d }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if recipe_distros %}
|
||||||
|
<dt>Distributions</dt>
|
||||||
|
<dd>
|
||||||
|
<ul class="unstyled">
|
||||||
|
{% for d in recipe_distros %}
|
||||||
|
<li>{{ d }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
{% endif %}
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endautoescape %}
|
{% endautoescape %}
|
||||||
|
|
|
@ -29,7 +29,22 @@
|
||||||
<b class="caret"></b>
|
<b class="caret"></b>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu" id="select-status">
|
<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 %}
|
{% if us = upstream_status %}
|
||||||
<li class="active">
|
<li class="active">
|
||||||
<a href="#">
|
<a href="#">
|
||||||
|
@ -50,7 +65,24 @@
|
||||||
Maintainer: <strong>{{ maintainer_name }}</strong>
|
Maintainer: <strong>{{ maintainer_name }}</strong>
|
||||||
<b class="caret"></b>
|
<b class="caret"></b>
|
||||||
</a>
|
</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 %}
|
{% for m in all_maintainers %}
|
||||||
{% if m = maintainer_name %}
|
{% if m = maintainer_name %}
|
||||||
<li class="active">
|
<li class="active">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user