Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
2c53de7a
Commit
2c53de7a
authored
Aug 06, 2012
by
Clément Schreiner
Browse files
Move excessive python code from the template into the controller.
parent
65542944
Changes
2
Hide whitespace changes
Inline
Side-by-side
debexpo/controllers/package.py
View file @
2c53de7a
...
@@ -109,6 +109,13 @@ class PackageController(BaseController):
...
@@ -109,6 +109,13 @@ class PackageController(BaseController):
else
:
else
:
c
.
user
=
None
c
.
user
=
None
c
.
plugins
=
dict
()
for
package_version
in
package
.
package_versions
:
pv_plugins
=
Plugins
(
'qa'
,
package_version
)
pv_plugins
.
load_plugins
()
pv_plugins
.
load_results
()
c
.
plugins
[
package_version
.
id
]
=
pv_plugins
log
.
debug
(
'Rendering page'
)
log
.
debug
(
'Rendering page'
)
return
render
(
'/package/index.mako'
)
return
render
(
'/package/index.mako'
)
...
...
debexpo/templates/package/index.mako
View file @
2c53de7a
...
@@ -147,20 +147,16 @@
...
@@ -147,20 +147,16 @@
% endif
% endif
</table>
</table>
<%
% if len(c.plugins[package_version.id]) > 0:
plugins = c.plugins('qa', package_version)
plugins.load_results()
%>
% if len(plugins.results) > 0:
<h3 class="qa-toplevel-header">${ _('QA information') }</h3>
<h3 class="qa-toplevel-header">${ _('QA information') }</h3>
<ul class="qa">
<ul class="qa">
## Print result from plugins
## Print result from plugins
% for plugin in plugins
.results
:
% for
name,
plugin in
c.
plugins
[package_version.id].iteritems()
:
<li class="severity-${ h.constants.PLUGIN_SEVERITY[
1
].lower() }">
<li class="severity-${ h.constants.PLUGIN_SEVERITY[
plugin.test_severity
].lower() }">
<span class="visibility" title="${h.constants.PLUGIN_SEVERITY[
1
]}">–</span>
<span class="visibility" title="${h.constants.PLUGIN_SEVERITY[
plugin.test_severity
]}">–</span>
${ plugin
s.plugins[plugin].render(plugins.results[plugin],
'html') | n }
${ plugin
.render(
'html') | n }
</li>
</li>
% endfor
% endfor
</ul>
</ul>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment