damned-lies r1497 - in trunk: . media/css stats templates templates/languages
- From: claudep svn gnome org
- To: svn-commits-list gnome org
- Subject: damned-lies r1497 - in trunk: . media/css stats templates templates/languages
- Date: Sat, 14 Mar 2009 20:52:03 +0000 (UTC)
Author: claudep
Date: Sat Mar 14 20:52:02 2009
New Revision: 1497
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1497&view=rev
Log:
2009-03-14 Claude Paroz <claude 2xlibre net>
* templates/release_compare.html: Sort by language name by default.
* media/css/main.css: Add style for comment in language_release.
* stats/models.py: Fill stateDb objects with last comment, if any.
* templates/languages/language_release_stats.html: Show last comment on
module, if any and state is None (Inactive).
Fixes (partially?) bug #566429.
Modified:
trunk/ChangeLog
trunk/media/css/main.css
trunk/stats/models.py
trunk/templates/languages/language_release_stats.html
trunk/templates/release_compare.html
Modified: trunk/media/css/main.css
==============================================================================
--- trunk/media/css/main.css (original)
+++ trunk/media/css/main.css Sat Mar 14 20:52:02 2009
@@ -40,7 +40,7 @@
background-color: #EEEEEE;
border-bottom: #AAAAAA solid 1px;
cursor: pointer;
- padding-right: 1em;
+ padding-right: 1.2em;
}
table.tablesorter thead tr .headerSortUp {
@@ -224,6 +224,12 @@
color: #999;
}
+.comment {
+ font-size: small;
+ font-style: italic;
+ color: #666666;
+}
+
.djform td {
font-size: 10px;
color: #999;
Modified: trunk/stats/models.py
==============================================================================
--- trunk/stats/models.py (original)
+++ trunk/stats/models.py Sat Mar 14 20:52:02 2009
@@ -1084,7 +1084,7 @@
'all_errors':[]
}
"""
- from vertimus.models import StateDb # import here to prevent a circular dependency
+ from vertimus.models import StateDb, ActionDb # import here to prevent a circular dependency
stats = {'dtype':dtype, 'totaltrans':0, 'totalfuzzy':0, 'totaluntrans':0,
'totaltransperc': 0, 'totalfuzzyperc': 0, 'totaluntransperc': 0,
@@ -1105,6 +1105,7 @@
infos_dict = Information.get_info_dict(lang)
+ # Prepare StateDb objects in a dict (with "branch_id-domain_id" as key), to save database queries later
vt_states = StateDb.objects.select_related('branch','domain')
if release:
vt_states = vt_states.filter(language=lang, branch__releases=release, domain__dtype=dtype)
@@ -1112,6 +1113,13 @@
vt_states = vt_states.filter(language=lang, domain__dtype=dtype)
vt_states_dict = dict([("%d-%d" % (vt.branch.id, vt.domain.id),vt) for vt in vt_states])
+ # Get comments from last action of StateDb objects
+ actions = ActionDb.objects.filter(state_db__in=vt_states, comment__isnull=False).order_by('created')
+ actions_dict = dict([(act.state_db_id, act) for act in actions])
+ for vt_state in vt_states_dict.values():
+ if vt_state.id in actions_dict:
+ vt_state.last_comment = actions_dict[vt_state.id].comment
+
for stat in pot_stats:
categdescr = "default"
if release:
Modified: trunk/templates/languages/language_release_stats.html
==============================================================================
--- trunk/templates/languages/language_release_stats.html (original)
+++ trunk/templates/languages/language_release_stats.html Sat Mar 14 20:52:02 2009
@@ -74,7 +74,11 @@
{% ifnotequal stat.state.name "None" %}
<em><small>{{ stat.state.get_state }}</small></em></td>
<td><span style="display: none;">{{ stat.state.updated }}</span><em><small>{{ stat.state.updated|date:dateformat }}
- {% else %} </td><td>
+ {% else %}
+ {% if stat.state.last_comment %}
+ <span class="comment">{{ stat.state.last_comment|truncatewords:12 }}</span>
+ {% endif %}
+ </td><td>
{% endifnotequal %}
{% else %} </td><td>
{% endif %}
Modified: trunk/templates/release_compare.html
==============================================================================
--- trunk/templates/release_compare.html (original)
+++ trunk/templates/release_compare.html Sat Mar 14 20:52:02 2009
@@ -9,7 +9,7 @@
<script type="text/javascript">
$(document).ready(function()
{
- $("#stats").tablesorter();
+ $("#stats").tablesorter({sortList: [[0,0]]});
}
);
</script>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]