~ubuntu-translations-coordinators/ubuntu-translations/ul10n-stats

« back to all changes in this revision

Viewing changes to common/templates/custom_blacklisted_priority.py

the merge between trunk and my custom branch with conlicts resolved

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
# html_report_template - Provides a template to render an HTML page after
 
4
# Python variable substitution
 
5
#
 
6
# Author: David Planella <david.planella@ubuntu.com>, with mods by
 
7
#   Kyle Nitzsche <kyle.nitzsche@canonical.com>
 
8
#
 
9
# Copyright (c) 2009, 2010 Canonical Ltd.
 
10
#
 
11
# This program is free software: you can redistribute it and/or modify it
 
12
# under the terms of the GNU General Public License version 3, as published
 
13
# by the Free Software Foundation.
 
14
#
 
15
# This program is distributed in the hope that it will be useful, but
 
16
# WITHOUT ANY WARRANTY; without even the implied warranties of
 
17
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
18
# PURPOSE.  See the GNU General Public License for more details.
 
19
#
 
20
# You should have received a copy of the GNU General Public License along
 
21
# with this program.  If not, see <http://www.gnu.org/licenses/>.
 
22
 
 
23
ubuntu_template = """
 
24
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
25
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
26
 
 
27
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
28
  <head>
 
29
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 
30
    <title>Ubuntu %(distro_release)s Languages</title>
 
31
    <link rel="stylesheet" href="css/light.css" type="text/css" />
 
32
 
 
33
    <script src="http://www.google.com/jsapi" type="text/javascript"></script>
 
34
    <script type="text/javascript">
 
35
 
 
36
      google.load("visualization", "1", {packages:["table"]});
 
37
      google.setOnLoadCallback(drawTable);
 
38
 
 
39
      function drawTable() {
 
40
          var table_data = new google.visualization.DataTable(%(blacklisted_priority_json)s, 0.6);
 
41
 
 
42
          var table = new google.visualization.Table(
 
43
            document.getElementById('table'));
 
44
 
 
45
          var formatter = new google.visualization.BarFormat({
 
46
              min: 0,
 
47
              max: 100,
 
48
              width: 100,
 
49
              colorPositive: 'green'});
 
50
          formatter.format(table_data, 0); // Apply formatter to second column
 
51
 
 
52
          table.draw(table_data, {
 
53
              allowHtml: true,
 
54
              showRowNumber: true,
 
55
              page: 'enable',
 
56
              pageSize: 100});
 
57
 
 
58
          // google.visualization.events.addListener(table, 'select', function() {
 
59
          //     var row = table.getSelection()[0].row;
 
60
          //     alert('You selected ' + table_data.getValue(row, 0));
 
61
 
 
62
          google.visualization.events.addListener(table, 'select', selectHandler);
 
63
      }
 
64
 
 
65
    function selectHandler(e) {
 
66
        var row = table.getSelection()[0].row;
 
67
        //alert('A table row was selected');
 
68
        alert('A table row was selected' + table_data.getValue(row, 0));
 
69
    }
 
70
    </script>
 
71
 
 
72
    <style type="text/css">
 
73
        #report-meta {
 
74
          text-align: right;
 
75
          font-size: small;
 
76
          color: #999;
 
77
          float: right;
 
78
        }
 
79
 
 
80
       #report-meta p {
 
81
         margin: 0;
 
82
       }
 
83
 
 
84
       table {margin-left:auto; margin-right:auto;}
 
85
    </style>
 
86
  </head>
 
87
 
 
88
  <body>
 
89
    <div id="container">
 
90
      <div id="container-inner" class="container clear-block">
 
91
        <div id="header">
 
92
 
 
93
          <h1 id="ubuntu-header">
 
94
            <a href="https://wiki.ubuntu.com/Translations" title="Canonical OEM Translation Statistics"></a>
 
95
          </h1>
 
96
        </div>
 
97
 
 
98
        <div id="page">
 
99
          <div id="content">
 
100
            <div class="titlepage">
 
101
              <h2 class="title"><a id="id2820777"></a>Custom Project: %(project)s</h2>
 
102
                <h3>Blacklisted through Priority</h3>
 
103
              <p>The table lists src packages/gettext domains that are excluded from the translation statistics because their LP template has priority that is lower that the blacklist priority cut-off value.</p>
 
104
            </div>
 
105
 
 
106
          <div id="table"></div>
 
107
 
 
108
          <div id="footer">
 
109
            <div id="ubuntulinks">
 
110
                Last update on %(gen_date)s
 
111
            </div>
 
112
          </div>
 
113
        </div>
 
114
      </div>
 
115
    </div>
 
116
  </body>
 
117
 
 
118
</html>
 
119
"""