Show More
@@ -1,95 +1,95 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
<% |
|
3 | <%block name="title"> | |
4 | ${_('About')} |
|
4 | ${_('About')} | |
5 | %if c.site_name: |
|
5 | %if c.site_name: | |
6 | · ${c.site_name} |
|
6 | · ${c.site_name} | |
7 | %endif |
|
7 | %endif | |
8 | </%def> |
|
8 | </%block> | |
9 | <%def name="breadcrumbs()"> |
|
9 | <%def name="breadcrumbs()"> | |
10 | ${c.site_name} |
|
10 | ${c.site_name} | |
11 | </%def> |
|
11 | </%def> | |
12 | <%block name="header_menu"> |
|
12 | <%block name="header_menu"> | |
13 | ${self.menu('about')} |
|
13 | ${self.menu('about')} | |
14 | </%block> |
|
14 | </%block> | |
15 | <%def name="main()"> |
|
15 | <%def name="main()"> | |
16 |
|
16 | |||
17 | <div class="box"> |
|
17 | <div class="box"> | |
18 | <!-- box / title --> |
|
18 | <!-- box / title --> | |
19 | <div class="title"> |
|
19 | <div class="title"> | |
20 | <h5>${_('About')} Kallithea</h5> |
|
20 | <h5>${_('About')} Kallithea</h5> | |
21 | </div> |
|
21 | </div> | |
22 |
|
22 | |||
23 | <p><a href="https://kallithea-scm.org/">Kallithea</a> is a project of the |
|
23 | <p><a href="https://kallithea-scm.org/">Kallithea</a> is a project of the | |
24 | <a href="http://sfconservancy.org/">Software Freedom Conservancy, Inc.</a> |
|
24 | <a href="http://sfconservancy.org/">Software Freedom Conservancy, Inc.</a> | |
25 | and is released under the terms of the |
|
25 | and is released under the terms of the | |
26 | <a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License, |
|
26 | <a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License, | |
27 | v 3.0 (GPLv3)</a>.</p> |
|
27 | v 3.0 (GPLv3)</a>.</p> | |
28 |
|
28 | |||
29 | <p>Kallithea is copyrighted by various authors, including but not |
|
29 | <p>Kallithea is copyrighted by various authors, including but not | |
30 | necessarily limited to the following: |
|
30 | necessarily limited to the following: | |
31 | <ul style="margin: 0 0 0 50px;"> |
|
31 | <ul style="margin: 0 0 0 50px;"> | |
32 | <li>Copyright © 2010–2013, RhodeCode GmbH</li> |
|
32 | <li>Copyright © 2010–2013, RhodeCode GmbH</li> | |
33 | <li>Copyright © 2011–2014, Unity Technologies</li> |
|
33 | <li>Copyright © 2011–2014, Unity Technologies</li> | |
34 | <li>Copyright © 2012, 2014, Andrew Shadura</li> |
|
34 | <li>Copyright © 2012, 2014, Andrew Shadura</li> | |
35 | <li>Copyright © 2012, Augusto Herrmann</li> |
|
35 | <li>Copyright © 2012, Augusto Herrmann</li> | |
36 | <li>Copyright © 2012, Dan Sheridan</li> |
|
36 | <li>Copyright © 2012, Dan Sheridan</li> | |
37 | <li>Copyright © 2012, 2014, Dominik Ruf</li> |
|
37 | <li>Copyright © 2012, 2014, Dominik Ruf</li> | |
38 | <li>Copyright © 2012, Vincent Duvert</li> |
|
38 | <li>Copyright © 2012, Vincent Duvert</li> | |
39 | <li>Copyright © 2011, Liad Shani</li> |
|
39 | <li>Copyright © 2011, Liad Shani</li> | |
40 | <li>Copyright © 2013, Jonathan Sternberg</li> |
|
40 | <li>Copyright © 2013, Jonathan Sternberg</li> | |
41 | <li>Copyright © 2011, Jason F. Harris</li> |
|
41 | <li>Copyright © 2011, Jason F. Harris</li> | |
42 | <li>Copyright © 2011, Lorenzo M. Catucci</li> |
|
42 | <li>Copyright © 2011, Lorenzo M. Catucci</li> | |
43 | <li>Copyright © 2013, Grzegorz Rożniecki</li> |
|
43 | <li>Copyright © 2013, Grzegorz Rożniecki</li> | |
44 | <li>Copyright © 2011, Les Peabody</li> |
|
44 | <li>Copyright © 2011, Les Peabody</li> | |
45 | <li>Copyright © 2011, Nicolas VINOT</li> |
|
45 | <li>Copyright © 2011, Nicolas VINOT</li> | |
46 | <li>Copyright © 2012, Indra Talip</li> |
|
46 | <li>Copyright © 2012, Indra Talip</li> | |
47 | <li>Copyright © 2012, H Waldo G</li> |
|
47 | <li>Copyright © 2012, H Waldo G</li> | |
48 | <li>Copyright © 2011, Aparkar</li> |
|
48 | <li>Copyright © 2011, Aparkar</li> | |
49 | <li>Copyright © 2013, Dennis Brakhane</li> |
|
49 | <li>Copyright © 2013, Dennis Brakhane</li> | |
50 | <li>Copyright © 2011, Matt Zuba</li> |
|
50 | <li>Copyright © 2011, Matt Zuba</li> | |
51 | <li>Copyright © 2014, Bradley M. Kuhn</li> |
|
51 | <li>Copyright © 2014, Bradley M. Kuhn</li> | |
52 | <li>Copyright © 2012–2013, xpol</li> |
|
52 | <li>Copyright © 2012–2013, xpol</li> | |
53 | <li>Copyright © 2012, hppj</li> |
|
53 | <li>Copyright © 2012, hppj</li> | |
54 | <li>Copyright © 2013–2014, Takumi IINO</li> |
|
54 | <li>Copyright © 2013–2014, Takumi IINO</li> | |
55 | <li>Copyright © 2011, Shawn K. O'Shea</li> |
|
55 | <li>Copyright © 2011, Shawn K. O'Shea</li> | |
56 | <li>Copyright © 2012, Tony Bussieres</li> |
|
56 | <li>Copyright © 2012, Tony Bussieres</li> | |
57 | <li>Copyright © 2011, Simon Lopez</li> |
|
57 | <li>Copyright © 2011, Simon Lopez</li> | |
58 | <li>Copyright © 2012, mikespook</li> |
|
58 | <li>Copyright © 2012, mikespook</li> | |
59 | <li>Copyright © 2012, nansenat16</li> |
|
59 | <li>Copyright © 2012, nansenat16</li> | |
60 | <li>Copyright © 2012, Zachary Auclair</li> |
|
60 | <li>Copyright © 2012, Zachary Auclair</li> | |
61 | <li>Copyright © 2012, Raoul Thill</li> |
|
61 | <li>Copyright © 2012, Raoul Thill</li> | |
62 | <li>Copyright © 2011, Jared Bunting</li> |
|
62 | <li>Copyright © 2011, Jared Bunting</li> | |
63 | <li>Copyright © 2013, Magnus Ericmats</li> |
|
63 | <li>Copyright © 2013, Magnus Ericmats</li> | |
64 | <li>Copyright © 2010, Łukasz Balcerzak</li> |
|
64 | <li>Copyright © 2010, Łukasz Balcerzak</li> | |
65 | <li>Copyright © 2014, Sean Farley</li> |
|
65 | <li>Copyright © 2014, Sean Farley</li> | |
66 | <li>Copyright © 2014, Martin Vium</li> |
|
66 | <li>Copyright © 2014, Martin Vium</li> | |
67 | <li>Copyright © 2014, Daniel Anderson</li> |
|
67 | <li>Copyright © 2014, Daniel Anderson</li> | |
68 | <li>Copyright © 2014, Travis Burtrum</li> |
|
68 | <li>Copyright © 2014, Travis Burtrum</li> | |
69 |
|
69 | |||
70 | ## We did not list the following copyright holders, given that they appeared |
|
70 | ## We did not list the following copyright holders, given that they appeared | |
71 | ## to use for-profit company affiliations in their contribution in the |
|
71 | ## to use for-profit company affiliations in their contribution in the | |
72 | ## Mercurial log and therefore I didn't know if copyright was theirs or |
|
72 | ## Mercurial log and therefore I didn't know if copyright was theirs or | |
73 | ## their company's. |
|
73 | ## their company's. | |
74 | ## Copyright © 2011 Thayne Harbaugh <thayne@fusionio.com> |
|
74 | ## Copyright © 2011 Thayne Harbaugh <thayne@fusionio.com> | |
75 | ## Copyright © 2012 Dies Koper <diesk@fast.au.fujitsu.com> |
|
75 | ## Copyright © 2012 Dies Koper <diesk@fast.au.fujitsu.com> | |
76 | ## Copyright © 2012 Erwin Kroon <e.kroon@smartmetersolutions.nl> |
|
76 | ## Copyright © 2012 Erwin Kroon <e.kroon@smartmetersolutions.nl> | |
77 | ## Copyright © 2012 Vincent Caron <vcaron@bearstech.com> |
|
77 | ## Copyright © 2012 Vincent Caron <vcaron@bearstech.com> | |
78 | ## |
|
78 | ## | |
79 | ## These contributors' contributions may not be copyrightable: |
|
79 | ## These contributors' contributions may not be copyrightable: | |
80 | ## philip.j@hostdime.com in 2012 |
|
80 | ## philip.j@hostdime.com in 2012 | |
81 | ## Stefan Engel <mail@engel-stefan.de> in 2012 |
|
81 | ## Stefan Engel <mail@engel-stefan.de> in 2012 | |
82 | ## Ton Plomp <tcplomp@gmail.com> in 2013 |
|
82 | ## Ton Plomp <tcplomp@gmail.com> in 2013 | |
83 | ## |
|
83 | ## | |
84 | </ul></p> |
|
84 | </ul></p> | |
85 |
|
85 | |||
86 | <p>The above are the copyright holders who have submitted direct |
|
86 | <p>The above are the copyright holders who have submitted direct | |
87 | contributions to the Kallithea repository. In |
|
87 | contributions to the Kallithea repository. In | |
88 | the <a href="https://kallithea-scm.org/repos/kallithea">Kallithea source |
|
88 | the <a href="https://kallithea-scm.org/repos/kallithea">Kallithea source | |
89 | code</a>, there is |
|
89 | code</a>, there is | |
90 | a <a href="https://kallithea-scm.org/repos/kallithea/files/tip/LICENSE.md">list |
|
90 | a <a href="https://kallithea-scm.org/repos/kallithea/files/tip/LICENSE.md">list | |
91 | of third-party libraries and code that Kallithea incorporates</a>.</p> |
|
91 | of third-party libraries and code that Kallithea incorporates</a>.</p> | |
92 |
|
92 | |||
93 | </div> |
|
93 | </div> | |
94 |
|
94 | |||
95 | </%def> |
|
95 | </%def> |
@@ -1,60 +1,60 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Admin Journal')} |
|
5 | ${_('Admin Journal')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | <form id="filter_form"> |
|
12 | <form id="filter_form"> | |
13 | <input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term or _('journal filter...')}"/> |
|
13 | <input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term or _('journal filter...')}"/> | |
14 | <span class="tooltip" title="${h.tooltip(h.journal_filter_help())}">?</span> |
|
14 | <span class="tooltip" title="${h.tooltip(h.journal_filter_help())}">?</span> | |
15 | <input type='submit' value="${_('Filter')}" class="btn btn-mini" style="padding:0px 2px 0px 2px;margin:0px"/> |
|
15 | <input type='submit' value="${_('Filter')}" class="btn btn-mini" style="padding:0px 2px 0px 2px;margin:0px"/> | |
16 | ${_('Admin Journal')} - ${ungettext('%s Entry', '%s Entries', c.users_log.item_count) % (c.users_log.item_count)} |
|
16 | ${_('Admin Journal')} - ${ungettext('%s Entry', '%s Entries', c.users_log.item_count) % (c.users_log.item_count)} | |
17 | </form> |
|
17 | </form> | |
18 | ${h.end_form()} |
|
18 | ${h.end_form()} | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%block name="header_menu"> |
|
21 | <%block name="header_menu"> | |
22 | ${self.menu('admin')} |
|
22 | ${self.menu('admin')} | |
23 | </%block> |
|
23 | </%block> | |
24 | <%def name="main()"> |
|
24 | <%def name="main()"> | |
25 | <div class="box"> |
|
25 | <div class="box"> | |
26 | <!-- box / title --> |
|
26 | <!-- box / title --> | |
27 | <div class="title"> |
|
27 | <div class="title"> | |
28 | ${self.breadcrumbs()} |
|
28 | ${self.breadcrumbs()} | |
29 | </div> |
|
29 | </div> | |
30 | <!-- end box / title --> |
|
30 | <!-- end box / title --> | |
31 | <div class="table"> |
|
31 | <div class="table"> | |
32 | <div id="user_log"> |
|
32 | <div id="user_log"> | |
33 | ${c.log_data} |
|
33 | ${c.log_data} | |
34 | </div> |
|
34 | </div> | |
35 | </div> |
|
35 | </div> | |
36 | </div> |
|
36 | </div> | |
37 |
|
37 | |||
38 | <script> |
|
38 | <script> | |
39 | $(document).ready(function() { |
|
39 | $(document).ready(function() { | |
40 | $('#j_filter').click(function(){ |
|
40 | $('#j_filter').click(function(){ | |
41 | var $jfilter = $('#j_filter'); |
|
41 | var $jfilter = $('#j_filter'); | |
42 | if($jfilter.hasClass('initial')){ |
|
42 | if($jfilter.hasClass('initial')){ | |
43 | $jfilter.val(''); |
|
43 | $jfilter.val(''); | |
44 | } |
|
44 | } | |
45 | }); |
|
45 | }); | |
46 | var fix_j_filter_width = function(len){ |
|
46 | var fix_j_filter_width = function(len){ | |
47 | $('#j_filter').css('width', Math.max(80, len*6.50)+'px'); |
|
47 | $('#j_filter').css('width', Math.max(80, len*6.50)+'px'); | |
48 | }; |
|
48 | }; | |
49 | $('#j_filter').keyup(function () { |
|
49 | $('#j_filter').keyup(function () { | |
50 | fix_j_filter_width($('#j_filter').val().length); |
|
50 | fix_j_filter_width($('#j_filter').val().length); | |
51 | }); |
|
51 | }); | |
52 | $('#filter_form').submit(function (e) { |
|
52 | $('#filter_form').submit(function (e) { | |
53 | e.preventDefault(); |
|
53 | e.preventDefault(); | |
54 | var val = $('#j_filter').val(); |
|
54 | var val = $('#j_filter').val(); | |
55 | window.location = "${url.current(filter='__FILTER__')}".replace('__FILTER__',val); |
|
55 | window.location = "${url.current(filter='__FILTER__')}".replace('__FILTER__',val); | |
56 | }); |
|
56 | }); | |
57 | fix_j_filter_width($('#j_filter').val().length); |
|
57 | fix_j_filter_width($('#j_filter').val().length); | |
58 | }); |
|
58 | }); | |
59 | </script> |
|
59 | </script> | |
60 | </%def> |
|
60 | </%def> |
@@ -1,138 +1,138 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Authentication Settings')} |
|
5 | ${_('Authentication Settings')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} | |
13 | » |
|
13 | » | |
14 | ${_('Authentication')} |
|
14 | ${_('Authentication')} | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%block name="header_menu"> |
|
17 | <%block name="header_menu"> | |
18 | ${self.menu('admin')} |
|
18 | ${self.menu('admin')} | |
19 | </%block> |
|
19 | </%block> | |
20 |
|
20 | |||
21 | <%def name="main()"> |
|
21 | <%def name="main()"> | |
22 | <div class="box"> |
|
22 | <div class="box"> | |
23 | <!-- box / title --> |
|
23 | <!-- box / title --> | |
24 | <div class="title"> |
|
24 | <div class="title"> | |
25 | ${self.breadcrumbs()} |
|
25 | ${self.breadcrumbs()} | |
26 | </div> |
|
26 | </div> | |
27 | ${h.form(url('auth_settings'))} |
|
27 | ${h.form(url('auth_settings'))} | |
28 | <div class="form"> |
|
28 | <div class="form"> | |
29 |
|
29 | |||
30 | ## enabled auth plugins |
|
30 | ## enabled auth plugins | |
31 | <h1>${_('Authentication Plugins')}</h1> |
|
31 | <h1>${_('Authentication Plugins')}</h1> | |
32 | <div class="fields"> |
|
32 | <div class="fields"> | |
33 | <div class="field"> |
|
33 | <div class="field"> | |
34 | <div class="label"><label for="auth_plugins">${_("Enabled Plugins")}</label></div> |
|
34 | <div class="label"><label for="auth_plugins">${_("Enabled Plugins")}</label></div> | |
35 | <div class="input">${h.text("auth_plugins", class_='large')} |
|
35 | <div class="input">${h.text("auth_plugins", class_='large')} | |
36 | <span class="help-block">${_('Comma separated list of plugins. Order of plugins is also order in which Kallithea will try to authenticate user')}</span> |
|
36 | <span class="help-block">${_('Comma separated list of plugins. Order of plugins is also order in which Kallithea will try to authenticate user')}</span> | |
37 | <div style="padding:10px 0px 10px 0px;font-weight: bold">${_('Available built-in plugins')}</div> |
|
37 | <div style="padding:10px 0px 10px 0px;font-weight: bold">${_('Available built-in plugins')}</div> | |
38 | <ul> |
|
38 | <ul> | |
39 | %for plugin_path in c.available_plugins: |
|
39 | %for plugin_path in c.available_plugins: | |
40 | <li> |
|
40 | <li> | |
41 | <div style="padding:3px 0px 3px 0px"> |
|
41 | <div style="padding:3px 0px 3px 0px"> | |
42 | <span style="margin: 0px 10px 0px 0px" plugin_id="${plugin_path}" class="toggle-plugin btn btn-mini ${'btn-success' if plugin_path in c.enabled_plugins else ''}"> |
|
42 | <span style="margin: 0px 10px 0px 0px" plugin_id="${plugin_path}" class="toggle-plugin btn btn-mini ${'btn-success' if plugin_path in c.enabled_plugins else ''}"> | |
43 | ${_('enabled') if plugin_path in c.enabled_plugins else _('disabled')}</span>${plugin_path} |
|
43 | ${_('enabled') if plugin_path in c.enabled_plugins else _('disabled')}</span>${plugin_path} | |
44 | </div> |
|
44 | </div> | |
45 | </li> |
|
45 | </li> | |
46 | %endfor |
|
46 | %endfor | |
47 | </ul> |
|
47 | </ul> | |
48 | </div> |
|
48 | </div> | |
49 | </div> |
|
49 | </div> | |
50 | </div> |
|
50 | </div> | |
51 |
|
51 | |||
52 | %for cnt, module in enumerate(c.auth_plugins): |
|
52 | %for cnt, module in enumerate(c.auth_plugins): | |
53 | <% pluginName = c.auth_plugins_shortnames[module] %> |
|
53 | <% pluginName = c.auth_plugins_shortnames[module] %> | |
54 | <h1>${_('Plugin')}: ${pluginName}</h1> |
|
54 | <h1>${_('Plugin')}: ${pluginName}</h1> | |
55 | <div class="fields"> |
|
55 | <div class="fields"> | |
56 | ## autoform generation, based on plugin definition from it's settings |
|
56 | ## autoform generation, based on plugin definition from it's settings | |
57 | %for setting in c.plugin_settings[module]: |
|
57 | %for setting in c.plugin_settings[module]: | |
58 | <% fullsetting = "auth_%s_%s" % (pluginName, setting["name"]) %> |
|
58 | <% fullsetting = "auth_%s_%s" % (pluginName, setting["name"]) %> | |
59 | <% displayname = (setting["formname"] if ("formname" in setting) else setting["name"]) %> |
|
59 | <% displayname = (setting["formname"] if ("formname" in setting) else setting["name"]) %> | |
60 | %if setting["type"] == "password": |
|
60 | %if setting["type"] == "password": | |
61 | <div class="field"> |
|
61 | <div class="field"> | |
62 | <div class="label"><label for="${fullsetting}">${_(displayname)}</label></div> |
|
62 | <div class="label"><label for="${fullsetting}">${_(displayname)}</label></div> | |
63 | <div class="input"> |
|
63 | <div class="input"> | |
64 | ${h.password(fullsetting,class_='small',autocomplete="off")} |
|
64 | ${h.password(fullsetting,class_='small',autocomplete="off")} | |
65 | <span class="help-block">${setting["description"]}</span> |
|
65 | <span class="help-block">${setting["description"]}</span> | |
66 | </div> |
|
66 | </div> | |
67 | </div> |
|
67 | </div> | |
68 | %elif setting["type"] in ["string", "int"]: |
|
68 | %elif setting["type"] in ["string", "int"]: | |
69 | <div class="field"> |
|
69 | <div class="field"> | |
70 | <div class="label"><label for="${fullsetting}">${_(displayname)}</label></div> |
|
70 | <div class="label"><label for="${fullsetting}">${_(displayname)}</label></div> | |
71 | <div class="input"> |
|
71 | <div class="input"> | |
72 | ${h.text(fullsetting,class_='small')} |
|
72 | ${h.text(fullsetting,class_='small')} | |
73 | <span class="help-block">${setting["description"]}</span> |
|
73 | <span class="help-block">${setting["description"]}</span> | |
74 | </div> |
|
74 | </div> | |
75 | </div> |
|
75 | </div> | |
76 | %elif setting["type"] == "bool": |
|
76 | %elif setting["type"] == "bool": | |
77 | <div class="field"> |
|
77 | <div class="field"> | |
78 | <div class="label label-checkbox"><label for="${fullsetting}">${_(displayname)}</label></div> |
|
78 | <div class="label label-checkbox"><label for="${fullsetting}">${_(displayname)}</label></div> | |
79 | <div class="checkboxes"> |
|
79 | <div class="checkboxes"> | |
80 | <div class="checkbox">${h.checkbox(fullsetting,True,class_='small')}</div> |
|
80 | <div class="checkbox">${h.checkbox(fullsetting,True,class_='small')}</div> | |
81 | <span class="help-block">${setting["description"]}</span> |
|
81 | <span class="help-block">${setting["description"]}</span> | |
82 | </div> |
|
82 | </div> | |
83 | </div> |
|
83 | </div> | |
84 | %elif setting["type"] == "select": |
|
84 | %elif setting["type"] == "select": | |
85 | <div class="field"> |
|
85 | <div class="field"> | |
86 | <div class="label"><label for="${fullsetting}">${_(displayname)}</label></div> |
|
86 | <div class="label"><label for="${fullsetting}">${_(displayname)}</label></div> | |
87 | <div class="select"> |
|
87 | <div class="select"> | |
88 | ${h.select(fullsetting,setting['values'][0],setting['values'],class_='small')} |
|
88 | ${h.select(fullsetting,setting['values'][0],setting['values'],class_='small')} | |
89 | <span class="help-block">${setting["description"]}</span> |
|
89 | <span class="help-block">${setting["description"]}</span> | |
90 | </div> |
|
90 | </div> | |
91 | </div> |
|
91 | </div> | |
92 | %else: |
|
92 | %else: | |
93 | <div class="field"> |
|
93 | <div class="field"> | |
94 | <div class="label"><label for="${fullsetting}">${_(displayname)}</label></div> |
|
94 | <div class="label"><label for="${fullsetting}">${_(displayname)}</label></div> | |
95 | <div class="input">This field is of type ${setting['type']}, which cannot be displayed. Must be one of [string|int|bool|select].</div> |
|
95 | <div class="input">This field is of type ${setting['type']}, which cannot be displayed. Must be one of [string|int|bool|select].</div> | |
96 | <span class="help-block">${setting["description"]}</span> |
|
96 | <span class="help-block">${setting["description"]}</span> | |
97 | </div> |
|
97 | </div> | |
98 | %endif |
|
98 | %endif | |
99 | %endfor |
|
99 | %endfor | |
100 | </div> |
|
100 | </div> | |
101 | %endfor |
|
101 | %endfor | |
102 | <div class="fields"> |
|
102 | <div class="fields"> | |
103 | <div class="buttons"> |
|
103 | <div class="buttons"> | |
104 | ${h.submit('save',_('Save'),class_="btn")} |
|
104 | ${h.submit('save',_('Save'),class_="btn")} | |
105 | </div> |
|
105 | </div> | |
106 | </div> |
|
106 | </div> | |
107 | </div> |
|
107 | </div> | |
108 | ${h.end_form()} |
|
108 | ${h.end_form()} | |
109 | </div> |
|
109 | </div> | |
110 |
|
110 | |||
111 | <script> |
|
111 | <script> | |
112 | $('.toggle-plugin').click(function(e){ |
|
112 | $('.toggle-plugin').click(function(e){ | |
113 | var $auth_plugins_input = $('#auth_plugins'); |
|
113 | var $auth_plugins_input = $('#auth_plugins'); | |
114 | var notEmpty = function(element, index, array) { |
|
114 | var notEmpty = function(element, index, array) { | |
115 | return (element != ""); |
|
115 | return (element != ""); | |
116 | } |
|
116 | } | |
117 | var elems = $auth_plugins_input.val().split(',').filter(notEmpty); |
|
117 | var elems = $auth_plugins_input.val().split(',').filter(notEmpty); | |
118 | var $cur_button = $(e.currentTarget); |
|
118 | var $cur_button = $(e.currentTarget); | |
119 | var plugin_id = $cur_button.attr('plugin_id'); |
|
119 | var plugin_id = $cur_button.attr('plugin_id'); | |
120 |
|
120 | |||
121 | if($cur_button.hasClass('btn-success')){ |
|
121 | if($cur_button.hasClass('btn-success')){ | |
122 | elems.splice(elems.indexOf(plugin_id), 1); |
|
122 | elems.splice(elems.indexOf(plugin_id), 1); | |
123 | $auth_plugins_input.val(elems.join(',')); |
|
123 | $auth_plugins_input.val(elems.join(',')); | |
124 | $cur_button.removeClass('btn-success'); |
|
124 | $cur_button.removeClass('btn-success'); | |
125 | $cur_button.html(_TM['disabled']); |
|
125 | $cur_button.html(_TM['disabled']); | |
126 | } |
|
126 | } | |
127 | else{ |
|
127 | else{ | |
128 | console.log(elems); |
|
128 | console.log(elems); | |
129 | if(elems.indexOf(plugin_id) == -1){ |
|
129 | if(elems.indexOf(plugin_id) == -1){ | |
130 | elems.push(plugin_id); |
|
130 | elems.push(plugin_id); | |
131 | } |
|
131 | } | |
132 | $auth_plugins_input.val(elems.join(',')); |
|
132 | $auth_plugins_input.val(elems.join(',')); | |
133 | $cur_button.addClass('btn-success'); |
|
133 | $cur_button.addClass('btn-success'); | |
134 | $cur_button.html(_TM['enabled']); |
|
134 | $cur_button.html(_TM['enabled']); | |
135 | } |
|
135 | } | |
136 | }); |
|
136 | }); | |
137 | </script> |
|
137 | </script> | |
138 | </%def> |
|
138 | </%def> |
@@ -1,96 +1,96 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Repository Defaults')} |
|
5 | ${_('Repository Defaults')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} | |
13 | » |
|
13 | » | |
14 | ${_('Defaults')} |
|
14 | ${_('Defaults')} | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%block name="header_menu"> |
|
17 | <%block name="header_menu"> | |
18 | ${self.menu('admin')} |
|
18 | ${self.menu('admin')} | |
19 | </%block> |
|
19 | </%block> | |
20 |
|
20 | |||
21 | <%def name="main()"> |
|
21 | <%def name="main()"> | |
22 | <div class="box"> |
|
22 | <div class="box"> | |
23 | <!-- box / title --> |
|
23 | <!-- box / title --> | |
24 | <div class="title"> |
|
24 | <div class="title"> | |
25 | ${self.breadcrumbs()} |
|
25 | ${self.breadcrumbs()} | |
26 | </div> |
|
26 | </div> | |
27 |
|
27 | |||
28 | <h3>${_('Repository Defaults')}</h3> |
|
28 | <h3>${_('Repository Defaults')}</h3> | |
29 |
|
29 | |||
30 | ${h.form(url('default', id='defaults'),method='put')} |
|
30 | ${h.form(url('default', id='defaults'),method='put')} | |
31 | <div class="form"> |
|
31 | <div class="form"> | |
32 | <!-- fields --> |
|
32 | <!-- fields --> | |
33 |
|
33 | |||
34 | <div class="fields"> |
|
34 | <div class="fields"> | |
35 |
|
35 | |||
36 | <div class="field"> |
|
36 | <div class="field"> | |
37 | <div class="label"> |
|
37 | <div class="label"> | |
38 | <label for="default_repo_type">${_('Type')}:</label> |
|
38 | <label for="default_repo_type">${_('Type')}:</label> | |
39 | </div> |
|
39 | </div> | |
40 | <div class="input"> |
|
40 | <div class="input"> | |
41 | ${h.select('default_repo_type','hg',c.backends,class_="medium")} |
|
41 | ${h.select('default_repo_type','hg',c.backends,class_="medium")} | |
42 | </div> |
|
42 | </div> | |
43 | </div> |
|
43 | </div> | |
44 |
|
44 | |||
45 | <div class="field"> |
|
45 | <div class="field"> | |
46 | <div class="label label-checkbox"> |
|
46 | <div class="label label-checkbox"> | |
47 | <label for="default_repo_private">${_('Private repository')}:</label> |
|
47 | <label for="default_repo_private">${_('Private repository')}:</label> | |
48 | </div> |
|
48 | </div> | |
49 | <div class="checkboxes"> |
|
49 | <div class="checkboxes"> | |
50 | ${h.checkbox('default_repo_private',value="True")} |
|
50 | ${h.checkbox('default_repo_private',value="True")} | |
51 | <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span> |
|
51 | <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span> | |
52 | </div> |
|
52 | </div> | |
53 | </div> |
|
53 | </div> | |
54 |
|
54 | |||
55 |
|
55 | |||
56 | <div class="field"> |
|
56 | <div class="field"> | |
57 | <div class="label label-checkbox"> |
|
57 | <div class="label label-checkbox"> | |
58 | <label for="default_repo_enable_statistics">${_('Enable statistics')}:</label> |
|
58 | <label for="default_repo_enable_statistics">${_('Enable statistics')}:</label> | |
59 | </div> |
|
59 | </div> | |
60 | <div class="checkboxes"> |
|
60 | <div class="checkboxes"> | |
61 | ${h.checkbox('default_repo_enable_statistics',value="True")} |
|
61 | ${h.checkbox('default_repo_enable_statistics',value="True")} | |
62 | <span class="help-block">${_('Enable statistics window on summary page.')}</span> |
|
62 | <span class="help-block">${_('Enable statistics window on summary page.')}</span> | |
63 | </div> |
|
63 | </div> | |
64 | </div> |
|
64 | </div> | |
65 |
|
65 | |||
66 | <div class="field"> |
|
66 | <div class="field"> | |
67 | <div class="label label-checkbox"> |
|
67 | <div class="label label-checkbox"> | |
68 | <label for="default_repo_enable_downloads">${_('Enable downloads')}:</label> |
|
68 | <label for="default_repo_enable_downloads">${_('Enable downloads')}:</label> | |
69 | </div> |
|
69 | </div> | |
70 | <div class="checkboxes"> |
|
70 | <div class="checkboxes"> | |
71 | ${h.checkbox('default_repo_enable_downloads',value="True")} |
|
71 | ${h.checkbox('default_repo_enable_downloads',value="True")} | |
72 | <span class="help-block">${_('Enable download menu on summary page.')}</span> |
|
72 | <span class="help-block">${_('Enable download menu on summary page.')}</span> | |
73 | </div> |
|
73 | </div> | |
74 | </div> |
|
74 | </div> | |
75 |
|
75 | |||
76 | <div class="field"> |
|
76 | <div class="field"> | |
77 | <div class="label label-checkbox"> |
|
77 | <div class="label label-checkbox"> | |
78 | <label for="default_repo_enable_locking">${_('Enable locking')}:</label> |
|
78 | <label for="default_repo_enable_locking">${_('Enable locking')}:</label> | |
79 | </div> |
|
79 | </div> | |
80 | <div class="checkboxes"> |
|
80 | <div class="checkboxes"> | |
81 | ${h.checkbox('default_repo_enable_locking',value="True")} |
|
81 | ${h.checkbox('default_repo_enable_locking',value="True")} | |
82 | <span class="help-block">${_('Enable lock-by-pulling on repository.')}</span> |
|
82 | <span class="help-block">${_('Enable lock-by-pulling on repository.')}</span> | |
83 | </div> |
|
83 | </div> | |
84 | </div> |
|
84 | </div> | |
85 |
|
85 | |||
86 | <div class="buttons"> |
|
86 | <div class="buttons"> | |
87 | ${h.submit('save',_('Save'),class_="btn")} |
|
87 | ${h.submit('save',_('Save'),class_="btn")} | |
88 | </div> |
|
88 | </div> | |
89 | </div> |
|
89 | </div> | |
90 | </div> |
|
90 | </div> | |
91 | ${h.end_form()} |
|
91 | ${h.end_form()} | |
92 |
|
92 | |||
93 | ##<h3>${_('Groups defaults')}</h3> |
|
93 | ##<h3>${_('Groups defaults')}</h3> | |
94 |
|
94 | |||
95 | </div> |
|
95 | </div> | |
96 | </%def> |
|
96 | </%def> |
@@ -1,177 +1,177 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Edit Gist')} · ${c.gist.gist_access_id} |
|
5 | ${_('Edit Gist')} · ${c.gist.gist_access_id} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%block name="js_extra"> |
|
11 | <%block name="js_extra"> | |
12 | <script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script> |
|
12 | <script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script> | |
13 | <script type="text/javascript" src="${h.url('/js/codemirror_loadmode.js')}"></script> |
|
13 | <script type="text/javascript" src="${h.url('/js/codemirror_loadmode.js')}"></script> | |
14 | <script type="text/javascript" src="${h.url('/codemirror/mode/meta.js')}"></script> |
|
14 | <script type="text/javascript" src="${h.url('/codemirror/mode/meta.js')}"></script> | |
15 | </%block> |
|
15 | </%block> | |
16 | <%block name="css_extra"> |
|
16 | <%block name="css_extra"> | |
17 | <link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/> |
|
17 | <link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/> | |
18 | </%block> |
|
18 | </%block> | |
19 |
|
19 | |||
20 | <%def name="breadcrumbs_links()"> |
|
20 | <%def name="breadcrumbs_links()"> | |
21 | ${_('Edit Gist')} · ${c.gist.gist_access_id} |
|
21 | ${_('Edit Gist')} · ${c.gist.gist_access_id} | |
22 | </%def> |
|
22 | </%def> | |
23 |
|
23 | |||
24 | <%block name="header_menu"> |
|
24 | <%block name="header_menu"> | |
25 | ${self.menu('gists')} |
|
25 | ${self.menu('gists')} | |
26 | </%block> |
|
26 | </%block> | |
27 |
|
27 | |||
28 | <%def name="main()"> |
|
28 | <%def name="main()"> | |
29 | <div class="box"> |
|
29 | <div class="box"> | |
30 | <!-- box / title --> |
|
30 | <!-- box / title --> | |
31 | <div class="title"> |
|
31 | <div class="title"> | |
32 | ${self.breadcrumbs()} |
|
32 | ${self.breadcrumbs()} | |
33 | </div> |
|
33 | </div> | |
34 |
|
34 | |||
35 | <div class="table"> |
|
35 | <div class="table"> | |
36 | <div id="edit_error" style="display: none" class="flash_msg"> |
|
36 | <div id="edit_error" style="display: none" class="flash_msg"> | |
37 | <div class="alert alert-dismissable alert-warning"> |
|
37 | <div class="alert alert-dismissable alert-warning"> | |
38 | <button type="button" class="close" data-dismiss="alert" aria-hidden="true"><i class="icon-cancel-circled"></i></button> |
|
38 | <button type="button" class="close" data-dismiss="alert" aria-hidden="true"><i class="icon-cancel-circled"></i></button> | |
39 | ${h.literal(_('Gist was update since you started editing. Copy your changes and click %(here)s to reload new version.') |
|
39 | ${h.literal(_('Gist was update since you started editing. Copy your changes and click %(here)s to reload new version.') | |
40 | % {'here': h.link_to('here',h.url('edit_gist', gist_id=c.gist.gist_access_id))})} |
|
40 | % {'here': h.link_to('here',h.url('edit_gist', gist_id=c.gist.gist_access_id))})} | |
41 | </div> |
|
41 | </div> | |
42 | <script> |
|
42 | <script> | |
43 | if (typeof jQuery != 'undefined') { |
|
43 | if (typeof jQuery != 'undefined') { | |
44 | $(".alert").alert(); |
|
44 | $(".alert").alert(); | |
45 | } |
|
45 | } | |
46 | </script> |
|
46 | </script> | |
47 | </div> |
|
47 | </div> | |
48 |
|
48 | |||
49 | <div id="files_data"> |
|
49 | <div id="files_data"> | |
50 | ${h.form(h.url('edit_gist', gist_id=c.gist.gist_access_id), method='post', id='eform')} |
|
50 | ${h.form(h.url('edit_gist', gist_id=c.gist.gist_access_id), method='post', id='eform')} | |
51 | <div> |
|
51 | <div> | |
52 | <div class="gravatar"> |
|
52 | <div class="gravatar"> | |
53 | ${h.gravatar(c.authuser.email, size=32)} |
|
53 | ${h.gravatar(c.authuser.email, size=32)} | |
54 | </div> |
|
54 | </div> | |
55 | <input type="hidden" value="${c.file_changeset.raw_id}" name="parent_hash"> |
|
55 | <input type="hidden" value="${c.file_changeset.raw_id}" name="parent_hash"> | |
56 | <textarea style="resize:vertical; width:400px;border: 1px solid #ccc;border-radius: 3px;" |
|
56 | <textarea style="resize:vertical; width:400px;border: 1px solid #ccc;border-radius: 3px;" | |
57 | id="description" name="description" |
|
57 | id="description" name="description" | |
58 | placeholder="${_('Gist description ...')}">${c.gist.gist_description}</textarea> |
|
58 | placeholder="${_('Gist description ...')}">${c.gist.gist_description}</textarea> | |
59 | <div style="padding:0px 0px 0px 42px"> |
|
59 | <div style="padding:0px 0px 0px 42px"> | |
60 | <label for='lifetime'>${_('Gist lifetime')}</label> |
|
60 | <label for='lifetime'>${_('Gist lifetime')}</label> | |
61 | ${h.select('lifetime', '0', c.lifetime_options)} |
|
61 | ${h.select('lifetime', '0', c.lifetime_options)} | |
62 | <span class="" style="color: #AAA"> |
|
62 | <span class="" style="color: #AAA"> | |
63 | %if c.gist.gist_expires == -1: |
|
63 | %if c.gist.gist_expires == -1: | |
64 | ${_('Expires')}: ${_('never')} |
|
64 | ${_('Expires')}: ${_('never')} | |
65 | %else: |
|
65 | %else: | |
66 | ${_('Expires')}: ${h.age(h.time_to_datetime(c.gist.gist_expires))} |
|
66 | ${_('Expires')}: ${h.age(h.time_to_datetime(c.gist.gist_expires))} | |
67 | %endif |
|
67 | %endif | |
68 | </span> |
|
68 | </span> | |
69 | </div> |
|
69 | </div> | |
70 | </div> |
|
70 | </div> | |
71 |
|
71 | |||
72 | % for cnt, file in enumerate(c.files): |
|
72 | % for cnt, file in enumerate(c.files): | |
73 | <div id="body" class="codeblock" style="margin-bottom: 4px"> |
|
73 | <div id="body" class="codeblock" style="margin-bottom: 4px"> | |
74 | <div style="padding: 10px 10px 10px 26px;color:#666666"> |
|
74 | <div style="padding: 10px 10px 10px 26px;color:#666666"> | |
75 | <input type="hidden" value="${file.path}" name="org_files"> |
|
75 | <input type="hidden" value="${file.path}" name="org_files"> | |
76 | <input id="filename_${h.FID('f',file.path)}" name="files" size="30" type="text" value="${file.path}"> |
|
76 | <input id="filename_${h.FID('f',file.path)}" name="files" size="30" type="text" value="${file.path}"> | |
77 | <select id="mimetype_${h.FID('f',file.path)}" name="mimetypes"/> |
|
77 | <select id="mimetype_${h.FID('f',file.path)}" name="mimetypes"/> | |
78 | </div> |
|
78 | </div> | |
79 | <div class="editor_container"> |
|
79 | <div class="editor_container"> | |
80 | <pre id="editor_pre"></pre> |
|
80 | <pre id="editor_pre"></pre> | |
81 | <textarea id="editor_${h.FID('f',file.path)}" name="contents" style="display:none">${file.content}</textarea> |
|
81 | <textarea id="editor_${h.FID('f',file.path)}" name="contents" style="display:none">${file.content}</textarea> | |
82 | </div> |
|
82 | </div> | |
83 | </div> |
|
83 | </div> | |
84 |
|
84 | |||
85 | ## dynamic edit box. |
|
85 | ## dynamic edit box. | |
86 | <script type="text/javascript"> |
|
86 | <script type="text/javascript"> | |
87 | var myCodeMirror = initCodeMirror("editor_${h.FID('f',file.path)}", ''); |
|
87 | var myCodeMirror = initCodeMirror("editor_${h.FID('f',file.path)}", ''); | |
88 |
|
88 | |||
89 | //inject new modes |
|
89 | //inject new modes | |
90 | var $modes_select = $('#mimetype_${h.FID('f',file.path)}'); |
|
90 | var $modes_select = $('#mimetype_${h.FID('f',file.path)}'); | |
91 | $modes_select.each(function(){ |
|
91 | $modes_select.each(function(){ | |
92 | var modes_select = this; |
|
92 | var modes_select = this; | |
93 | var index = 1; |
|
93 | var index = 1; | |
94 | for(var i=0;i<CodeMirror.modeInfo.length;i++) { |
|
94 | for(var i=0;i<CodeMirror.modeInfo.length;i++) { | |
95 | var m = CodeMirror.modeInfo[i]; |
|
95 | var m = CodeMirror.modeInfo[i]; | |
96 | var opt = new Option(m.name, m.mime); |
|
96 | var opt = new Option(m.name, m.mime); | |
97 | $(opt).attr('mode', m.mode); |
|
97 | $(opt).attr('mode', m.mode); | |
98 | if (m.mime == 'text/plain') { |
|
98 | if (m.mime == 'text/plain') { | |
99 | // default plain text |
|
99 | // default plain text | |
100 | $(opt).attr('selected', 'selected'); |
|
100 | $(opt).attr('selected', 'selected'); | |
101 | modes_select.options[0] = opt; |
|
101 | modes_select.options[0] = opt; | |
102 | } else { |
|
102 | } else { | |
103 | modes_select.options[index++] = opt; |
|
103 | modes_select.options[index++] = opt; | |
104 | } |
|
104 | } | |
105 | } |
|
105 | } | |
106 | }); |
|
106 | }); | |
107 |
|
107 | |||
108 | var $filename = $('#filename_${h.FID('f',file.path)}'); |
|
108 | var $filename = $('#filename_${h.FID('f',file.path)}'); | |
109 | // on select change set new mode |
|
109 | // on select change set new mode | |
110 | $modes_select.change(function(e){ |
|
110 | $modes_select.change(function(e){ | |
111 | var selected = e.currentTarget; |
|
111 | var selected = e.currentTarget; | |
112 | var node = selected.options[selected.selectedIndex]; |
|
112 | var node = selected.options[selected.selectedIndex]; | |
113 | var detected_mode = CodeMirror.findModeByMIME(node.value); |
|
113 | var detected_mode = CodeMirror.findModeByMIME(node.value); | |
114 | setCodeMirrorMode(myCodeMirror, detected_mode); |
|
114 | setCodeMirrorMode(myCodeMirror, detected_mode); | |
115 |
|
115 | |||
116 | var proposed_ext = CodeMirror.findExtensionByMode(detected_mode); |
|
116 | var proposed_ext = CodeMirror.findExtensionByMode(detected_mode); | |
117 | var file_data = CodeMirror.getFilenameAndExt($filename.val()); |
|
117 | var file_data = CodeMirror.getFilenameAndExt($filename.val()); | |
118 | var filename = file_data['filename'] || 'filename1'; |
|
118 | var filename = file_data['filename'] || 'filename1'; | |
119 | $filename.val(filename + '.' + proposed_ext); |
|
119 | $filename.val(filename + '.' + proposed_ext); | |
120 | }); |
|
120 | }); | |
121 |
|
121 | |||
122 | // on type the new filename set mode |
|
122 | // on type the new filename set mode | |
123 | $filename.keyup(function(e){ |
|
123 | $filename.keyup(function(e){ | |
124 | var file_data = CodeMirror.getFilenameAndExt(this.value); |
|
124 | var file_data = CodeMirror.getFilenameAndExt(this.value); | |
125 | if(file_data['ext'] != null){ |
|
125 | if(file_data['ext'] != null){ | |
126 | var detected_mode = CodeMirror.findModeByExtension(file_data['ext']) || CodeMirror.findModeByMIME('text/plain'); |
|
126 | var detected_mode = CodeMirror.findModeByExtension(file_data['ext']) || CodeMirror.findModeByMIME('text/plain'); | |
127 |
|
127 | |||
128 | if (detected_mode){ |
|
128 | if (detected_mode){ | |
129 | setCodeMirrorMode(myCodeMirror, detected_mode); |
|
129 | setCodeMirrorMode(myCodeMirror, detected_mode); | |
130 | $modes_select.val(detected_mode.mime); |
|
130 | $modes_select.val(detected_mode.mime); | |
131 | } |
|
131 | } | |
132 | } |
|
132 | } | |
133 | }); |
|
133 | }); | |
134 |
|
134 | |||
135 | // set mode on page load |
|
135 | // set mode on page load | |
136 | var detected_mode = CodeMirror.findModeByExtension("${file.extension}"); |
|
136 | var detected_mode = CodeMirror.findModeByExtension("${file.extension}"); | |
137 |
|
137 | |||
138 | if (detected_mode){ |
|
138 | if (detected_mode){ | |
139 | setCodeMirrorMode(myCodeMirror, detected_mode); |
|
139 | setCodeMirrorMode(myCodeMirror, detected_mode); | |
140 | $modes_select.val(detected_mode.mime); |
|
140 | $modes_select.val(detected_mode.mime); | |
141 | } |
|
141 | } | |
142 |
|
142 | |||
143 | </script> |
|
143 | </script> | |
144 |
|
144 | |||
145 | %endfor |
|
145 | %endfor | |
146 |
|
146 | |||
147 | <div style="padding-top: 5px"> |
|
147 | <div style="padding-top: 5px"> | |
148 | ${h.submit('update',_('Update Gist'),class_="btn btn-mini btn-success")} |
|
148 | ${h.submit('update',_('Update Gist'),class_="btn btn-mini btn-success")} | |
149 | <a class="btn btn-mini" href="${h.url('gist', gist_id=c.gist.gist_access_id)}">${_('Cancel')}</a> |
|
149 | <a class="btn btn-mini" href="${h.url('gist', gist_id=c.gist.gist_access_id)}">${_('Cancel')}</a> | |
150 | </div> |
|
150 | </div> | |
151 | ${h.end_form()} |
|
151 | ${h.end_form()} | |
152 | <script> |
|
152 | <script> | |
153 | $('#update').on('click', function(e){ |
|
153 | $('#update').on('click', function(e){ | |
154 | e.preventDefault(); |
|
154 | e.preventDefault(); | |
155 |
|
155 | |||
156 | // check for newer version. |
|
156 | // check for newer version. | |
157 | $.ajax({ |
|
157 | $.ajax({ | |
158 | url: "${h.url('edit_gist_check_revision', gist_id=c.gist.gist_access_id)}", |
|
158 | url: "${h.url('edit_gist_check_revision', gist_id=c.gist.gist_access_id)}", | |
159 | data: {'revision': '${c.file_changeset.raw_id}'}, |
|
159 | data: {'revision': '${c.file_changeset.raw_id}'}, | |
160 | dataType: 'json', |
|
160 | dataType: 'json', | |
161 | type: 'POST', |
|
161 | type: 'POST', | |
162 | success: function(data) { |
|
162 | success: function(data) { | |
163 | if(data.success == false){ |
|
163 | if(data.success == false){ | |
164 | $('#edit_error').show(); |
|
164 | $('#edit_error').show(); | |
165 | } |
|
165 | } | |
166 | else{ |
|
166 | else{ | |
167 | $('#eform').submit(); |
|
167 | $('#eform').submit(); | |
168 | } |
|
168 | } | |
169 | } |
|
169 | } | |
170 | }) |
|
170 | }) | |
171 | }); |
|
171 | }); | |
172 | </script> |
|
172 | </script> | |
173 | </div> |
|
173 | </div> | |
174 | </div> |
|
174 | </div> | |
175 |
|
175 | |||
176 | </div> |
|
176 | </div> | |
177 | </%def> |
|
177 | </%def> |
@@ -1,80 +1,80 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | %if c.show_private: |
|
5 | %if c.show_private: | |
6 | ${_('Private Gists for User %s') % c.authuser.username} |
|
6 | ${_('Private Gists for User %s') % c.authuser.username} | |
7 | %elif c.show_public: |
|
7 | %elif c.show_public: | |
8 | ${_('Public Gists for User %s') % c.authuser.username} |
|
8 | ${_('Public Gists for User %s') % c.authuser.username} | |
9 | %else: |
|
9 | %else: | |
10 | ${_('Public Gists')} |
|
10 | ${_('Public Gists')} | |
11 | %endif |
|
11 | %endif | |
12 | %if c.site_name: |
|
12 | %if c.site_name: | |
13 | · ${c.site_name} |
|
13 | · ${c.site_name} | |
14 | %endif |
|
14 | %endif | |
15 | </%def> |
|
15 | </%block> | |
16 |
|
16 | |||
17 | <%def name="breadcrumbs_links()"> |
|
17 | <%def name="breadcrumbs_links()"> | |
18 | %if c.show_private: |
|
18 | %if c.show_private: | |
19 | ${_('Private Gists for User %s') % c.authuser.username} |
|
19 | ${_('Private Gists for User %s') % c.authuser.username} | |
20 | %elif c.show_public: |
|
20 | %elif c.show_public: | |
21 | ${_('Public Gists for User %s') % c.authuser.username} |
|
21 | ${_('Public Gists for User %s') % c.authuser.username} | |
22 | %else: |
|
22 | %else: | |
23 | ${_('Public Gists')} |
|
23 | ${_('Public Gists')} | |
24 | %endif |
|
24 | %endif | |
25 | - ${c.gists_pager.item_count} |
|
25 | - ${c.gists_pager.item_count} | |
26 | </%def> |
|
26 | </%def> | |
27 |
|
27 | |||
28 | <%block name="header_menu"> |
|
28 | <%block name="header_menu"> | |
29 | ${self.menu('gists')} |
|
29 | ${self.menu('gists')} | |
30 | </%block> |
|
30 | </%block> | |
31 |
|
31 | |||
32 | <%def name="main()"> |
|
32 | <%def name="main()"> | |
33 | <div class="box"> |
|
33 | <div class="box"> | |
34 | <!-- box / title --> |
|
34 | <!-- box / title --> | |
35 | <div class="title"> |
|
35 | <div class="title"> | |
36 | ${self.breadcrumbs()} |
|
36 | ${self.breadcrumbs()} | |
37 | %if c.authuser.username != 'default': |
|
37 | %if c.authuser.username != 'default': | |
38 | <ul class="links"> |
|
38 | <ul class="links"> | |
39 | <li> |
|
39 | <li> | |
40 | <a href="${h.url('new_gist')}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_(u'Create New Gist')}</a> |
|
40 | <a href="${h.url('new_gist')}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_(u'Create New Gist')}</a> | |
41 | </li> |
|
41 | </li> | |
42 | </ul> |
|
42 | </ul> | |
43 | %endif |
|
43 | %endif | |
44 | </div> |
|
44 | </div> | |
45 | %if c.gists_pager.item_count>0: |
|
45 | %if c.gists_pager.item_count>0: | |
46 | % for gist in c.gists_pager: |
|
46 | % for gist in c.gists_pager: | |
47 | <div class="gist-item" style="padding:10px 20px 10px 15px"> |
|
47 | <div class="gist-item" style="padding:10px 20px 10px 15px"> | |
48 |
|
48 | |||
49 | <div class="gravatar"> |
|
49 | <div class="gravatar"> | |
50 | ${h.gravatar(gist.owner.email, size=28)} |
|
50 | ${h.gravatar(gist.owner.email, size=28)} | |
51 | </div> |
|
51 | </div> | |
52 | <div title="${gist.owner.full_contact}" class="user" style="font-size: 16px"> |
|
52 | <div title="${gist.owner.full_contact}" class="user" style="font-size: 16px"> | |
53 | <b>${h.person(gist.owner.full_contact)}</b> / |
|
53 | <b>${h.person(gist.owner.full_contact)}</b> / | |
54 | <b><a href="${h.url('gist',gist_id=gist.gist_access_id)}">gist: ${gist.gist_access_id}</a></b> |
|
54 | <b><a href="${h.url('gist',gist_id=gist.gist_access_id)}">gist: ${gist.gist_access_id}</a></b> | |
55 | </div> |
|
55 | </div> | |
56 | <div style="padding: 4px 0px 0px 0px"> |
|
56 | <div style="padding: 4px 0px 0px 0px"> | |
57 | ${_('Created')} ${h.age(gist.created_on)} / |
|
57 | ${_('Created')} ${h.age(gist.created_on)} / | |
58 | <span style="color: #AAA"> |
|
58 | <span style="color: #AAA"> | |
59 | %if gist.gist_expires == -1: |
|
59 | %if gist.gist_expires == -1: | |
60 | ${_('Expires')}: ${_('never')} |
|
60 | ${_('Expires')}: ${_('never')} | |
61 | %else: |
|
61 | %else: | |
62 | ${_('Expires')}: ${h.age(h.time_to_datetime(gist.gist_expires))} |
|
62 | ${_('Expires')}: ${h.age(h.time_to_datetime(gist.gist_expires))} | |
63 | %endif |
|
63 | %endif | |
64 | </span> |
|
64 | </span> | |
65 | </div> |
|
65 | </div> | |
66 |
|
66 | |||
67 | <div style="border:0px;padding:10px 0px 0px 40px;color:#AAA">${gist.gist_description}</div> |
|
67 | <div style="border:0px;padding:10px 0px 0px 40px;color:#AAA">${gist.gist_description}</div> | |
68 | </div> |
|
68 | </div> | |
69 | % endfor |
|
69 | % endfor | |
70 |
|
70 | |||
71 | <div class="notification-paginator"> |
|
71 | <div class="notification-paginator"> | |
72 | <div class="pagination-wh pagination-left"> |
|
72 | <div class="pagination-wh pagination-left"> | |
73 | ${c.gists_pager.pager('$link_previous ~2~ $link_next', **request.GET.mixed())} |
|
73 | ${c.gists_pager.pager('$link_previous ~2~ $link_next', **request.GET.mixed())} | |
74 | </div> |
|
74 | </div> | |
75 | </div> |
|
75 | </div> | |
76 | %else: |
|
76 | %else: | |
77 | <div class="table">${_('There are no gists yet')}</div> |
|
77 | <div class="table">${_('There are no gists yet')}</div> | |
78 | %endif |
|
78 | %endif | |
79 | </div> |
|
79 | </div> | |
80 | </%def> |
|
80 | </%def> |
@@ -1,116 +1,116 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('New Gist')} |
|
5 | ${_('New Gist')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%block name="js_extra"> |
|
11 | <%block name="js_extra"> | |
12 | <script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script> |
|
12 | <script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script> | |
13 | <script type="text/javascript" src="${h.url('/js/codemirror_loadmode.js')}"></script> |
|
13 | <script type="text/javascript" src="${h.url('/js/codemirror_loadmode.js')}"></script> | |
14 | <script type="text/javascript" src="${h.url('/codemirror/mode/meta.js')}"></script> |
|
14 | <script type="text/javascript" src="${h.url('/codemirror/mode/meta.js')}"></script> | |
15 | </%block> |
|
15 | </%block> | |
16 | <%block name="css_extra"> |
|
16 | <%block name="css_extra"> | |
17 | <link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/> |
|
17 | <link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/> | |
18 | </%block> |
|
18 | </%block> | |
19 |
|
19 | |||
20 | <%def name="breadcrumbs_links()"> |
|
20 | <%def name="breadcrumbs_links()"> | |
21 | ${_('New Gist')} |
|
21 | ${_('New Gist')} | |
22 | </%def> |
|
22 | </%def> | |
23 |
|
23 | |||
24 | <%block name="header_menu"> |
|
24 | <%block name="header_menu"> | |
25 | ${self.menu('gists')} |
|
25 | ${self.menu('gists')} | |
26 | </%block> |
|
26 | </%block> | |
27 |
|
27 | |||
28 | <%def name="main()"> |
|
28 | <%def name="main()"> | |
29 | <div class="box"> |
|
29 | <div class="box"> | |
30 | <!-- box / title --> |
|
30 | <!-- box / title --> | |
31 | <div class="title"> |
|
31 | <div class="title"> | |
32 | ${self.breadcrumbs()} |
|
32 | ${self.breadcrumbs()} | |
33 | </div> |
|
33 | </div> | |
34 |
|
34 | |||
35 | <div class="table"> |
|
35 | <div class="table"> | |
36 | <div id="files_data"> |
|
36 | <div id="files_data"> | |
37 | ${h.form(h.url('gists'), method='post',id='eform')} |
|
37 | ${h.form(h.url('gists'), method='post',id='eform')} | |
38 | <div> |
|
38 | <div> | |
39 | <div class="gravatar"> |
|
39 | <div class="gravatar"> | |
40 | ${h.gravatar(c.authuser.email, size=32)} |
|
40 | ${h.gravatar(c.authuser.email, size=32)} | |
41 | </div> |
|
41 | </div> | |
42 | <textarea style="resize:vertical; width:400px;border: 1px solid #ccc;border-radius: 3px;" id="description" name="description" placeholder="${_('Gist description ...')}"></textarea> |
|
42 | <textarea style="resize:vertical; width:400px;border: 1px solid #ccc;border-radius: 3px;" id="description" name="description" placeholder="${_('Gist description ...')}"></textarea> | |
43 | <div style="padding:0px 0px 0px 42px"> |
|
43 | <div style="padding:0px 0px 0px 42px"> | |
44 | <label for='lifetime'>${_('Gist lifetime')}</label> |
|
44 | <label for='lifetime'>${_('Gist lifetime')}</label> | |
45 | ${h.select('lifetime', '', c.lifetime_options)} |
|
45 | ${h.select('lifetime', '', c.lifetime_options)} | |
46 | </div> |
|
46 | </div> | |
47 | </div> |
|
47 | </div> | |
48 | <div id="body" class="codeblock"> |
|
48 | <div id="body" class="codeblock"> | |
49 | <div style="padding: 10px 10px 10px 26px;color:#666666"> |
|
49 | <div style="padding: 10px 10px 10px 26px;color:#666666"> | |
50 | ${h.text('filename', size=30, placeholder=_('name this file...'))} |
|
50 | ${h.text('filename', size=30, placeholder=_('name this file...'))} | |
51 | <select id="mimetype" name="mimetype"/> |
|
51 | <select id="mimetype" name="mimetype"/> | |
52 | </div> |
|
52 | </div> | |
53 | <div id="editor_container"> |
|
53 | <div id="editor_container"> | |
54 | <pre id="editor_pre"></pre> |
|
54 | <pre id="editor_pre"></pre> | |
55 | <textarea id="editor" name="content" style="display:none"></textarea> |
|
55 | <textarea id="editor" name="content" style="display:none"></textarea> | |
56 | </div> |
|
56 | </div> | |
57 | </div> |
|
57 | </div> | |
58 | <div style="padding-top: 5px"> |
|
58 | <div style="padding-top: 5px"> | |
59 | ${h.submit('private',_('Create Private Gist'),class_="btn btn-mini btn-success")} |
|
59 | ${h.submit('private',_('Create Private Gist'),class_="btn btn-mini btn-success")} | |
60 | ${h.submit('public',_('Create Public Gist'),class_="btn btn-mini")} |
|
60 | ${h.submit('public',_('Create Public Gist'),class_="btn btn-mini")} | |
61 | ${h.reset('reset',_('Reset'),class_="btn btn-mini")} |
|
61 | ${h.reset('reset',_('Reset'),class_="btn btn-mini")} | |
62 | </div> |
|
62 | </div> | |
63 | ${h.end_form()} |
|
63 | ${h.end_form()} | |
64 | <script type="text/javascript"> |
|
64 | <script type="text/javascript"> | |
65 | var myCodeMirror = initCodeMirror('editor', ''); |
|
65 | var myCodeMirror = initCodeMirror('editor', ''); | |
66 |
|
66 | |||
67 | //inject new modes |
|
67 | //inject new modes | |
68 | var $modes_select = $('#mimetype'); |
|
68 | var $modes_select = $('#mimetype'); | |
69 | $modes_select.each(function(){ |
|
69 | $modes_select.each(function(){ | |
70 | var modes_select = this; |
|
70 | var modes_select = this; | |
71 | var index = 1; |
|
71 | var index = 1; | |
72 | for(var i=0;i<CodeMirror.modeInfo.length;i++) { |
|
72 | for(var i=0;i<CodeMirror.modeInfo.length;i++) { | |
73 | var m = CodeMirror.modeInfo[i]; |
|
73 | var m = CodeMirror.modeInfo[i]; | |
74 | var opt = new Option(m.name, m.mime); |
|
74 | var opt = new Option(m.name, m.mime); | |
75 | $(opt).attr('mode', m.mode); |
|
75 | $(opt).attr('mode', m.mode); | |
76 | if (m.mime == 'text/plain') { |
|
76 | if (m.mime == 'text/plain') { | |
77 | // default plain text |
|
77 | // default plain text | |
78 | $(opt).attr('selected', 'selected'); |
|
78 | $(opt).attr('selected', 'selected'); | |
79 | modes_select.options[0] = opt; |
|
79 | modes_select.options[0] = opt; | |
80 | } else { |
|
80 | } else { | |
81 | modes_select.options[index++] = opt; |
|
81 | modes_select.options[index++] = opt; | |
82 | } |
|
82 | } | |
83 | } |
|
83 | } | |
84 | }); |
|
84 | }); | |
85 |
|
85 | |||
86 | var $filename = $('#filename'); |
|
86 | var $filename = $('#filename'); | |
87 | // on select change set new mode |
|
87 | // on select change set new mode | |
88 | $modes_select.change(function(e){ |
|
88 | $modes_select.change(function(e){ | |
89 | var selected = e.currentTarget; |
|
89 | var selected = e.currentTarget; | |
90 | var node = selected.options[selected.selectedIndex]; |
|
90 | var node = selected.options[selected.selectedIndex]; | |
91 | var detected_mode = CodeMirror.findModeByMIME(node.value); |
|
91 | var detected_mode = CodeMirror.findModeByMIME(node.value); | |
92 | setCodeMirrorMode(myCodeMirror, detected_mode); |
|
92 | setCodeMirrorMode(myCodeMirror, detected_mode); | |
93 |
|
93 | |||
94 | var proposed_ext = CodeMirror.findExtensionByMode(detected_mode); |
|
94 | var proposed_ext = CodeMirror.findExtensionByMode(detected_mode); | |
95 | var file_data = CodeMirror.getFilenameAndExt($filename.val()); |
|
95 | var file_data = CodeMirror.getFilenameAndExt($filename.val()); | |
96 | var filename = file_data['filename'] || 'filename1'; |
|
96 | var filename = file_data['filename'] || 'filename1'; | |
97 | $filename.val(filename + '.' + proposed_ext); |
|
97 | $filename.val(filename + '.' + proposed_ext); | |
98 | }); |
|
98 | }); | |
99 |
|
99 | |||
100 | // on type the new filename set mode |
|
100 | // on type the new filename set mode | |
101 | $filename.keyup(function(e){ |
|
101 | $filename.keyup(function(e){ | |
102 | var file_data = CodeMirror.getFilenameAndExt(this.value); |
|
102 | var file_data = CodeMirror.getFilenameAndExt(this.value); | |
103 | if(file_data['ext'] != null){ |
|
103 | if(file_data['ext'] != null){ | |
104 | var detected_mode = CodeMirror.findModeByExtension(file_data['ext']) || CodeMirror.findModeByMIME('text/plain'); |
|
104 | var detected_mode = CodeMirror.findModeByExtension(file_data['ext']) || CodeMirror.findModeByMIME('text/plain'); | |
105 | if (detected_mode){ |
|
105 | if (detected_mode){ | |
106 | setCodeMirrorMode(myCodeMirror, detected_mode); |
|
106 | setCodeMirrorMode(myCodeMirror, detected_mode); | |
107 | $modes_select.val(detected_mode.mime); |
|
107 | $modes_select.val(detected_mode.mime); | |
108 | } |
|
108 | } | |
109 | } |
|
109 | } | |
110 | }); |
|
110 | }); | |
111 | </script> |
|
111 | </script> | |
112 | </div> |
|
112 | </div> | |
113 | </div> |
|
113 | </div> | |
114 |
|
114 | |||
115 | </div> |
|
115 | </div> | |
116 | </%def> |
|
116 | </%def> |
@@ -1,102 +1,102 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Gist')} · ${c.gist.gist_access_id} |
|
5 | ${_('Gist')} · ${c.gist.gist_access_id} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${_('Gist')} · ${c.gist.gist_access_id} |
|
12 | ${_('Gist')} · ${c.gist.gist_access_id} | |
13 | / ${_('URL')}: ${c.gist.gist_url()} |
|
13 | / ${_('URL')}: ${c.gist.gist_url()} | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%block name="header_menu"> |
|
16 | <%block name="header_menu"> | |
17 | ${self.menu('gists')} |
|
17 | ${self.menu('gists')} | |
18 | </%block> |
|
18 | </%block> | |
19 |
|
19 | |||
20 | <%def name="main()"> |
|
20 | <%def name="main()"> | |
21 | <div class="box"> |
|
21 | <div class="box"> | |
22 | <!-- box / title --> |
|
22 | <!-- box / title --> | |
23 | <div class="title"> |
|
23 | <div class="title"> | |
24 | ${self.breadcrumbs()} |
|
24 | ${self.breadcrumbs()} | |
25 | %if c.authuser.username != 'default': |
|
25 | %if c.authuser.username != 'default': | |
26 | <ul class="links"> |
|
26 | <ul class="links"> | |
27 | <li> |
|
27 | <li> | |
28 | <a href="${h.url('new_gist')}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_(u'Create New Gist')}</a> |
|
28 | <a href="${h.url('new_gist')}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_(u'Create New Gist')}</a> | |
29 | </li> |
|
29 | </li> | |
30 | </ul> |
|
30 | </ul> | |
31 | %endif |
|
31 | %endif | |
32 | </div> |
|
32 | </div> | |
33 | <div class="table"> |
|
33 | <div class="table"> | |
34 | <div id="files_data"> |
|
34 | <div id="files_data"> | |
35 | <div id="body" class="codeblock"> |
|
35 | <div id="body" class="codeblock"> | |
36 | <div class="code-header"> |
|
36 | <div class="code-header"> | |
37 | <div class="stats"> |
|
37 | <div class="stats"> | |
38 | <div class="left" style="margin: -4px 0px 0px 0px"> |
|
38 | <div class="left" style="margin: -4px 0px 0px 0px"> | |
39 | %if c.gist.gist_type == 'public': |
|
39 | %if c.gist.gist_type == 'public': | |
40 | <div class="btn btn-mini btn-success disabled">${_('Public Gist')}</div> |
|
40 | <div class="btn btn-mini btn-success disabled">${_('Public Gist')}</div> | |
41 | %else: |
|
41 | %else: | |
42 | <div class="btn btn-mini btn-warning disabled">${_('Private Gist')}</div> |
|
42 | <div class="btn btn-mini btn-warning disabled">${_('Private Gist')}</div> | |
43 | %endif |
|
43 | %endif | |
44 | </div> |
|
44 | </div> | |
45 | <div class="left item"> |
|
45 | <div class="left item"> | |
46 | ${c.gist.gist_description} |
|
46 | ${c.gist.gist_description} | |
47 | </div> |
|
47 | </div> | |
48 | <div class="left item last" style="color: #AAA"> |
|
48 | <div class="left item last" style="color: #AAA"> | |
49 | %if c.gist.gist_expires == -1: |
|
49 | %if c.gist.gist_expires == -1: | |
50 | ${_('Expires')}: ${_('never')} |
|
50 | ${_('Expires')}: ${_('never')} | |
51 | %else: |
|
51 | %else: | |
52 | ${_('Expires')}: ${h.age(h.time_to_datetime(c.gist.gist_expires))} |
|
52 | ${_('Expires')}: ${h.age(h.time_to_datetime(c.gist.gist_expires))} | |
53 | %endif |
|
53 | %endif | |
54 | </div> |
|
54 | </div> | |
55 |
|
55 | |||
56 | %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.authuser.user_id: |
|
56 | %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.authuser.user_id: | |
57 | <div style="float:right"> |
|
57 | <div style="float:right"> | |
58 | ${h.form(url('gist', gist_id=c.gist.gist_id),method='delete')} |
|
58 | ${h.form(url('gist', gist_id=c.gist.gist_id),method='delete')} | |
59 | ${h.submit('remove_gist', _('Delete'),class_="btn btn-mini btn-danger",onclick="return confirm('"+_('Confirm to delete this Gist')+"');")} |
|
59 | ${h.submit('remove_gist', _('Delete'),class_="btn btn-mini btn-danger",onclick="return confirm('"+_('Confirm to delete this Gist')+"');")} | |
60 | ${h.end_form()} |
|
60 | ${h.end_form()} | |
61 | </div> |
|
61 | </div> | |
62 | %endif |
|
62 | %endif | |
63 | <div class="buttons"> |
|
63 | <div class="buttons"> | |
64 | ## only owner should see that |
|
64 | ## only owner should see that | |
65 | %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.authuser.user_id: |
|
65 | %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.authuser.user_id: | |
66 | ${h.link_to(_('Edit'),h.url('edit_gist', gist_id=c.gist.gist_access_id),class_="btn btn-mini")} |
|
66 | ${h.link_to(_('Edit'),h.url('edit_gist', gist_id=c.gist.gist_access_id),class_="btn btn-mini")} | |
67 | %endif |
|
67 | %endif | |
68 | ${h.link_to(_('Show as Raw'),h.url('formatted_gist', gist_id=c.gist.gist_access_id, format='raw'),class_="btn btn-mini")} |
|
68 | ${h.link_to(_('Show as Raw'),h.url('formatted_gist', gist_id=c.gist.gist_access_id, format='raw'),class_="btn btn-mini")} | |
69 | </div> |
|
69 | </div> | |
70 | </div> |
|
70 | </div> | |
71 |
|
71 | |||
72 | <div class="author"> |
|
72 | <div class="author"> | |
73 | <div class="gravatar"> |
|
73 | <div class="gravatar"> | |
74 | ${h.gravatar(h.email_or_none(c.file_changeset.author), size=16)} |
|
74 | ${h.gravatar(h.email_or_none(c.file_changeset.author), size=16)} | |
75 | </div> |
|
75 | </div> | |
76 | <div title="${c.file_changeset.author}" class="user">${h.person(c.file_changeset.author)} - ${_('created')} ${h.age(c.file_changeset.date)}</div> |
|
76 | <div title="${c.file_changeset.author}" class="user">${h.person(c.file_changeset.author)} - ${_('created')} ${h.age(c.file_changeset.date)}</div> | |
77 | </div> |
|
77 | </div> | |
78 | <div class="commit">${h.urlify_commit(c.file_changeset.message,c.repo_name)}</div> |
|
78 | <div class="commit">${h.urlify_commit(c.file_changeset.message,c.repo_name)}</div> | |
79 | </div> |
|
79 | </div> | |
80 | </div> |
|
80 | </div> | |
81 |
|
81 | |||
82 | ## iterate over the files |
|
82 | ## iterate over the files | |
83 | % for file in c.files: |
|
83 | % for file in c.files: | |
84 | <div style="border: 1px solid #EEE;margin-top:20px"> |
|
84 | <div style="border: 1px solid #EEE;margin-top:20px"> | |
85 | <div id="${h.FID('G', file.path)}" class="stats" style="border-bottom: 1px solid #DDD;padding: 8px 14px;"> |
|
85 | <div id="${h.FID('G', file.path)}" class="stats" style="border-bottom: 1px solid #DDD;padding: 8px 14px;"> | |
86 | <a href="${c.gist.gist_url()}">¶</a> |
|
86 | <a href="${c.gist.gist_url()}">¶</a> | |
87 | <b style="margin:0px 0px 0px 4px">${file.path}</b> |
|
87 | <b style="margin:0px 0px 0px 4px">${file.path}</b> | |
88 | <div style="float:right; margin: -5px"> |
|
88 | <div style="float:right; margin: -5px"> | |
89 | ${h.link_to(_('Show as raw'),h.url('formatted_gist_file', gist_id=c.gist.gist_access_id, format='raw', revision=file.changeset.raw_id, f_path=file.path),class_="btn btn-mini")} |
|
89 | ${h.link_to(_('Show as raw'),h.url('formatted_gist_file', gist_id=c.gist.gist_access_id, format='raw', revision=file.changeset.raw_id, f_path=file.path),class_="btn btn-mini")} | |
90 | </div> |
|
90 | </div> | |
91 | </div> |
|
91 | </div> | |
92 | <div class="code-body"> |
|
92 | <div class="code-body"> | |
93 | ${h.pygmentize(file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} |
|
93 | ${h.pygmentize(file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} | |
94 | </div> |
|
94 | </div> | |
95 | </div> |
|
95 | </div> | |
96 | %endfor |
|
96 | %endfor | |
97 | </div> |
|
97 | </div> | |
98 | </div> |
|
98 | </div> | |
99 |
|
99 | |||
100 |
|
100 | |||
101 | </div> |
|
101 | </div> | |
102 | </%def> |
|
102 | </%def> |
@@ -1,53 +1,53 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('My Account')} ${c.authuser.username} |
|
5 | ${_('My Account')} ${c.authuser.username} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${_('My Account')} |
|
12 | ${_('My Account')} | |
13 | </%def> |
|
13 | </%def> | |
14 |
|
14 | |||
15 | <%block name="header_menu"> |
|
15 | <%block name="header_menu"> | |
16 | ${self.menu('admin')} |
|
16 | ${self.menu('admin')} | |
17 | </%block> |
|
17 | </%block> | |
18 |
|
18 | |||
19 | <%def name="main()"> |
|
19 | <%def name="main()"> | |
20 | <div class="box" style="overflow:auto"> |
|
20 | <div class="box" style="overflow:auto"> | |
21 | <div class="title"> |
|
21 | <div class="title"> | |
22 | ${self.breadcrumbs()} |
|
22 | ${self.breadcrumbs()} | |
23 | </div> |
|
23 | </div> | |
24 |
|
24 | |||
25 | ##main |
|
25 | ##main | |
26 | <div style="width: 150px; float:left"> |
|
26 | <div style="width: 150px; float:left"> | |
27 | <ul class="nav nav-pills nav-stacked"> |
|
27 | <ul class="nav nav-pills nav-stacked"> | |
28 | <li> |
|
28 | <li> | |
29 | <div class="gravatar_box" style="height: 26px"> |
|
29 | <div class="gravatar_box" style="height: 26px"> | |
30 | <div class="gravatar" style="float: left"> |
|
30 | <div class="gravatar" style="float: left"> | |
31 | ${h.gravatar(c.user.email)} |
|
31 | ${h.gravatar(c.user.email)} | |
32 | </div> |
|
32 | </div> | |
33 | <div class="truncate" style="margin:10px 0px 10px 0px; color:#5f5f5f; float:left; width: 100px"> |
|
33 | <div class="truncate" style="margin:10px 0px 10px 0px; color:#5f5f5f; float:left; width: 100px"> | |
34 | <strong>${c.user.username}</strong> |
|
34 | <strong>${c.user.username}</strong> | |
35 | </div> |
|
35 | </div> | |
36 | </div> |
|
36 | </div> | |
37 | </li> |
|
37 | </li> | |
38 | <li class="${'active' if c.active=='profile' else ''}"><a href="${h.url('my_account')}">${_('Profile')}</a></li> |
|
38 | <li class="${'active' if c.active=='profile' else ''}"><a href="${h.url('my_account')}">${_('Profile')}</a></li> | |
39 | <li class="${'active' if c.active=='password' else ''}"><a href="${h.url('my_account_password')}">${_('Password')}</a></li> |
|
39 | <li class="${'active' if c.active=='password' else ''}"><a href="${h.url('my_account_password')}">${_('Password')}</a></li> | |
40 | <li class="${'active' if c.active=='api_keys' else ''}"><a href="${h.url('my_account_api_keys')}">${_('API Keys')}</a></li> |
|
40 | <li class="${'active' if c.active=='api_keys' else ''}"><a href="${h.url('my_account_api_keys')}">${_('API Keys')}</a></li> | |
41 | <li class="${'active' if c.active=='emails' else ''}"><a href="${h.url('my_account_emails')}">${_('My Emails')}</a></li> |
|
41 | <li class="${'active' if c.active=='emails' else ''}"><a href="${h.url('my_account_emails')}">${_('My Emails')}</a></li> | |
42 | <li class="${'active' if c.active=='repos' else ''}"><a href="${h.url('my_account_repos')}">${_('My Repositories')}</a></li> |
|
42 | <li class="${'active' if c.active=='repos' else ''}"><a href="${h.url('my_account_repos')}">${_('My Repositories')}</a></li> | |
43 | <li class="${'active' if c.active=='watched' else ''}"><a href="${h.url('my_account_watched')}">${_('Watched')}</a></li> |
|
43 | <li class="${'active' if c.active=='watched' else ''}"><a href="${h.url('my_account_watched')}">${_('Watched')}</a></li> | |
44 | <li class="${'active' if c.active=='perms' else ''}"><a href="${h.url('my_account_perms')}">${_('My Permissions')}</a></li> |
|
44 | <li class="${'active' if c.active=='perms' else ''}"><a href="${h.url('my_account_perms')}">${_('My Permissions')}</a></li> | |
45 | </ul> |
|
45 | </ul> | |
46 | </div> |
|
46 | </div> | |
47 |
|
47 | |||
48 | <div style="min-width:750px; float:left; padding: 10px 0px 0px 20px;margin: 0px 0px 0px 10px; border-left: 1px solid #DDDDDD"> |
|
48 | <div style="min-width:750px; float:left; padding: 10px 0px 0px 20px;margin: 0px 0px 0px 10px; border-left: 1px solid #DDDDDD"> | |
49 | <%include file="/admin/my_account/my_account_${c.active}.html"/> |
|
49 | <%include file="/admin/my_account/my_account_${c.active}.html"/> | |
50 | </div> |
|
50 | </div> | |
51 | </div> |
|
51 | </div> | |
52 |
|
52 | |||
53 | </%def> |
|
53 | </%def> |
@@ -1,61 +1,61 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('My Notifications')} ${c.authuser.username} |
|
5 | ${_('My Notifications')} ${c.authuser.username} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${_('My Notifications')} |
|
12 | ${_('My Notifications')} | |
13 | </%def> |
|
13 | </%def> | |
14 |
|
14 | |||
15 | <%block name="header_menu"> |
|
15 | <%block name="header_menu"> | |
16 | ${self.menu('admin')} |
|
16 | ${self.menu('admin')} | |
17 | </%block> |
|
17 | </%block> | |
18 |
|
18 | |||
19 | <%def name="main()"> |
|
19 | <%def name="main()"> | |
20 | <div class="box"> |
|
20 | <div class="box"> | |
21 | <!-- box / title --> |
|
21 | <!-- box / title --> | |
22 | <div class="title"> |
|
22 | <div class="title"> | |
23 | ${self.breadcrumbs()} |
|
23 | ${self.breadcrumbs()} | |
24 | </div> |
|
24 | </div> | |
25 |
|
25 | |||
26 | <div style="padding:14px 18px;text-align: right;float:left"> |
|
26 | <div style="padding:14px 18px;text-align: right;float:left"> | |
27 | <span id='all' class="btn btn-small"><a href="${h.url.current()}">${_('All')}</a></span> |
|
27 | <span id='all' class="btn btn-small"><a href="${h.url.current()}">${_('All')}</a></span> | |
28 | <span id='comment' class="btn btn-small"><a href="${h.url.current(type=c.comment_type)}">${_('Comments')}</a></span> |
|
28 | <span id='comment' class="btn btn-small"><a href="${h.url.current(type=c.comment_type)}">${_('Comments')}</a></span> | |
29 | <span id='pull_request' class="btn btn-small"><a href="${h.url.current(type=c.pull_request_type)}">${_('Pull Requests')}</a></span> |
|
29 | <span id='pull_request' class="btn btn-small"><a href="${h.url.current(type=c.pull_request_type)}">${_('Pull Requests')}</a></span> | |
30 | </div> |
|
30 | </div> | |
31 | %if c.notifications: |
|
31 | %if c.notifications: | |
32 | <div style="padding:14px 18px;text-align: right;float:right"> |
|
32 | <div style="padding:14px 18px;text-align: right;float:right"> | |
33 | <span id='mark_all_read' class="btn btn-small">${_('Mark All Read')}</span> |
|
33 | <span id='mark_all_read' class="btn btn-small">${_('Mark All Read')}</span> | |
34 | </div> |
|
34 | </div> | |
35 | %endif |
|
35 | %endif | |
36 | <div id='notification_data'> |
|
36 | <div id='notification_data'> | |
37 | <%include file='notifications_data.html'/> |
|
37 | <%include file='notifications_data.html'/> | |
38 | </div> |
|
38 | </div> | |
39 | </div> |
|
39 | </div> | |
40 | <script type="text/javascript"> |
|
40 | <script type="text/javascript"> | |
41 | var url_action = "${url('notification', notification_id='__NOTIFICATION_ID__')}"; |
|
41 | var url_action = "${url('notification', notification_id='__NOTIFICATION_ID__')}"; | |
42 | var run = function(){ |
|
42 | var run = function(){ | |
43 | $('.delete-notification').click(function(e){ |
|
43 | $('.delete-notification').click(function(e){ | |
44 | var notification_id = e.currentTarget.id; |
|
44 | var notification_id = e.currentTarget.id; | |
45 | deleteNotification(url_action,notification_id); |
|
45 | deleteNotification(url_action,notification_id); | |
46 | }); |
|
46 | }); | |
47 | $('.read-notification').click(function(e){ |
|
47 | $('.read-notification').click(function(e){ | |
48 | var notification_id = e.currentTarget.id; |
|
48 | var notification_id = e.currentTarget.id; | |
49 | readNotification(url_action,notification_id); |
|
49 | readNotification(url_action,notification_id); | |
50 | }); |
|
50 | }); | |
51 | } |
|
51 | } | |
52 | run(); |
|
52 | run(); | |
53 | $('#mark_all_read').click(function(){ |
|
53 | $('#mark_all_read').click(function(){ | |
54 | var url = "${h.url('notifications_mark_all_read', **request.GET.mixed())}"; |
|
54 | var url = "${h.url('notifications_mark_all_read', **request.GET.mixed())}"; | |
55 | asynchtml(url, $('#notification_data'), function(){run();}); |
|
55 | asynchtml(url, $('#notification_data'), function(){run();}); | |
56 | }); |
|
56 | }); | |
57 |
|
57 | |||
58 | var current_filter = "${c.current_filter}"; |
|
58 | var current_filter = "${c.current_filter}"; | |
59 | $('#'+current_filter).addClass('active'); |
|
59 | $('#'+current_filter).addClass('active'); | |
60 | </script> |
|
60 | </script> | |
61 | </%def> |
|
61 | </%def> |
@@ -1,57 +1,57 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Show Notification')} ${c.authuser.username} |
|
5 | ${_('Show Notification')} ${c.authuser.username} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${h.link_to(_('Notifications'),h.url('notifications'))} |
|
12 | ${h.link_to(_('Notifications'),h.url('notifications'))} | |
13 | » |
|
13 | » | |
14 | ${_('Show Notification')} |
|
14 | ${_('Show Notification')} | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%block name="header_menu"> |
|
17 | <%block name="header_menu"> | |
18 | ${self.menu('admin')} |
|
18 | ${self.menu('admin')} | |
19 | </%block> |
|
19 | </%block> | |
20 |
|
20 | |||
21 | <%def name="main()"> |
|
21 | <%def name="main()"> | |
22 | <div class="box"> |
|
22 | <div class="box"> | |
23 | <!-- box / title --> |
|
23 | <!-- box / title --> | |
24 | <div class="title"> |
|
24 | <div class="title"> | |
25 | ${self.breadcrumbs()} |
|
25 | ${self.breadcrumbs()} | |
26 | </div> |
|
26 | </div> | |
27 | <div class="table"> |
|
27 | <div class="table"> | |
28 | <div id="notification_${c.notification.notification_id}"> |
|
28 | <div id="notification_${c.notification.notification_id}"> | |
29 | <div class="notification-header"> |
|
29 | <div class="notification-header"> | |
30 | <div class="gravatar"> |
|
30 | <div class="gravatar"> | |
31 | ${h.gravatar(c.notification.created_by_user.email, size=24)} |
|
31 | ${h.gravatar(c.notification.created_by_user.email, size=24)} | |
32 | </div> |
|
32 | </div> | |
33 | <div class="desc"> |
|
33 | <div class="desc"> | |
34 | ${c.notification.description} |
|
34 | ${c.notification.description} | |
35 | </div> |
|
35 | </div> | |
36 | <div class="delete-notifications"> |
|
36 | <div class="delete-notifications"> | |
37 | <span id="${c.notification.notification_id}" class="delete-notification action"><i class="icon-minus-circled" id="yui-gen24"></i></span> |
|
37 | <span id="${c.notification.notification_id}" class="delete-notification action"><i class="icon-minus-circled" id="yui-gen24"></i></span> | |
38 | </div> |
|
38 | </div> | |
39 | </div> |
|
39 | </div> | |
40 | <div class="notification-body"> |
|
40 | <div class="notification-body"> | |
41 | <div class="notification-subject">${h.literal(c.notification.subject)}</div> |
|
41 | <div class="notification-subject">${h.literal(c.notification.subject)}</div> | |
42 | %if c.notification.body: |
|
42 | %if c.notification.body: | |
43 | ${h.rst_w_mentions(c.notification.body)} |
|
43 | ${h.rst_w_mentions(c.notification.body)} | |
44 | %endif |
|
44 | %endif | |
45 | </div> |
|
45 | </div> | |
46 | </div> |
|
46 | </div> | |
47 | </div> |
|
47 | </div> | |
48 | </div> |
|
48 | </div> | |
49 | <script type="text/javascript"> |
|
49 | <script type="text/javascript"> | |
50 | var url = "${url('notification', notification_id='__NOTIFICATION_ID__')}"; |
|
50 | var url = "${url('notification', notification_id='__NOTIFICATION_ID__')}"; | |
51 | var main = "${url('notifications')}"; |
|
51 | var main = "${url('notifications')}"; | |
52 | $('.delete-notification').click(function(e){ |
|
52 | $('.delete-notification').click(function(e){ | |
53 | var notification_id = e.currentTarget.id; |
|
53 | var notification_id = e.currentTarget.id; | |
54 | deleteNotification(url,notification_id,[function(){window.location=main}]) |
|
54 | deleteNotification(url,notification_id,[function(){window.location=main}]) | |
55 | }); |
|
55 | }); | |
56 | </script> |
|
56 | </script> | |
57 | </%def> |
|
57 | </%def> |
@@ -1,52 +1,52 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Permissions Administration')} |
|
5 | ${_('Permissions Administration')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} | |
13 | » |
|
13 | » | |
14 | ${_('Permissions')} |
|
14 | ${_('Permissions')} | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%block name="header_menu"> |
|
17 | <%block name="header_menu"> | |
18 | ${self.menu('admin')} |
|
18 | ${self.menu('admin')} | |
19 | </%block> |
|
19 | </%block> | |
20 |
|
20 | |||
21 |
|
21 | |||
22 | <%def name="main()"> |
|
22 | <%def name="main()"> | |
23 | <div class="box" style="overflow:auto"> |
|
23 | <div class="box" style="overflow:auto"> | |
24 | <div class="title"> |
|
24 | <div class="title"> | |
25 | ${self.breadcrumbs()} |
|
25 | ${self.breadcrumbs()} | |
26 | </div> |
|
26 | </div> | |
27 |
|
27 | |||
28 | ##main |
|
28 | ##main | |
29 | <div style="width: 150px; float:left"> |
|
29 | <div style="width: 150px; float:left"> | |
30 | <ul class="nav nav-pills nav-stacked"> |
|
30 | <ul class="nav nav-pills nav-stacked"> | |
31 | <li> |
|
31 | <li> | |
32 | <div class="gravatar_box" style="height: 26px"> |
|
32 | <div class="gravatar_box" style="height: 26px"> | |
33 | <div class="gravatar" style="float: left"> |
|
33 | <div class="gravatar" style="float: left"> | |
34 | <i class="icon-block" style="font-size: 26px"></i> |
|
34 | <i class="icon-block" style="font-size: 26px"></i> | |
35 | </div> |
|
35 | </div> | |
36 | <div class="truncate" style="margin:10px 0px 10px 0px; color:#5f5f5f; float:left; width: 100px"> |
|
36 | <div class="truncate" style="margin:10px 0px 10px 0px; color:#5f5f5f; float:left; width: 100px"> | |
37 | <strong>${_('Permissions')}</strong> |
|
37 | <strong>${_('Permissions')}</strong> | |
38 | </div> |
|
38 | </div> | |
39 | </div> |
|
39 | </div> | |
40 | </li> |
|
40 | </li> | |
41 | <li class="${'active' if c.active=='globals' else ''}"><a href="${h.url('admin_permissions')}">${_('Global')}</a></li> |
|
41 | <li class="${'active' if c.active=='globals' else ''}"><a href="${h.url('admin_permissions')}">${_('Global')}</a></li> | |
42 | <li class="${'active' if c.active=='ips' else ''}"><a href="${h.url('admin_permissions_ips')}">${_('IP Whitelist')}</a></li> |
|
42 | <li class="${'active' if c.active=='ips' else ''}"><a href="${h.url('admin_permissions_ips')}">${_('IP Whitelist')}</a></li> | |
43 | <li class="${'active' if c.active=='perms' else ''}"><a href="${h.url('admin_permissions_perms')}">${_('Overview')}</a></li> |
|
43 | <li class="${'active' if c.active=='perms' else ''}"><a href="${h.url('admin_permissions_perms')}">${_('Overview')}</a></li> | |
44 | </ul> |
|
44 | </ul> | |
45 | </div> |
|
45 | </div> | |
46 |
|
46 | |||
47 | <div style="width:750px; float:left; padding: 10px 0px 0px 20px;margin: 0px 0px 0px 10px; border-left: 1px solid #DDDDDD"> |
|
47 | <div style="width:750px; float:left; padding: 10px 0px 0px 20px;margin: 0px 0px 0px 10px; border-left: 1px solid #DDDDDD"> | |
48 | <%include file="/admin/permissions/permissions_${c.active}.html"/> |
|
48 | <%include file="/admin/permissions/permissions_${c.active}.html"/> | |
49 | </div> |
|
49 | </div> | |
50 | </div> |
|
50 | </div> | |
51 |
|
51 | |||
52 | </%def> |
|
52 | </%def> |
@@ -1,98 +1,98 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Add Repository Group')} |
|
5 | ${_('Add Repository Group')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} | |
13 | » |
|
13 | » | |
14 | ${h.link_to(_('Repository Groups'),h.url('repos_groups'))} |
|
14 | ${h.link_to(_('Repository Groups'),h.url('repos_groups'))} | |
15 | » |
|
15 | » | |
16 | ${_('Add Repository Group')} |
|
16 | ${_('Add Repository Group')} | |
17 | </%def> |
|
17 | </%def> | |
18 |
|
18 | |||
19 | <%block name="header_menu"> |
|
19 | <%block name="header_menu"> | |
20 | ${self.menu('admin')} |
|
20 | ${self.menu('admin')} | |
21 | </%block> |
|
21 | </%block> | |
22 |
|
22 | |||
23 | <%def name="main()"> |
|
23 | <%def name="main()"> | |
24 | <div class="box"> |
|
24 | <div class="box"> | |
25 | <!-- box / title --> |
|
25 | <!-- box / title --> | |
26 | <div class="title"> |
|
26 | <div class="title"> | |
27 | ${self.breadcrumbs()} |
|
27 | ${self.breadcrumbs()} | |
28 | </div> |
|
28 | </div> | |
29 | <!-- end box / title --> |
|
29 | <!-- end box / title --> | |
30 | ${h.form(url('repos_groups'))} |
|
30 | ${h.form(url('repos_groups'))} | |
31 | <div class="form"> |
|
31 | <div class="form"> | |
32 | <!-- fields --> |
|
32 | <!-- fields --> | |
33 | <div class="fields"> |
|
33 | <div class="fields"> | |
34 | <div class="field"> |
|
34 | <div class="field"> | |
35 | <div class="label"> |
|
35 | <div class="label"> | |
36 | <label for="group_name">${_('Group name')}:</label> |
|
36 | <label for="group_name">${_('Group name')}:</label> | |
37 | </div> |
|
37 | </div> | |
38 | <div class="input"> |
|
38 | <div class="input"> | |
39 | ${h.text('group_name',class_='small')} |
|
39 | ${h.text('group_name',class_='small')} | |
40 | </div> |
|
40 | </div> | |
41 | </div> |
|
41 | </div> | |
42 |
|
42 | |||
43 | <div class="field"> |
|
43 | <div class="field"> | |
44 | <div class="label label-textarea"> |
|
44 | <div class="label label-textarea"> | |
45 | <label for="group_description">${_('Description')}:</label> |
|
45 | <label for="group_description">${_('Description')}:</label> | |
46 | </div> |
|
46 | </div> | |
47 | <div class="textarea-repo editor"> |
|
47 | <div class="textarea-repo editor"> | |
48 | ${h.textarea('group_description',cols=23,rows=5,class_="medium")} |
|
48 | ${h.textarea('group_description',cols=23,rows=5,class_="medium")} | |
49 | </div> |
|
49 | </div> | |
50 | </div> |
|
50 | </div> | |
51 |
|
51 | |||
52 | <div class="field"> |
|
52 | <div class="field"> | |
53 | <div class="label"> |
|
53 | <div class="label"> | |
54 | <label for="group_parent_id">${_('Group parent')}:</label> |
|
54 | <label for="group_parent_id">${_('Group parent')}:</label> | |
55 | </div> |
|
55 | </div> | |
56 | <div class="input"> |
|
56 | <div class="input"> | |
57 | ${h.select('group_parent_id',request.GET.get('parent_group'),c.repo_groups,class_="medium")} |
|
57 | ${h.select('group_parent_id',request.GET.get('parent_group'),c.repo_groups,class_="medium")} | |
58 | </div> |
|
58 | </div> | |
59 | </div> |
|
59 | </div> | |
60 |
|
60 | |||
61 | <div id="copy_perms" class="field"> |
|
61 | <div id="copy_perms" class="field"> | |
62 | <div class="label label-checkbox"> |
|
62 | <div class="label label-checkbox"> | |
63 | <label for="group_copy_permissions">${_('Copy parent group permissions')}:</label> |
|
63 | <label for="group_copy_permissions">${_('Copy parent group permissions')}:</label> | |
64 | </div> |
|
64 | </div> | |
65 | <div class="checkboxes"> |
|
65 | <div class="checkboxes"> | |
66 | ${h.checkbox('group_copy_permissions',value="True")} |
|
66 | ${h.checkbox('group_copy_permissions',value="True")} | |
67 | <span class="help-block">${_('Copy permission set from parent repository group.')}</span> |
|
67 | <span class="help-block">${_('Copy permission set from parent repository group.')}</span> | |
68 | </div> |
|
68 | </div> | |
69 | </div> |
|
69 | </div> | |
70 |
|
70 | |||
71 | <div class="buttons"> |
|
71 | <div class="buttons"> | |
72 | ${h.submit('save',_('Save'),class_="btn")} |
|
72 | ${h.submit('save',_('Save'),class_="btn")} | |
73 | </div> |
|
73 | </div> | |
74 | </div> |
|
74 | </div> | |
75 | </div> |
|
75 | </div> | |
76 | ${h.end_form()} |
|
76 | ${h.end_form()} | |
77 | </div> |
|
77 | </div> | |
78 | <script> |
|
78 | <script> | |
79 | $(document).ready(function(){ |
|
79 | $(document).ready(function(){ | |
80 | var setCopyPermsOption = function(group_val){ |
|
80 | var setCopyPermsOption = function(group_val){ | |
81 | if(group_val != "-1"){ |
|
81 | if(group_val != "-1"){ | |
82 | $('#copy_perms').show() |
|
82 | $('#copy_perms').show() | |
83 | } |
|
83 | } | |
84 | else{ |
|
84 | else{ | |
85 | $('#copy_perms').hide(); |
|
85 | $('#copy_perms').hide(); | |
86 | } |
|
86 | } | |
87 | } |
|
87 | } | |
88 | $("#group_parent_id").select2({ |
|
88 | $("#group_parent_id").select2({ | |
89 | 'dropdownAutoWidth': true |
|
89 | 'dropdownAutoWidth': true | |
90 | }); |
|
90 | }); | |
91 | setCopyPermsOption($('#group_parent_id').val()) |
|
91 | setCopyPermsOption($('#group_parent_id').val()) | |
92 | $("#group_parent_id").on("change", function(e) { |
|
92 | $("#group_parent_id").on("change", function(e) { | |
93 | setCopyPermsOption(e.val) |
|
93 | setCopyPermsOption(e.val) | |
94 | }) |
|
94 | }) | |
95 | $('#group_name').focus(); |
|
95 | $('#group_name').focus(); | |
96 | }) |
|
96 | }) | |
97 | </script> |
|
97 | </script> | |
98 | </%def> |
|
98 | </%def> |
@@ -1,63 +1,63 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('%s Repository Group Settings') % c.repo_group.name} |
|
5 | ${_('%s Repository Group Settings') % c.repo_group.name} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} | |
13 | » |
|
13 | » | |
14 | ${h.link_to(_('Repository Groups'),h.url('repos_groups'))} |
|
14 | ${h.link_to(_('Repository Groups'),h.url('repos_groups'))} | |
15 | %if c.repo_group.parent_group: |
|
15 | %if c.repo_group.parent_group: | |
16 | » ${h.link_to(c.repo_group.parent_group.name,h.url('repos_group_home',group_name=c.repo_group.parent_group.group_name))} |
|
16 | » ${h.link_to(c.repo_group.parent_group.name,h.url('repos_group_home',group_name=c.repo_group.parent_group.group_name))} | |
17 | %endif |
|
17 | %endif | |
18 | » ${c.repo_group.name} |
|
18 | » ${c.repo_group.name} | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%def name="breadcrumbs_side_links()"> |
|
21 | <%def name="breadcrumbs_side_links()"> | |
22 | <ul class="links"> |
|
22 | <ul class="links"> | |
23 | <li> |
|
23 | <li> | |
24 | <a href="${h.url('new_repos_group', parent_group=c.repo_group.group_id)}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_(u'Add Child Group')}</a> |
|
24 | <a href="${h.url('new_repos_group', parent_group=c.repo_group.group_id)}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_(u'Add Child Group')}</a> | |
25 | </li> |
|
25 | </li> | |
26 | </ul> |
|
26 | </ul> | |
27 | </%def> |
|
27 | </%def> | |
28 |
|
28 | |||
29 | <%block name="header_menu"> |
|
29 | <%block name="header_menu"> | |
30 | ${self.menu('admin')} |
|
30 | ${self.menu('admin')} | |
31 | </%block> |
|
31 | </%block> | |
32 |
|
32 | |||
33 | <%def name="main()"> |
|
33 | <%def name="main()"> | |
34 | <div class="box" style="overflow:auto"> |
|
34 | <div class="box" style="overflow:auto"> | |
35 | <div class="title"> |
|
35 | <div class="title"> | |
36 | ${self.breadcrumbs()} |
|
36 | ${self.breadcrumbs()} | |
37 | ${self.breadcrumbs_side_links()} |
|
37 | ${self.breadcrumbs_side_links()} | |
38 | </div> |
|
38 | </div> | |
39 |
|
39 | |||
40 | ##main |
|
40 | ##main | |
41 | <div style="width: 150px; float:left"> |
|
41 | <div style="width: 150px; float:left"> | |
42 | <ul class="nav nav-pills nav-stacked"> |
|
42 | <ul class="nav nav-pills nav-stacked"> | |
43 | <li> |
|
43 | <li> | |
44 | <div class="gravatar_box" style="height: 26px"> |
|
44 | <div class="gravatar_box" style="height: 26px"> | |
45 | <div class="gravatar" style="float: left"> |
|
45 | <div class="gravatar" style="float: left"> | |
46 | <i class="icon-folder-close" style="font-size: 26px"></i> |
|
46 | <i class="icon-folder-close" style="font-size: 26px"></i> | |
47 | </div> |
|
47 | </div> | |
48 | <div class="truncate" style="margin:10px 0px 10px 0px; color:#5f5f5f; float:left; width: 100px"> |
|
48 | <div class="truncate" style="margin:10px 0px 10px 0px; color:#5f5f5f; float:left; width: 100px"> | |
49 | <strong>${c.repo_group.name}</strong> |
|
49 | <strong>${c.repo_group.name}</strong> | |
50 | </div> |
|
50 | </div> | |
51 | </div> |
|
51 | </div> | |
52 | </li> |
|
52 | </li> | |
53 | <li class="${'active' if c.active=='settings' else ''}"><a href="${h.url('edit_repo_group', group_name=c.repo_group.group_name)}">${_('Settings')}</a></li> |
|
53 | <li class="${'active' if c.active=='settings' else ''}"><a href="${h.url('edit_repo_group', group_name=c.repo_group.group_name)}">${_('Settings')}</a></li> | |
54 | <li class="${'active' if c.active=='advanced' else ''}"><a href="${h.url('edit_repo_group_advanced', group_name=c.repo_group.group_name)}">${_('Advanced')}</a></li> |
|
54 | <li class="${'active' if c.active=='advanced' else ''}"><a href="${h.url('edit_repo_group_advanced', group_name=c.repo_group.group_name)}">${_('Advanced')}</a></li> | |
55 | <li class="${'active' if c.active=='perms' else ''}"><a href="${h.url('edit_repo_group_perms', group_name=c.repo_group.group_name)}">${_('Permissions')}</a></li> |
|
55 | <li class="${'active' if c.active=='perms' else ''}"><a href="${h.url('edit_repo_group_perms', group_name=c.repo_group.group_name)}">${_('Permissions')}</a></li> | |
56 | </ul> |
|
56 | </ul> | |
57 | </div> |
|
57 | </div> | |
58 |
|
58 | |||
59 | <div style="width:750px; float:left; padding: 10px 0px 0px 20px;margin: 0px 0px 0px 10px; border-left: 1px solid #DDDDDD"> |
|
59 | <div style="width:750px; float:left; padding: 10px 0px 0px 20px;margin: 0px 0px 0px 10px; border-left: 1px solid #DDDDDD"> | |
60 | <%include file="/admin/repo_groups/repo_group_edit_${c.active}.html"/> |
|
60 | <%include file="/admin/repo_groups/repo_group_edit_${c.active}.html"/> | |
61 | </div> |
|
61 | </div> | |
62 | </div> |
|
62 | </div> | |
63 | </%def> |
|
63 | </%def> |
@@ -1,26 +1,26 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
<% |
|
3 | <%block name="title"> | |
4 | ${_('%s Repository group dashboard') % c.group.group_name} |
|
4 | ${_('%s Repository group dashboard') % c.group.group_name} | |
5 | %if c.site_name: |
|
5 | %if c.site_name: | |
6 | · ${c.site_name} |
|
6 | · ${c.site_name} | |
7 | %endif |
|
7 | %endif | |
8 | </%def> |
|
8 | </%block> | |
9 |
|
9 | |||
10 | <%def name="breadcrumbs()"> |
|
10 | <%def name="breadcrumbs()"> | |
11 | <span class="groups_breadcrumbs"> |
|
11 | <span class="groups_breadcrumbs"> | |
12 | ${h.link_to(_(u'Home'),h.url('/'))} |
|
12 | ${h.link_to(_(u'Home'),h.url('/'))} | |
13 | %if c.group.parent_group: |
|
13 | %if c.group.parent_group: | |
14 | » ${h.link_to(c.group.parent_group.name,h.url('repos_group_home',group_name=c.group.parent_group.group_name))} |
|
14 | » ${h.link_to(c.group.parent_group.name,h.url('repos_group_home',group_name=c.group.parent_group.group_name))} | |
15 | %endif |
|
15 | %endif | |
16 | » "${c.group.name}" ${_('with')} |
|
16 | » "${c.group.name}" ${_('with')} | |
17 | </span> |
|
17 | </span> | |
18 | </%def> |
|
18 | </%def> | |
19 |
|
19 | |||
20 | <%block name="header_menu"> |
|
20 | <%block name="header_menu"> | |
21 | ${self.menu('repositories')} |
|
21 | ${self.menu('repositories')} | |
22 | </%block> |
|
22 | </%block> | |
23 |
|
23 | |||
24 | <%def name="main()"> |
|
24 | <%def name="main()"> | |
25 | <%include file="/index_base.html" args="parent=self,group_name=c.group.group_name"/> |
|
25 | <%include file="/index_base.html" args="parent=self,group_name=c.group.group_name"/> | |
26 | </%def> |
|
26 | </%def> |
@@ -1,59 +1,59 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Repository Groups Administration')} |
|
5 | ${_('Repository Groups Administration')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="repo_group_count">0</span> ${_('Repository Groups')} |
|
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="repo_group_count">0</span> ${_('Repository Groups')} | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 |
|
16 | |||
17 | <%block name="header_menu"> |
|
17 | <%block name="header_menu"> | |
18 | ${self.menu('admin')} |
|
18 | ${self.menu('admin')} | |
19 | </%block> |
|
19 | </%block> | |
20 |
|
20 | |||
21 | <%def name="main()"> |
|
21 | <%def name="main()"> | |
22 | <div class="box"> |
|
22 | <div class="box"> | |
23 | <!-- box / title --> |
|
23 | <!-- box / title --> | |
24 | <div class="title"> |
|
24 | <div class="title"> | |
25 | ${self.breadcrumbs()} |
|
25 | ${self.breadcrumbs()} | |
26 | <ul class="links"> |
|
26 | <ul class="links"> | |
27 | %if h.HasPermissionAny('hg.admin')(): |
|
27 | %if h.HasPermissionAny('hg.admin')(): | |
28 | <li> |
|
28 | <li> | |
29 | <a href="${h.url('new_repos_group')}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_(u'Add Repository Group')}</a> |
|
29 | <a href="${h.url('new_repos_group')}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_(u'Add Repository Group')}</a> | |
30 | </li> |
|
30 | </li> | |
31 | %endif |
|
31 | %endif | |
32 | </ul> |
|
32 | </ul> | |
33 | </div> |
|
33 | </div> | |
34 | <!-- end box / title --> |
|
34 | <!-- end box / title --> | |
35 | <div class="table-grid table yui-skin-sam" id="datatable_list_wrap"></div> |
|
35 | <div class="table-grid table yui-skin-sam" id="datatable_list_wrap"></div> | |
36 | <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div> |
|
36 | <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div> | |
37 | </div> |
|
37 | </div> | |
38 | <script> |
|
38 | <script> | |
39 | var data = ${c.data|n}; |
|
39 | var data = ${c.data|n}; | |
40 | var fields = [ |
|
40 | var fields = [ | |
41 | {key: "group_name"}, |
|
41 | {key: "group_name"}, | |
42 | {key: "raw_name"}, |
|
42 | {key: "raw_name"}, | |
43 | {key: "desc"}, |
|
43 | {key: "desc"}, | |
44 | {key: "repos"}, |
|
44 | {key: "repos"}, | |
45 | {key: "owner"}, |
|
45 | {key: "owner"}, | |
46 | {key: "action"} |
|
46 | {key: "action"} | |
47 | ]; |
|
47 | ]; | |
48 | var column_defs = [ |
|
48 | var column_defs = [ | |
49 | {key:"group_name",label:"${_('Name')}",sortable:true, sortOptions: { sortFunction: nameSort }}, |
|
49 | {key:"group_name",label:"${_('Name')}",sortable:true, sortOptions: { sortFunction: nameSort }}, | |
50 | {key:"desc",label:"${_('Description')}",sortable:true}, |
|
50 | {key:"desc",label:"${_('Description')}",sortable:true}, | |
51 | {key:"repos",label:"${_('Number of Top-level Repositories')}",sortable:true}, |
|
51 | {key:"repos",label:"${_('Number of Top-level Repositories')}",sortable:true}, | |
52 | {key:"owner",label:"${_('Owner')}",sortable:true}, |
|
52 | {key:"owner",label:"${_('Owner')}",sortable:true}, | |
53 | {key:"action",label:"${_('Action')}",sortable:false} |
|
53 | {key:"action",label:"${_('Action')}",sortable:false} | |
54 | ]; |
|
54 | ]; | |
55 | var counter = YUD.get('repo_group_count'); |
|
55 | var counter = YUD.get('repo_group_count'); | |
56 | var sort_key = "group_name"; |
|
56 | var sort_key = "group_name"; | |
57 | YUI_datatable(data, fields, column_defs, counter, sort_key, ${c.visual.admin_grid_items}); |
|
57 | YUI_datatable(data, fields, column_defs, counter, sort_key, ${c.visual.admin_grid_items}); | |
58 | </script> |
|
58 | </script> | |
59 | </%def> |
|
59 | </%def> |
@@ -1,37 +1,37 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Add Repository')} |
|
5 | ${_('Add Repository')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | %if c.authuser.is_admin: |
|
12 | %if c.authuser.is_admin: | |
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} | |
14 | » |
|
14 | » | |
15 | ${h.link_to(_('Repositories'),h.url('repos'))} |
|
15 | ${h.link_to(_('Repositories'),h.url('repos'))} | |
16 | %else: |
|
16 | %else: | |
17 | ${_('Admin')} |
|
17 | ${_('Admin')} | |
18 | » |
|
18 | » | |
19 | ${_('Repositories')} |
|
19 | ${_('Repositories')} | |
20 | %endif |
|
20 | %endif | |
21 | » |
|
21 | » | |
22 | ${_('Add Repository')} |
|
22 | ${_('Add Repository')} | |
23 | </%def> |
|
23 | </%def> | |
24 |
|
24 | |||
25 | <%block name="header_menu"> |
|
25 | <%block name="header_menu"> | |
26 | ${self.menu('admin')} |
|
26 | ${self.menu('admin')} | |
27 | </%block> |
|
27 | </%block> | |
28 |
|
28 | |||
29 | <%def name="main()"> |
|
29 | <%def name="main()"> | |
30 | <div class="box"> |
|
30 | <div class="box"> | |
31 | <!-- box / title --> |
|
31 | <!-- box / title --> | |
32 | <div class="title"> |
|
32 | <div class="title"> | |
33 | ${self.breadcrumbs()} |
|
33 | ${self.breadcrumbs()} | |
34 | </div> |
|
34 | </div> | |
35 | <%include file="repo_add_base.html"/> |
|
35 | <%include file="repo_add_base.html"/> | |
36 | </div> |
|
36 | </div> | |
37 | </%def> |
|
37 | </%def> |
@@ -1,69 +1,69 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 | ## don't trigger flash messages on this page |
|
4 | ## don't trigger flash messages on this page | |
5 | <%def name="flash_msg()"> |
|
5 | <%def name="flash_msg()"> | |
6 | </%def> |
|
6 | </%def> | |
7 |
|
7 | |||
8 |
<% |
|
8 | <%block name="title"> | |
9 | ${_('%s Creating Repository') % c.repo_name} |
|
9 | ${_('%s Creating Repository') % c.repo_name} | |
10 | %if c.site_name: |
|
10 | %if c.site_name: | |
11 | · ${c.site_name} |
|
11 | · ${c.site_name} | |
12 | %endif |
|
12 | %endif | |
13 | </%def> |
|
13 | </%block> | |
14 |
|
14 | |||
15 | <%def name="breadcrumbs_links()"> |
|
15 | <%def name="breadcrumbs_links()"> | |
16 | ${_('Creating repository')} ${c.repo} |
|
16 | ${_('Creating repository')} ${c.repo} | |
17 | </%def> |
|
17 | </%def> | |
18 |
|
18 | |||
19 | <%block name="header_menu"> |
|
19 | <%block name="header_menu"> | |
20 | ${self.menu('repositories')} |
|
20 | ${self.menu('repositories')} | |
21 | </%block> |
|
21 | </%block> | |
22 | <%def name="main()"> |
|
22 | <%def name="main()"> | |
23 | <div class="box"> |
|
23 | <div class="box"> | |
24 | <!-- box / title --> |
|
24 | <!-- box / title --> | |
25 | <div class="title"> |
|
25 | <div class="title"> | |
26 | ${self.breadcrumbs()} |
|
26 | ${self.breadcrumbs()} | |
27 | </div> |
|
27 | </div> | |
28 |
|
28 | |||
29 | <div style="display:table; padding: 10px 0px; font-size: 14px;font-weight: bold;margin-right: auto;margin-left: auto"> |
|
29 | <div style="display:table; padding: 10px 0px; font-size: 14px;font-weight: bold;margin-right: auto;margin-left: auto"> | |
30 | ${_('Repository "%(repo_name)s" is being created, you will be redirected when this process is finished.' % {'repo_name':c.repo_name})} |
|
30 | ${_('Repository "%(repo_name)s" is being created, you will be redirected when this process is finished.' % {'repo_name':c.repo_name})} | |
31 | </div> |
|
31 | </div> | |
32 |
|
32 | |||
33 | <div id="progress" style="width: 500px;margin-left: auto; margin-right: auto"> |
|
33 | <div id="progress" style="width: 500px;margin-left: auto; margin-right: auto"> | |
34 | <div class="progress progress-striped active"> |
|
34 | <div class="progress progress-striped active"> | |
35 | <div class="progress-bar progress-bar" role="progressbar" |
|
35 | <div class="progress-bar progress-bar" role="progressbar" | |
36 | aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%"> |
|
36 | aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%"> | |
37 | </div> |
|
37 | </div> | |
38 | </div> |
|
38 | </div> | |
39 | </div> |
|
39 | </div> | |
40 | <div id="progress_error" style="display: none;"> |
|
40 | <div id="progress_error" style="display: none;"> | |
41 | <div style="font-weight: bold; color:#aa1111"> |
|
41 | <div style="font-weight: bold; color:#aa1111"> | |
42 | ${_("We're sorry but error occurred during this operation. Please check your Kallithea server logs, or contact administrator.")} |
|
42 | ${_("We're sorry but error occurred during this operation. Please check your Kallithea server logs, or contact administrator.")} | |
43 | </div> |
|
43 | </div> | |
44 | </div> |
|
44 | </div> | |
45 | </div> |
|
45 | </div> | |
46 | </%def> |
|
46 | </%def> | |
47 |
|
47 | |||
48 | <script> |
|
48 | <script> | |
49 | (function worker() { |
|
49 | (function worker() { | |
50 | $.ajax({ |
|
50 | $.ajax({ | |
51 | url: '${h.url('repo_check_home', repo_name=c.repo_name, repo=c.repo, task_id=c.task_id)}', |
|
51 | url: '${h.url('repo_check_home', repo_name=c.repo_name, repo=c.repo, task_id=c.task_id)}', | |
52 | success: function(data) { |
|
52 | success: function(data) { | |
53 | if(data.result === true){ |
|
53 | if(data.result === true){ | |
54 | //redirect to created fork if our ajax loop tells us to do so. |
|
54 | //redirect to created fork if our ajax loop tells us to do so. | |
55 | window.location = "${h.url('summary_home', repo_name = c.repo)}"; |
|
55 | window.location = "${h.url('summary_home', repo_name = c.repo)}"; | |
56 | } |
|
56 | } | |
57 | }, |
|
57 | }, | |
58 | complete: function(resp, status) { |
|
58 | complete: function(resp, status) { | |
59 | if (resp.status == 200){ |
|
59 | if (resp.status == 200){ | |
60 | // Schedule the next request when the current one's complete |
|
60 | // Schedule the next request when the current one's complete | |
61 | setTimeout(worker, 1000); |
|
61 | setTimeout(worker, 1000); | |
62 | } |
|
62 | } | |
63 | else{ |
|
63 | else{ | |
64 | $("#progress").html($('#progress_error').html()) |
|
64 | $("#progress").html($('#progress_error').html()) | |
65 | } |
|
65 | } | |
66 | } |
|
66 | } | |
67 | }); |
|
67 | }); | |
68 | })(); |
|
68 | })(); | |
69 | </script> |
|
69 | </script> |
@@ -1,71 +1,71 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | ## |
|
2 | ## | |
3 | ## See also repo_settings.html |
|
3 | ## See also repo_settings.html | |
4 | ## |
|
4 | ## | |
5 | <%inherit file="/base/base.html"/> |
|
5 | <%inherit file="/base/base.html"/> | |
6 |
|
6 | |||
7 |
<% |
|
7 | <%block name="title"> | |
8 | ${_('%s Repository Settings') % c.repo_info.repo_name} |
|
8 | ${_('%s Repository Settings') % c.repo_info.repo_name} | |
9 | %if c.site_name: |
|
9 | %if c.site_name: | |
10 | · ${c.site_name} |
|
10 | · ${c.site_name} | |
11 | %endif |
|
11 | %endif | |
12 | </%def> |
|
12 | </%block> | |
13 |
|
13 | |||
14 | <%def name="breadcrumbs_links()"> |
|
14 | <%def name="breadcrumbs_links()"> | |
15 | ${_('Settings')} |
|
15 | ${_('Settings')} | |
16 | </%def> |
|
16 | </%def> | |
17 |
|
17 | |||
18 | <%block name="header_menu"> |
|
18 | <%block name="header_menu"> | |
19 | ${self.menu('repositories')} |
|
19 | ${self.menu('repositories')} | |
20 | </%block> |
|
20 | </%block> | |
21 |
|
21 | |||
22 | <%def name="main()"> |
|
22 | <%def name="main()"> | |
23 | ${self.repo_context_bar('options')} |
|
23 | ${self.repo_context_bar('options')} | |
24 | <div class="box" style="overflow:auto"> |
|
24 | <div class="box" style="overflow:auto"> | |
25 | <!--<div class="title">--> |
|
25 | <!--<div class="title">--> | |
26 | <!--${self.breadcrumbs()}--> |
|
26 | <!--${self.breadcrumbs()}--> | |
27 | <!--</div>--> |
|
27 | <!--</div>--> | |
28 |
|
28 | |||
29 | ##main |
|
29 | ##main | |
30 | <div style="width: 150px; float:left"> |
|
30 | <div style="width: 150px; float:left"> | |
31 | <ul class="nav nav-pills nav-stacked"> |
|
31 | <ul class="nav nav-pills nav-stacked"> | |
32 | <!--<li>--> |
|
32 | <!--<li>--> | |
33 | <!--<div class="gravatar_box" style="height: 26px">--> |
|
33 | <!--<div class="gravatar_box" style="height: 26px">--> | |
34 | <!--<div class="gravatar" style="float: left">--> |
|
34 | <!--<div class="gravatar" style="float: left">--> | |
35 | <!--<i class="icon-users" style="font-size: 26px"></i>--> |
|
35 | <!--<i class="icon-users" style="font-size: 26px"></i>--> | |
36 | <!--</div>--> |
|
36 | <!--</div>--> | |
37 | <!--<div style="margin:10px 0px 10px 0px; color:#5f5f5f; float:left">--> |
|
37 | <!--<div style="margin:10px 0px 10px 0px; color:#5f5f5f; float:left">--> | |
38 | <!--<strong>${'repo-info'}</strong>--> |
|
38 | <!--<strong>${'repo-info'}</strong>--> | |
39 | <!--</div>--> |
|
39 | <!--</div>--> | |
40 | <!--</div>--> |
|
40 | <!--</div>--> | |
41 | <!--</li>--> |
|
41 | <!--</li>--> | |
42 | <li class="${'active' if c.active=='settings' else ''}"> |
|
42 | <li class="${'active' if c.active=='settings' else ''}"> | |
43 | <a href="${h.url('edit_repo', repo_name=c.repo_name)}">${_('Settings')}</a> |
|
43 | <a href="${h.url('edit_repo', repo_name=c.repo_name)}">${_('Settings')}</a> | |
44 | </li> |
|
44 | </li> | |
45 | <li class="${'active' if c.active=='permissions' else ''}"> |
|
45 | <li class="${'active' if c.active=='permissions' else ''}"> | |
46 | <a href="${h.url('edit_repo_perms', repo_name=c.repo_name)}">${_('Permissions')}</a> |
|
46 | <a href="${h.url('edit_repo_perms', repo_name=c.repo_name)}">${_('Permissions')}</a> | |
47 | </li> |
|
47 | </li> | |
48 | <li class="${'active' if c.active=='advanced' else ''}"> |
|
48 | <li class="${'active' if c.active=='advanced' else ''}"> | |
49 | <a href="${h.url('edit_repo_advanced', repo_name=c.repo_name)}">${_('Advanced')}</a> |
|
49 | <a href="${h.url('edit_repo_advanced', repo_name=c.repo_name)}">${_('Advanced')}</a> | |
50 | </li> |
|
50 | </li> | |
51 | <li class="${'active' if c.active=='fields' else ''}"> |
|
51 | <li class="${'active' if c.active=='fields' else ''}"> | |
52 | <a href="${h.url('edit_repo_fields', repo_name=c.repo_name)}">${_('Extra Fields')}</a> |
|
52 | <a href="${h.url('edit_repo_fields', repo_name=c.repo_name)}">${_('Extra Fields')}</a> | |
53 | </li> |
|
53 | </li> | |
54 | <li class="${'active' if c.active=='caches' else ''}"> |
|
54 | <li class="${'active' if c.active=='caches' else ''}"> | |
55 | <a href="${h.url('edit_repo_caches', repo_name=c.repo_name)}">${_('Caches')}</a> |
|
55 | <a href="${h.url('edit_repo_caches', repo_name=c.repo_name)}">${_('Caches')}</a> | |
56 | </li> |
|
56 | </li> | |
57 | <li class="${'active' if c.active=='remote' else ''}"> |
|
57 | <li class="${'active' if c.active=='remote' else ''}"> | |
58 | <a href="${h.url('edit_repo_remote', repo_name=c.repo_name)}">${_('Remote')}</a> |
|
58 | <a href="${h.url('edit_repo_remote', repo_name=c.repo_name)}">${_('Remote')}</a> | |
59 | </li> |
|
59 | </li> | |
60 | <li class="${'active' if c.active=='statistics' else ''}"> |
|
60 | <li class="${'active' if c.active=='statistics' else ''}"> | |
61 | <a href="${h.url('edit_repo_statistics', repo_name=c.repo_name)}">${_('Statistics')}</a> |
|
61 | <a href="${h.url('edit_repo_statistics', repo_name=c.repo_name)}">${_('Statistics')}</a> | |
62 | </li> |
|
62 | </li> | |
63 | </ul> |
|
63 | </ul> | |
64 | </div> |
|
64 | </div> | |
65 |
|
65 | |||
66 | <div style="width:750px; float:left; padding: 10px 0px 0px 20px;margin: 0px 0px 0px 10px; border-left: 1px solid #DDDDDD"> |
|
66 | <div style="width:750px; float:left; padding: 10px 0px 0px 20px;margin: 0px 0px 0px 10px; border-left: 1px solid #DDDDDD"> | |
67 | <%include file="/admin/repos/repo_edit_${c.active}.html"/> |
|
67 | <%include file="/admin/repos/repo_edit_${c.active}.html"/> | |
68 | </div> |
|
68 | </div> | |
69 | </div> |
|
69 | </div> | |
70 |
|
70 | |||
71 | </%def> |
|
71 | </%def> |
@@ -1,62 +1,62 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Repositories Administration')} |
|
5 | ${_('Repositories Administration')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="repo_count">0</span> ${_('Repositories')} |
|
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="repo_count">0</span> ${_('Repositories')} | |
13 | </%def> |
|
13 | </%def> | |
14 | <%block name="header_menu"> |
|
14 | <%block name="header_menu"> | |
15 | ${self.menu('admin')} |
|
15 | ${self.menu('admin')} | |
16 | </%block> |
|
16 | </%block> | |
17 | <%def name="main()"> |
|
17 | <%def name="main()"> | |
18 | <div class="box"> |
|
18 | <div class="box"> | |
19 |
|
19 | |||
20 | <div class="title"> |
|
20 | <div class="title"> | |
21 | ${self.breadcrumbs()} |
|
21 | ${self.breadcrumbs()} | |
22 | <ul class="links"> |
|
22 | <ul class="links"> | |
23 | %if h.HasPermissionAny('hg.admin','hg.create.repository')(): |
|
23 | %if h.HasPermissionAny('hg.admin','hg.create.repository')(): | |
24 | <li> |
|
24 | <li> | |
25 | <a href="${h.url('new_repo')}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_(u'Add Repository')}</a> |
|
25 | <a href="${h.url('new_repo')}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_(u'Add Repository')}</a> | |
26 | </li> |
|
26 | </li> | |
27 | %endif |
|
27 | %endif | |
28 | </ul> |
|
28 | </ul> | |
29 | </div> |
|
29 | </div> | |
30 | <div class="table-grid table yui-skin-sam" id="datatable_list_wrap"></div> |
|
30 | <div class="table-grid table yui-skin-sam" id="datatable_list_wrap"></div> | |
31 | <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div> |
|
31 | <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div> | |
32 |
|
32 | |||
33 |
|
33 | |||
34 | </div> |
|
34 | </div> | |
35 | <script> |
|
35 | <script> | |
36 | var data = ${c.data|n}; |
|
36 | var data = ${c.data|n}; | |
37 | var fields = [ |
|
37 | var fields = [ | |
38 | {key:"menu"}, |
|
38 | {key:"menu"}, | |
39 | {key:"raw_name"}, |
|
39 | {key:"raw_name"}, | |
40 | {key:"name"}, |
|
40 | {key:"name"}, | |
41 | {key:"desc"}, |
|
41 | {key:"desc"}, | |
42 | {key:"last_changeset"}, |
|
42 | {key:"last_changeset"}, | |
43 | {key:"last_rev_raw"}, |
|
43 | {key:"last_rev_raw"}, | |
44 | {key:"owner"}, |
|
44 | {key:"owner"}, | |
45 | {key:"state"}, |
|
45 | {key:"state"}, | |
46 | {key:"action"} |
|
46 | {key:"action"} | |
47 | ]; |
|
47 | ]; | |
48 | var column_defs = [ |
|
48 | var column_defs = [ | |
49 | {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"}, |
|
49 | {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"}, | |
50 | {key:"name",label:"${_('Name')}",sortable:true, sortOptions: { sortFunction: nameSort }}, |
|
50 | {key:"name",label:"${_('Name')}",sortable:true, sortOptions: { sortFunction: nameSort }}, | |
51 | {key:"desc",label:"${_('Description')}",sortable:true}, |
|
51 | {key:"desc",label:"${_('Description')}",sortable:true}, | |
52 | {key:"last_changeset",label:"${_('Tip')}",sortable:true, sortOptions: { sortFunction: revisionSort }}, |
|
52 | {key:"last_changeset",label:"${_('Tip')}",sortable:true, sortOptions: { sortFunction: revisionSort }}, | |
53 | {key:"owner",label:"${_('Owner')}",sortable:true}, |
|
53 | {key:"owner",label:"${_('Owner')}",sortable:true}, | |
54 | {key:"state",label:"${_('State')}",sortable:true}, |
|
54 | {key:"state",label:"${_('State')}",sortable:true}, | |
55 | {key:"action",label:"${_('Action')}",sortable:false} |
|
55 | {key:"action",label:"${_('Action')}",sortable:false} | |
56 | ]; |
|
56 | ]; | |
57 | var counter = YUD.get('repo_count'); |
|
57 | var counter = YUD.get('repo_count'); | |
58 | var sort_key = "name"; |
|
58 | var sort_key = "name"; | |
59 | YUI_datatable(data, fields, column_defs, counter, sort_key, ${c.visual.admin_grid_items}); |
|
59 | YUI_datatable(data, fields, column_defs, counter, sort_key, ${c.visual.admin_grid_items}); | |
60 | </script> |
|
60 | </script> | |
61 |
|
61 | |||
62 | </%def> |
|
62 | </%def> |
@@ -1,56 +1,56 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Settings Administration')} |
|
5 | ${_('Settings Administration')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} | |
13 | » |
|
13 | » | |
14 | ${_('Settings')} |
|
14 | ${_('Settings')} | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%block name="header_menu"> |
|
17 | <%block name="header_menu"> | |
18 | ${self.menu('admin')} |
|
18 | ${self.menu('admin')} | |
19 | </%block> |
|
19 | </%block> | |
20 |
|
20 | |||
21 | <%def name="main()"> |
|
21 | <%def name="main()"> | |
22 | <div class="box" style="overflow:auto"> |
|
22 | <div class="box" style="overflow:auto"> | |
23 | <div class="title"> |
|
23 | <div class="title"> | |
24 | ${self.breadcrumbs()} |
|
24 | ${self.breadcrumbs()} | |
25 | </div> |
|
25 | </div> | |
26 |
|
26 | |||
27 | ##main |
|
27 | ##main | |
28 | <div style="width: 150px; float:left"> |
|
28 | <div style="width: 150px; float:left"> | |
29 | <ul class="nav nav-pills nav-stacked"> |
|
29 | <ul class="nav nav-pills nav-stacked"> | |
30 | <li> |
|
30 | <li> | |
31 | <div class="gravatar_box" style="height: 26px"> |
|
31 | <div class="gravatar_box" style="height: 26px"> | |
32 | <div class="gravatar" style="float: left"> |
|
32 | <div class="gravatar" style="float: left"> | |
33 | <i class="icon-gear" style="font-size: 26px"></i> |
|
33 | <i class="icon-gear" style="font-size: 26px"></i> | |
34 | </div> |
|
34 | </div> | |
35 | <div style="margin:10px 0px 10px 0px; color:#5f5f5f; float:left"> |
|
35 | <div style="margin:10px 0px 10px 0px; color:#5f5f5f; float:left"> | |
36 | <strong>${_('Settings')}</strong> |
|
36 | <strong>${_('Settings')}</strong> | |
37 | </div> |
|
37 | </div> | |
38 | </div> |
|
38 | </div> | |
39 | </li> |
|
39 | </li> | |
40 | <li class="${'active' if c.active=='vcs' else ''}"><a href="${h.url('admin_settings')}">${_('VCS')}</a></li> |
|
40 | <li class="${'active' if c.active=='vcs' else ''}"><a href="${h.url('admin_settings')}">${_('VCS')}</a></li> | |
41 | <li class="${'active' if c.active=='mapping' else ''}"><a href="${h.url('admin_settings_mapping')}">${_('Remap and Rescan')}</a></li> |
|
41 | <li class="${'active' if c.active=='mapping' else ''}"><a href="${h.url('admin_settings_mapping')}">${_('Remap and Rescan')}</a></li> | |
42 | <li class="${'active' if c.active=='global' else ''}"><a href="${h.url('admin_settings_global')}">${_('Global')}</a></li> |
|
42 | <li class="${'active' if c.active=='global' else ''}"><a href="${h.url('admin_settings_global')}">${_('Global')}</a></li> | |
43 | <li class="${'active' if c.active=='visual' else ''}"><a href="${h.url('admin_settings_visual')}">${_('Visual')}</a></li> |
|
43 | <li class="${'active' if c.active=='visual' else ''}"><a href="${h.url('admin_settings_visual')}">${_('Visual')}</a></li> | |
44 | <li class="${'active' if c.active=='email' else ''}"><a href="${h.url('admin_settings_email')}">${_('Email')}</a></li> |
|
44 | <li class="${'active' if c.active=='email' else ''}"><a href="${h.url('admin_settings_email')}">${_('Email')}</a></li> | |
45 | <li class="${'active' if c.active=='hooks' else ''}"><a href="${h.url('admin_settings_hooks')}">${_('Hooks')}</a></li> |
|
45 | <li class="${'active' if c.active=='hooks' else ''}"><a href="${h.url('admin_settings_hooks')}">${_('Hooks')}</a></li> | |
46 | <li class="${'active' if c.active=='search' else ''}"><a href="${h.url('admin_settings_search')}">${_('Full Text Search')}</a></li> |
|
46 | <li class="${'active' if c.active=='search' else ''}"><a href="${h.url('admin_settings_search')}">${_('Full Text Search')}</a></li> | |
47 | <li class="${'active' if c.active=='system' else ''}"><a href="${h.url('admin_settings_system')}">${_('System Info')}</a></li> |
|
47 | <li class="${'active' if c.active=='system' else ''}"><a href="${h.url('admin_settings_system')}">${_('System Info')}</a></li> | |
48 | </ul> |
|
48 | </ul> | |
49 | </div> |
|
49 | </div> | |
50 |
|
50 | |||
51 | <div style="width:750px; float:left; padding: 10px 0px 0px 20px;margin: 0px 0px 0px 10px; border-left: 1px solid #DDDDDD"> |
|
51 | <div style="width:750px; float:left; padding: 10px 0px 0px 20px;margin: 0px 0px 0px 10px; border-left: 1px solid #DDDDDD"> | |
52 | <%include file="/admin/settings/settings_${c.active}.html"/> |
|
52 | <%include file="/admin/settings/settings_${c.active}.html"/> | |
53 | </div> |
|
53 | </div> | |
54 | </div> |
|
54 | </div> | |
55 |
|
55 | |||
56 | </%def> |
|
56 | </%def> |
@@ -1,72 +1,72 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Add user group')} |
|
5 | ${_('Add user group')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 | <%def name="breadcrumbs_links()"> |
|
10 | <%def name="breadcrumbs_links()"> | |
11 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
11 | ${h.link_to(_('Admin'),h.url('admin_home'))} | |
12 | » |
|
12 | » | |
13 | ${h.link_to(_('User Groups'),h.url('users_groups'))} |
|
13 | ${h.link_to(_('User Groups'),h.url('users_groups'))} | |
14 | » |
|
14 | » | |
15 | ${_('Add User Group')} |
|
15 | ${_('Add User Group')} | |
16 | </%def> |
|
16 | </%def> | |
17 |
|
17 | |||
18 | <%block name="header_menu"> |
|
18 | <%block name="header_menu"> | |
19 | ${self.menu('admin')} |
|
19 | ${self.menu('admin')} | |
20 | </%block> |
|
20 | </%block> | |
21 |
|
21 | |||
22 | <%def name="main()"> |
|
22 | <%def name="main()"> | |
23 | <div class="box"> |
|
23 | <div class="box"> | |
24 | <!-- box / title --> |
|
24 | <!-- box / title --> | |
25 | <div class="title"> |
|
25 | <div class="title"> | |
26 | ${self.breadcrumbs()} |
|
26 | ${self.breadcrumbs()} | |
27 | </div> |
|
27 | </div> | |
28 | <!-- end box / title --> |
|
28 | <!-- end box / title --> | |
29 | ${h.form(url('users_groups'))} |
|
29 | ${h.form(url('users_groups'))} | |
30 | <div class="form"> |
|
30 | <div class="form"> | |
31 | <!-- fields --> |
|
31 | <!-- fields --> | |
32 | <div class="fields"> |
|
32 | <div class="fields"> | |
33 | <div class="field"> |
|
33 | <div class="field"> | |
34 | <div class="label"> |
|
34 | <div class="label"> | |
35 | <label for="users_group_name">${_('Group name')}:</label> |
|
35 | <label for="users_group_name">${_('Group name')}:</label> | |
36 | </div> |
|
36 | </div> | |
37 | <div class="input"> |
|
37 | <div class="input"> | |
38 | ${h.text('users_group_name',class_='small')} |
|
38 | ${h.text('users_group_name',class_='small')} | |
39 | </div> |
|
39 | </div> | |
40 | </div> |
|
40 | </div> | |
41 | <div class="field"> |
|
41 | <div class="field"> | |
42 | <div class="label label-textarea"> |
|
42 | <div class="label label-textarea"> | |
43 | <label for="user_group_description">${_('Description')}:</label> |
|
43 | <label for="user_group_description">${_('Description')}:</label> | |
44 | </div> |
|
44 | </div> | |
45 | <div class="textarea text-area editor"> |
|
45 | <div class="textarea text-area editor"> | |
46 | ${h.textarea('user_group_description')} |
|
46 | ${h.textarea('user_group_description')} | |
47 | <span class="help-block">${_('Short, optional description for this user group.')}</span> |
|
47 | <span class="help-block">${_('Short, optional description for this user group.')}</span> | |
48 | </div> |
|
48 | </div> | |
49 | </div> |
|
49 | </div> | |
50 | <div class="field"> |
|
50 | <div class="field"> | |
51 | <div class="label label-checkbox"> |
|
51 | <div class="label label-checkbox"> | |
52 | <label for="users_group_active">${_('Active')}:</label> |
|
52 | <label for="users_group_active">${_('Active')}:</label> | |
53 | </div> |
|
53 | </div> | |
54 | <div class="checkboxes"> |
|
54 | <div class="checkboxes"> | |
55 | ${h.checkbox('users_group_active',value=True, checked='checked')} |
|
55 | ${h.checkbox('users_group_active',value=True, checked='checked')} | |
56 | </div> |
|
56 | </div> | |
57 | </div> |
|
57 | </div> | |
58 |
|
58 | |||
59 | <div class="buttons"> |
|
59 | <div class="buttons"> | |
60 | ${h.submit('save',_('Save'),class_="btn")} |
|
60 | ${h.submit('save',_('Save'),class_="btn")} | |
61 | </div> |
|
61 | </div> | |
62 | </div> |
|
62 | </div> | |
63 | </div> |
|
63 | </div> | |
64 | ${h.end_form()} |
|
64 | ${h.end_form()} | |
65 | </div> |
|
65 | </div> | |
66 | </%def> |
|
66 | </%def> | |
67 |
|
67 | |||
68 | <script> |
|
68 | <script> | |
69 | $(document).ready(function(){ |
|
69 | $(document).ready(function(){ | |
70 | $('#users_group_name').focus(); |
|
70 | $('#users_group_name').focus(); | |
71 | }) |
|
71 | }) | |
72 | </script> |
|
72 | </script> |
@@ -1,54 +1,54 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('%s user group settings') % c.user_group.users_group_name} |
|
5 | ${_('%s user group settings') % c.user_group.users_group_name} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} | |
13 | » |
|
13 | » | |
14 | ${h.link_to(_('User Groups'),h.url('users_groups'))} |
|
14 | ${h.link_to(_('User Groups'),h.url('users_groups'))} | |
15 | » |
|
15 | » | |
16 | ${c.user_group.users_group_name} |
|
16 | ${c.user_group.users_group_name} | |
17 | </%def> |
|
17 | </%def> | |
18 |
|
18 | |||
19 | <%block name="header_menu"> |
|
19 | <%block name="header_menu"> | |
20 | ${self.menu('admin')} |
|
20 | ${self.menu('admin')} | |
21 | </%block> |
|
21 | </%block> | |
22 |
|
22 | |||
23 | <%def name="main()"> |
|
23 | <%def name="main()"> | |
24 | <div class="box" style="overflow:auto"> |
|
24 | <div class="box" style="overflow:auto"> | |
25 | <div class="title"> |
|
25 | <div class="title"> | |
26 | ${self.breadcrumbs()} |
|
26 | ${self.breadcrumbs()} | |
27 | </div> |
|
27 | </div> | |
28 |
|
28 | |||
29 | ##main |
|
29 | ##main | |
30 | <div style="width: 150px; float:left"> |
|
30 | <div style="width: 150px; float:left"> | |
31 | <ul class="nav nav-pills nav-stacked"> |
|
31 | <ul class="nav nav-pills nav-stacked"> | |
32 | <li> |
|
32 | <li> | |
33 | <div class="gravatar_box" style="height: 26px"> |
|
33 | <div class="gravatar_box" style="height: 26px"> | |
34 | <div class="gravatar" style="float: left"> |
|
34 | <div class="gravatar" style="float: left"> | |
35 | <i class="icon-users" style="font-size: 26px"></i> |
|
35 | <i class="icon-users" style="font-size: 26px"></i> | |
36 | </div> |
|
36 | </div> | |
37 | <div class="truncate" style="margin:7px 0px 10px 0px; color:#5f5f5f; float:left; width: 100px"> |
|
37 | <div class="truncate" style="margin:7px 0px 10px 0px; color:#5f5f5f; float:left; width: 100px"> | |
38 | <strong>${c.user_group.users_group_name}</strong> |
|
38 | <strong>${c.user_group.users_group_name}</strong> | |
39 | </div> |
|
39 | </div> | |
40 | </div> |
|
40 | </div> | |
41 | </li> |
|
41 | </li> | |
42 | <li class="${'active' if c.active=='settings' else ''}"><a href="${h.url('edit_users_group', id=c.user_group.users_group_id)}">${_('Settings')}</a></li> |
|
42 | <li class="${'active' if c.active=='settings' else ''}"><a href="${h.url('edit_users_group', id=c.user_group.users_group_id)}">${_('Settings')}</a></li> | |
43 | <li class="${'active' if c.active=='advanced' else ''}"><a href="${h.url('edit_user_group_advanced', id=c.user_group.users_group_id)}">${_('Advanced')}</a></li> |
|
43 | <li class="${'active' if c.active=='advanced' else ''}"><a href="${h.url('edit_user_group_advanced', id=c.user_group.users_group_id)}">${_('Advanced')}</a></li> | |
44 | <li class="${'active' if c.active=='default_perms' else ''}"><a href="${h.url('edit_user_group_default_perms', id=c.user_group.users_group_id)}">${_('Default permissions')}</a></li> |
|
44 | <li class="${'active' if c.active=='default_perms' else ''}"><a href="${h.url('edit_user_group_default_perms', id=c.user_group.users_group_id)}">${_('Default permissions')}</a></li> | |
45 | <li class="${'active' if c.active=='perms' else ''}"><a href="${h.url('edit_user_group_perms', id=c.user_group.users_group_id)}">${_('Permissions')}</a></li> |
|
45 | <li class="${'active' if c.active=='perms' else ''}"><a href="${h.url('edit_user_group_perms', id=c.user_group.users_group_id)}">${_('Permissions')}</a></li> | |
46 | <li class="${'active' if c.active=='members' else ''}"><a href="${h.url('edit_user_group_members', id=c.user_group.users_group_id)}">${_('Members')}</a></li> |
|
46 | <li class="${'active' if c.active=='members' else ''}"><a href="${h.url('edit_user_group_members', id=c.user_group.users_group_id)}">${_('Members')}</a></li> | |
47 | </ul> |
|
47 | </ul> | |
48 | </div> |
|
48 | </div> | |
49 |
|
49 | |||
50 | <div style="width:750px; float:left; padding: 10px 0px 0px 20px;margin: 0px 0px 0px 10px; border-left: 1px solid #DDDDDD"> |
|
50 | <div style="width:750px; float:left; padding: 10px 0px 0px 20px;margin: 0px 0px 0px 10px; border-left: 1px solid #DDDDDD"> | |
51 | <%include file="/admin/user_groups/user_group_edit_${c.active}.html"/> |
|
51 | <%include file="/admin/user_groups/user_group_edit_${c.active}.html"/> | |
52 | </div> |
|
52 | </div> | |
53 | </div> |
|
53 | </div> | |
54 | </%def> |
|
54 | </%def> |
@@ -1,60 +1,60 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('User Groups Administration')} |
|
5 | ${_('User Groups Administration')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="user_group_count">0</span> ${_('user groups')} |
|
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="user_group_count">0</span> ${_('user groups')} | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%block name="header_menu"> |
|
16 | <%block name="header_menu"> | |
17 | ${self.menu('admin')} |
|
17 | ${self.menu('admin')} | |
18 | </%block> |
|
18 | </%block> | |
19 |
|
19 | |||
20 | <%def name="main()"> |
|
20 | <%def name="main()"> | |
21 | <div class="box"> |
|
21 | <div class="box"> | |
22 | <!-- box / title --> |
|
22 | <!-- box / title --> | |
23 | <div class="title"> |
|
23 | <div class="title"> | |
24 | ${self.breadcrumbs()} |
|
24 | ${self.breadcrumbs()} | |
25 | <ul class="links"> |
|
25 | <ul class="links"> | |
26 | %if h.HasPermissionAny('hg.admin', 'hg.usergroup.create.true')(): |
|
26 | %if h.HasPermissionAny('hg.admin', 'hg.usergroup.create.true')(): | |
27 | <li> |
|
27 | <li> | |
28 | <a href="${h.url('new_users_group')}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_(u'Add User Group')}</a> |
|
28 | <a href="${h.url('new_users_group')}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_(u'Add User Group')}</a> | |
29 | </li> |
|
29 | </li> | |
30 | %endif |
|
30 | %endif | |
31 | </ul> |
|
31 | </ul> | |
32 | </div> |
|
32 | </div> | |
33 | <!-- end box / title --> |
|
33 | <!-- end box / title --> | |
34 | <div class="table-grid table yui-skin-sam" id="datatable_list_wrap"></div> |
|
34 | <div class="table-grid table yui-skin-sam" id="datatable_list_wrap"></div> | |
35 | <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div> |
|
35 | <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div> | |
36 | </div> |
|
36 | </div> | |
37 | <script> |
|
37 | <script> | |
38 | var data = ${c.data|n}; |
|
38 | var data = ${c.data|n}; | |
39 | var fields = [ |
|
39 | var fields = [ | |
40 | {key: "group_name"}, |
|
40 | {key: "group_name"}, | |
41 | {key: "raw_name"}, |
|
41 | {key: "raw_name"}, | |
42 | {key: "desc"}, |
|
42 | {key: "desc"}, | |
43 | {key: "members"}, |
|
43 | {key: "members"}, | |
44 | {key: "active"}, |
|
44 | {key: "active"}, | |
45 | {key: "owner"}, |
|
45 | {key: "owner"}, | |
46 | {key: "action"} |
|
46 | {key: "action"} | |
47 | ]; |
|
47 | ]; | |
48 | var column_defs = [ |
|
48 | var column_defs = [ | |
49 | {key:"group_name",label:"${_('Name')}",sortable:true, sortOptions: { sortFunction: nameSort }}, |
|
49 | {key:"group_name",label:"${_('Name')}",sortable:true, sortOptions: { sortFunction: nameSort }}, | |
50 | {key:"desc",label:"${_('Description')}",sortable:true}, |
|
50 | {key:"desc",label:"${_('Description')}",sortable:true}, | |
51 | {key:"members",label:"${_('Members')}",sortable:false}, |
|
51 | {key:"members",label:"${_('Members')}",sortable:false}, | |
52 | {key:"active",label:"${_('Active')}",sortable:true}, |
|
52 | {key:"active",label:"${_('Active')}",sortable:true}, | |
53 | {key:"owner",label:"${_('Owner')}",sortable:true}, |
|
53 | {key:"owner",label:"${_('Owner')}",sortable:true}, | |
54 | {key:"action",label:"${_('Action')}",sortable:false} |
|
54 | {key:"action",label:"${_('Action')}",sortable:false} | |
55 | ]; |
|
55 | ]; | |
56 | var counter = YUD.get('user_group_count'); |
|
56 | var counter = YUD.get('user_group_count'); | |
57 | var sort_key = "group_name"; |
|
57 | var sort_key = "group_name"; | |
58 | YUI_datatable(data, fields, column_defs, counter, sort_key, ${c.visual.admin_grid_items}); |
|
58 | YUI_datatable(data, fields, column_defs, counter, sort_key, ${c.visual.admin_grid_items}); | |
59 | </script> |
|
59 | </script> | |
60 | </%def> |
|
60 | </%def> |
@@ -1,110 +1,110 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Add user')} |
|
5 | ${_('Add user')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 | <%def name="breadcrumbs_links()"> |
|
10 | <%def name="breadcrumbs_links()"> | |
11 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
11 | ${h.link_to(_('Admin'),h.url('admin_home'))} | |
12 | » |
|
12 | » | |
13 | ${h.link_to(_('Users'),h.url('users'))} |
|
13 | ${h.link_to(_('Users'),h.url('users'))} | |
14 | » |
|
14 | » | |
15 | ${_('Add User')} |
|
15 | ${_('Add User')} | |
16 | </%def> |
|
16 | </%def> | |
17 |
|
17 | |||
18 | <%block name="header_menu"> |
|
18 | <%block name="header_menu"> | |
19 | ${self.menu('admin')} |
|
19 | ${self.menu('admin')} | |
20 | </%block> |
|
20 | </%block> | |
21 |
|
21 | |||
22 | <%def name="main()"> |
|
22 | <%def name="main()"> | |
23 | <div class="box"> |
|
23 | <div class="box"> | |
24 | <!-- box / title --> |
|
24 | <!-- box / title --> | |
25 | <div class="title"> |
|
25 | <div class="title"> | |
26 | ${self.breadcrumbs()} |
|
26 | ${self.breadcrumbs()} | |
27 | </div> |
|
27 | </div> | |
28 | <!-- end box / title --> |
|
28 | <!-- end box / title --> | |
29 | ${h.form(url('users'))} |
|
29 | ${h.form(url('users'))} | |
30 | <div class="form"> |
|
30 | <div class="form"> | |
31 | <!-- fields --> |
|
31 | <!-- fields --> | |
32 | <div class="fields"> |
|
32 | <div class="fields"> | |
33 | <div class="field"> |
|
33 | <div class="field"> | |
34 | <div class="label"> |
|
34 | <div class="label"> | |
35 | <label for="username">${_('Username')}:</label> |
|
35 | <label for="username">${_('Username')}:</label> | |
36 | </div> |
|
36 | </div> | |
37 | <div class="input"> |
|
37 | <div class="input"> | |
38 | ${h.text('username',class_='small')} |
|
38 | ${h.text('username',class_='small')} | |
39 | </div> |
|
39 | </div> | |
40 | </div> |
|
40 | </div> | |
41 |
|
41 | |||
42 | <div class="field"> |
|
42 | <div class="field"> | |
43 | <div class="label"> |
|
43 | <div class="label"> | |
44 | <label for="password">${_('Password')}:</label> |
|
44 | <label for="password">${_('Password')}:</label> | |
45 | </div> |
|
45 | </div> | |
46 | <div class="input"> |
|
46 | <div class="input"> | |
47 | ${h.password('password',class_='small',autocomplete="off")} |
|
47 | ${h.password('password',class_='small',autocomplete="off")} | |
48 | </div> |
|
48 | </div> | |
49 | </div> |
|
49 | </div> | |
50 |
|
50 | |||
51 | <div class="field"> |
|
51 | <div class="field"> | |
52 | <div class="label"> |
|
52 | <div class="label"> | |
53 | <label for="password_confirmation">${_('Password confirmation')}:</label> |
|
53 | <label for="password_confirmation">${_('Password confirmation')}:</label> | |
54 | </div> |
|
54 | </div> | |
55 | <div class="input"> |
|
55 | <div class="input"> | |
56 | ${h.password('password_confirmation',class_="small",autocomplete="off")} |
|
56 | ${h.password('password_confirmation',class_="small",autocomplete="off")} | |
57 | </div> |
|
57 | </div> | |
58 | </div> |
|
58 | </div> | |
59 |
|
59 | |||
60 | <div class="field"> |
|
60 | <div class="field"> | |
61 | <div class="label"> |
|
61 | <div class="label"> | |
62 | <label for="firstname">${_('First Name')}:</label> |
|
62 | <label for="firstname">${_('First Name')}:</label> | |
63 | </div> |
|
63 | </div> | |
64 | <div class="input"> |
|
64 | <div class="input"> | |
65 | ${h.text('firstname',class_='small')} |
|
65 | ${h.text('firstname',class_='small')} | |
66 | </div> |
|
66 | </div> | |
67 | </div> |
|
67 | </div> | |
68 |
|
68 | |||
69 | <div class="field"> |
|
69 | <div class="field"> | |
70 | <div class="label"> |
|
70 | <div class="label"> | |
71 | <label for="lastname">${_('Last Name')}:</label> |
|
71 | <label for="lastname">${_('Last Name')}:</label> | |
72 | </div> |
|
72 | </div> | |
73 | <div class="input"> |
|
73 | <div class="input"> | |
74 | ${h.text('lastname',class_='small')} |
|
74 | ${h.text('lastname',class_='small')} | |
75 | </div> |
|
75 | </div> | |
76 | </div> |
|
76 | </div> | |
77 |
|
77 | |||
78 | <div class="field"> |
|
78 | <div class="field"> | |
79 | <div class="label"> |
|
79 | <div class="label"> | |
80 | <label for="email">${_('Email')}:</label> |
|
80 | <label for="email">${_('Email')}:</label> | |
81 | </div> |
|
81 | </div> | |
82 | <div class="input"> |
|
82 | <div class="input"> | |
83 | ${h.text('email',class_='small')} |
|
83 | ${h.text('email',class_='small')} | |
84 | ${h.hidden('extern_name', c.default_extern_type)} |
|
84 | ${h.hidden('extern_name', c.default_extern_type)} | |
85 | ${h.hidden('extern_type', c.default_extern_type)} |
|
85 | ${h.hidden('extern_type', c.default_extern_type)} | |
86 | </div> |
|
86 | </div> | |
87 | </div> |
|
87 | </div> | |
88 |
|
88 | |||
89 | <div class="field"> |
|
89 | <div class="field"> | |
90 | <div class="label label-checkbox"> |
|
90 | <div class="label label-checkbox"> | |
91 | <label for="active">${_('Active')}:</label> |
|
91 | <label for="active">${_('Active')}:</label> | |
92 | </div> |
|
92 | </div> | |
93 | <div class="checkboxes"> |
|
93 | <div class="checkboxes"> | |
94 | ${h.checkbox('active',value=True,checked='checked')} |
|
94 | ${h.checkbox('active',value=True,checked='checked')} | |
95 | </div> |
|
95 | </div> | |
96 | </div> |
|
96 | </div> | |
97 |
|
97 | |||
98 | <div class="buttons"> |
|
98 | <div class="buttons"> | |
99 | ${h.submit('save',_('Save'),class_="btn")} |
|
99 | ${h.submit('save',_('Save'),class_="btn")} | |
100 | </div> |
|
100 | </div> | |
101 | </div> |
|
101 | </div> | |
102 | </div> |
|
102 | </div> | |
103 | ${h.end_form()} |
|
103 | ${h.end_form()} | |
104 | </div> |
|
104 | </div> | |
105 | </%def> |
|
105 | </%def> | |
106 | <script> |
|
106 | <script> | |
107 | $(document).ready(function(){ |
|
107 | $(document).ready(function(){ | |
108 | $('#username').focus(); |
|
108 | $('#username').focus(); | |
109 | }) |
|
109 | }) | |
110 | </script> |
|
110 | </script> |
@@ -1,56 +1,56 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('%s user settings') % c.user.username} |
|
5 | ${_('%s user settings') % c.user.username} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
12 | ${h.link_to(_('Admin'),h.url('admin_home'))} | |
13 | » |
|
13 | » | |
14 | ${h.link_to(_('Users'),h.url('users'))} |
|
14 | ${h.link_to(_('Users'),h.url('users'))} | |
15 | » |
|
15 | » | |
16 | ${c.user.username} |
|
16 | ${c.user.username} | |
17 | </%def> |
|
17 | </%def> | |
18 |
|
18 | |||
19 | <%block name="header_menu"> |
|
19 | <%block name="header_menu"> | |
20 | ${self.menu('admin')} |
|
20 | ${self.menu('admin')} | |
21 | </%block> |
|
21 | </%block> | |
22 |
|
22 | |||
23 | <%def name="main()"> |
|
23 | <%def name="main()"> | |
24 | <div class="box" style="overflow:auto"> |
|
24 | <div class="box" style="overflow:auto"> | |
25 | <div class="title"> |
|
25 | <div class="title"> | |
26 | ${self.breadcrumbs()} |
|
26 | ${self.breadcrumbs()} | |
27 | </div> |
|
27 | </div> | |
28 |
|
28 | |||
29 | ##main |
|
29 | ##main | |
30 | <div style="width: 150px; float:left"> |
|
30 | <div style="width: 150px; float:left"> | |
31 | <ul class="nav nav-pills nav-stacked"> |
|
31 | <ul class="nav nav-pills nav-stacked"> | |
32 | <li> |
|
32 | <li> | |
33 | <div class="gravatar_box" style="height: 26px"> |
|
33 | <div class="gravatar_box" style="height: 26px"> | |
34 | <div class="gravatar" style="float: left"> |
|
34 | <div class="gravatar" style="float: left"> | |
35 | ${h.gravatar(c.user.email, size=26)} |
|
35 | ${h.gravatar(c.user.email, size=26)} | |
36 | </div> |
|
36 | </div> | |
37 | <div class="truncate" style="margin:10px 0px 10px 0px; color:#5f5f5f; float:left; width: 100px"> |
|
37 | <div class="truncate" style="margin:10px 0px 10px 0px; color:#5f5f5f; float:left; width: 100px"> | |
38 | <strong>${c.user.username}</strong> |
|
38 | <strong>${c.user.username}</strong> | |
39 | </div> |
|
39 | </div> | |
40 | </div> |
|
40 | </div> | |
41 | </li> |
|
41 | </li> | |
42 | <li class="${'active' if c.active=='profile' else ''}"><a href="${h.url('edit_user', id=c.user.user_id)}">${_('Profile')}</a></li> |
|
42 | <li class="${'active' if c.active=='profile' else ''}"><a href="${h.url('edit_user', id=c.user.user_id)}">${_('Profile')}</a></li> | |
43 | <li class="${'active' if c.active=='api_keys' else ''}"><a href="${h.url('edit_user_api_keys', id=c.user.user_id)}">${_('API Keys')}</a></li> |
|
43 | <li class="${'active' if c.active=='api_keys' else ''}"><a href="${h.url('edit_user_api_keys', id=c.user.user_id)}">${_('API Keys')}</a></li> | |
44 | <li class="${'active' if c.active=='advanced' else ''}"><a href="${h.url('edit_user_advanced', id=c.user.user_id)}">${_('Advanced')}</a></li> |
|
44 | <li class="${'active' if c.active=='advanced' else ''}"><a href="${h.url('edit_user_advanced', id=c.user.user_id)}">${_('Advanced')}</a></li> | |
45 | <li class="${'active' if c.active=='perms' else ''}"><a href="${h.url('edit_user_perms', id=c.user.user_id)}">${_('Default Permissions')}</a></li> |
|
45 | <li class="${'active' if c.active=='perms' else ''}"><a href="${h.url('edit_user_perms', id=c.user.user_id)}">${_('Default Permissions')}</a></li> | |
46 | <li class="${'active' if c.active=='emails' else ''}"><a href="${h.url('edit_user_emails', id=c.user.user_id)}">${_('Emails')}</a></li> |
|
46 | <li class="${'active' if c.active=='emails' else ''}"><a href="${h.url('edit_user_emails', id=c.user.user_id)}">${_('Emails')}</a></li> | |
47 | <li class="${'active' if c.active=='ips' else ''}"><a href="${h.url('edit_user_ips', id=c.user.user_id)}">${_('IP Whitelist')}</a></li> |
|
47 | <li class="${'active' if c.active=='ips' else ''}"><a href="${h.url('edit_user_ips', id=c.user.user_id)}">${_('IP Whitelist')}</a></li> | |
48 | </ul> |
|
48 | </ul> | |
49 | </div> |
|
49 | </div> | |
50 |
|
50 | |||
51 | <div style="width:750px; float:left; padding: 10px 0px 0px 20px;margin: 0px 0px 0px 10px; border-left: 1px solid #DDDDDD"> |
|
51 | <div style="width:750px; float:left; padding: 10px 0px 0px 20px;margin: 0px 0px 0px 10px; border-left: 1px solid #DDDDDD"> | |
52 | <%include file="/admin/users/user_edit_${c.active}.html"/> |
|
52 | <%include file="/admin/users/user_edit_${c.active}.html"/> | |
53 | </div> |
|
53 | </div> | |
54 | </div> |
|
54 | </div> | |
55 |
|
55 | |||
56 | </%def> |
|
56 | </%def> |
@@ -1,67 +1,67 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Users Administration')} |
|
5 | ${_('Users Administration')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="user_count">0</span> ${_('Users')} |
|
13 | ${h.link_to(_('Admin'),h.url('admin_home'))} » <span id="user_count">0</span> ${_('Users')} | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%block name="header_menu"> |
|
16 | <%block name="header_menu"> | |
17 | ${self.menu('admin')} |
|
17 | ${self.menu('admin')} | |
18 | </%block> |
|
18 | </%block> | |
19 |
|
19 | |||
20 | <%def name="main()"> |
|
20 | <%def name="main()"> | |
21 | <div class="box"> |
|
21 | <div class="box"> | |
22 | <!-- box / title --> |
|
22 | <!-- box / title --> | |
23 | <div class="title"> |
|
23 | <div class="title"> | |
24 | ${self.breadcrumbs()} |
|
24 | ${self.breadcrumbs()} | |
25 | <ul class="links"> |
|
25 | <ul class="links"> | |
26 | <li> |
|
26 | <li> | |
27 | <a href="${h.url('new_user')}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_(u'Add User')}</a> |
|
27 | <a href="${h.url('new_user')}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_(u'Add User')}</a> | |
28 | </li> |
|
28 | </li> | |
29 | </ul> |
|
29 | </ul> | |
30 | </div> |
|
30 | </div> | |
31 | <!-- end box / title --> |
|
31 | <!-- end box / title --> | |
32 | <div class="table-grid table yui-skin-sam" id="datatable_list_wrap"></div> |
|
32 | <div class="table-grid table yui-skin-sam" id="datatable_list_wrap"></div> | |
33 | <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div> |
|
33 | <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div> | |
34 | </div> |
|
34 | </div> | |
35 |
|
35 | |||
36 | <script> |
|
36 | <script> | |
37 | var data = ${c.data|n}; |
|
37 | var data = ${c.data|n}; | |
38 | var fields = [ |
|
38 | var fields = [ | |
39 | {key: "gravatar"}, |
|
39 | {key: "gravatar"}, | |
40 | {key: "raw_name"}, |
|
40 | {key: "raw_name"}, | |
41 | {key: "username"}, |
|
41 | {key: "username"}, | |
42 | {key: "firstname"}, |
|
42 | {key: "firstname"}, | |
43 | {key: "lastname"}, |
|
43 | {key: "lastname"}, | |
44 | {key: "last_login"}, |
|
44 | {key: "last_login"}, | |
45 | {key: "last_login_raw"}, |
|
45 | {key: "last_login_raw"}, | |
46 | {key: "active"}, |
|
46 | {key: "active"}, | |
47 | {key: "admin"}, |
|
47 | {key: "admin"}, | |
48 | {key: "extern_type"}, |
|
48 | {key: "extern_type"}, | |
49 | {key: "action"} |
|
49 | {key: "action"} | |
50 | ]; |
|
50 | ]; | |
51 | var column_defs = [ |
|
51 | var column_defs = [ | |
52 | {key:"gravatar",label:"",sortable:false}, |
|
52 | {key:"gravatar",label:"",sortable:false}, | |
53 | {key:"username",label:"${_('Username')}",sortable:true}, |
|
53 | {key:"username",label:"${_('Username')}",sortable:true}, | |
54 | {key:"firstname",label:"${_('First Name')}",sortable:true}, |
|
54 | {key:"firstname",label:"${_('First Name')}",sortable:true}, | |
55 | {key:"lastname",label:"${_('Last Name')}",sortable:true}, |
|
55 | {key:"lastname",label:"${_('Last Name')}",sortable:true}, | |
56 | {key:"last_login",label:"${_('Last Login')}",sortable:true, sortOptions: { sortFunction: lastLoginSort }}, |
|
56 | {key:"last_login",label:"${_('Last Login')}",sortable:true, sortOptions: { sortFunction: lastLoginSort }}, | |
57 | {key:"active",label:"${_('Active')}",sortable:true}, |
|
57 | {key:"active",label:"${_('Active')}",sortable:true}, | |
58 | {key:"admin",label:"${_('Admin')}",sortable:true}, |
|
58 | {key:"admin",label:"${_('Admin')}",sortable:true}, | |
59 | {key:"extern_type",label:"${_('Auth Type')}",sortable:true}, |
|
59 | {key:"extern_type",label:"${_('Auth Type')}",sortable:true}, | |
60 | {key:"action",label:"${_('Action')}",sortable:false} |
|
60 | {key:"action",label:"${_('Action')}",sortable:false} | |
61 | ]; |
|
61 | ]; | |
62 | var counter = YUD.get('user_count'); |
|
62 | var counter = YUD.get('user_count'); | |
63 | var sort_key = "username"; |
|
63 | var sort_key = "username"; | |
64 | YUI_datatable(data, fields, column_defs, counter, sort_key, ${c.visual.admin_grid_items}); |
|
64 | YUI_datatable(data, fields, column_defs, counter, sort_key, ${c.visual.admin_grid_items}); | |
65 | </script> |
|
65 | </script> | |
66 |
|
66 | |||
67 | </%def> |
|
67 | </%def> |
@@ -1,144 +1,144 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <!DOCTYPE html> |
|
2 | <!DOCTYPE html> | |
3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|
3 | <html xmlns="http://www.w3.org/1999/xhtml"> | |
4 | <head> |
|
4 | <head> | |
5 |
<title> |
|
5 | <title><%block name="title"/></title> | |
6 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> |
|
6 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
7 | <meta name="robots" content="index, nofollow"/> |
|
7 | <meta name="robots" content="index, nofollow"/> | |
8 | <link rel="icon" href="${h.url('/images/favicon.ico')}" type="image/png" /> |
|
8 | <link rel="icon" href="${h.url('/images/favicon.ico')}" type="image/png" /> | |
9 |
|
9 | |||
10 | ## CSS ### |
|
10 | ## CSS ### | |
11 | <link rel="stylesheet" type="text/css" href="${h.url('/js/select2/select2.css', ver=c.kallithea_version)}"/> |
|
11 | <link rel="stylesheet" type="text/css" href="${h.url('/js/select2/select2.css', ver=c.kallithea_version)}"/> | |
12 | <link rel="stylesheet" type="text/css" href="${h.url('/css/pygments.css', ver=c.kallithea_version)}"/> |
|
12 | <link rel="stylesheet" type="text/css" href="${h.url('/css/pygments.css', ver=c.kallithea_version)}"/> | |
13 | <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css', ver=c.kallithea_version)}" media="screen"/> |
|
13 | <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css', ver=c.kallithea_version)}" media="screen"/> | |
14 | <link rel="stylesheet" type="text/css" href="${h.url('/css/contextbar.css', ver=c.kallithea_version)}" media="screen"/> |
|
14 | <link rel="stylesheet" type="text/css" href="${h.url('/css/contextbar.css', ver=c.kallithea_version)}" media="screen"/> | |
15 | <link rel="stylesheet" type="text/css" href="${h.url('/fontello/css/kallithea.css', ver=c.kallithea_version)}"> |
|
15 | <link rel="stylesheet" type="text/css" href="${h.url('/fontello/css/kallithea.css', ver=c.kallithea_version)}"> | |
16 | <%block name="css_extra"/> |
|
16 | <%block name="css_extra"/> | |
17 |
|
17 | |||
18 | ## JAVASCRIPT ## |
|
18 | ## JAVASCRIPT ## | |
19 | <script type="text/javascript"> |
|
19 | <script type="text/javascript"> | |
20 | ## JS translations map |
|
20 | ## JS translations map | |
21 | var TRANSLATION_MAP = { |
|
21 | var TRANSLATION_MAP = { | |
22 | 'Add Another Comment':'${_("Add Another Comment")}', |
|
22 | 'Add Another Comment':'${_("Add Another Comment")}', | |
23 | 'Stop following this repository':"${_('Stop following this repository')}", |
|
23 | 'Stop following this repository':"${_('Stop following this repository')}", | |
24 | 'Start following this repository':"${_('Start following this repository')}", |
|
24 | 'Start following this repository':"${_('Start following this repository')}", | |
25 | 'Group':"${_('Group')}", |
|
25 | 'Group':"${_('Group')}", | |
26 | 'members':"${_('members')}", |
|
26 | 'members':"${_('members')}", | |
27 | 'Loading ...':"${_('Loading ...')}", |
|
27 | 'Loading ...':"${_('Loading ...')}", | |
28 | 'loading ...':"${_('loading ...')}", |
|
28 | 'loading ...':"${_('loading ...')}", | |
29 | 'Search truncated': "${_('Search truncated')}", |
|
29 | 'Search truncated': "${_('Search truncated')}", | |
30 | 'No matching files': "${_('No matching files')}", |
|
30 | 'No matching files': "${_('No matching files')}", | |
31 | 'Open New Pull Request': "${_('Open New Pull Request')}", |
|
31 | 'Open New Pull Request': "${_('Open New Pull Request')}", | |
32 | 'Open New Pull Request for Selected Changesets': "${_('Open New Pull Request for Selected Changesets')}", |
|
32 | 'Open New Pull Request for Selected Changesets': "${_('Open New Pull Request for Selected Changesets')}", | |
33 | 'Show Selected Changesets __S → __E': "${h.literal(_('Show Selected Changesets __S → __E'))}", |
|
33 | 'Show Selected Changesets __S → __E': "${h.literal(_('Show Selected Changesets __S → __E'))}", | |
34 | 'Show Selected Changeset __S': "${_('Show Selected Changeset __S')}", |
|
34 | 'Show Selected Changeset __S': "${_('Show Selected Changeset __S')}", | |
35 | 'Selection Link': "${_('Selection Link')}", |
|
35 | 'Selection Link': "${_('Selection Link')}", | |
36 | 'Collapse Diff': "${_('Collapse Diff')}", |
|
36 | 'Collapse Diff': "${_('Collapse Diff')}", | |
37 | 'Expand Diff': "${_('Expand Diff')}", |
|
37 | 'Expand Diff': "${_('Expand Diff')}", | |
38 | 'Failed to revoke permission': "${_('Failed to revoke permission')}", |
|
38 | 'Failed to revoke permission': "${_('Failed to revoke permission')}", | |
39 | 'Confirm to revoke permission for {0}: {1} ?': "${_('Confirm to revoke permission for {0}: {1} ?')}", |
|
39 | 'Confirm to revoke permission for {0}: {1} ?': "${_('Confirm to revoke permission for {0}: {1} ?')}", | |
40 | 'enabled': "${_('enabled')}", |
|
40 | 'enabled': "${_('enabled')}", | |
41 | 'disabled': "${_('disabled')}", |
|
41 | 'disabled': "${_('disabled')}", | |
42 | 'Select changeset': "${_('Select changeset')}", |
|
42 | 'Select changeset': "${_('Select changeset')}", | |
43 | 'Specify changeset': "${_('Specify changeset')}", |
|
43 | 'Specify changeset': "${_('Specify changeset')}", | |
44 | 'MSG_SORTASC': "${_('Click to sort ascending')}", |
|
44 | 'MSG_SORTASC': "${_('Click to sort ascending')}", | |
45 | 'MSG_SORTDESC': "${_('Click to sort descending')}", |
|
45 | 'MSG_SORTDESC': "${_('Click to sort descending')}", | |
46 | 'MSG_EMPTY': "${_('No records found.')}", |
|
46 | 'MSG_EMPTY': "${_('No records found.')}", | |
47 | 'MSG_ERROR': "${_('Data error.')}", |
|
47 | 'MSG_ERROR': "${_('Data error.')}", | |
48 | 'MSG_LOADING': "${_('Loading...')}" |
|
48 | 'MSG_LOADING': "${_('Loading...')}" | |
49 | }; |
|
49 | }; | |
50 | var _TM = TRANSLATION_MAP; |
|
50 | var _TM = TRANSLATION_MAP; | |
51 |
|
51 | |||
52 | var TOGGLE_FOLLOW_URL = "${h.url('toggle_following')}"; |
|
52 | var TOGGLE_FOLLOW_URL = "${h.url('toggle_following')}"; | |
53 |
|
53 | |||
54 | var REPO_NAME = ""; |
|
54 | var REPO_NAME = ""; | |
55 | %if hasattr(c, 'repo_name'): |
|
55 | %if hasattr(c, 'repo_name'): | |
56 | var REPO_NAME = "${c.repo_name}"; |
|
56 | var REPO_NAME = "${c.repo_name}"; | |
57 | %endif |
|
57 | %endif | |
58 | </script> |
|
58 | </script> | |
59 | <script type="text/javascript" src="${h.url('/js/yui.2.9.js', ver=c.kallithea_version)}"></script> |
|
59 | <script type="text/javascript" src="${h.url('/js/yui.2.9.js', ver=c.kallithea_version)}"></script> | |
60 | <script type="text/javascript" src="${h.url('/js/jquery-1.11.1.min.js', ver=c.kallithea_version)}"></script> |
|
60 | <script type="text/javascript" src="${h.url('/js/jquery-1.11.1.min.js', ver=c.kallithea_version)}"></script> | |
61 | <script type="text/javascript" src="${h.url('/js/bootstrap.js', ver=c.kallithea_version)}"></script> |
|
61 | <script type="text/javascript" src="${h.url('/js/bootstrap.js', ver=c.kallithea_version)}"></script> | |
62 | <script type="text/javascript" src="${h.url('/js/select2/select2.js', ver=c.kallithea_version)}"></script> |
|
62 | <script type="text/javascript" src="${h.url('/js/select2/select2.js', ver=c.kallithea_version)}"></script> | |
63 | <script type="text/javascript" src="${h.url('/js/mousetrap.js', ver=c.kallithea_version)}"></script> |
|
63 | <script type="text/javascript" src="${h.url('/js/mousetrap.js', ver=c.kallithea_version)}"></script> | |
64 | <!--[if lt IE 9]> |
|
64 | <!--[if lt IE 9]> | |
65 | <script language="javascript" type="text/javascript" src="${h.url('/js/excanvas.min.js')}"></script> |
|
65 | <script language="javascript" type="text/javascript" src="${h.url('/js/excanvas.min.js')}"></script> | |
66 | <![endif]--> |
|
66 | <![endif]--> | |
67 | <script type="text/javascript" src="${h.url('/js/yui.flot.js', ver=c.kallithea_version)}"></script> |
|
67 | <script type="text/javascript" src="${h.url('/js/yui.flot.js', ver=c.kallithea_version)}"></script> | |
68 | <script type="text/javascript" src="${h.url('/js/native.history.js', ver=c.kallithea_version)}"></script> |
|
68 | <script type="text/javascript" src="${h.url('/js/native.history.js', ver=c.kallithea_version)}"></script> | |
69 | <script type="text/javascript" src="${h.url('/js/pyroutes_map.js', ver=c.kallithea_version)}"></script> |
|
69 | <script type="text/javascript" src="${h.url('/js/pyroutes_map.js', ver=c.kallithea_version)}"></script> | |
70 | <script type="text/javascript" src="${h.url('/js/base.js', ver=c.kallithea_version)}"></script> |
|
70 | <script type="text/javascript" src="${h.url('/js/base.js', ver=c.kallithea_version)}"></script> | |
71 | ## EXTRA FOR JS |
|
71 | ## EXTRA FOR JS | |
72 | <%block name="js_extra"/> |
|
72 | <%block name="js_extra"/> | |
73 | <script type="text/javascript"> |
|
73 | <script type="text/javascript"> | |
74 | (function(window,undefined){ |
|
74 | (function(window,undefined){ | |
75 | var History = window.History; // Note: We are using a capital H instead of a lower h |
|
75 | var History = window.History; // Note: We are using a capital H instead of a lower h | |
76 | if ( !History.enabled ) { |
|
76 | if ( !History.enabled ) { | |
77 | // History.js is disabled for this browser. |
|
77 | // History.js is disabled for this browser. | |
78 | // This is because we can optionally choose to support HTML4 browsers or not. |
|
78 | // This is because we can optionally choose to support HTML4 browsers or not. | |
79 | return false; |
|
79 | return false; | |
80 | } |
|
80 | } | |
81 | })(window); |
|
81 | })(window); | |
82 |
|
82 | |||
83 | $(document).ready(function(){ |
|
83 | $(document).ready(function(){ | |
84 | tooltip_activate(); |
|
84 | tooltip_activate(); | |
85 | show_more_event(); |
|
85 | show_more_event(); | |
86 | show_changeset_tooltip(); |
|
86 | show_changeset_tooltip(); | |
87 | // routes registration |
|
87 | // routes registration | |
88 | pyroutes.register('home', "${h.url('home')}", []); |
|
88 | pyroutes.register('home', "${h.url('home')}", []); | |
89 | pyroutes.register('new_gist', "${h.url('new_gist')}", []); |
|
89 | pyroutes.register('new_gist', "${h.url('new_gist')}", []); | |
90 | pyroutes.register('gists', "${h.url('gists')}", []); |
|
90 | pyroutes.register('gists', "${h.url('gists')}", []); | |
91 | pyroutes.register('new_repo', "${h.url('new_repo')}", []); |
|
91 | pyroutes.register('new_repo', "${h.url('new_repo')}", []); | |
92 |
|
92 | |||
93 | pyroutes.register('summary_home', "${h.url('summary_home', repo_name='%(repo_name)s')}", ['repo_name']); |
|
93 | pyroutes.register('summary_home', "${h.url('summary_home', repo_name='%(repo_name)s')}", ['repo_name']); | |
94 | pyroutes.register('changelog_home', "${h.url('changelog_home', repo_name='%(repo_name)s')}", ['repo_name']); |
|
94 | pyroutes.register('changelog_home', "${h.url('changelog_home', repo_name='%(repo_name)s')}", ['repo_name']); | |
95 | pyroutes.register('files_home', "${h.url('files_home', repo_name='%(repo_name)s',revision='%(revision)s',f_path='%(f_path)s')}", ['repo_name', 'revision', 'f_path']); |
|
95 | pyroutes.register('files_home', "${h.url('files_home', repo_name='%(repo_name)s',revision='%(revision)s',f_path='%(f_path)s')}", ['repo_name', 'revision', 'f_path']); | |
96 | pyroutes.register('edit_repo', "${h.url('edit_repo', repo_name='%(repo_name)s')}", ['repo_name']); |
|
96 | pyroutes.register('edit_repo', "${h.url('edit_repo', repo_name='%(repo_name)s')}", ['repo_name']); | |
97 | pyroutes.register('edit_repo_perms', "${h.url('edit_repo_perms', repo_name='%(repo_name)s')}", ['repo_name']); |
|
97 | pyroutes.register('edit_repo_perms', "${h.url('edit_repo_perms', repo_name='%(repo_name)s')}", ['repo_name']); | |
98 | pyroutes.register('pullrequest_home', "${h.url('pullrequest_home', repo_name='%(repo_name)s')}", ['repo_name']); |
|
98 | pyroutes.register('pullrequest_home', "${h.url('pullrequest_home', repo_name='%(repo_name)s')}", ['repo_name']); | |
99 |
|
99 | |||
100 | pyroutes.register('toggle_following', "${h.url('toggle_following')}"); |
|
100 | pyroutes.register('toggle_following', "${h.url('toggle_following')}"); | |
101 | pyroutes.register('changeset_info', "${h.url('changeset_info', repo_name='%(repo_name)s', revision='%(revision)s')}", ['repo_name', 'revision']); |
|
101 | pyroutes.register('changeset_info', "${h.url('changeset_info', repo_name='%(repo_name)s', revision='%(revision)s')}", ['repo_name', 'revision']); | |
102 | pyroutes.register('repo_size', "${h.url('repo_size', repo_name='%(repo_name)s')}", ['repo_name']); |
|
102 | pyroutes.register('repo_size', "${h.url('repo_size', repo_name='%(repo_name)s')}", ['repo_name']); | |
103 | pyroutes.register('changeset_comment_preview', "${h.url('changeset_comment_preview', repo_name='%(repo_name)s')}", ['repo_name']); |
|
103 | pyroutes.register('changeset_comment_preview', "${h.url('changeset_comment_preview', repo_name='%(repo_name)s')}", ['repo_name']); | |
104 | pyroutes.register('repo_refs_data', "${h.url('repo_refs_data', repo_name='%(repo_name)s')}", ['repo_name']); |
|
104 | pyroutes.register('repo_refs_data', "${h.url('repo_refs_data', repo_name='%(repo_name)s')}", ['repo_name']); | |
105 | }); |
|
105 | }); | |
106 | </script> |
|
106 | </script> | |
107 |
|
107 | |||
108 | <%block name="head_extra"/> |
|
108 | <%block name="head_extra"/> | |
109 | </head> |
|
109 | </head> | |
110 | <body id="body"> |
|
110 | <body id="body"> | |
111 | ## IE hacks |
|
111 | ## IE hacks | |
112 | <!--[if IE 7]> |
|
112 | <!--[if IE 7]> | |
113 | <script>$(document.body).addClass('ie7')</script> |
|
113 | <script>$(document.body).addClass('ie7')</script> | |
114 | <![endif]--> |
|
114 | <![endif]--> | |
115 | <!--[if IE 8]> |
|
115 | <!--[if IE 8]> | |
116 | <script>$(document.body).addClass('ie8')</script> |
|
116 | <script>$(document.body).addClass('ie8')</script> | |
117 | <![endif]--> |
|
117 | <![endif]--> | |
118 | <!--[if IE 9]> |
|
118 | <!--[if IE 9]> | |
119 | <script>$(document.body).addClass('ie9')</script> |
|
119 | <script>$(document.body).addClass('ie9')</script> | |
120 | <![endif]--> |
|
120 | <![endif]--> | |
121 |
|
121 | |||
122 | <div id="header"> |
|
122 | <div id="header"> | |
123 | <div id="header-inner" class="title"> |
|
123 | <div id="header-inner" class="title"> | |
124 | <div id="logo"> |
|
124 | <div id="logo"> | |
125 | <a href="${h.url('home')}" style="display: block;"> |
|
125 | <a href="${h.url('home')}" style="display: block;"> | |
126 | <div class="header"> |
|
126 | <div class="header"> | |
127 | <img src="${h.url('/images/kallithea-logo.svg')}" onerror="this.onerror='';this.src='${h.url('/images/kallithea-logo.png')}'" alt="Kallithea"/> |
|
127 | <img src="${h.url('/images/kallithea-logo.svg')}" onerror="this.onerror='';this.src='${h.url('/images/kallithea-logo.png')}'" alt="Kallithea"/> | |
128 | </div> |
|
128 | </div> | |
129 | %if c.site_name: |
|
129 | %if c.site_name: | |
130 | <div class="branding">${c.site_name}</div> |
|
130 | <div class="branding">${c.site_name}</div> | |
131 | %endif |
|
131 | %endif | |
132 | </a> |
|
132 | </a> | |
133 | </div> |
|
133 | </div> | |
134 | <%block name="header_menu"/> |
|
134 | <%block name="header_menu"/> | |
135 | </div> |
|
135 | </div> | |
136 | </div> |
|
136 | </div> | |
137 |
|
137 | |||
138 | ${next.body()} |
|
138 | ${next.body()} | |
139 |
|
139 | |||
140 | %if c.ga_code: |
|
140 | %if c.ga_code: | |
141 | ${h.literal(c.ga_code)} |
|
141 | ${h.literal(c.ga_code)} | |
142 | %endif |
|
142 | %endif | |
143 | </body> |
|
143 | </body> | |
144 | </html> |
|
144 | </html> |
@@ -1,99 +1,99 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('%s Bookmarks') % c.repo_name} |
|
5 | ${_('%s Bookmarks') % c.repo_name} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | <input class="q_filter_box" id="q_filter_bookmarks" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter_bookmarks" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | ${_('Bookmarks')} |
|
13 | ${_('Bookmarks')} | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%block name="header_menu"> |
|
16 | <%block name="header_menu"> | |
17 | ${self.menu('repositories')} |
|
17 | ${self.menu('repositories')} | |
18 | </%block> |
|
18 | </%block> | |
19 |
|
19 | |||
20 | <%def name="main()"> |
|
20 | <%def name="main()"> | |
21 | ${self.repo_context_bar('switch-to')} |
|
21 | ${self.repo_context_bar('switch-to')} | |
22 | <div class="box"> |
|
22 | <div class="box"> | |
23 | <!-- box / title --> |
|
23 | <!-- box / title --> | |
24 | <div class="title"> |
|
24 | <div class="title"> | |
25 | ${self.breadcrumbs()} |
|
25 | ${self.breadcrumbs()} | |
26 | </div> |
|
26 | </div> | |
27 | <!-- end box / title --> |
|
27 | <!-- end box / title --> | |
28 | %if c.repo_bookmarks: |
|
28 | %if c.repo_bookmarks: | |
29 | <div class="info_box" id="compare_bookmarks" style="clear: both;padding: 10px 19px;text-align: right;"><a href="#" class="btn btn-small">${_('Compare Bookmarks')}</a></div> |
|
29 | <div class="info_box" id="compare_bookmarks" style="clear: both;padding: 10px 19px;text-align: right;"><a href="#" class="btn btn-small">${_('Compare Bookmarks')}</a></div> | |
30 | %endif |
|
30 | %endif | |
31 | <div class="table"> |
|
31 | <div class="table"> | |
32 | <%include file='bookmarks_data.html'/> |
|
32 | <%include file='bookmarks_data.html'/> | |
33 | </div> |
|
33 | </div> | |
34 | </div> |
|
34 | </div> | |
35 |
|
35 | |||
36 | <script type="text/javascript"> |
|
36 | <script type="text/javascript"> | |
37 | $('#compare_bookmarks','click',function(e){ |
|
37 | $('#compare_bookmarks','click',function(e){ | |
38 | e.preventDefault(); |
|
38 | e.preventDefault(); | |
39 | var org = $('input[name=compare_org]:checked')[0]; |
|
39 | var org = $('input[name=compare_org]:checked')[0]; | |
40 | var other = $('input[name=compare_other]:checked')[0]; |
|
40 | var other = $('input[name=compare_other]:checked')[0]; | |
41 |
|
41 | |||
42 | if(org && other){ |
|
42 | if(org && other){ | |
43 | var compare_url = "${h.url('compare_url',repo_name=c.repo_name,org_ref_type='book',org_ref_name='__ORG__',other_ref_type='book',other_ref_name='__OTHER__')}"; |
|
43 | var compare_url = "${h.url('compare_url',repo_name=c.repo_name,org_ref_type='book',org_ref_name='__ORG__',other_ref_type='book',other_ref_name='__OTHER__')}"; | |
44 | var u = compare_url.replace('__ORG__',org.value) |
|
44 | var u = compare_url.replace('__ORG__',org.value) | |
45 | .replace('__OTHER__',other.value); |
|
45 | .replace('__OTHER__',other.value); | |
46 | window.location=u; |
|
46 | window.location=u; | |
47 | } |
|
47 | } | |
48 | }); |
|
48 | }); | |
49 |
|
49 | |||
50 | // main table sorting |
|
50 | // main table sorting | |
51 | var myColumnDefs = [ |
|
51 | var myColumnDefs = [ | |
52 | {key:"name",label:"${_('Name')}",sortable:true, |
|
52 | {key:"name",label:"${_('Name')}",sortable:true, | |
53 | sortOptions: { sortFunction: nameSort }}, |
|
53 | sortOptions: { sortFunction: nameSort }}, | |
54 | {key:"date",label:"${_('Date')}",sortable:true, |
|
54 | {key:"date",label:"${_('Date')}",sortable:true, | |
55 | sortOptions: { sortFunction: dateSort }}, |
|
55 | sortOptions: { sortFunction: dateSort }}, | |
56 | {key:"author",label:"${_('Author')}",sortable:true}, |
|
56 | {key:"author",label:"${_('Author')}",sortable:true}, | |
57 | {key:"revision",label:"${_('Revision')}",sortable:true, |
|
57 | {key:"revision",label:"${_('Revision')}",sortable:true, | |
58 | sortOptions: { sortFunction: revisionSort }}, |
|
58 | sortOptions: { sortFunction: revisionSort }}, | |
59 | {key:"compare",label:"${_('Compare')}",sortable:false} |
|
59 | {key:"compare",label:"${_('Compare')}",sortable:false} | |
60 | ]; |
|
60 | ]; | |
61 |
|
61 | |||
62 | var myDataSource = new YAHOO.util.DataSource(YUD.get("bookmarks_data")); |
|
62 | var myDataSource = new YAHOO.util.DataSource(YUD.get("bookmarks_data")); | |
63 |
|
63 | |||
64 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; |
|
64 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; | |
65 |
|
65 | |||
66 | myDataSource.responseSchema = { |
|
66 | myDataSource.responseSchema = { | |
67 | fields: [ |
|
67 | fields: [ | |
68 | {key:"raw_name"}, |
|
68 | {key:"raw_name"}, | |
69 | {key:"name"}, |
|
69 | {key:"name"}, | |
70 | {key:"raw_date"}, |
|
70 | {key:"raw_date"}, | |
71 | {key:"date"}, |
|
71 | {key:"date"}, | |
72 | {key:"author"}, |
|
72 | {key:"author"}, | |
73 | {key:"last_rev_raw"}, |
|
73 | {key:"last_rev_raw"}, | |
74 | {key:"revision"}, |
|
74 | {key:"revision"}, | |
75 | {key:"compare"} |
|
75 | {key:"compare"} | |
76 | ] |
|
76 | ] | |
77 | }; |
|
77 | }; | |
78 |
|
78 | |||
79 | var myDataTable = new YAHOO.widget.DataTable("table_wrap", myColumnDefs, myDataSource, |
|
79 | var myDataTable = new YAHOO.widget.DataTable("table_wrap", myColumnDefs, myDataSource, | |
80 | { |
|
80 | { | |
81 | sortedBy:{key:"name",dir:"asc"}, |
|
81 | sortedBy:{key:"name",dir:"asc"}, | |
82 | MSG_SORTASC:"${_('Click to sort ascending')}", |
|
82 | MSG_SORTASC:"${_('Click to sort ascending')}", | |
83 | MSG_SORTDESC:"${_('Click to sort descending')}", |
|
83 | MSG_SORTDESC:"${_('Click to sort descending')}", | |
84 | MSG_EMPTY:"${_('No records found.')}", |
|
84 | MSG_EMPTY:"${_('No records found.')}", | |
85 | MSG_ERROR:"${_('Data error.')}", |
|
85 | MSG_ERROR:"${_('Data error.')}", | |
86 | MSG_LOADING:"${_('Loading...')}" |
|
86 | MSG_LOADING:"${_('Loading...')}" | |
87 | } |
|
87 | } | |
88 | ); |
|
88 | ); | |
89 | myDataTable.subscribe('postRenderEvent',function(oArgs) { |
|
89 | myDataTable.subscribe('postRenderEvent',function(oArgs) { | |
90 | tooltip_activate(); |
|
90 | tooltip_activate(); | |
91 | var func = function(node){ |
|
91 | var func = function(node){ | |
92 | return node.parentNode.parentNode.parentNode.parentNode.parentNode; |
|
92 | return node.parentNode.parentNode.parentNode.parentNode.parentNode; | |
93 | } |
|
93 | } | |
94 | q_filter('q_filter_bookmarks',$('div.table tr td .logbooks .booktag a'),func); |
|
94 | q_filter('q_filter_bookmarks',$('div.table tr td .logbooks .booktag a'),func); | |
95 | }); |
|
95 | }); | |
96 |
|
96 | |||
97 | </script> |
|
97 | </script> | |
98 |
|
98 | |||
99 | </%def> |
|
99 | </%def> |
@@ -1,99 +1,99 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('%s Branches') % c.repo_name} |
|
5 | ${_('%s Branches') % c.repo_name} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | <input class="q_filter_box" id="q_filter_branches" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter_branches" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | ${_('Branches')} |
|
13 | ${_('Branches')} | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%block name="header_menu"> |
|
16 | <%block name="header_menu"> | |
17 | ${self.menu('repositories')} |
|
17 | ${self.menu('repositories')} | |
18 | </%block> |
|
18 | </%block> | |
19 |
|
19 | |||
20 | <%def name="main()"> |
|
20 | <%def name="main()"> | |
21 | ${self.repo_context_bar('switch-to')} |
|
21 | ${self.repo_context_bar('switch-to')} | |
22 | <div class="box"> |
|
22 | <div class="box"> | |
23 | <!-- box / title --> |
|
23 | <!-- box / title --> | |
24 | <div class="title"> |
|
24 | <div class="title"> | |
25 | ${self.breadcrumbs()} |
|
25 | ${self.breadcrumbs()} | |
26 | </div> |
|
26 | </div> | |
27 | <!-- end box / title --> |
|
27 | <!-- end box / title --> | |
28 | %if c.repo_branches: |
|
28 | %if c.repo_branches: | |
29 | <div class="info_box" id="compare_branches" style="clear: both;padding: 10px 19px;text-align: right;"><a href="#" class="btn btn-small">${_('Compare Branches')}</a></div> |
|
29 | <div class="info_box" id="compare_branches" style="clear: both;padding: 10px 19px;text-align: right;"><a href="#" class="btn btn-small">${_('Compare Branches')}</a></div> | |
30 | %endif |
|
30 | %endif | |
31 | <div class="table"> |
|
31 | <div class="table"> | |
32 | <%include file='branches_data.html'/> |
|
32 | <%include file='branches_data.html'/> | |
33 | </div> |
|
33 | </div> | |
34 | </div> |
|
34 | </div> | |
35 |
|
35 | |||
36 | <script type="text/javascript"> |
|
36 | <script type="text/javascript"> | |
37 | $('#compare_branches','click',function(e){ |
|
37 | $('#compare_branches','click',function(e){ | |
38 | e.preventDefault(); |
|
38 | e.preventDefault(); | |
39 | var org = $('input[name=compare_org]:checked')[0]; |
|
39 | var org = $('input[name=compare_org]:checked')[0]; | |
40 | var other = $('input[name=compare_other]:checked')[0]; |
|
40 | var other = $('input[name=compare_other]:checked')[0]; | |
41 |
|
41 | |||
42 | if(org && other){ |
|
42 | if(org && other){ | |
43 | var compare_url = "${h.url('compare_url',repo_name=c.repo_name,org_ref_type='branch',org_ref_name='__ORG__',other_ref_type='branch',other_ref_name='__OTHER__')}"; |
|
43 | var compare_url = "${h.url('compare_url',repo_name=c.repo_name,org_ref_type='branch',org_ref_name='__ORG__',other_ref_type='branch',other_ref_name='__OTHER__')}"; | |
44 | var u = compare_url.replace('__ORG__',org.value) |
|
44 | var u = compare_url.replace('__ORG__',org.value) | |
45 | .replace('__OTHER__',other.value); |
|
45 | .replace('__OTHER__',other.value); | |
46 | window.location=u; |
|
46 | window.location=u; | |
47 | } |
|
47 | } | |
48 | }); |
|
48 | }); | |
49 |
|
49 | |||
50 | // main table sorting |
|
50 | // main table sorting | |
51 | var myColumnDefs = [ |
|
51 | var myColumnDefs = [ | |
52 | {key:"name",label:"${_('Name')}",sortable:true, |
|
52 | {key:"name",label:"${_('Name')}",sortable:true, | |
53 | sortOptions: { sortFunction: nameSort }}, |
|
53 | sortOptions: { sortFunction: nameSort }}, | |
54 | {key:"date",label:"${_('Date')}",sortable:true, |
|
54 | {key:"date",label:"${_('Date')}",sortable:true, | |
55 | sortOptions: { sortFunction: dateSort }}, |
|
55 | sortOptions: { sortFunction: dateSort }}, | |
56 | {key:"author",label:"${_('Author')}",sortable:true}, |
|
56 | {key:"author",label:"${_('Author')}",sortable:true}, | |
57 | {key:"revision",label:"${_('Revision')}",sortable:true, |
|
57 | {key:"revision",label:"${_('Revision')}",sortable:true, | |
58 | sortOptions: { sortFunction: revisionSort }}, |
|
58 | sortOptions: { sortFunction: revisionSort }}, | |
59 | {key:"compare",label:"${_('Compare')}",sortable:false} |
|
59 | {key:"compare",label:"${_('Compare')}",sortable:false} | |
60 | ]; |
|
60 | ]; | |
61 |
|
61 | |||
62 | var myDataSource = new YAHOO.util.DataSource(YUD.get("branches_data")); |
|
62 | var myDataSource = new YAHOO.util.DataSource(YUD.get("branches_data")); | |
63 |
|
63 | |||
64 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; |
|
64 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; | |
65 |
|
65 | |||
66 | myDataSource.responseSchema = { |
|
66 | myDataSource.responseSchema = { | |
67 | fields: [ |
|
67 | fields: [ | |
68 | {key:"raw_name"}, |
|
68 | {key:"raw_name"}, | |
69 | {key:"name"}, |
|
69 | {key:"name"}, | |
70 | {key:"raw_date"}, |
|
70 | {key:"raw_date"}, | |
71 | {key:"date"}, |
|
71 | {key:"date"}, | |
72 | {key:"author"}, |
|
72 | {key:"author"}, | |
73 | {key:"last_rev_raw"}, |
|
73 | {key:"last_rev_raw"}, | |
74 | {key:"revision"}, |
|
74 | {key:"revision"}, | |
75 | {key:"compare"} |
|
75 | {key:"compare"} | |
76 | ] |
|
76 | ] | |
77 | }; |
|
77 | }; | |
78 |
|
78 | |||
79 | var myDataTable = new YAHOO.widget.DataTable("table_wrap", myColumnDefs, myDataSource, |
|
79 | var myDataTable = new YAHOO.widget.DataTable("table_wrap", myColumnDefs, myDataSource, | |
80 | { |
|
80 | { | |
81 | sortedBy:{key:"name",dir:"asc"}, |
|
81 | sortedBy:{key:"name",dir:"asc"}, | |
82 | MSG_SORTASC:"${_('Click to sort ascending')}", |
|
82 | MSG_SORTASC:"${_('Click to sort ascending')}", | |
83 | MSG_SORTDESC:"${_('Click to sort descending')}", |
|
83 | MSG_SORTDESC:"${_('Click to sort descending')}", | |
84 | MSG_EMPTY:"${_('No records found.')}", |
|
84 | MSG_EMPTY:"${_('No records found.')}", | |
85 | MSG_ERROR:"${_('Data error.')}", |
|
85 | MSG_ERROR:"${_('Data error.')}", | |
86 | MSG_LOADING:"${_('Loading...')}" |
|
86 | MSG_LOADING:"${_('Loading...')}" | |
87 | } |
|
87 | } | |
88 | ); |
|
88 | ); | |
89 | myDataTable.subscribe('postRenderEvent',function(oArgs) { |
|
89 | myDataTable.subscribe('postRenderEvent',function(oArgs) { | |
90 | tooltip_activate(); |
|
90 | tooltip_activate(); | |
91 | var func = function(node){ |
|
91 | var func = function(node){ | |
92 | return node.parentNode.parentNode.parentNode.parentNode.parentNode; |
|
92 | return node.parentNode.parentNode.parentNode.parentNode.parentNode; | |
93 | } |
|
93 | } | |
94 | q_filter('q_filter_branches',$('div.table tr td .logtags .branchtag a'),func); |
|
94 | q_filter('q_filter_branches',$('div.table tr td .logtags .branchtag a'),func); | |
95 | }); |
|
95 | }); | |
96 |
|
96 | |||
97 | </script> |
|
97 | </script> | |
98 |
|
98 | |||
99 | </%def> |
|
99 | </%def> |
@@ -1,297 +1,297 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | <%inherit file="/base/base.html"/> |
|
3 | <%inherit file="/base/base.html"/> | |
4 |
|
4 | |||
5 |
<% |
|
5 | <%block name="title"> | |
6 | ${_('%s Changelog') % c.repo_name} |
|
6 | ${_('%s Changelog') % c.repo_name} | |
7 | %if c.changelog_for_path: |
|
7 | %if c.changelog_for_path: | |
8 | /${c.changelog_for_path} |
|
8 | /${c.changelog_for_path} | |
9 | %endif |
|
9 | %endif | |
10 | %if c.site_name: |
|
10 | %if c.site_name: | |
11 | · ${c.site_name} |
|
11 | · ${c.site_name} | |
12 | %endif |
|
12 | %endif | |
13 | </%def> |
|
13 | </%block> | |
14 |
|
14 | |||
15 | <%def name="breadcrumbs_links()"> |
|
15 | <%def name="breadcrumbs_links()"> | |
16 | <% size = c.size if c.size <= c.total_cs else c.total_cs %> |
|
16 | <% size = c.size if c.size <= c.total_cs else c.total_cs %> | |
17 | ${_('Changelog')} |
|
17 | ${_('Changelog')} | |
18 | %if c.changelog_for_path: |
|
18 | %if c.changelog_for_path: | |
19 | - /${c.changelog_for_path} |
|
19 | - /${c.changelog_for_path} | |
20 | %endif |
|
20 | %endif | |
21 | %if c.revision: |
|
21 | %if c.revision: | |
22 | @ ${h.short_id(c.first_revision.raw_id)} |
|
22 | @ ${h.short_id(c.first_revision.raw_id)} | |
23 | %endif |
|
23 | %endif | |
24 | - ${ungettext('showing %d out of %d revision', 'showing %d out of %d revisions', size) % (size, c.total_cs)} |
|
24 | - ${ungettext('showing %d out of %d revision', 'showing %d out of %d revisions', size) % (size, c.total_cs)} | |
25 | </%def> |
|
25 | </%def> | |
26 |
|
26 | |||
27 | <%block name="header_menu"> |
|
27 | <%block name="header_menu"> | |
28 | ${self.menu('repositories')} |
|
28 | ${self.menu('repositories')} | |
29 | </%block> |
|
29 | </%block> | |
30 |
|
30 | |||
31 | <%def name="main()"> |
|
31 | <%def name="main()"> | |
32 | ${self.repo_context_bar('changelog', c.first_revision.raw_id if c.first_revision else None)} |
|
32 | ${self.repo_context_bar('changelog', c.first_revision.raw_id if c.first_revision else None)} | |
33 | <div class="box"> |
|
33 | <div class="box"> | |
34 | <!-- box / title --> |
|
34 | <!-- box / title --> | |
35 | <div class="title"> |
|
35 | <div class="title"> | |
36 | ${self.breadcrumbs()} |
|
36 | ${self.breadcrumbs()} | |
37 | </div> |
|
37 | </div> | |
38 | <div class="table"> |
|
38 | <div class="table"> | |
39 | % if c.pagination: |
|
39 | % if c.pagination: | |
40 | <div> |
|
40 | <div> | |
41 | <div style="overflow:auto; display:${'none' if c.changelog_for_path else ''}"> |
|
41 | <div style="overflow:auto; display:${'none' if c.changelog_for_path else ''}"> | |
42 | <div class="container_header"> |
|
42 | <div class="container_header"> | |
43 | <div style="float:left; margin-left:20px;"> |
|
43 | <div style="float:left; margin-left:20px;"> | |
44 | ${h.form(h.url.current(),method='get')} |
|
44 | ${h.form(h.url.current(),method='get')} | |
45 | ${h.submit('set',_('Show'),class_="btn btn-small")} |
|
45 | ${h.submit('set',_('Show'),class_="btn btn-small")} | |
46 | ${h.text('size',size=3,value=c.size)} |
|
46 | ${h.text('size',size=3,value=c.size)} | |
47 | ${_('revisions')} |
|
47 | ${_('revisions')} | |
48 | %if c.branch_name: |
|
48 | %if c.branch_name: | |
49 | ${h.hidden('branch', c.branch_name)} |
|
49 | ${h.hidden('branch', c.branch_name)} | |
50 | %endif |
|
50 | %endif | |
51 | ${h.end_form()} |
|
51 | ${h.end_form()} | |
52 | </div> |
|
52 | </div> | |
53 | <div style="float: right; margin: 0px 0px 0px 4px"> |
|
53 | <div style="float: right; margin: 0px 0px 0px 4px"> | |
54 | <a href="#" class="btn btn-small" id="rev_range_container" style="display:none"></a> |
|
54 | <a href="#" class="btn btn-small" id="rev_range_container" style="display:none"></a> | |
55 | <a href="#" class="btn btn-small" id="rev_range_clear" style="display:none">${_('Clear selection')}</a> |
|
55 | <a href="#" class="btn btn-small" id="rev_range_clear" style="display:none">${_('Clear selection')}</a> | |
56 | %if c.revision: |
|
56 | %if c.revision: | |
57 | <a class="btn btn-small" href="${h.url('changelog_home', repo_name=c.repo_name)}"> |
|
57 | <a class="btn btn-small" href="${h.url('changelog_home', repo_name=c.repo_name)}"> | |
58 | ${_('Go to tip of repository')} |
|
58 | ${_('Go to tip of repository')} | |
59 | </a> |
|
59 | </a> | |
60 | %endif |
|
60 | %endif | |
61 | %if c.db_repo.fork: |
|
61 | %if c.db_repo.fork: | |
62 | <a id="compare_fork" |
|
62 | <a id="compare_fork" | |
63 | title="${_('Compare fork with %s' % c.db_repo.fork.repo_name)}" |
|
63 | title="${_('Compare fork with %s' % c.db_repo.fork.repo_name)}" | |
64 | href="${h.url('compare_url',repo_name=c.db_repo.fork.repo_name,org_ref_type=c.db_repo.landing_rev[0],org_ref_name=c.db_repo.landing_rev[1],other_repo=c.repo_name,other_ref_type='branch' if request.GET.get('branch') else c.db_repo.landing_rev[0],other_ref_name=request.GET.get('branch') or c.db_repo.landing_rev[1], merge=1)}" |
|
64 | href="${h.url('compare_url',repo_name=c.db_repo.fork.repo_name,org_ref_type=c.db_repo.landing_rev[0],org_ref_name=c.db_repo.landing_rev[1],other_repo=c.repo_name,other_ref_type='branch' if request.GET.get('branch') else c.db_repo.landing_rev[0],other_ref_name=request.GET.get('branch') or c.db_repo.landing_rev[1], merge=1)}" | |
65 | class="btn btn-small"><i class="icon-git-compare"></i> ${_('Compare fork with parent repo (%s)' % c.db_repo.fork.repo_name)}</a> |
|
65 | class="btn btn-small"><i class="icon-git-compare"></i> ${_('Compare fork with parent repo (%s)' % c.db_repo.fork.repo_name)}</a> | |
66 | %endif |
|
66 | %endif | |
67 | ## text and href of open_new_pr is controlled from javascript |
|
67 | ## text and href of open_new_pr is controlled from javascript | |
68 | <a id="open_new_pr" class="btn btn-small"></a> |
|
68 | <a id="open_new_pr" class="btn btn-small"></a> | |
69 | ${_("Branch filter:")} ${h.select('branch_filter',c.branch_name,c.branch_filters)} |
|
69 | ${_("Branch filter:")} ${h.select('branch_filter',c.branch_name,c.branch_filters)} | |
70 | </div> |
|
70 | </div> | |
71 | </div> |
|
71 | </div> | |
72 | </div> |
|
72 | </div> | |
73 |
|
73 | |||
74 | <div id="changelog" style="clear:both"> |
|
74 | <div id="changelog" style="clear:both"> | |
75 |
|
75 | |||
76 | <div id="graph_nodes"> |
|
76 | <div id="graph_nodes"> | |
77 | <canvas id="graph_canvas"></canvas> |
|
77 | <canvas id="graph_canvas"></canvas> | |
78 | </div> |
|
78 | </div> | |
79 | <div id="graph_content" style="${'margin: 0px' if c.changelog_for_path else ''}"> |
|
79 | <div id="graph_content" style="${'margin: 0px' if c.changelog_for_path else ''}"> | |
80 |
|
80 | |||
81 | <table id="changesets"> |
|
81 | <table id="changesets"> | |
82 | <tbody> |
|
82 | <tbody> | |
83 | %for cnt,cs in enumerate(c.pagination): |
|
83 | %for cnt,cs in enumerate(c.pagination): | |
84 | <tr id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}"> |
|
84 | <tr id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}"> | |
85 | <td class="checkbox"> |
|
85 | <td class="checkbox"> | |
86 | %if c.changelog_for_path: |
|
86 | %if c.changelog_for_path: | |
87 | ${h.checkbox(cs.raw_id,class_="changeset_range", disabled="disabled")} |
|
87 | ${h.checkbox(cs.raw_id,class_="changeset_range", disabled="disabled")} | |
88 | %else: |
|
88 | %else: | |
89 | ${h.checkbox(cs.raw_id,class_="changeset_range")} |
|
89 | ${h.checkbox(cs.raw_id,class_="changeset_range")} | |
90 | %endif |
|
90 | %endif | |
91 | <td class="status"> |
|
91 | <td class="status"> | |
92 | %if c.statuses.get(cs.raw_id): |
|
92 | %if c.statuses.get(cs.raw_id): | |
93 | <div class="changeset-status-ico"> |
|
93 | <div class="changeset-status-ico"> | |
94 | %if c.statuses.get(cs.raw_id)[2]: |
|
94 | %if c.statuses.get(cs.raw_id)[2]: | |
95 | <a class="tooltip" title="${_('Changeset status: %s\nClick to open associated pull request #%s') % (h.changeset_status_lbl(c.statuses.get(cs.raw_id)[0]), c.statuses.get(cs.raw_id)[2])}" href="${h.url('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}"> |
|
95 | <a class="tooltip" title="${_('Changeset status: %s\nClick to open associated pull request #%s') % (h.changeset_status_lbl(c.statuses.get(cs.raw_id)[0]), c.statuses.get(cs.raw_id)[2])}" href="${h.url('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}"> | |
96 | <i class="icon-circle changeset-status-${c.statuses.get(cs.raw_id)[0]}"></i> |
|
96 | <i class="icon-circle changeset-status-${c.statuses.get(cs.raw_id)[0]}"></i> | |
97 | </a> |
|
97 | </a> | |
98 | %else: |
|
98 | %else: | |
99 | <a class="tooltip" title="${_('Changeset status: %s') % h.changeset_status_lbl(c.statuses.get(cs.raw_id)[0])}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}"> |
|
99 | <a class="tooltip" title="${_('Changeset status: %s') % h.changeset_status_lbl(c.statuses.get(cs.raw_id)[0])}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}"> | |
100 | <i class="icon-circle changeset-status-${c.statuses.get(cs.raw_id)[0]}"></i> |
|
100 | <i class="icon-circle changeset-status-${c.statuses.get(cs.raw_id)[0]}"></i> | |
101 | </a> |
|
101 | </a> | |
102 | %endif |
|
102 | %endif | |
103 | </div> |
|
103 | </div> | |
104 | %endif |
|
104 | %endif | |
105 | </td> |
|
105 | </td> | |
106 | <td class="author"> |
|
106 | <td class="author"> | |
107 | ${h.gravatar(h.email_or_none(cs.author), size=16)} |
|
107 | ${h.gravatar(h.email_or_none(cs.author), size=16)} | |
108 | <span title="${cs.author}" class="user">${h.shorter(h.person(cs.author),22)}</span> |
|
108 | <span title="${cs.author}" class="user">${h.shorter(h.person(cs.author),22)}</span> | |
109 | </td> |
|
109 | </td> | |
110 | <td class="hash" style="width:${len(h.show_id(cs))*6.5}px"> |
|
110 | <td class="hash" style="width:${len(h.show_id(cs))*6.5}px"> | |
111 | <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"> |
|
111 | <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"> | |
112 | <span class="changeset_hash">${h.show_id(cs)}</span> |
|
112 | <span class="changeset_hash">${h.show_id(cs)}</span> | |
113 | </a> |
|
113 | </a> | |
114 | </td> |
|
114 | </td> | |
115 | <td class="date"> |
|
115 | <td class="date"> | |
116 | <div class="date">${h.age(cs.date,True)}</div> |
|
116 | <div class="date">${h.age(cs.date,True)}</div> | |
117 | </td> |
|
117 | </td> | |
118 | <td class="expand_commit" commit_id="${cs.raw_id}" title="${_('Expand commit message')}"> |
|
118 | <td class="expand_commit" commit_id="${cs.raw_id}" title="${_('Expand commit message')}"> | |
119 | <i class="icon-align-left" style="color:#999"></i> |
|
119 | <i class="icon-align-left" style="color:#999"></i> | |
120 | </td> |
|
120 | </td> | |
121 | <td class="mid"> |
|
121 | <td class="mid"> | |
122 | <div class="log-container"> |
|
122 | <div class="log-container"> | |
123 | <div class="message" id="C-${cs.raw_id}">${h.urlify_commit(cs.message, c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div> |
|
123 | <div class="message" id="C-${cs.raw_id}">${h.urlify_commit(cs.message, c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div> | |
124 | <div class="extra-container"> |
|
124 | <div class="extra-container"> | |
125 | %if c.comments.get(cs.raw_id): |
|
125 | %if c.comments.get(cs.raw_id): | |
126 | <div class="comments-container"> |
|
126 | <div class="comments-container"> | |
127 | <div class="comments-cnt" title="${_('Changeset has comments')}"> |
|
127 | <div class="comments-cnt" title="${_('Changeset has comments')}"> | |
128 | <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}"> |
|
128 | <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}"> | |
129 | ${len(c.comments[cs.raw_id])} |
|
129 | ${len(c.comments[cs.raw_id])} | |
130 | <i class="icon-comment-discussion"></i> |
|
130 | <i class="icon-comment-discussion"></i> | |
131 | </a> |
|
131 | </a> | |
132 | </div> |
|
132 | </div> | |
133 | </div> |
|
133 | </div> | |
134 | %endif |
|
134 | %endif | |
135 | %if h.is_hg(c.db_repo_scm_instance): |
|
135 | %if h.is_hg(c.db_repo_scm_instance): | |
136 | %for book in cs.bookmarks: |
|
136 | %for book in cs.bookmarks: | |
137 | <div class="booktag" title="${_('Bookmark %s') % book}"> |
|
137 | <div class="booktag" title="${_('Bookmark %s') % book}"> | |
138 | ${h.link_to(book,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} |
|
138 | ${h.link_to(book,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} | |
139 | </div> |
|
139 | </div> | |
140 | %endfor |
|
140 | %endfor | |
141 | %endif |
|
141 | %endif | |
142 | %for tag in cs.tags: |
|
142 | %for tag in cs.tags: | |
143 | <div class="tagtag" title="${_('Tag %s') % tag}"> |
|
143 | <div class="tagtag" title="${_('Tag %s') % tag}"> | |
144 | ${h.link_to(tag,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} |
|
144 | ${h.link_to(tag,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} | |
145 | </div> |
|
145 | </div> | |
146 | %endfor |
|
146 | %endfor | |
147 | %if (not c.branch_name) and cs.branch: |
|
147 | %if (not c.branch_name) and cs.branch: | |
148 | <div class="branchtag" title="${_('Branch %s' % cs.branch)}"> |
|
148 | <div class="branchtag" title="${_('Branch %s' % cs.branch)}"> | |
149 | ${h.link_to(cs.branch,h.url('changelog_home',repo_name=c.repo_name,branch=cs.branch))} |
|
149 | ${h.link_to(cs.branch,h.url('changelog_home',repo_name=c.repo_name,branch=cs.branch))} | |
150 | </div> |
|
150 | </div> | |
151 | %endif |
|
151 | %endif | |
152 | </div> |
|
152 | </div> | |
153 | </div> |
|
153 | </div> | |
154 | </td> |
|
154 | </td> | |
155 | </tr> |
|
155 | </tr> | |
156 | %endfor |
|
156 | %endfor | |
157 | </tbody> |
|
157 | </tbody> | |
158 | </table> |
|
158 | </table> | |
159 |
|
159 | |||
160 | </div> |
|
160 | </div> | |
161 |
|
161 | |||
162 | <div class="pagination-wh pagination-left"> |
|
162 | <div class="pagination-wh pagination-left"> | |
163 | ${c.pagination.pager('$link_previous ~2~ $link_next')} |
|
163 | ${c.pagination.pager('$link_previous ~2~ $link_next')} | |
164 | </div> |
|
164 | </div> | |
165 | </div> |
|
165 | </div> | |
166 | </div> |
|
166 | </div> | |
167 |
|
167 | |||
168 | <script type="text/javascript" src="${h.url('/js/graph.js', ver=c.kallithea_version)}"></script> |
|
168 | <script type="text/javascript" src="${h.url('/js/graph.js', ver=c.kallithea_version)}"></script> | |
169 | <script type="text/javascript"> |
|
169 | <script type="text/javascript"> | |
170 | $(document).ready(function(){ |
|
170 | $(document).ready(function(){ | |
171 | //Monitor range checkboxes and build a link to changesets ranges |
|
171 | //Monitor range checkboxes and build a link to changesets ranges | |
172 | var checkboxes = YUD.getElementsByClassName('changeset_range'); |
|
172 | var checkboxes = YUD.getElementsByClassName('changeset_range'); | |
173 | // register extra routes needed for this view |
|
173 | // register extra routes needed for this view | |
174 | pyroutes.register('changeset_home', "${h.url('changeset_home', repo_name='%(repo_name)s', revision='%(revision)s')}", ['repo_name', 'revision']); |
|
174 | pyroutes.register('changeset_home', "${h.url('changeset_home', repo_name='%(repo_name)s', revision='%(revision)s')}", ['repo_name', 'revision']); | |
175 |
|
175 | |||
176 | var checkbox_checker = function(e){ |
|
176 | var checkbox_checker = function(e){ | |
177 | var checked_checkboxes = []; |
|
177 | var checked_checkboxes = []; | |
178 | for (pos in checkboxes){ |
|
178 | for (pos in checkboxes){ | |
179 | if(checkboxes[pos].checked){ |
|
179 | if(checkboxes[pos].checked){ | |
180 | checked_checkboxes.push(checkboxes[pos]); |
|
180 | checked_checkboxes.push(checkboxes[pos]); | |
181 | } |
|
181 | } | |
182 | } |
|
182 | } | |
183 | if(YUD.get('open_new_pr')){ |
|
183 | if(YUD.get('open_new_pr')){ | |
184 | if(checked_checkboxes.length>1){ |
|
184 | if(checked_checkboxes.length>1){ | |
185 | YUD.setStyle('open_new_pr','display','none'); |
|
185 | YUD.setStyle('open_new_pr','display','none'); | |
186 | } else { |
|
186 | } else { | |
187 | YUD.setStyle('open_new_pr','display',''); |
|
187 | YUD.setStyle('open_new_pr','display',''); | |
188 | if(checked_checkboxes.length>0){ |
|
188 | if(checked_checkboxes.length>0){ | |
189 | YUD.get('open_new_pr').innerHTML = _TM['Open New Pull Request for Selected Changesets']; |
|
189 | YUD.get('open_new_pr').innerHTML = _TM['Open New Pull Request for Selected Changesets']; | |
190 | }else{ |
|
190 | }else{ | |
191 | YUD.get('open_new_pr').innerHTML = _TM['Open New Pull Request']; |
|
191 | YUD.get('open_new_pr').innerHTML = _TM['Open New Pull Request']; | |
192 | } |
|
192 | } | |
193 | } |
|
193 | } | |
194 | } |
|
194 | } | |
195 |
|
195 | |||
196 | if(checked_checkboxes.length>0){ |
|
196 | if(checked_checkboxes.length>0){ | |
197 | var rev_end = checked_checkboxes[0].name; |
|
197 | var rev_end = checked_checkboxes[0].name; | |
198 | var rev_start = checked_checkboxes[checked_checkboxes.length-1].name; |
|
198 | var rev_start = checked_checkboxes[checked_checkboxes.length-1].name; | |
199 | var url = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}', |
|
199 | var url = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}', | |
200 | 'revision': rev_start+'...'+rev_end}); |
|
200 | 'revision': rev_start+'...'+rev_end}); | |
201 |
|
201 | |||
202 | var link = (rev_start == rev_end) |
|
202 | var link = (rev_start == rev_end) | |
203 | ? _TM['Show Selected Changeset __S'] |
|
203 | ? _TM['Show Selected Changeset __S'] | |
204 | : _TM['Show Selected Changesets __S → __E']; |
|
204 | : _TM['Show Selected Changesets __S → __E']; | |
205 |
|
205 | |||
206 | link = link.replace('__S',rev_start.substr(0,6)); |
|
206 | link = link.replace('__S',rev_start.substr(0,6)); | |
207 | link = link.replace('__E',rev_end.substr(0,6)); |
|
207 | link = link.replace('__E',rev_end.substr(0,6)); | |
208 | YUD.get('rev_range_container').href = url; |
|
208 | YUD.get('rev_range_container').href = url; | |
209 | YUD.get('rev_range_container').innerHTML = link; |
|
209 | YUD.get('rev_range_container').innerHTML = link; | |
210 | YUD.setStyle('rev_range_container','display',''); |
|
210 | YUD.setStyle('rev_range_container','display',''); | |
211 | YUD.setStyle('rev_range_clear','display',''); |
|
211 | YUD.setStyle('rev_range_clear','display',''); | |
212 |
|
212 | |||
213 | YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home', |
|
213 | YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home', | |
214 | {'repo_name': '${c.repo_name}', |
|
214 | {'repo_name': '${c.repo_name}', | |
215 | 'rev_start': rev_start, |
|
215 | 'rev_start': rev_start, | |
216 | 'rev_end': rev_end}) |
|
216 | 'rev_end': rev_end}) | |
217 |
|
217 | |||
218 | YUD.setStyle('compare_fork','display','none'); |
|
218 | YUD.setStyle('compare_fork','display','none'); | |
219 | }else{ |
|
219 | }else{ | |
220 | YUD.setStyle('rev_range_container','display','none'); |
|
220 | YUD.setStyle('rev_range_container','display','none'); | |
221 | YUD.setStyle('rev_range_clear','display','none'); |
|
221 | YUD.setStyle('rev_range_clear','display','none'); | |
222 | %if c.revision: |
|
222 | %if c.revision: | |
223 | YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home', |
|
223 | YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home', | |
224 | {'repo_name': '${c.repo_name}', |
|
224 | {'repo_name': '${c.repo_name}', | |
225 | 'rev_end':'${c.first_revision.raw_id}'}); |
|
225 | 'rev_end':'${c.first_revision.raw_id}'}); | |
226 | %else: |
|
226 | %else: | |
227 | YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home', |
|
227 | YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home', | |
228 | {'repo_name': '${c.repo_name}', |
|
228 | {'repo_name': '${c.repo_name}', | |
229 | 'branch':'${c.first_revision.branch}'}); |
|
229 | 'branch':'${c.first_revision.branch}'}); | |
230 | %endif |
|
230 | %endif | |
231 | YUD.setStyle('compare_fork','display',''); |
|
231 | YUD.setStyle('compare_fork','display',''); | |
232 | } |
|
232 | } | |
233 | }; |
|
233 | }; | |
234 | checkbox_checker(); |
|
234 | checkbox_checker(); | |
235 | YUE.on(checkboxes,'click', checkbox_checker); |
|
235 | YUE.on(checkboxes,'click', checkbox_checker); | |
236 |
|
236 | |||
237 | YUE.on('rev_range_clear','click',function(e){ |
|
237 | YUE.on('rev_range_clear','click',function(e){ | |
238 | for (var i=0; i<checkboxes.length; i++){ |
|
238 | for (var i=0; i<checkboxes.length; i++){ | |
239 | var cb = checkboxes[i]; |
|
239 | var cb = checkboxes[i]; | |
240 | cb.checked = false; |
|
240 | cb.checked = false; | |
241 | } |
|
241 | } | |
242 | checkbox_checker(); |
|
242 | checkbox_checker(); | |
243 | YUE.preventDefault(e); |
|
243 | YUE.preventDefault(e); | |
244 | }); |
|
244 | }); | |
245 |
|
245 | |||
246 | var $msgs = $('.message'); |
|
246 | var $msgs = $('.message'); | |
247 | // get first element height |
|
247 | // get first element height | |
248 | var el = $('#graph_content .container')[0]; |
|
248 | var el = $('#graph_content .container')[0]; | |
249 | var row_h = el.clientHeight; |
|
249 | var row_h = el.clientHeight; | |
250 | $msgs.each(function() { |
|
250 | $msgs.each(function() { | |
251 | var m = this; |
|
251 | var m = this; | |
252 |
|
252 | |||
253 | var h = m.clientHeight; |
|
253 | var h = m.clientHeight; | |
254 | if(h > row_h){ |
|
254 | if(h > row_h){ | |
255 | var offset = row_h - (h+12); |
|
255 | var offset = row_h - (h+12); | |
256 | $(m.nextElementSibling).css('display', 'block'); |
|
256 | $(m.nextElementSibling).css('display', 'block'); | |
257 | $(m.nextElementSibling).css('margin-top', offset+'px'); |
|
257 | $(m.nextElementSibling).css('margin-top', offset+'px'); | |
258 | } |
|
258 | } | |
259 | }); |
|
259 | }); | |
260 |
|
260 | |||
261 | $('.expand_commit').on('click',function(e){ |
|
261 | $('.expand_commit').on('click',function(e){ | |
262 | var cid = $(this).attr('commit_id'); |
|
262 | var cid = $(this).attr('commit_id'); | |
263 | $('#C-'+cid).toggleClass('expanded'); |
|
263 | $('#C-'+cid).toggleClass('expanded'); | |
264 |
|
264 | |||
265 | //redraw the graph, r and jsdata are bound outside function |
|
265 | //redraw the graph, r and jsdata are bound outside function | |
266 | r.render(jsdata,100); |
|
266 | r.render(jsdata,100); | |
267 | }); |
|
267 | }); | |
268 |
|
268 | |||
269 | // change branch filter |
|
269 | // change branch filter | |
270 | $("#branch_filter").select2({ |
|
270 | $("#branch_filter").select2({ | |
271 | dropdownAutoWidth: true, |
|
271 | dropdownAutoWidth: true, | |
272 | minimumInputLength: 1 |
|
272 | minimumInputLength: 1 | |
273 | }); |
|
273 | }); | |
274 |
|
274 | |||
275 | $("#branch_filter").change(function(e){ |
|
275 | $("#branch_filter").change(function(e){ | |
276 | var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value; |
|
276 | var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value; | |
277 | if(selected_branch != ''){ |
|
277 | if(selected_branch != ''){ | |
278 | window.location = pyroutes.url('changelog_home', {'repo_name': '${c.repo_name}', |
|
278 | window.location = pyroutes.url('changelog_home', {'repo_name': '${c.repo_name}', | |
279 | 'branch': selected_branch}); |
|
279 | 'branch': selected_branch}); | |
280 | }else{ |
|
280 | }else{ | |
281 | window.location = pyroutes.url('changelog_home', {'repo_name': '${c.repo_name}'}); |
|
281 | window.location = pyroutes.url('changelog_home', {'repo_name': '${c.repo_name}'}); | |
282 | } |
|
282 | } | |
283 | $("#changelog").hide(); |
|
283 | $("#changelog").hide(); | |
284 | }); |
|
284 | }); | |
285 |
|
285 | |||
286 | var jsdata = ${c.jsdata|n}; |
|
286 | var jsdata = ${c.jsdata|n}; | |
287 | var r = new BranchRenderer('graph_canvas', 'graph_content', 'chg_'); |
|
287 | var r = new BranchRenderer('graph_canvas', 'graph_content', 'chg_'); | |
288 | r.render(jsdata,100); |
|
288 | r.render(jsdata,100); | |
289 | }); |
|
289 | }); | |
290 |
|
290 | |||
291 | </script> |
|
291 | </script> | |
292 | %else: |
|
292 | %else: | |
293 | ${_('There are no changes yet')} |
|
293 | ${_('There are no changes yet')} | |
294 | %endif |
|
294 | %endif | |
295 | </div> |
|
295 | </div> | |
296 | </div> |
|
296 | </div> | |
297 | </%def> |
|
297 | </%def> |
@@ -1,292 +1,292 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | <%inherit file="/base/base.html"/> |
|
3 | <%inherit file="/base/base.html"/> | |
4 |
|
4 | |||
5 |
<% |
|
5 | <%block name="title"> | |
6 | ${_('%s Changeset') % c.repo_name} - ${h.show_id(c.changeset)} |
|
6 | ${_('%s Changeset') % c.repo_name} - ${h.show_id(c.changeset)} | |
7 | %if c.site_name: |
|
7 | %if c.site_name: | |
8 | · ${c.site_name} |
|
8 | · ${c.site_name} | |
9 | %endif |
|
9 | %endif | |
10 | </%def> |
|
10 | </%block> | |
11 |
|
11 | |||
12 | <%def name="breadcrumbs_links()"> |
|
12 | <%def name="breadcrumbs_links()"> | |
13 | ${_('Changeset')} - <span class='hash'>${h.show_id(c.changeset)}</span> |
|
13 | ${_('Changeset')} - <span class='hash'>${h.show_id(c.changeset)}</span> | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%block name="header_menu"> |
|
16 | <%block name="header_menu"> | |
17 | ${self.menu('repositories')} |
|
17 | ${self.menu('repositories')} | |
18 | </%block> |
|
18 | </%block> | |
19 |
|
19 | |||
20 | <%def name="main()"> |
|
20 | <%def name="main()"> | |
21 | ${self.repo_context_bar('changelog', c.changeset.raw_id)} |
|
21 | ${self.repo_context_bar('changelog', c.changeset.raw_id)} | |
22 | <div class="box"> |
|
22 | <div class="box"> | |
23 | <!-- box / title --> |
|
23 | <!-- box / title --> | |
24 | <div class="title"> |
|
24 | <div class="title"> | |
25 | ${self.breadcrumbs()} |
|
25 | ${self.breadcrumbs()} | |
26 | </div> |
|
26 | </div> | |
27 | <script> |
|
27 | <script> | |
28 | var _USERS_AC_DATA = ${c.users_array|n}; |
|
28 | var _USERS_AC_DATA = ${c.users_array|n}; | |
29 | var _GROUPS_AC_DATA = ${c.user_groups_array|n}; |
|
29 | var _GROUPS_AC_DATA = ${c.user_groups_array|n}; | |
30 | AJAX_COMMENT_URL = "${url('changeset_comment',repo_name=c.repo_name,revision=c.changeset.raw_id)}"; |
|
30 | AJAX_COMMENT_URL = "${url('changeset_comment',repo_name=c.repo_name,revision=c.changeset.raw_id)}"; | |
31 | AJAX_COMMENT_DELETE_URL = "${url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}"; |
|
31 | AJAX_COMMENT_DELETE_URL = "${url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}"; | |
32 | </script> |
|
32 | </script> | |
33 | <div class="table"> |
|
33 | <div class="table"> | |
34 | <div class="diffblock"> |
|
34 | <div class="diffblock"> | |
35 | <div class="parents"> |
|
35 | <div class="parents"> | |
36 | <div id="parent_link" class="changeset_hash"> |
|
36 | <div id="parent_link" class="changeset_hash"> | |
37 | <i style="color:#036185" class="icon-left-open"></i> <a href="#">${_('parent rev.')}</a> |
|
37 | <i style="color:#036185" class="icon-left-open"></i> <a href="#">${_('parent rev.')}</a> | |
38 | </div> |
|
38 | </div> | |
39 | </div> |
|
39 | </div> | |
40 |
|
40 | |||
41 | <div class="children"> |
|
41 | <div class="children"> | |
42 | <div id="child_link" class="changeset_hash"> |
|
42 | <div id="child_link" class="changeset_hash"> | |
43 | <a href="#">${_('child rev.')}</a> <i style="color:#036185" class="icon-right-open"></i> |
|
43 | <a href="#">${_('child rev.')}</a> <i style="color:#036185" class="icon-right-open"></i> | |
44 | </div> |
|
44 | </div> | |
45 | </div> |
|
45 | </div> | |
46 |
|
46 | |||
47 | <div class="code-header banner"> |
|
47 | <div class="code-header banner"> | |
48 | <div class="changeset-status-container"> |
|
48 | <div class="changeset-status-container"> | |
49 | %if c.statuses: |
|
49 | %if c.statuses: | |
50 | <div class="changeset-status-ico"><i class="icon-circle changeset-status-${c.statuses[0]}"></i></div> |
|
50 | <div class="changeset-status-ico"><i class="icon-circle changeset-status-${c.statuses[0]}"></i></div> | |
51 | <div title="${_('Changeset status')}" class="changeset-status-lbl">[${h.changeset_status_lbl(c.statuses[0])}]</div> |
|
51 | <div title="${_('Changeset status')}" class="changeset-status-lbl">[${h.changeset_status_lbl(c.statuses[0])}]</div> | |
52 | %endif |
|
52 | %endif | |
53 | </div> |
|
53 | </div> | |
54 | <div class="diff-actions"> |
|
54 | <div class="diff-actions"> | |
55 | <a href="${h.url('changeset_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id)}" class="tooltip" title="${h.tooltip(_('Raw diff'))}"> |
|
55 | <a href="${h.url('changeset_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id)}" class="tooltip" title="${h.tooltip(_('Raw diff'))}"> | |
56 | <i class="icon-diff"></i> |
|
56 | <i class="icon-diff"></i> | |
57 | </a> |
|
57 | </a> | |
58 | <a href="${h.url('changeset_patch_home',repo_name=c.repo_name,revision=c.changeset.raw_id)}" class="tooltip" title="${h.tooltip(_('Patch diff'))}"> |
|
58 | <a href="${h.url('changeset_patch_home',repo_name=c.repo_name,revision=c.changeset.raw_id)}" class="tooltip" title="${h.tooltip(_('Patch diff'))}"> | |
59 | <i class="icon-file-powerpoint"></i> |
|
59 | <i class="icon-file-powerpoint"></i> | |
60 | </a> |
|
60 | </a> | |
61 | <a href="${h.url('changeset_download_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download')}" class="tooltip" title="${h.tooltip(_('Download diff'))}"> |
|
61 | <a href="${h.url('changeset_download_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download')}" class="tooltip" title="${h.tooltip(_('Download diff'))}"> | |
62 | <i class="icon-floppy"></i> |
|
62 | <i class="icon-floppy"></i> | |
63 | </a> |
|
63 | </a> | |
64 | ${c.ignorews_url(request.GET)} |
|
64 | ${c.ignorews_url(request.GET)} | |
65 | ${c.context_url(request.GET)} |
|
65 | ${c.context_url(request.GET)} | |
66 | </div> |
|
66 | </div> | |
67 | <div class="comments-number" style="float:right;padding-right:5px">${ungettext("%d comment", "%d comments", len(c.comments)) % len(c.comments)} ${ungettext("(%d inline)", "(%d inline)", c.inline_cnt) % c.inline_cnt} <span class="firstlink"></span> </div> |
|
67 | <div class="comments-number" style="float:right;padding-right:5px">${ungettext("%d comment", "%d comments", len(c.comments)) % len(c.comments)} ${ungettext("(%d inline)", "(%d inline)", c.inline_cnt) % c.inline_cnt} <span class="firstlink"></span> </div> | |
68 | </div> |
|
68 | </div> | |
69 | </div> |
|
69 | </div> | |
70 | <div id="changeset_content"> |
|
70 | <div id="changeset_content"> | |
71 | <div class="container"> |
|
71 | <div class="container"> | |
72 |
|
72 | |||
73 | <div class="right"> |
|
73 | <div class="right"> | |
74 | <div class="changes"> |
|
74 | <div class="changes"> | |
75 | % if (len(c.changeset.affected_files) <= c.affected_files_cut_off) or c.fulldiff: |
|
75 | % if (len(c.changeset.affected_files) <= c.affected_files_cut_off) or c.fulldiff: | |
76 | <span class="removed" title="${_('Removed')}">${len(c.changeset.removed)}</span> |
|
76 | <span class="removed" title="${_('Removed')}">${len(c.changeset.removed)}</span> | |
77 | <span class="changed" title="${_('Changed')}">${len(c.changeset.changed)}</span> |
|
77 | <span class="changed" title="${_('Changed')}">${len(c.changeset.changed)}</span> | |
78 | <span class="added" title="${_('Added')}">${len(c.changeset.added)}</span> |
|
78 | <span class="added" title="${_('Added')}">${len(c.changeset.added)}</span> | |
79 | % else: |
|
79 | % else: | |
80 | <span class="removed" title="${_('Affected %s files') % len(c.changeset.affected_files)}">!</span> |
|
80 | <span class="removed" title="${_('Affected %s files') % len(c.changeset.affected_files)}">!</span> | |
81 | <span class="changed" title="${_('Affected %s files') % len(c.changeset.affected_files)}">!</span> |
|
81 | <span class="changed" title="${_('Affected %s files') % len(c.changeset.affected_files)}">!</span> | |
82 | <span class="added" title="${_('Affected %s files') % len(c.changeset.affected_files)}">!</span> |
|
82 | <span class="added" title="${_('Affected %s files') % len(c.changeset.affected_files)}">!</span> | |
83 | % endif |
|
83 | % endif | |
84 | </div> |
|
84 | </div> | |
85 |
|
85 | |||
86 | <span class="logtags"> |
|
86 | <span class="logtags"> | |
87 | %if len(c.changeset.parents)>1: |
|
87 | %if len(c.changeset.parents)>1: | |
88 | <span class="merge">${_('merge')}</span> |
|
88 | <span class="merge">${_('merge')}</span> | |
89 | %endif |
|
89 | %endif | |
90 |
|
90 | |||
91 | %if h.is_hg(c.db_repo_scm_instance): |
|
91 | %if h.is_hg(c.db_repo_scm_instance): | |
92 | %for book in c.changeset.bookmarks: |
|
92 | %for book in c.changeset.bookmarks: | |
93 | <span class="booktag" title="${_('Bookmark %s') % book}"> |
|
93 | <span class="booktag" title="${_('Bookmark %s') % book}"> | |
94 | ${h.link_to(book,h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))} |
|
94 | ${h.link_to(book,h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))} | |
95 | </span> |
|
95 | </span> | |
96 | %endfor |
|
96 | %endfor | |
97 | %endif |
|
97 | %endif | |
98 |
|
98 | |||
99 | %for tag in c.changeset.tags: |
|
99 | %for tag in c.changeset.tags: | |
100 | <span class="tagtag" title="${_('Tag %s') % tag}"> |
|
100 | <span class="tagtag" title="${_('Tag %s') % tag}"> | |
101 | ${h.link_to(tag,h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span> |
|
101 | ${h.link_to(tag,h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span> | |
102 | %endfor |
|
102 | %endfor | |
103 |
|
103 | |||
104 | %if c.changeset.branch: |
|
104 | %if c.changeset.branch: | |
105 | <span class="branchtag" title="${_('Branch %s') % c.changeset.branch}"> |
|
105 | <span class="branchtag" title="${_('Branch %s') % c.changeset.branch}"> | |
106 | ${h.link_to(c.changeset.branch,h.url('changelog_home',repo_name=c.repo_name,branch=c.changeset.branch))} |
|
106 | ${h.link_to(c.changeset.branch,h.url('changelog_home',repo_name=c.repo_name,branch=c.changeset.branch))} | |
107 | </span> |
|
107 | </span> | |
108 | %endif |
|
108 | %endif | |
109 | </span> |
|
109 | </span> | |
110 | </div> |
|
110 | </div> | |
111 | <div class="left"> |
|
111 | <div class="left"> | |
112 | <div class="author"> |
|
112 | <div class="author"> | |
113 | <div class="gravatar"> |
|
113 | <div class="gravatar"> | |
114 | ${h.gravatar(h.email_or_none(c.changeset.author), size=20)} |
|
114 | ${h.gravatar(h.email_or_none(c.changeset.author), size=20)} | |
115 | </div> |
|
115 | </div> | |
116 | <span><b>${h.person(c.changeset.author,'username_and_name')}</b> - ${h.age(c.changeset.date,True)} ${h.fmt_date(c.changeset.date)}</span><br/> |
|
116 | <span><b>${h.person(c.changeset.author,'username_and_name')}</b> - ${h.age(c.changeset.date,True)} ${h.fmt_date(c.changeset.date)}</span><br/> | |
117 | <span>${h.email_or_none(c.changeset.author)}</span><br/> |
|
117 | <span>${h.email_or_none(c.changeset.author)}</span><br/> | |
118 | </div> |
|
118 | </div> | |
119 | <% rev = c.changeset.extra.get('source') %> |
|
119 | <% rev = c.changeset.extra.get('source') %> | |
120 | %if rev: |
|
120 | %if rev: | |
121 | <div> |
|
121 | <div> | |
122 | ${_('Grafted from:')} ${h.link_to(h.short_id(rev),h.url('changeset_home',repo_name=c.repo_name,revision=rev))} |
|
122 | ${_('Grafted from:')} ${h.link_to(h.short_id(rev),h.url('changeset_home',repo_name=c.repo_name,revision=rev))} | |
123 | </div> |
|
123 | </div> | |
124 | %endif |
|
124 | %endif | |
125 | <% rev = c.changeset.extra.get('transplant_source', '').encode('hex') %> |
|
125 | <% rev = c.changeset.extra.get('transplant_source', '').encode('hex') %> | |
126 | %if rev: |
|
126 | %if rev: | |
127 | <div> |
|
127 | <div> | |
128 | ${_('Transplanted from:')} ${h.link_to(h.short_id(rev),h.url('changeset_home',repo_name=c.repo_name,revision=rev))} |
|
128 | ${_('Transplanted from:')} ${h.link_to(h.short_id(rev),h.url('changeset_home',repo_name=c.repo_name,revision=rev))} | |
129 | </div> |
|
129 | </div> | |
130 | %endif |
|
130 | %endif | |
131 | <div class="message">${h.urlify_commit(c.changeset.message, c.repo_name)}</div> |
|
131 | <div class="message">${h.urlify_commit(c.changeset.message, c.repo_name)}</div> | |
132 | </div> |
|
132 | </div> | |
133 | </div> |
|
133 | </div> | |
134 | <div class="changes_txt"> |
|
134 | <div class="changes_txt"> | |
135 | % if c.limited_diff: |
|
135 | % if c.limited_diff: | |
136 | ${ungettext('%s file changed','%s files changed',len(c.changeset.affected_files)) % (len(c.changeset.affected_files))}: |
|
136 | ${ungettext('%s file changed','%s files changed',len(c.changeset.affected_files)) % (len(c.changeset.affected_files))}: | |
137 | % else: |
|
137 | % else: | |
138 | ${ungettext('%s file changed with %s insertions and %s deletions','%s files changed with %s insertions and %s deletions', len(c.changeset.affected_files)) % (len(c.changeset.affected_files),c.lines_added,c.lines_deleted)}: |
|
138 | ${ungettext('%s file changed with %s insertions and %s deletions','%s files changed with %s insertions and %s deletions', len(c.changeset.affected_files)) % (len(c.changeset.affected_files),c.lines_added,c.lines_deleted)}: | |
139 | %endif |
|
139 | %endif | |
140 | </div> |
|
140 | </div> | |
141 | <div class="cs_files"> |
|
141 | <div class="cs_files"> | |
142 | %for FID, (cs1, cs2, change, path, diff, stats) in c.changes[c.changeset.raw_id].iteritems(): |
|
142 | %for FID, (cs1, cs2, change, path, diff, stats) in c.changes[c.changeset.raw_id].iteritems(): | |
143 | <div class="cs_${change}"> |
|
143 | <div class="cs_${change}"> | |
144 | <div class="node"> |
|
144 | <div class="node"> | |
145 | <i class="icon-diff-${change}"></i> |
|
145 | <i class="icon-diff-${change}"></i> | |
146 | <a href="#${FID}">${h.safe_unicode(path)}</a> |
|
146 | <a href="#${FID}">${h.safe_unicode(path)}</a> | |
147 | </div> |
|
147 | </div> | |
148 | <div class="changes">${h.fancy_file_stats(stats)}</div> |
|
148 | <div class="changes">${h.fancy_file_stats(stats)}</div> | |
149 | </div> |
|
149 | </div> | |
150 | %endfor |
|
150 | %endfor | |
151 | % if c.limited_diff: |
|
151 | % if c.limited_diff: | |
152 | <h5>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h5> |
|
152 | <h5>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h5> | |
153 | % endif |
|
153 | % endif | |
154 | </div> |
|
154 | </div> | |
155 | </div> |
|
155 | </div> | |
156 |
|
156 | |||
157 | </div> |
|
157 | </div> | |
158 |
|
158 | |||
159 | ## diff block |
|
159 | ## diff block | |
160 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> |
|
160 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> | |
161 | ${diff_block.diff_block_js()} |
|
161 | ${diff_block.diff_block_js()} | |
162 | ${diff_block.diff_block(c.changes[c.changeset.raw_id])} |
|
162 | ${diff_block.diff_block(c.changes[c.changeset.raw_id])} | |
163 |
|
163 | |||
164 | % if c.limited_diff: |
|
164 | % if c.limited_diff: | |
165 | <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h4> |
|
165 | <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h4> | |
166 | % endif |
|
166 | % endif | |
167 |
|
167 | |||
168 | ## template for inline comment form |
|
168 | ## template for inline comment form | |
169 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
|
169 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> | |
170 | ${comment.comment_inline_form()} |
|
170 | ${comment.comment_inline_form()} | |
171 |
|
171 | |||
172 | ## render comments and inlines |
|
172 | ## render comments and inlines | |
173 | ${comment.generate_comments()} |
|
173 | ${comment.generate_comments()} | |
174 |
|
174 | |||
175 | ## main comment form and it status |
|
175 | ## main comment form and it status | |
176 | ${comment.comments(h.url('changeset_comment', repo_name=c.repo_name, revision=c.changeset.raw_id), |
|
176 | ${comment.comments(h.url('changeset_comment', repo_name=c.repo_name, revision=c.changeset.raw_id), | |
177 | h.changeset_status(c.db_repo, c.changeset.raw_id))} |
|
177 | h.changeset_status(c.db_repo, c.changeset.raw_id))} | |
178 |
|
178 | |||
179 | ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS |
|
179 | ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS | |
180 | <script type="text/javascript"> |
|
180 | <script type="text/javascript"> | |
181 | $(document).ready(function(){ |
|
181 | $(document).ready(function(){ | |
182 | $('.show-inline-comments').change(function(e){ |
|
182 | $('.show-inline-comments').change(function(e){ | |
183 | var target = e.currentTarget; |
|
183 | var target = e.currentTarget; | |
184 | if(target == null){ |
|
184 | if(target == null){ | |
185 | target = this; |
|
185 | target = this; | |
186 | } |
|
186 | } | |
187 | var boxid = $(target).attr('id_for'); |
|
187 | var boxid = $(target).attr('id_for'); | |
188 | if(target.checked){ |
|
188 | if(target.checked){ | |
189 | $('#{0} .inline-comments'.format(boxid)).show(); |
|
189 | $('#{0} .inline-comments'.format(boxid)).show(); | |
190 | $('#{0} .inline-comments-button'.format(boxid)).show(); |
|
190 | $('#{0} .inline-comments-button'.format(boxid)).show(); | |
191 | }else{ |
|
191 | }else{ | |
192 | $('#{0} .inline-comments'.format(boxid)).hide(); |
|
192 | $('#{0} .inline-comments'.format(boxid)).hide(); | |
193 | $('#{0} .inline-comments-button'.format(boxid)).hide(); |
|
193 | $('#{0} .inline-comments-button'.format(boxid)).hide(); | |
194 | } |
|
194 | } | |
195 | }); |
|
195 | }); | |
196 | $('.add-bubble').click(function(e){ |
|
196 | $('.add-bubble').click(function(e){ | |
197 | var tr = e.currentTarget; |
|
197 | var tr = e.currentTarget; | |
198 | if(tr == null){ |
|
198 | if(tr == null){ | |
199 | tr = this; |
|
199 | tr = this; | |
200 | } |
|
200 | } | |
201 | injectInlineForm(tr.parentNode.parentNode); |
|
201 | injectInlineForm(tr.parentNode.parentNode); | |
202 | }); |
|
202 | }); | |
203 |
|
203 | |||
204 | // inject comments into they proper positions |
|
204 | // inject comments into they proper positions | |
205 | var file_comments = $('.inline-comment-placeholder').toArray(); |
|
205 | var file_comments = $('.inline-comment-placeholder').toArray(); | |
206 | renderInlineComments(file_comments); |
|
206 | renderInlineComments(file_comments); | |
207 |
|
207 | |||
208 | linkInlineComments(document.getElementsByClassName('firstlink'), document.getElementsByClassName("inline-comment")); |
|
208 | linkInlineComments(document.getElementsByClassName('firstlink'), document.getElementsByClassName("inline-comment")); | |
209 |
|
209 | |||
210 | pyroutes.register('changeset_home', |
|
210 | pyroutes.register('changeset_home', | |
211 | "${h.url('changeset_home', repo_name='%(repo_name)s', revision='%(revision)s')}", |
|
211 | "${h.url('changeset_home', repo_name='%(repo_name)s', revision='%(revision)s')}", | |
212 | ['repo_name', 'revision']); |
|
212 | ['repo_name', 'revision']); | |
213 |
|
213 | |||
214 | //next links |
|
214 | //next links | |
215 | $('#child_link').on('click', function(e){ |
|
215 | $('#child_link').on('click', function(e){ | |
216 | //fetch via ajax what is going to be the next link, if we have |
|
216 | //fetch via ajax what is going to be the next link, if we have | |
217 | //>1 links show them to user to choose |
|
217 | //>1 links show them to user to choose | |
218 | if(!$('#child_link').hasClass('disabled')){ |
|
218 | if(!$('#child_link').hasClass('disabled')){ | |
219 | $.ajax({ |
|
219 | $.ajax({ | |
220 | url: '${h.url('changeset_children',repo_name=c.repo_name, revision=c.changeset.raw_id)}', |
|
220 | url: '${h.url('changeset_children',repo_name=c.repo_name, revision=c.changeset.raw_id)}', | |
221 | success: function(data) { |
|
221 | success: function(data) { | |
222 | if(data.results.length === 0){ |
|
222 | if(data.results.length === 0){ | |
223 | $('#child_link').addClass('disabled'); |
|
223 | $('#child_link').addClass('disabled'); | |
224 | $('#child_link').html('${_('no revisions')}'); |
|
224 | $('#child_link').html('${_('no revisions')}'); | |
225 | } |
|
225 | } | |
226 | if(data.results.length === 1){ |
|
226 | if(data.results.length === 1){ | |
227 | var commit = data.results[0]; |
|
227 | var commit = data.results[0]; | |
228 | window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id}); |
|
228 | window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id}); | |
229 | } |
|
229 | } | |
230 | else if(data.results.length === 2){ |
|
230 | else if(data.results.length === 2){ | |
231 | $('#child_link').addClass('disabled'); |
|
231 | $('#child_link').addClass('disabled'); | |
232 | $('#child_link').addClass('double'); |
|
232 | $('#child_link').addClass('double'); | |
233 | var _html = ''; |
|
233 | var _html = ''; | |
234 | _html +='<a title="__title__" href="__url__">__rev__</a> <i style="color:#036185" class="icon-right-open"></i>' |
|
234 | _html +='<a title="__title__" href="__url__">__rev__</a> <i style="color:#036185" class="icon-right-open"></i>' | |
235 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) |
|
235 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) | |
236 | .replace('__title__', data.results[0].message) |
|
236 | .replace('__title__', data.results[0].message) | |
237 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id})); |
|
237 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id})); | |
238 | _html +='<br/>' |
|
238 | _html +='<br/>' | |
239 | _html +='<a title="__title__" href="__url__">__rev__</a> <i style="color:#036185" class="icon-right-open"></i>' |
|
239 | _html +='<a title="__title__" href="__url__">__rev__</a> <i style="color:#036185" class="icon-right-open"></i>' | |
240 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) |
|
240 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) | |
241 | .replace('__title__', data.results[1].message) |
|
241 | .replace('__title__', data.results[1].message) | |
242 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id})); |
|
242 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id})); | |
243 | $('#child_link').html(_html); |
|
243 | $('#child_link').html(_html); | |
244 | } |
|
244 | } | |
245 | } |
|
245 | } | |
246 | }); |
|
246 | }); | |
247 | e.preventDefault(); |
|
247 | e.preventDefault(); | |
248 | } |
|
248 | } | |
249 | }) |
|
249 | }) | |
250 |
|
250 | |||
251 | //prev links |
|
251 | //prev links | |
252 | $('#parent_link').on('click', function(e){ |
|
252 | $('#parent_link').on('click', function(e){ | |
253 | //fetch via ajax what is going to be the next link, if we have |
|
253 | //fetch via ajax what is going to be the next link, if we have | |
254 | //>1 links show them to user to choose |
|
254 | //>1 links show them to user to choose | |
255 | if(!$('#parent_link').hasClass('disabled')){ |
|
255 | if(!$('#parent_link').hasClass('disabled')){ | |
256 | $.ajax({ |
|
256 | $.ajax({ | |
257 | url: '${h.url('changeset_parents',repo_name=c.repo_name, revision=c.changeset.raw_id)}', |
|
257 | url: '${h.url('changeset_parents',repo_name=c.repo_name, revision=c.changeset.raw_id)}', | |
258 | success: function(data) { |
|
258 | success: function(data) { | |
259 | if(data.results.length === 0){ |
|
259 | if(data.results.length === 0){ | |
260 | $('#parent_link').addClass('disabled'); |
|
260 | $('#parent_link').addClass('disabled'); | |
261 | $('#parent_link').html('${_('no revisions')}'); |
|
261 | $('#parent_link').html('${_('no revisions')}'); | |
262 | } |
|
262 | } | |
263 | if(data.results.length === 1){ |
|
263 | if(data.results.length === 1){ | |
264 | var commit = data.results[0]; |
|
264 | var commit = data.results[0]; | |
265 | window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id}); |
|
265 | window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id}); | |
266 | } |
|
266 | } | |
267 | else if(data.results.length === 2){ |
|
267 | else if(data.results.length === 2){ | |
268 | $('#parent_link').addClass('disabled'); |
|
268 | $('#parent_link').addClass('disabled'); | |
269 | $('#parent_link').addClass('double'); |
|
269 | $('#parent_link').addClass('double'); | |
270 | var _html = ''; |
|
270 | var _html = ''; | |
271 | _html +='<i style="color:#036185" class="icon-left-open"></i> <a title="__title__" href="__url__">__rev__</a>' |
|
271 | _html +='<i style="color:#036185" class="icon-left-open"></i> <a title="__title__" href="__url__">__rev__</a>' | |
272 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) |
|
272 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) | |
273 | .replace('__title__', data.results[0].message) |
|
273 | .replace('__title__', data.results[0].message) | |
274 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id})); |
|
274 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id})); | |
275 | _html +='<br/>' |
|
275 | _html +='<br/>' | |
276 | _html +='<i style="color:#036185" class="icon-left-open"></i> <a title="__title__" href="__url__">__rev__</a>' |
|
276 | _html +='<i style="color:#036185" class="icon-left-open"></i> <a title="__title__" href="__url__">__rev__</a>' | |
277 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) |
|
277 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) | |
278 | .replace('__title__', data.results[1].message) |
|
278 | .replace('__title__', data.results[1].message) | |
279 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id})); |
|
279 | .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id})); | |
280 | $('#parent_link').html(_html); |
|
280 | $('#parent_link').html(_html); | |
281 | } |
|
281 | } | |
282 | } |
|
282 | } | |
283 | }); |
|
283 | }); | |
284 | e.preventDefault(); |
|
284 | e.preventDefault(); | |
285 | } |
|
285 | } | |
286 | }) |
|
286 | }) | |
287 | }) |
|
287 | }) | |
288 |
|
288 | |||
289 | </script> |
|
289 | </script> | |
290 |
|
290 | |||
291 | </div> |
|
291 | </div> | |
292 | </%def> |
|
292 | </%def> |
@@ -1,116 +1,116 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('%s Changesets') % c.repo_name} - ${h.show_id(c.cs_ranges[0])} > ${h.show_id(c.cs_ranges[-1])} |
|
5 | ${_('%s Changesets') % c.repo_name} - ${h.show_id(c.cs_ranges[0])} > ${h.show_id(c.cs_ranges[-1])} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${_('Changesets')} - |
|
12 | ${_('Changesets')} - | |
13 | ${h.link_to(h.show_id(c.cs_ranges[0]),h.url('changeset_home',repo_name=c.repo_name,revision=c.cs_ranges[0]))}</td> |
|
13 | ${h.link_to(h.show_id(c.cs_ranges[0]),h.url('changeset_home',repo_name=c.repo_name,revision=c.cs_ranges[0]))}</td> | |
14 | <i class="icon-arrow-right"></i> |
|
14 | <i class="icon-arrow-right"></i> | |
15 | ${h.link_to(h.show_id(c.cs_ranges[-1]),h.url('changeset_home',repo_name=c.repo_name,revision=c.cs_ranges[-1]))}</td> |
|
15 | ${h.link_to(h.show_id(c.cs_ranges[-1]),h.url('changeset_home',repo_name=c.repo_name,revision=c.cs_ranges[-1]))}</td> | |
16 | </%def> |
|
16 | </%def> | |
17 |
|
17 | |||
18 | <%block name="header_menu"> |
|
18 | <%block name="header_menu"> | |
19 | ${self.menu('repositories')} |
|
19 | ${self.menu('repositories')} | |
20 | </%block> |
|
20 | </%block> | |
21 |
|
21 | |||
22 | <%def name="main()"> |
|
22 | <%def name="main()"> | |
23 | ${self.repo_context_bar('changelog')} |
|
23 | ${self.repo_context_bar('changelog')} | |
24 | <div class="box"> |
|
24 | <div class="box"> | |
25 | <!-- box / title --> |
|
25 | <!-- box / title --> | |
26 | <div class="title"> |
|
26 | <div class="title"> | |
27 | ${self.breadcrumbs()} |
|
27 | ${self.breadcrumbs()} | |
28 | </div> |
|
28 | </div> | |
29 | <div class="table"> |
|
29 | <div class="table"> | |
30 | <div id="body" class="diffblock"> |
|
30 | <div id="body" class="diffblock"> | |
31 | <div class="code-header"> |
|
31 | <div class="code-header"> | |
32 | <div> |
|
32 | <div> | |
33 | ${h.show_id(c.cs_ranges[0])} |
|
33 | ${h.show_id(c.cs_ranges[0])} | |
34 | <i class="icon-arrow-right"></i> |
|
34 | <i class="icon-arrow-right"></i> | |
35 | ${h.show_id(c.cs_ranges[-1])} |
|
35 | ${h.show_id(c.cs_ranges[-1])} | |
36 | <a style="font-weight: bold" href="${h.url('compare_url',repo_name=c.repo_name,org_ref_type='rev',org_ref_name=getattr(c.cs_ranges[0].parents[0] if c.cs_ranges[0].parents else h.EmptyChangeset(),'raw_id'),other_ref_type='rev',other_ref_name=c.cs_ranges[-1].raw_id)}" class="btn btn-small"><i class="icon-git-compare"></i> Compare Revisions</a> |
|
36 | <a style="font-weight: bold" href="${h.url('compare_url',repo_name=c.repo_name,org_ref_type='rev',org_ref_name=getattr(c.cs_ranges[0].parents[0] if c.cs_ranges[0].parents else h.EmptyChangeset(),'raw_id'),other_ref_type='rev',other_ref_name=c.cs_ranges[-1].raw_id)}" class="btn btn-small"><i class="icon-git-compare"></i> Compare Revisions</a> | |
37 | </div> |
|
37 | </div> | |
38 | </div> |
|
38 | </div> | |
39 | </div> |
|
39 | </div> | |
40 | <div id="changeset_compare_view_content"> |
|
40 | <div id="changeset_compare_view_content"> | |
41 | <div class="container"> |
|
41 | <div class="container"> | |
42 | <table class="compare_view_commits noborder"> |
|
42 | <table class="compare_view_commits noborder"> | |
43 | %for cnt,cs in enumerate(c.cs_ranges): |
|
43 | %for cnt,cs in enumerate(c.cs_ranges): | |
44 | <tr> |
|
44 | <tr> | |
45 | <td><div class="gravatar">${h.gravatar(h.email_or_none(cs.author), size=14)}</div></td> |
|
45 | <td><div class="gravatar">${h.gravatar(h.email_or_none(cs.author), size=14)}</div></td> | |
46 | <td>${h.link_to('r%s:%s' % (cs.revision,h.short_id(cs.raw_id)),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))}</td> |
|
46 | <td>${h.link_to('r%s:%s' % (cs.revision,h.short_id(cs.raw_id)),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))}</td> | |
47 | <td><div class="author">${h.person(cs.author)}</div></td> |
|
47 | <td><div class="author">${h.person(cs.author)}</div></td> | |
48 | <td><span class="tooltip" title="${h.age(cs.date)}">${cs.date}</span></td> |
|
48 | <td><span class="tooltip" title="${h.age(cs.date)}">${cs.date}</span></td> | |
49 | <td> |
|
49 | <td> | |
50 | %if c.statuses: |
|
50 | %if c.statuses: | |
51 | <div title="${h.tooltip(_('Changeset status'))}" class="changeset-status-ico"><i class="icon-circle changeset-status-${c.statuses[cnt]}"></i></div> |
|
51 | <div title="${h.tooltip(_('Changeset status'))}" class="changeset-status-ico"><i class="icon-circle changeset-status-${c.statuses[cnt]}"></i></div> | |
52 | %endif |
|
52 | %endif | |
53 | </td> |
|
53 | </td> | |
54 | <td><div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}</div></td> |
|
54 | <td><div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}</div></td> | |
55 | </tr> |
|
55 | </tr> | |
56 | %endfor |
|
56 | %endfor | |
57 | </table> |
|
57 | </table> | |
58 | </div> |
|
58 | </div> | |
59 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Files affected')}</div> |
|
59 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Files affected')}</div> | |
60 | <div class="cs_files"> |
|
60 | <div class="cs_files"> | |
61 | %for cs in c.cs_ranges: |
|
61 | %for cs in c.cs_ranges: | |
62 | <div class="cur_cs">${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))}</div> |
|
62 | <div class="cur_cs">${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))}</div> | |
63 | %for FID, (cs1, cs2, change, path, diff, stats) in c.changes[cs.raw_id].iteritems(): |
|
63 | %for FID, (cs1, cs2, change, path, diff, stats) in c.changes[cs.raw_id].iteritems(): | |
64 | <div class="cs_${change}"> |
|
64 | <div class="cs_${change}"> | |
65 | <div class="node"> |
|
65 | <div class="node"> | |
66 | <i class="icon-diff-${change}"></i> |
|
66 | <i class="icon-diff-${change}"></i> | |
67 | ${h.link_to(h.safe_unicode(path),h.url.current(anchor=FID))} |
|
67 | ${h.link_to(h.safe_unicode(path),h.url.current(anchor=FID))} | |
68 | </div> |
|
68 | </div> | |
69 | <div class="changes">${h.fancy_file_stats(stats)}</div> |
|
69 | <div class="changes">${h.fancy_file_stats(stats)}</div> | |
70 | </div> |
|
70 | </div> | |
71 | %endfor |
|
71 | %endfor | |
72 | %endfor |
|
72 | %endfor | |
73 | </div> |
|
73 | </div> | |
74 | </div> |
|
74 | </div> | |
75 |
|
75 | |||
76 | </div> |
|
76 | </div> | |
77 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
|
77 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> | |
78 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> |
|
78 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> | |
79 | ${diff_block.diff_block_js()} |
|
79 | ${diff_block.diff_block_js()} | |
80 | %for cs in c.cs_ranges: |
|
80 | %for cs in c.cs_ranges: | |
81 | ##${comment.comment_inline_form(cs)} |
|
81 | ##${comment.comment_inline_form(cs)} | |
82 | ## diff block |
|
82 | ## diff block | |
83 | <div class="h3"> |
|
83 | <div class="h3"> | |
84 | <a class="tooltip" title="${h.tooltip(cs.message)}" href="${h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id)}">${h.show_id(cs)}</a> |
|
84 | <a class="tooltip" title="${h.tooltip(cs.message)}" href="${h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id)}">${h.show_id(cs)}</a> | |
85 | <div class="gravatar"> |
|
85 | <div class="gravatar"> | |
86 | ${h.gravatar(h.email_or_none(cs.author), size=20)} |
|
86 | ${h.gravatar(h.email_or_none(cs.author), size=20)} | |
87 | </div> |
|
87 | </div> | |
88 | <div class="right"> |
|
88 | <div class="right"> | |
89 | <span class="logtags"> |
|
89 | <span class="logtags"> | |
90 | %if len(cs.parents)>1: |
|
90 | %if len(cs.parents)>1: | |
91 | <span class="merge">${_('merge')}</span> |
|
91 | <span class="merge">${_('merge')}</span> | |
92 | %endif |
|
92 | %endif | |
93 | %if h.is_hg(c.db_repo_scm_instance): |
|
93 | %if h.is_hg(c.db_repo_scm_instance): | |
94 | %for book in cs.bookmarks: |
|
94 | %for book in cs.bookmarks: | |
95 | <span class="booktag" title="${_('Bookmark %s') % book}"> |
|
95 | <span class="booktag" title="${_('Bookmark %s') % book}"> | |
96 | ${h.link_to(book,h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))} |
|
96 | ${h.link_to(book,h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))} | |
97 | </span> |
|
97 | </span> | |
98 | %endfor |
|
98 | %endfor | |
99 | %endif |
|
99 | %endif | |
100 | %for tag in cs.tags: |
|
100 | %for tag in cs.tags: | |
101 | <span class="tagtag" title="${_('Tag %s') % tag}"> |
|
101 | <span class="tagtag" title="${_('Tag %s') % tag}"> | |
102 | ${h.link_to(tag,h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))}</span> |
|
102 | ${h.link_to(tag,h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))}</span> | |
103 | %endfor |
|
103 | %endfor | |
104 | %if cs.branch: |
|
104 | %if cs.branch: | |
105 | <span class="branchtag" title="${_('Branch %s') % cs.branch}"> |
|
105 | <span class="branchtag" title="${_('Branch %s') % cs.branch}"> | |
106 | ${h.link_to(cs.branch,h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))} |
|
106 | ${h.link_to(cs.branch,h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))} | |
107 | </span> |
|
107 | </span> | |
108 | %endif |
|
108 | %endif | |
109 | </span> |
|
109 | </span> | |
110 | </div> |
|
110 | </div> | |
111 | </div> |
|
111 | </div> | |
112 | ${diff_block.diff_block(c.changes[cs.raw_id])} |
|
112 | ${diff_block.diff_block(c.changes[cs.raw_id])} | |
113 |
|
113 | |||
114 | %endfor |
|
114 | %endfor | |
115 | </div> |
|
115 | </div> | |
116 | </%def> |
|
116 | </%def> |
@@ -1,212 +1,212 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | %if c.compare_home: |
|
5 | %if c.compare_home: | |
6 | ${_('%s Compare') % c.repo_name} |
|
6 | ${_('%s Compare') % c.repo_name} | |
7 | %else: |
|
7 | %else: | |
8 | ${_('%s Compare') % c.repo_name} - ${'%s@%s' % (c.a_repo.repo_name, c.a_ref_name)} > ${'%s@%s' % (c.cs_repo.repo_name, c.cs_ref_name)} |
|
8 | ${_('%s Compare') % c.repo_name} - ${'%s@%s' % (c.a_repo.repo_name, c.a_ref_name)} > ${'%s@%s' % (c.cs_repo.repo_name, c.cs_ref_name)} | |
9 | %endif |
|
9 | %endif | |
10 | %if c.site_name: |
|
10 | %if c.site_name: | |
11 | · ${c.site_name} |
|
11 | · ${c.site_name} | |
12 | %endif |
|
12 | %endif | |
13 | </%def> |
|
13 | </%block> | |
14 |
|
14 | |||
15 | <%def name="breadcrumbs_links()"> |
|
15 | <%def name="breadcrumbs_links()"> | |
16 | ${_('Compare Revisions')} |
|
16 | ${_('Compare Revisions')} | |
17 | </%def> |
|
17 | </%def> | |
18 |
|
18 | |||
19 | <%block name="header_menu"> |
|
19 | <%block name="header_menu"> | |
20 | ${self.menu('repositories')} |
|
20 | ${self.menu('repositories')} | |
21 | </%block> |
|
21 | </%block> | |
22 |
|
22 | |||
23 | <%def name="main()"> |
|
23 | <%def name="main()"> | |
24 | ${self.repo_context_bar('changelog')} |
|
24 | ${self.repo_context_bar('changelog')} | |
25 | <div class="box"> |
|
25 | <div class="box"> | |
26 | <!-- box / title --> |
|
26 | <!-- box / title --> | |
27 | <div class="title"> |
|
27 | <div class="title"> | |
28 | ${self.breadcrumbs()} |
|
28 | ${self.breadcrumbs()} | |
29 | </div> |
|
29 | </div> | |
30 | <div class="table"> |
|
30 | <div class="table"> | |
31 | <div id="body" class="diffblock"> |
|
31 | <div id="body" class="diffblock"> | |
32 | <div class="code-header"> |
|
32 | <div class="code-header"> | |
33 | <div> |
|
33 | <div> | |
34 | ${h.hidden('compare_org')} <i class="icon-arrow-right"></i> ${h.hidden('compare_other')} |
|
34 | ${h.hidden('compare_org')} <i class="icon-arrow-right"></i> ${h.hidden('compare_other')} | |
35 | %if not c.compare_home: |
|
35 | %if not c.compare_home: | |
36 | <a class="btn btn-small" href="${c.swap_url}"><i class="icon-arrows-cw"></i> ${_('Swap')}</a> |
|
36 | <a class="btn btn-small" href="${c.swap_url}"><i class="icon-arrows-cw"></i> ${_('Swap')}</a> | |
37 | %endif |
|
37 | %endif | |
38 | <div id="compare_revs" class="btn btn-small"><i class="icon-git-compare"></i> ${_('Compare Revisions')}</div> |
|
38 | <div id="compare_revs" class="btn btn-small"><i class="icon-git-compare"></i> ${_('Compare Revisions')}</div> | |
39 | </div> |
|
39 | </div> | |
40 | </div> |
|
40 | </div> | |
41 | </div> |
|
41 | </div> | |
42 |
|
42 | |||
43 | %if c.compare_home: |
|
43 | %if c.compare_home: | |
44 | <div id="changeset_compare_view_content"> |
|
44 | <div id="changeset_compare_view_content"> | |
45 | <div style="color:#999;font-size: 18px">${_('Compare revisions, branches, bookmarks, or tags.')}</div> |
|
45 | <div style="color:#999;font-size: 18px">${_('Compare revisions, branches, bookmarks, or tags.')}</div> | |
46 | </div> |
|
46 | </div> | |
47 | %else: |
|
47 | %else: | |
48 | <div id="changeset_compare_view_content"> |
|
48 | <div id="changeset_compare_view_content"> | |
49 | ##CS |
|
49 | ##CS | |
50 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${ungettext('Showing %s commit','Showing %s commits', len(c.cs_ranges)) % len(c.cs_ranges)}</div> |
|
50 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${ungettext('Showing %s commit','Showing %s commits', len(c.cs_ranges)) % len(c.cs_ranges)}</div> | |
51 | <%include file="compare_cs.html" /> |
|
51 | <%include file="compare_cs.html" /> | |
52 |
|
52 | |||
53 | ## FILES |
|
53 | ## FILES | |
54 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px"> |
|
54 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px"> | |
55 |
|
55 | |||
56 | % if c.limited_diff: |
|
56 | % if c.limited_diff: | |
57 | ${ungettext('%s file changed', '%s files changed', len(c.files)) % len(c.files)} |
|
57 | ${ungettext('%s file changed', '%s files changed', len(c.files)) % len(c.files)} | |
58 | % else: |
|
58 | % else: | |
59 | ${ungettext('%s file changed with %s insertions and %s deletions','%s files changed with %s insertions and %s deletions', len(c.files)) % (len(c.files),c.lines_added,c.lines_deleted)}: |
|
59 | ${ungettext('%s file changed with %s insertions and %s deletions','%s files changed with %s insertions and %s deletions', len(c.files)) % (len(c.files),c.lines_added,c.lines_deleted)}: | |
60 | %endif |
|
60 | %endif | |
61 |
|
61 | |||
62 | ${c.ignorews_url(request.GET)} |
|
62 | ${c.ignorews_url(request.GET)} | |
63 | ${c.context_url(request.GET)} |
|
63 | ${c.context_url(request.GET)} | |
64 |
|
64 | |||
65 | </div> |
|
65 | </div> | |
66 | <div class="cs_files"> |
|
66 | <div class="cs_files"> | |
67 | %if not c.files: |
|
67 | %if not c.files: | |
68 | <span class="empty_data">${_('No files')}</span> |
|
68 | <span class="empty_data">${_('No files')}</span> | |
69 | %endif |
|
69 | %endif | |
70 | %for fid, change, f, stat in c.files: |
|
70 | %for fid, change, f, stat in c.files: | |
71 | <div class="cs_${change}"> |
|
71 | <div class="cs_${change}"> | |
72 | <div class="node"> |
|
72 | <div class="node"> | |
73 | <i class="icon-diff-${change}"></i> |
|
73 | <i class="icon-diff-${change}"></i> | |
74 | ${h.link_to(h.safe_unicode(f), '#' + fid)} |
|
74 | ${h.link_to(h.safe_unicode(f), '#' + fid)} | |
75 | </div> |
|
75 | </div> | |
76 | <div class="changes">${h.fancy_file_stats(stat)}</div> |
|
76 | <div class="changes">${h.fancy_file_stats(stat)}</div> | |
77 | </div> |
|
77 | </div> | |
78 | %endfor |
|
78 | %endfor | |
79 | </div> |
|
79 | </div> | |
80 | % if c.limited_diff: |
|
80 | % if c.limited_diff: | |
81 | <h5>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff')}</a></h5> |
|
81 | <h5>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff')}</a></h5> | |
82 | % endif |
|
82 | % endif | |
83 | </div> |
|
83 | </div> | |
84 |
|
84 | |||
85 | ## diff block |
|
85 | ## diff block | |
86 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> |
|
86 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> | |
87 | ${diff_block.diff_block_js()} |
|
87 | ${diff_block.diff_block_js()} | |
88 | %for fid, change, f, stat in c.files: |
|
88 | %for fid, change, f, stat in c.files: | |
89 | ${diff_block.diff_block_simple([c.changes[fid]])} |
|
89 | ${diff_block.diff_block_simple([c.changes[fid]])} | |
90 | %endfor |
|
90 | %endfor | |
91 | % if c.limited_diff: |
|
91 | % if c.limited_diff: | |
92 | <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff')}</a></h4> |
|
92 | <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff')}</a></h4> | |
93 | % endif |
|
93 | % endif | |
94 | %endif |
|
94 | %endif | |
95 | </div> |
|
95 | </div> | |
96 |
|
96 | |||
97 | </div> |
|
97 | </div> | |
98 | <script type="text/javascript"> |
|
98 | <script type="text/javascript"> | |
99 |
|
99 | |||
100 | $(document).ready(function(){ |
|
100 | $(document).ready(function(){ | |
101 | var cache = {} |
|
101 | var cache = {} | |
102 | $("#compare_org").select2({ |
|
102 | $("#compare_org").select2({ | |
103 | placeholder: "${'%s@%s' % (c.a_repo.repo_name, c.a_ref_name)}", |
|
103 | placeholder: "${'%s@%s' % (c.a_repo.repo_name, c.a_ref_name)}", | |
104 | formatSelection: function(obj){ |
|
104 | formatSelection: function(obj){ | |
105 | return '{0}@{1}'.format("${c.a_repo.repo_name}", obj.text) |
|
105 | return '{0}@{1}'.format("${c.a_repo.repo_name}", obj.text) | |
106 | }, |
|
106 | }, | |
107 | dropdownAutoWidth: true, |
|
107 | dropdownAutoWidth: true, | |
108 | query: function(query){ |
|
108 | query: function(query){ | |
109 | var key = 'cache'; |
|
109 | var key = 'cache'; | |
110 | var cached = cache[key] ; |
|
110 | var cached = cache[key] ; | |
111 | if(cached) { |
|
111 | if(cached) { | |
112 | var data = {results: []}; |
|
112 | var data = {results: []}; | |
113 | //filter results |
|
113 | //filter results | |
114 | $.each(cached.results, function(){ |
|
114 | $.each(cached.results, function(){ | |
115 | var section = this.text; |
|
115 | var section = this.text; | |
116 | var children = []; |
|
116 | var children = []; | |
117 | $.each(this.children, function(){ |
|
117 | $.each(this.children, function(){ | |
118 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ |
|
118 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ | |
119 | children.push({'id': this.id, 'text': this.text}) |
|
119 | children.push({'id': this.id, 'text': this.text}) | |
120 | } |
|
120 | } | |
121 | }) |
|
121 | }) | |
122 | data.results.push({'text': section, 'children': children}) |
|
122 | data.results.push({'text': section, 'children': children}) | |
123 | }); |
|
123 | }); | |
124 | //push the typed in changeset |
|
124 | //push the typed in changeset | |
125 | data.results.push({'text':_TM['Specify changeset'], |
|
125 | data.results.push({'text':_TM['Specify changeset'], | |
126 | 'children': [{'id': query.term, 'text': query.term, 'type': 'rev'}]}) |
|
126 | 'children': [{'id': query.term, 'text': query.term, 'type': 'rev'}]}) | |
127 | query.callback(data); |
|
127 | query.callback(data); | |
128 | }else{ |
|
128 | }else{ | |
129 | $.ajax({ |
|
129 | $.ajax({ | |
130 | url: pyroutes.url('repo_refs_data', {'repo_name': '${c.a_repo.repo_name}'}), |
|
130 | url: pyroutes.url('repo_refs_data', {'repo_name': '${c.a_repo.repo_name}'}), | |
131 | data: {}, |
|
131 | data: {}, | |
132 | dataType: 'json', |
|
132 | dataType: 'json', | |
133 | type: 'GET', |
|
133 | type: 'GET', | |
134 | success: function(data) { |
|
134 | success: function(data) { | |
135 | cache[key] = data; |
|
135 | cache[key] = data; | |
136 | query.callback(data); |
|
136 | query.callback(data); | |
137 | } |
|
137 | } | |
138 | }) |
|
138 | }) | |
139 | } |
|
139 | } | |
140 | } |
|
140 | } | |
141 | }); |
|
141 | }); | |
142 | $("#compare_other").select2({ |
|
142 | $("#compare_other").select2({ | |
143 | placeholder: "${'%s@%s' % (c.cs_repo.repo_name, c.cs_ref_name)}", |
|
143 | placeholder: "${'%s@%s' % (c.cs_repo.repo_name, c.cs_ref_name)}", | |
144 | dropdownAutoWidth: true, |
|
144 | dropdownAutoWidth: true, | |
145 | formatSelection: function(obj){ |
|
145 | formatSelection: function(obj){ | |
146 | return '{0}@{1}'.format("${c.cs_repo.repo_name}", obj.text) |
|
146 | return '{0}@{1}'.format("${c.cs_repo.repo_name}", obj.text) | |
147 | }, |
|
147 | }, | |
148 | query: function(query){ |
|
148 | query: function(query){ | |
149 | var key = 'cache2'; |
|
149 | var key = 'cache2'; | |
150 | var cached = cache[key] ; |
|
150 | var cached = cache[key] ; | |
151 | if(cached) { |
|
151 | if(cached) { | |
152 | var data = {results: []}; |
|
152 | var data = {results: []}; | |
153 | //filter results |
|
153 | //filter results | |
154 | $.each(cached.results, function(){ |
|
154 | $.each(cached.results, function(){ | |
155 | var section = this.text; |
|
155 | var section = this.text; | |
156 | var children = []; |
|
156 | var children = []; | |
157 | $.each(this.children, function(){ |
|
157 | $.each(this.children, function(){ | |
158 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ |
|
158 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ | |
159 | children.push({'id': this.id, 'text': this.text}) |
|
159 | children.push({'id': this.id, 'text': this.text}) | |
160 | } |
|
160 | } | |
161 | }) |
|
161 | }) | |
162 | data.results.push({'text': section, 'children': children}) |
|
162 | data.results.push({'text': section, 'children': children}) | |
163 | }); |
|
163 | }); | |
164 | //push the typed in changeset |
|
164 | //push the typed in changeset | |
165 | data.results.push({'text':_TM['Specify changeset'], |
|
165 | data.results.push({'text':_TM['Specify changeset'], | |
166 | 'children': [{'id': query.term, 'text': query.term, 'type': 'rev'}]}) |
|
166 | 'children': [{'id': query.term, 'text': query.term, 'type': 'rev'}]}) | |
167 | query.callback(data); |
|
167 | query.callback(data); | |
168 | }else{ |
|
168 | }else{ | |
169 | $.ajax({ |
|
169 | $.ajax({ | |
170 | url: pyroutes.url('repo_refs_data', {'repo_name': '${c.cs_repo.repo_name}'}), |
|
170 | url: pyroutes.url('repo_refs_data', {'repo_name': '${c.cs_repo.repo_name}'}), | |
171 | data: {}, |
|
171 | data: {}, | |
172 | dataType: 'json', |
|
172 | dataType: 'json', | |
173 | type: 'GET', |
|
173 | type: 'GET', | |
174 | success: function(data) { |
|
174 | success: function(data) { | |
175 | cache[key] = data; |
|
175 | cache[key] = data; | |
176 | query.callback({results: data.results}); |
|
176 | query.callback({results: data.results}); | |
177 | } |
|
177 | } | |
178 | }) |
|
178 | }) | |
179 | } |
|
179 | } | |
180 | } |
|
180 | } | |
181 | }); |
|
181 | }); | |
182 |
|
182 | |||
183 | var values_changed = function() { |
|
183 | var values_changed = function() { | |
184 | var values = $('#compare_org').select2('data') && $('#compare_other').select2('data'); |
|
184 | var values = $('#compare_org').select2('data') && $('#compare_other').select2('data'); | |
185 | if (values) { |
|
185 | if (values) { | |
186 | $('#compare_revs').removeClass("disabled"); |
|
186 | $('#compare_revs').removeClass("disabled"); | |
187 | // TODO: the swap button ... if any |
|
187 | // TODO: the swap button ... if any | |
188 | } else { |
|
188 | } else { | |
189 | $('#compare_revs').addClass("disabled"); |
|
189 | $('#compare_revs').addClass("disabled"); | |
190 | // TODO: the swap button ... if any |
|
190 | // TODO: the swap button ... if any | |
191 | } |
|
191 | } | |
192 | } |
|
192 | } | |
193 | values_changed(); |
|
193 | values_changed(); | |
194 | $('#compare_org').change(values_changed); |
|
194 | $('#compare_org').change(values_changed); | |
195 | $('#compare_other').change(values_changed); |
|
195 | $('#compare_other').change(values_changed); | |
196 | $('#compare_revs').on('click', function(e){ |
|
196 | $('#compare_revs').on('click', function(e){ | |
197 | var org = $('#compare_org').select2('data'); |
|
197 | var org = $('#compare_org').select2('data'); | |
198 | var other = $('#compare_other').select2('data'); |
|
198 | var other = $('#compare_other').select2('data'); | |
199 | if (!org || !other) { |
|
199 | if (!org || !other) { | |
200 | return; |
|
200 | return; | |
201 | } |
|
201 | } | |
202 |
|
202 | |||
203 | var compare_url = "${h.url('compare_url',repo_name=c.repo_name,org_ref_type='__other_ref_type__',org_ref_name='__org__',other_ref_type='__org_ref_type__',other_ref_name='__other__', other_repo=c.cs_repo.repo_name)}"; |
|
203 | var compare_url = "${h.url('compare_url',repo_name=c.repo_name,org_ref_type='__other_ref_type__',org_ref_name='__org__',other_ref_type='__org_ref_type__',other_ref_name='__other__', other_repo=c.cs_repo.repo_name)}"; | |
204 | var u = compare_url.replace('__other_ref_type__',org.type) |
|
204 | var u = compare_url.replace('__other_ref_type__',org.type) | |
205 | .replace('__org__',org.text) |
|
205 | .replace('__org__',org.text) | |
206 | .replace('__org_ref_type__',other.type) |
|
206 | .replace('__org_ref_type__',other.type) | |
207 | .replace('__other__',other.text); |
|
207 | .replace('__other__',other.text); | |
208 | window.location = u; |
|
208 | window.location = u; | |
209 | }); |
|
209 | }); | |
210 | }); |
|
210 | }); | |
211 | </script> |
|
211 | </script> | |
212 | </%def> |
|
212 | </%def> |
@@ -1,112 +1,112 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | <%inherit file="/base/base.html"/> |
|
3 | <%inherit file="/base/base.html"/> | |
4 |
|
4 | |||
5 | <%block name="js_extra"> |
|
5 | <%block name="js_extra"> | |
6 | <script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script> |
|
6 | <script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script> | |
7 | <script type="text/javascript" src="${h.url('/js/mergely.js')}"></script> |
|
7 | <script type="text/javascript" src="${h.url('/js/mergely.js')}"></script> | |
8 | </%block> |
|
8 | </%block> | |
9 | <%block name="css_extra"> |
|
9 | <%block name="css_extra"> | |
10 | <link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/> |
|
10 | <link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/> | |
11 | <link rel="stylesheet" type="text/css" href="${h.url('/css/mergely.css')}"/> |
|
11 | <link rel="stylesheet" type="text/css" href="${h.url('/css/mergely.css')}"/> | |
12 | </%block> |
|
12 | </%block> | |
13 |
|
13 | |||
14 |
<% |
|
14 | <%block name="title"> | |
15 | ${_('%s File side-by-side diff') % c.repo_name} |
|
15 | ${_('%s File side-by-side diff') % c.repo_name} | |
16 | %if c.site_name: |
|
16 | %if c.site_name: | |
17 | · ${c.site_name} |
|
17 | · ${c.site_name} | |
18 | %endif |
|
18 | %endif | |
19 | </%def> |
|
19 | </%block> | |
20 |
|
20 | |||
21 | <%def name="breadcrumbs_links()"> |
|
21 | <%def name="breadcrumbs_links()"> | |
22 | ${_('File diff')} ${h.show_id(c.changeset_1)} → ${h.show_id(c.changeset_2)} |
|
22 | ${_('File diff')} ${h.show_id(c.changeset_1)} → ${h.show_id(c.changeset_2)} | |
23 | </%def> |
|
23 | </%def> | |
24 |
|
24 | |||
25 | <%block name="header_menu"> |
|
25 | <%block name="header_menu"> | |
26 | ${self.menu('repositories')} |
|
26 | ${self.menu('repositories')} | |
27 | </%block> |
|
27 | </%block> | |
28 |
|
28 | |||
29 | <%def name="main()"> |
|
29 | <%def name="main()"> | |
30 | ${self.repo_context_bar('changelog')} |
|
30 | ${self.repo_context_bar('changelog')} | |
31 | <div class="box"> |
|
31 | <div class="box"> | |
32 | <!-- box / title --> |
|
32 | <!-- box / title --> | |
33 | <div class="title"> |
|
33 | <div class="title"> | |
34 | ${self.breadcrumbs()} |
|
34 | ${self.breadcrumbs()} | |
35 | </div> |
|
35 | </div> | |
36 |
|
36 | |||
37 | <div class="diff-container" style="overflow-x: hidden"> |
|
37 | <div class="diff-container" style="overflow-x: hidden"> | |
38 | <div class="diffblock comm" style="margin:3px; padding:1px"> |
|
38 | <div class="diffblock comm" style="margin:3px; padding:1px"> | |
39 | <div class="code-header"> |
|
39 | <div class="code-header"> | |
40 | <div class="changeset_header"> |
|
40 | <div class="changeset_header"> | |
41 | <div class="changeset_file"> |
|
41 | <div class="changeset_file"> | |
42 | ${h.link_to(h.safe_unicode(c.node1.path),h.url('files_home',repo_name=c.repo_name, |
|
42 | ${h.link_to(h.safe_unicode(c.node1.path),h.url('files_home',repo_name=c.repo_name, | |
43 | revision=c.cs2.raw_id,f_path=h.safe_unicode(c.node1.path)))} |
|
43 | revision=c.cs2.raw_id,f_path=h.safe_unicode(c.node1.path)))} | |
44 | </div> |
|
44 | </div> | |
45 | <div class="diff-actions"> |
|
45 | <div class="diff-actions"> | |
46 | <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='diff',fulldiff=1)}" class="tooltip" title="${h.tooltip(_('Show full diff for this file'))}"> |
|
46 | <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='diff',fulldiff=1)}" class="tooltip" title="${h.tooltip(_('Show full diff for this file'))}"> | |
47 | <i class="icon-file-code"></i> |
|
47 | <i class="icon-file-code"></i> | |
48 | </a> |
|
48 | </a> | |
49 | <a href="${h.url('files_diff_2way_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='diff',fulldiff=1)}" class="tooltip" title="${h.tooltip(_('Show full side-by-side diff for this file'))}"> |
|
49 | <a href="${h.url('files_diff_2way_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='diff',fulldiff=1)}" class="tooltip" title="${h.tooltip(_('Show full side-by-side diff for this file'))}"> | |
50 | <i class="icon-docs"></i> |
|
50 | <i class="icon-docs"></i> | |
51 | </a> |
|
51 | </a> | |
52 | <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='raw')}" class="tooltip" title="${h.tooltip(_('Raw diff'))}"> |
|
52 | <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='raw')}" class="tooltip" title="${h.tooltip(_('Raw diff'))}"> | |
53 | <i class="icon-diff"></i> |
|
53 | <i class="icon-diff"></i> | |
54 | </a> |
|
54 | </a> | |
55 | <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='download')}" class="tooltip" title="${h.tooltip(_('Download diff'))}"> |
|
55 | <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='download')}" class="tooltip" title="${h.tooltip(_('Download diff'))}"> | |
56 | <i class="icon-floppy"></i> |
|
56 | <i class="icon-floppy"></i> | |
57 | </a> |
|
57 | </a> | |
58 | ${h.checkbox('ignorews', label=_('Ignore whitespace'))} |
|
58 | ${h.checkbox('ignorews', label=_('Ignore whitespace'))} | |
59 | ${h.checkbox('edit_mode', label=_('Edit'))} |
|
59 | ${h.checkbox('edit_mode', label=_('Edit'))} | |
60 | </div> |
|
60 | </div> | |
61 | </div> |
|
61 | </div> | |
62 | </div> |
|
62 | </div> | |
63 | <div id="compare"></div> |
|
63 | <div id="compare"></div> | |
64 | </div> |
|
64 | </div> | |
65 | </div> |
|
65 | </div> | |
66 |
|
66 | |||
67 | <script> |
|
67 | <script> | |
68 | var orig1_url = '${h.url('files_raw_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),revision=c.cs1.raw_id)}'; |
|
68 | var orig1_url = '${h.url('files_raw_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),revision=c.cs1.raw_id)}'; | |
69 | var orig2_url = '${h.url('files_raw_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node2.path),revision=c.cs2.raw_id)}'; |
|
69 | var orig2_url = '${h.url('files_raw_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node2.path),revision=c.cs2.raw_id)}'; | |
70 |
|
70 | |||
71 | $(document).ready(function () { |
|
71 | $(document).ready(function () { | |
72 | $('#compare').mergely({ |
|
72 | $('#compare').mergely({ | |
73 | width: 'auto', |
|
73 | width: 'auto', | |
74 | height: '600', |
|
74 | height: '600', | |
75 | fgcolor: {a:'#ddffdd',c:'#cccccc',d:'#ffdddd'}, |
|
75 | fgcolor: {a:'#ddffdd',c:'#cccccc',d:'#ffdddd'}, | |
76 | bgcolor: '#fff', |
|
76 | bgcolor: '#fff', | |
77 | viewport: true, |
|
77 | viewport: true, | |
78 | cmsettings: {mode: 'text/plain', readOnly: true, lineWrapping: false, lineNumbers: true}, |
|
78 | cmsettings: {mode: 'text/plain', readOnly: true, lineWrapping: false, lineNumbers: true}, | |
79 | lhs: function(setValue) { |
|
79 | lhs: function(setValue) { | |
80 | if("${c.node1.is_binary}" == "True"){ |
|
80 | if("${c.node1.is_binary}" == "True"){ | |
81 | setValue('Binary file') |
|
81 | setValue('Binary file') | |
82 | } |
|
82 | } | |
83 | else{ |
|
83 | else{ | |
84 | $.ajax(orig1_url, {dataType: 'text', success: setValue}); |
|
84 | $.ajax(orig1_url, {dataType: 'text', success: setValue}); | |
85 | } |
|
85 | } | |
86 |
|
86 | |||
87 | }, |
|
87 | }, | |
88 | rhs: function(setValue) { |
|
88 | rhs: function(setValue) { | |
89 | if("${c.node2.is_binary}" == "True"){ |
|
89 | if("${c.node2.is_binary}" == "True"){ | |
90 | setValue('Binary file') |
|
90 | setValue('Binary file') | |
91 | } |
|
91 | } | |
92 | else{ |
|
92 | else{ | |
93 | $.ajax(orig2_url, {dataType: 'text', success: setValue}); |
|
93 | $.ajax(orig2_url, {dataType: 'text', success: setValue}); | |
94 | } |
|
94 | } | |
95 | } |
|
95 | } | |
96 | }); |
|
96 | }); | |
97 | $('#ignorews').change(function(e){ |
|
97 | $('#ignorews').change(function(e){ | |
98 | var val = e.currentTarget.checked; |
|
98 | var val = e.currentTarget.checked; | |
99 | $('#compare').mergely('options', {ignorews: val}); |
|
99 | $('#compare').mergely('options', {ignorews: val}); | |
100 | $('#compare').mergely('update'); |
|
100 | $('#compare').mergely('update'); | |
101 | }) |
|
101 | }) | |
102 | $('#edit_mode').change(function(e){ |
|
102 | $('#edit_mode').change(function(e){ | |
103 | var val = !e.currentTarget.checked; |
|
103 | var val = !e.currentTarget.checked; | |
104 | $('#compare').mergely('cm', 'lhs').setOption('readOnly', val); |
|
104 | $('#compare').mergely('cm', 'lhs').setOption('readOnly', val); | |
105 | $('#compare').mergely('cm', 'rhs').setOption('readOnly', val); |
|
105 | $('#compare').mergely('cm', 'rhs').setOption('readOnly', val); | |
106 | $('#compare').mergely('update'); |
|
106 | $('#compare').mergely('update'); | |
107 | }) |
|
107 | }) | |
108 | }); |
|
108 | }); | |
109 | </script> |
|
109 | </script> | |
110 |
|
110 | |||
111 | </div> |
|
111 | </div> | |
112 | </%def> |
|
112 | </%def> |
@@ -1,32 +1,32 | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 |
<% |
|
3 | <%block name="title"> | |
4 | ${_('%s File Diff') % c.repo_name} |
|
4 | ${_('%s File Diff') % c.repo_name} | |
5 | %if c.site_name: |
|
5 | %if c.site_name: | |
6 | · ${c.site_name} |
|
6 | · ${c.site_name} | |
7 | %endif |
|
7 | %endif | |
8 | </%def> |
|
8 | </%block> | |
9 |
|
9 | |||
10 | <%def name="breadcrumbs_links()"> |
|
10 | <%def name="breadcrumbs_links()"> | |
11 | ${_('File diff')} ${h.show_id(c.changeset_1)} → ${h.show_id(c.changeset_2)} |
|
11 | ${_('File diff')} ${h.show_id(c.changeset_1)} → ${h.show_id(c.changeset_2)} | |
12 | </%def> |
|
12 | </%def> | |
13 |
|
13 | |||
14 | <%block name="header_menu"> |
|
14 | <%block name="header_menu"> | |
15 | ${self.menu('repositories')} |
|
15 | ${self.menu('repositories')} | |
16 | </%block> |
|
16 | </%block> | |
17 |
|
17 | |||
18 | <%def name="main()"> |
|
18 | <%def name="main()"> | |
19 | ${self.repo_context_bar('changelog')} |
|
19 | ${self.repo_context_bar('changelog')} | |
20 | <div class="box"> |
|
20 | <div class="box"> | |
21 | <!-- box / title --> |
|
21 | <!-- box / title --> | |
22 | <div class="title"> |
|
22 | <div class="title"> | |
23 | ${self.breadcrumbs()} |
|
23 | ${self.breadcrumbs()} | |
24 | </div> |
|
24 | </div> | |
25 | <div> |
|
25 | <div> | |
26 | ## diff block |
|
26 | ## diff block | |
27 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> |
|
27 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> | |
28 | ${diff_block.diff_block_js()} |
|
28 | ${diff_block.diff_block_js()} | |
29 | ${diff_block.diff_block(c.changes)} |
|
29 | ${diff_block.diff_block(c.changes)} | |
30 | </div> |
|
30 | </div> | |
31 | </div> |
|
31 | </div> | |
32 | </%def> |
|
32 | </%def> |
@@ -1,257 +1,257 | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 |
<% |
|
3 | <%block name="title"> | |
4 | ${_('%s Files') % c.repo_name} |
|
4 | ${_('%s Files') % c.repo_name} | |
5 | %if hasattr(c,'file'): |
|
5 | %if hasattr(c,'file'): | |
6 | · ${h.safe_unicode(c.file.path) or '/'} |
|
6 | · ${h.safe_unicode(c.file.path) or '/'} | |
7 | %endif |
|
7 | %endif | |
8 |
|
8 | |||
9 | %if c.site_name: |
|
9 | %if c.site_name: | |
10 | · ${c.site_name} |
|
10 | · ${c.site_name} | |
11 | %endif |
|
11 | %endif | |
12 | </%def> |
|
12 | </%block> | |
13 |
|
13 | |||
14 | <%def name="breadcrumbs_links()"> |
|
14 | <%def name="breadcrumbs_links()"> | |
15 | ${_('Files')} |
|
15 | ${_('Files')} | |
16 | %if c.file: |
|
16 | %if c.file: | |
17 | @ ${h.show_id(c.changeset)} |
|
17 | @ ${h.show_id(c.changeset)} | |
18 | %endif |
|
18 | %endif | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%block name="header_menu"> |
|
21 | <%block name="header_menu"> | |
22 | ${self.menu('repositories')} |
|
22 | ${self.menu('repositories')} | |
23 | </%block> |
|
23 | </%block> | |
24 |
|
24 | |||
25 | <%def name="main()"> |
|
25 | <%def name="main()"> | |
26 | ${self.repo_context_bar('files', c.revision)} |
|
26 | ${self.repo_context_bar('files', c.revision)} | |
27 | <div class="box"> |
|
27 | <div class="box"> | |
28 | <!-- box / title --> |
|
28 | <!-- box / title --> | |
29 | <div class="title"> |
|
29 | <div class="title"> | |
30 | ${self.breadcrumbs()} |
|
30 | ${self.breadcrumbs()} | |
31 | <ul class="links"> |
|
31 | <ul class="links"> | |
32 | <li style="color:white"> |
|
32 | <li style="color:white"> | |
33 | ${_("Branch filter:")} ${h.select('branch_selector',c.changeset.raw_id,c.revision_options)} |
|
33 | ${_("Branch filter:")} ${h.select('branch_selector',c.changeset.raw_id,c.revision_options)} | |
34 | </li> |
|
34 | </li> | |
35 | </ul> |
|
35 | </ul> | |
36 | </div> |
|
36 | </div> | |
37 | <div class="table"> |
|
37 | <div class="table"> | |
38 | <div id="files_data"> |
|
38 | <div id="files_data"> | |
39 | <%include file='files_ypjax.html'/> |
|
39 | <%include file='files_ypjax.html'/> | |
40 | </div> |
|
40 | </div> | |
41 | </div> |
|
41 | </div> | |
42 | </div> |
|
42 | </div> | |
43 |
|
43 | |||
44 | <script type="text/javascript"> |
|
44 | <script type="text/javascript"> | |
45 | var CACHE = {}; |
|
45 | var CACHE = {}; | |
46 | var CACHE_EXPIRE = 5*60*1000; //cache for 5*60s |
|
46 | var CACHE_EXPIRE = 5*60*1000; //cache for 5*60s | |
47 | //used to construct links from the search list |
|
47 | //used to construct links from the search list | |
48 | var url_base = '${h.url("files_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__')}'; |
|
48 | var url_base = '${h.url("files_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__')}'; | |
49 | //send the nodelist request to this url |
|
49 | //send the nodelist request to this url | |
50 | var node_list_url = '${h.url("files_nodelist_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__')}'; |
|
50 | var node_list_url = '${h.url("files_nodelist_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__')}'; | |
51 | // send the node history requst to this url |
|
51 | // send the node history requst to this url | |
52 | var node_history_url = '${h.url("files_history_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__')}'; |
|
52 | var node_history_url = '${h.url("files_history_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__')}'; | |
53 |
|
53 | |||
54 | ## new pyroutes URLs |
|
54 | ## new pyroutes URLs | |
55 | pyroutes.register('files_nodelist_home', "${h.url('files_nodelist_home', repo_name=c.repo_name,revision='%(revision)s',f_path='%(f_path)s')}", ['revision', 'f_path']); |
|
55 | pyroutes.register('files_nodelist_home', "${h.url('files_nodelist_home', repo_name=c.repo_name,revision='%(revision)s',f_path='%(f_path)s')}", ['revision', 'f_path']); | |
56 | pyroutes.register('files_history_home', "${h.url('files_history_home', repo_name=c.repo_name,revision='%(revision)s',f_path='%(f_path)s')}", ['revision', 'f_path']); |
|
56 | pyroutes.register('files_history_home', "${h.url('files_history_home', repo_name=c.repo_name,revision='%(revision)s',f_path='%(f_path)s')}", ['revision', 'f_path']); | |
57 | pyroutes.register('files_authors_home', "${h.url('files_authors_home', repo_name=c.repo_name,revision='%(revision)s',f_path='%(f_path)s')}", ['revision', 'f_path']); |
|
57 | pyroutes.register('files_authors_home', "${h.url('files_authors_home', repo_name=c.repo_name,revision='%(revision)s',f_path='%(f_path)s')}", ['revision', 'f_path']); | |
58 |
|
58 | |||
59 | var ypjax_links = function(){ |
|
59 | var ypjax_links = function(){ | |
60 | $('.ypjax-link').click(function(e){ |
|
60 | $('.ypjax-link').click(function(e){ | |
61 |
|
61 | |||
62 | //don't do ypjax on middle click |
|
62 | //don't do ypjax on middle click | |
63 | if(e.which == 2 || !History.enabled){ |
|
63 | if(e.which == 2 || !History.enabled){ | |
64 | return true; |
|
64 | return true; | |
65 | } |
|
65 | } | |
66 |
|
66 | |||
67 | var el = e.currentTarget; |
|
67 | var el = e.currentTarget; | |
68 | var url = el.href; |
|
68 | var url = el.href; | |
69 |
|
69 | |||
70 | var _base_url = '${h.url("files_home",repo_name=c.repo_name,revision='',f_path='')}'; |
|
70 | var _base_url = '${h.url("files_home",repo_name=c.repo_name,revision='',f_path='')}'; | |
71 | _base_url = _base_url.replace('//','/') |
|
71 | _base_url = _base_url.replace('//','/') | |
72 |
|
72 | |||
73 | //extract rev and the f_path from url. |
|
73 | //extract rev and the f_path from url. | |
74 | parts = url.split(_base_url) |
|
74 | parts = url.split(_base_url) | |
75 | if(parts.length != 2){ |
|
75 | if(parts.length != 2){ | |
76 | return false; |
|
76 | return false; | |
77 | } |
|
77 | } | |
78 |
|
78 | |||
79 | var parts2 = parts[1].split('/'); |
|
79 | var parts2 = parts[1].split('/'); | |
80 | var rev = parts2.shift(); // pop the first element which is the revision |
|
80 | var rev = parts2.shift(); // pop the first element which is the revision | |
81 | var f_path = parts2.join('/'); |
|
81 | var f_path = parts2.join('/'); | |
82 |
|
82 | |||
83 |
//page title make this consistent with title |
|
83 | //page title - make this consistent with title mako block above | |
84 | var title = "${_('%s Files') % c.repo_name}" + " \u00B7 " + (f_path || '/') + " \u00B7 " + "${c.site_name}"; |
|
84 | var title = "${_('%s Files') % c.repo_name}" + " \u00B7 " + (f_path || '/') + " \u00B7 " + "${c.site_name}"; | |
85 |
|
85 | |||
86 | var _node_list_url = node_list_url.replace('__REV__',rev).replace('__FPATH__', f_path); |
|
86 | var _node_list_url = node_list_url.replace('__REV__',rev).replace('__FPATH__', f_path); | |
87 | var _url_base = url_base.replace('__REV__',rev); |
|
87 | var _url_base = url_base.replace('__REV__',rev); | |
88 |
|
88 | |||
89 | // Change our States and save some data for handling events |
|
89 | // Change our States and save some data for handling events | |
90 | var data = {url:url,title:title, url_base:_url_base, |
|
90 | var data = {url:url,title:title, url_base:_url_base, | |
91 | node_list_url:_node_list_url, rev:rev, f_path:f_path}; |
|
91 | node_list_url:_node_list_url, rev:rev, f_path:f_path}; | |
92 | History.pushState(data, title, url); |
|
92 | History.pushState(data, title, url); | |
93 |
|
93 | |||
94 | //now we're sure that we can do ypjax things |
|
94 | //now we're sure that we can do ypjax things | |
95 | e.preventDefault(); |
|
95 | e.preventDefault(); | |
96 | return false; |
|
96 | return false; | |
97 | }); |
|
97 | }); | |
98 | } |
|
98 | } | |
99 |
|
99 | |||
100 | // callbacks needed to process the pjax filebrowser |
|
100 | // callbacks needed to process the ypjax filebrowser | |
101 | var callbacks = function(State){ |
|
101 | var callbacks = function(State){ | |
102 | ypjax_links(); |
|
102 | ypjax_links(); | |
103 | tooltip_activate(); |
|
103 | tooltip_activate(); | |
104 |
|
104 | |||
105 | if(State !== undefined){ |
|
105 | if(State !== undefined){ | |
106 | //inistially loaded stuff |
|
106 | //inistially loaded stuff | |
107 | var _f_path = State.data.f_path; |
|
107 | var _f_path = State.data.f_path; | |
108 | var _rev = State.data.rev; |
|
108 | var _rev = State.data.rev; | |
109 |
|
109 | |||
110 | fileBrowserListeners(State.url, State.data.node_list_url, State.data.url_base); |
|
110 | fileBrowserListeners(State.url, State.data.node_list_url, State.data.url_base); | |
111 | // Inform Google Analytics of the change |
|
111 | // Inform Google Analytics of the change | |
112 | if ( typeof window.pageTracker !== 'undefined' ) { |
|
112 | if ( typeof window.pageTracker !== 'undefined' ) { | |
113 | window.pageTracker._trackPageview(State.url); |
|
113 | window.pageTracker._trackPageview(State.url); | |
114 | } |
|
114 | } | |
115 | } |
|
115 | } | |
116 |
|
116 | |||
117 | function highlight_lines(lines){ |
|
117 | function highlight_lines(lines){ | |
118 | for(pos in lines){ |
|
118 | for(pos in lines){ | |
119 | $('#L'+lines[pos]).css('background-color','#FFFFBE'); |
|
119 | $('#L'+lines[pos]).css('background-color','#FFFFBE'); | |
120 | } |
|
120 | } | |
121 | } |
|
121 | } | |
122 | page_highlights = location.href.substring(location.href.indexOf('#')+1).split('L'); |
|
122 | page_highlights = location.href.substring(location.href.indexOf('#')+1).split('L'); | |
123 | if (page_highlights.length == 2){ |
|
123 | if (page_highlights.length == 2){ | |
124 | highlight_ranges = page_highlights[1].split(","); |
|
124 | highlight_ranges = page_highlights[1].split(","); | |
125 |
|
125 | |||
126 | var h_lines = []; |
|
126 | var h_lines = []; | |
127 | for (pos in highlight_ranges){ |
|
127 | for (pos in highlight_ranges){ | |
128 | var _range = highlight_ranges[pos].split('-'); |
|
128 | var _range = highlight_ranges[pos].split('-'); | |
129 | if(_range.length == 2){ |
|
129 | if(_range.length == 2){ | |
130 | var start = parseInt(_range[0]); |
|
130 | var start = parseInt(_range[0]); | |
131 | var end = parseInt(_range[1]); |
|
131 | var end = parseInt(_range[1]); | |
132 | if (start < end){ |
|
132 | if (start < end){ | |
133 | for(var i=start;i<=end;i++){ |
|
133 | for(var i=start;i<=end;i++){ | |
134 | h_lines.push(i); |
|
134 | h_lines.push(i); | |
135 | } |
|
135 | } | |
136 | } |
|
136 | } | |
137 | } |
|
137 | } | |
138 | else{ |
|
138 | else{ | |
139 | h_lines.push(parseInt(highlight_ranges[pos])); |
|
139 | h_lines.push(parseInt(highlight_ranges[pos])); | |
140 | } |
|
140 | } | |
141 | } |
|
141 | } | |
142 | highlight_lines(h_lines); |
|
142 | highlight_lines(h_lines); | |
143 | $('#L'+h_lines[0]).each(function(){ |
|
143 | $('#L'+h_lines[0]).each(function(){ | |
144 | this.scrollIntoView(); |
|
144 | this.scrollIntoView(); | |
145 | }); |
|
145 | }); | |
146 | } |
|
146 | } | |
147 |
|
147 | |||
148 | // select code link event |
|
148 | // select code link event | |
149 | $('#hlcode').mouseup(getSelectionLink); |
|
149 | $('#hlcode').mouseup(getSelectionLink); | |
150 |
|
150 | |||
151 | // history select field |
|
151 | // history select field | |
152 | var cache = {} |
|
152 | var cache = {} | |
153 | $("#diff1").select2({ |
|
153 | $("#diff1").select2({ | |
154 | placeholder: _TM['Select changeset'], |
|
154 | placeholder: _TM['Select changeset'], | |
155 | dropdownAutoWidth: true, |
|
155 | dropdownAutoWidth: true, | |
156 | query: function(query){ |
|
156 | query: function(query){ | |
157 | var key = 'cache'; |
|
157 | var key = 'cache'; | |
158 | var cached = cache[key] ; |
|
158 | var cached = cache[key] ; | |
159 | if(cached) { |
|
159 | if(cached) { | |
160 | var data = {results: []}; |
|
160 | var data = {results: []}; | |
161 | //filter results |
|
161 | //filter results | |
162 | $.each(cached.results, function(){ |
|
162 | $.each(cached.results, function(){ | |
163 | var section = this.text; |
|
163 | var section = this.text; | |
164 | var children = []; |
|
164 | var children = []; | |
165 | $.each(this.children, function(){ |
|
165 | $.each(this.children, function(){ | |
166 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ |
|
166 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ | |
167 | children.push({'id': this.id, 'text': this.text}) |
|
167 | children.push({'id': this.id, 'text': this.text}) | |
168 | } |
|
168 | } | |
169 | }) |
|
169 | }) | |
170 | data.results.push({'text': section, 'children': children}) |
|
170 | data.results.push({'text': section, 'children': children}) | |
171 | }); |
|
171 | }); | |
172 | query.callback(data); |
|
172 | query.callback(data); | |
173 | }else{ |
|
173 | }else{ | |
174 | $.ajax({ |
|
174 | $.ajax({ | |
175 | url: pyroutes.url('files_history_home', {'revision': _rev, 'f_path': _f_path}), |
|
175 | url: pyroutes.url('files_history_home', {'revision': _rev, 'f_path': _f_path}), | |
176 | data: {}, |
|
176 | data: {}, | |
177 | dataType: 'json', |
|
177 | dataType: 'json', | |
178 | type: 'GET', |
|
178 | type: 'GET', | |
179 | success: function(data) { |
|
179 | success: function(data) { | |
180 | cache[key] = data; |
|
180 | cache[key] = data; | |
181 | query.callback({results: data.results}); |
|
181 | query.callback({results: data.results}); | |
182 | } |
|
182 | } | |
183 | }) |
|
183 | }) | |
184 | } |
|
184 | } | |
185 | } |
|
185 | } | |
186 | }); |
|
186 | }); | |
187 | $('#show_authors').on('click', function(){ |
|
187 | $('#show_authors').on('click', function(){ | |
188 | $.ajax({ |
|
188 | $.ajax({ | |
189 | url: pyroutes.url('files_authors_home', {'revision': _rev, 'f_path': _f_path}), |
|
189 | url: pyroutes.url('files_authors_home', {'revision': _rev, 'f_path': _f_path}), | |
190 | success: function(data) { |
|
190 | success: function(data) { | |
191 | $('#file_authors').html(data); |
|
191 | $('#file_authors').html(data); | |
192 | $('#file_authors').show(); |
|
192 | $('#file_authors').show(); | |
193 | tooltip_activate() |
|
193 | tooltip_activate() | |
194 | } |
|
194 | } | |
195 | }) |
|
195 | }) | |
196 | }) |
|
196 | }) | |
197 | } |
|
197 | } | |
198 |
|
198 | |||
199 | $(document).ready(function(){ |
|
199 | $(document).ready(function(){ | |
200 | ypjax_links(); |
|
200 | ypjax_links(); | |
201 | var $files_data = $('#files_data'); |
|
201 | var $files_data = $('#files_data'); | |
202 | //Bind to StateChange Event |
|
202 | //Bind to StateChange Event | |
203 | History.Adapter.bind(window,'statechange',function(){ |
|
203 | History.Adapter.bind(window,'statechange',function(){ | |
204 | var State = History.getState(); |
|
204 | var State = History.getState(); | |
205 | cache_key = State.url; |
|
205 | cache_key = State.url; | |
206 | //check if we have this request in cache maybe ? |
|
206 | //check if we have this request in cache maybe ? | |
207 | var _cache_obj = CACHE[cache_key]; |
|
207 | var _cache_obj = CACHE[cache_key]; | |
208 | var _cur_time = new Date().getTime(); |
|
208 | var _cur_time = new Date().getTime(); | |
209 | // get from cache if it's there and not yet expired ! |
|
209 | // get from cache if it's there and not yet expired ! | |
210 | if(_cache_obj !== undefined && _cache_obj[0] > _cur_time){ |
|
210 | if(_cache_obj !== undefined && _cache_obj[0] > _cur_time){ | |
211 | $files_data.html(_cache_obj[1]); |
|
211 | $files_data.html(_cache_obj[1]); | |
212 | $files_data.css('opacity','1.0'); |
|
212 | $files_data.css('opacity','1.0'); | |
213 | //callbacks after ypjax call |
|
213 | //callbacks after ypjax call | |
214 | callbacks(State); |
|
214 | callbacks(State); | |
215 | } |
|
215 | } | |
216 | else{ |
|
216 | else{ | |
217 | asynchtml(State.url, $files_data, function(){ |
|
217 | asynchtml(State.url, $files_data, function(){ | |
218 | callbacks(State); |
|
218 | callbacks(State); | |
219 | var expire_on = new Date().getTime() + CACHE_EXPIRE; |
|
219 | var expire_on = new Date().getTime() + CACHE_EXPIRE; | |
220 | CACHE[cache_key] = [expire_on, $files_data.html()]; |
|
220 | CACHE[cache_key] = [expire_on, $files_data.html()]; | |
221 | }); |
|
221 | }); | |
222 | } |
|
222 | } | |
223 | }); |
|
223 | }); | |
224 |
|
224 | |||
225 | // init the search filter |
|
225 | // init the search filter | |
226 | var _State = { |
|
226 | var _State = { | |
227 | url: "${h.url.current()}", |
|
227 | url: "${h.url.current()}", | |
228 | data: { |
|
228 | data: { | |
229 | node_list_url: node_list_url.replace('__REV__',"${c.changeset.raw_id}").replace('__FPATH__', "${h.safe_unicode(c.file.path)}"), |
|
229 | node_list_url: node_list_url.replace('__REV__',"${c.changeset.raw_id}").replace('__FPATH__', "${h.safe_unicode(c.file.path)}"), | |
230 | url_base: url_base.replace('__REV__',"${c.changeset.raw_id}"), |
|
230 | url_base: url_base.replace('__REV__',"${c.changeset.raw_id}"), | |
231 | rev:"${c.changeset.raw_id}", |
|
231 | rev:"${c.changeset.raw_id}", | |
232 | f_path: "${h.safe_unicode(c.file.path)}" |
|
232 | f_path: "${h.safe_unicode(c.file.path)}" | |
233 | } |
|
233 | } | |
234 | } |
|
234 | } | |
235 | fileBrowserListeners(_State.url, _State.data.node_list_url, _State.data.url_base); |
|
235 | fileBrowserListeners(_State.url, _State.data.node_list_url, _State.data.url_base); | |
236 |
|
236 | |||
237 | // change branch filter |
|
237 | // change branch filter | |
238 | $("#branch_selector").select2({ |
|
238 | $("#branch_selector").select2({ | |
239 | dropdownAutoWidth: true, |
|
239 | dropdownAutoWidth: true, | |
240 | minimumInputLength: 1 |
|
240 | minimumInputLength: 1 | |
241 | }); |
|
241 | }); | |
242 |
|
242 | |||
243 | $("#branch_selector").change(function(e){ |
|
243 | $("#branch_selector").change(function(e){ | |
244 | var selected = e.currentTarget.options[e.currentTarget.selectedIndex].value; |
|
244 | var selected = e.currentTarget.options[e.currentTarget.selectedIndex].value; | |
245 | if(selected && selected != "${c.changeset.raw_id}"){ |
|
245 | if(selected && selected != "${c.changeset.raw_id}"){ | |
246 | window.location = pyroutes.url('files_home', {'repo_name': "${h.safe_unicode(c.repo_name)}", 'revision': selected, 'f_path': "${h.safe_unicode(c.file.path)}"}); |
|
246 | window.location = pyroutes.url('files_home', {'repo_name': "${h.safe_unicode(c.repo_name)}", 'revision': selected, 'f_path': "${h.safe_unicode(c.file.path)}"}); | |
247 | $("#browserblock").hide(); |
|
247 | $("#browserblock").hide(); | |
248 | } else { |
|
248 | } else { | |
249 | $("#branch_selector").val("${c.changeset.raw_id}"); |
|
249 | $("#branch_selector").val("${c.changeset.raw_id}"); | |
250 | } |
|
250 | } | |
251 | }); |
|
251 | }); | |
252 |
|
252 | |||
253 | }); |
|
253 | }); | |
254 |
|
254 | |||
255 | </script> |
|
255 | </script> | |
256 |
|
256 | |||
257 | </%def> |
|
257 | </%def> |
@@ -1,120 +1,120 | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 |
<% |
|
3 | <%block name="title"> | |
4 | ${_('%s Files Add') % c.repo_name} |
|
4 | ${_('%s Files Add') % c.repo_name} | |
5 | %if c.site_name: |
|
5 | %if c.site_name: | |
6 | · ${c.site_name} |
|
6 | · ${c.site_name} | |
7 | %endif |
|
7 | %endif | |
8 | </%def> |
|
8 | </%block> | |
9 |
|
9 | |||
10 | <%block name="js_extra"> |
|
10 | <%block name="js_extra"> | |
11 | <script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script> |
|
11 | <script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script> | |
12 | <script type="text/javascript" src="${h.url('/js/codemirror_loadmode.js')}"></script> |
|
12 | <script type="text/javascript" src="${h.url('/js/codemirror_loadmode.js')}"></script> | |
13 | <script type="text/javascript" src="${h.url('/codemirror/mode/meta.js')}"></script> |
|
13 | <script type="text/javascript" src="${h.url('/codemirror/mode/meta.js')}"></script> | |
14 | </%block> |
|
14 | </%block> | |
15 | <%block name="css_extra"> |
|
15 | <%block name="css_extra"> | |
16 | <link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/> |
|
16 | <link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/> | |
17 | </%block> |
|
17 | </%block> | |
18 |
|
18 | |||
19 | <%block name="header_menu"> |
|
19 | <%block name="header_menu"> | |
20 | ${self.menu('repositories')} |
|
20 | ${self.menu('repositories')} | |
21 | </%block> |
|
21 | </%block> | |
22 |
|
22 | |||
23 | <%def name="breadcrumbs_links()"> |
|
23 | <%def name="breadcrumbs_links()"> | |
24 | ${_('Add New File')} @ ${h.show_id(c.cs)} |
|
24 | ${_('Add New File')} @ ${h.show_id(c.cs)} | |
25 | </%def> |
|
25 | </%def> | |
26 |
|
26 | |||
27 | <%def name="main()"> |
|
27 | <%def name="main()"> | |
28 | ${self.repo_context_bar('files')} |
|
28 | ${self.repo_context_bar('files')} | |
29 | <div class="box"> |
|
29 | <div class="box"> | |
30 | <!-- box / title --> |
|
30 | <!-- box / title --> | |
31 | <div class="title"> |
|
31 | <div class="title"> | |
32 | ${self.breadcrumbs()} |
|
32 | ${self.breadcrumbs()} | |
33 | <ul class="links"> |
|
33 | <ul class="links"> | |
34 | <li> |
|
34 | <li> | |
35 | <span><a href="#">${_('Branch')}: ${c.cs.branch}</a></span> |
|
35 | <span><a href="#">${_('Branch')}: ${c.cs.branch}</a></span> | |
36 | </li> |
|
36 | </li> | |
37 | </ul> |
|
37 | </ul> | |
38 | </div> |
|
38 | </div> | |
39 | <div class="table" id="edit"> |
|
39 | <div class="table" id="edit"> | |
40 | <div id="files_data"> |
|
40 | <div id="files_data"> | |
41 | ${h.form(h.url.current(),method='post',id='eform',enctype="multipart/form-data", class_="form-horizontal")} |
|
41 | ${h.form(h.url.current(),method='post',id='eform',enctype="multipart/form-data", class_="form-horizontal")} | |
42 | <h3 class="files_location"> |
|
42 | <h3 class="files_location"> | |
43 | ${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cs.raw_id,c.f_path)} / |
|
43 | ${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cs.raw_id,c.f_path)} / | |
44 | <span id="filename_container" class="file reviewer_ac"> |
|
44 | <span id="filename_container" class="file reviewer_ac"> | |
45 | <input class="input-small" type="text" value="" size="30" name="filename" id="filename" placeholder="${_('Enter filename...')}"> |
|
45 | <input class="input-small" type="text" value="" size="30" name="filename" id="filename" placeholder="${_('Enter filename...')}"> | |
46 | <input type="hidden" value="${c.f_path}" size="30" name="location" id="location"> |
|
46 | <input type="hidden" value="${c.f_path}" size="30" name="location" id="location"> | |
47 | ${_('or')} <div class="btn btn-small" id="upload_file_enable">${_('Upload File')}</div> |
|
47 | ${_('or')} <div class="btn btn-small" id="upload_file_enable">${_('Upload File')}</div> | |
48 | </span> |
|
48 | </span> | |
49 | <span id="upload_file_container" class="reviewer_ac" style="display:none"> |
|
49 | <span id="upload_file_container" class="reviewer_ac" style="display:none"> | |
50 | <input type="file" size="20" name="upload_file" id="upload_file"> |
|
50 | <input type="file" size="20" name="upload_file" id="upload_file"> | |
51 | ${_('or')} <div class="btn btn-small" id="file_enable">${_('Create New File')}</div> |
|
51 | ${_('or')} <div class="btn btn-small" id="file_enable">${_('Create New File')}</div> | |
52 | </span> |
|
52 | </span> | |
53 | </h3> |
|
53 | </h3> | |
54 | <div id="body" class="codeblock"> |
|
54 | <div id="body" class="codeblock"> | |
55 | <div class="code-header" id="set_mode_header"> |
|
55 | <div class="code-header" id="set_mode_header"> | |
56 | <label class="commit" for="set_mode">${_('New file mode')}</label> |
|
56 | <label class="commit" for="set_mode">${_('New file mode')}</label> | |
57 | <select id="set_mode" name="set_mode"/> |
|
57 | <select id="set_mode" name="set_mode"/> | |
58 | </div> |
|
58 | </div> | |
59 | <div id="editor_container"> |
|
59 | <div id="editor_container"> | |
60 | <pre id="editor_pre"></pre> |
|
60 | <pre id="editor_pre"></pre> | |
61 | <textarea id="editor" name="content" style="display:none"></textarea> |
|
61 | <textarea id="editor" name="content" style="display:none"></textarea> | |
62 | </div> |
|
62 | </div> | |
63 | <div style="padding: 10px;color:#666666">${_('Commit Message')}</div> |
|
63 | <div style="padding: 10px;color:#666666">${_('Commit Message')}</div> | |
64 | <textarea id="commit" name="message" style="height: 100px;width: 99%;margin-left:4px" placeholder="${c.default_message}"></textarea> |
|
64 | <textarea id="commit" name="message" style="height: 100px;width: 99%;margin-left:4px" placeholder="${c.default_message}"></textarea> | |
65 | </div> |
|
65 | </div> | |
66 | <div style="text-align: left;padding-top: 5px"> |
|
66 | <div style="text-align: left;padding-top: 5px"> | |
67 | ${h.submit('commit',_('Commit Changes'),class_="btn btn-small btn-success")} |
|
67 | ${h.submit('commit',_('Commit Changes'),class_="btn btn-small btn-success")} | |
68 | ${h.reset('reset',_('Reset'),class_="btn btn-small")} |
|
68 | ${h.reset('reset',_('Reset'),class_="btn btn-small")} | |
69 | </div> |
|
69 | </div> | |
70 | ${h.end_form()} |
|
70 | ${h.end_form()} | |
71 | <script type="text/javascript"> |
|
71 | <script type="text/javascript"> | |
72 | var reset_url = "${h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path)}"; |
|
72 | var reset_url = "${h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path)}"; | |
73 | var myCodeMirror = initCodeMirror('editor',reset_url); |
|
73 | var myCodeMirror = initCodeMirror('editor',reset_url); | |
74 |
|
74 | |||
75 | //inject new modes, based on codeMirrors modeInfo object |
|
75 | //inject new modes, based on codeMirrors modeInfo object | |
76 | $('#set_mode').each(function(){ |
|
76 | $('#set_mode').each(function(){ | |
77 | var modes_select = this; |
|
77 | var modes_select = this; | |
78 | var index = 1; |
|
78 | var index = 1; | |
79 | for(var i=0;i<CodeMirror.modeInfo.length;i++){ |
|
79 | for(var i=0;i<CodeMirror.modeInfo.length;i++){ | |
80 | var m = CodeMirror.modeInfo[i]; |
|
80 | var m = CodeMirror.modeInfo[i]; | |
81 | var opt = new Option(m.name, m.mime); |
|
81 | var opt = new Option(m.name, m.mime); | |
82 | $(opt).attr('mode', m.mode); |
|
82 | $(opt).attr('mode', m.mode); | |
83 | if (m.mime == 'text/plain') { |
|
83 | if (m.mime == 'text/plain') { | |
84 | // default plain text |
|
84 | // default plain text | |
85 | $(opt).attr('selected', 'selected'); |
|
85 | $(opt).attr('selected', 'selected'); | |
86 | modes_select.options[0] = opt; |
|
86 | modes_select.options[0] = opt; | |
87 | } else { |
|
87 | } else { | |
88 | modes_select.options[index++] = opt; |
|
88 | modes_select.options[index++] = opt; | |
89 | } |
|
89 | } | |
90 | } |
|
90 | } | |
91 | }); |
|
91 | }); | |
92 | $('#set_mode').change(function(e){ |
|
92 | $('#set_mode').change(function(e){ | |
93 | var selected = e.currentTarget; |
|
93 | var selected = e.currentTarget; | |
94 | var node = selected.options[selected.selectedIndex]; |
|
94 | var node = selected.options[selected.selectedIndex]; | |
95 | var detected_mode = CodeMirror.findModeByMIME(node.value); |
|
95 | var detected_mode = CodeMirror.findModeByMIME(node.value); | |
96 | setCodeMirrorMode(myCodeMirror, detected_mode); |
|
96 | setCodeMirrorMode(myCodeMirror, detected_mode); | |
97 |
|
97 | |||
98 | var filenameInput = $('#filename'); |
|
98 | var filenameInput = $('#filename'); | |
99 | var proposed_ext = CodeMirror.findExtensionByMode(detected_mode); |
|
99 | var proposed_ext = CodeMirror.findExtensionByMode(detected_mode); | |
100 | var file_data = CodeMirror.getFilenameAndExt(filenameInput.val()); |
|
100 | var file_data = CodeMirror.getFilenameAndExt(filenameInput.val()); | |
101 | var filename = file_data['filename'] || 'filename1'; |
|
101 | var filename = file_data['filename'] || 'filename1'; | |
102 | filenameInput.val(filename + '.' + proposed_ext); |
|
102 | filenameInput.val(filename + '.' + proposed_ext); | |
103 | }); |
|
103 | }); | |
104 |
|
104 | |||
105 | // on type the new filename set mode |
|
105 | // on type the new filename set mode | |
106 | $('#filename').keyup(function(e){ |
|
106 | $('#filename').keyup(function(e){ | |
107 | var file_data = CodeMirror.getFilenameAndExt(this.value); |
|
107 | var file_data = CodeMirror.getFilenameAndExt(this.value); | |
108 | if(file_data['ext'] != null){ |
|
108 | if(file_data['ext'] != null){ | |
109 | var detected_mode = CodeMirror.findModeByExtension(file_data['ext']) || CodeMirror.findModeByMIME('text/plain'); |
|
109 | var detected_mode = CodeMirror.findModeByExtension(file_data['ext']) || CodeMirror.findModeByMIME('text/plain'); | |
110 | if (detected_mode){ |
|
110 | if (detected_mode){ | |
111 | setCodeMirrorMode(myCodeMirror, detected_mode); |
|
111 | setCodeMirrorMode(myCodeMirror, detected_mode); | |
112 | $('#set_mode').val(detected_mode.mime); |
|
112 | $('#set_mode').val(detected_mode.mime); | |
113 | } |
|
113 | } | |
114 | } |
|
114 | } | |
115 | }); |
|
115 | }); | |
116 | </script> |
|
116 | </script> | |
117 | </div> |
|
117 | </div> | |
118 | </div> |
|
118 | </div> | |
119 | </div> |
|
119 | </div> | |
120 | </%def> |
|
120 | </%def> |
@@ -1,53 +1,53 | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 |
<% |
|
3 | <%block name="title"> | |
4 | ${_('%s Files Delete') % c.repo_name} |
|
4 | ${_('%s Files Delete') % c.repo_name} | |
5 | %if c.site_name: |
|
5 | %if c.site_name: | |
6 | · ${c.site_name} |
|
6 | · ${c.site_name} | |
7 | %endif |
|
7 | %endif | |
8 | </%def> |
|
8 | </%block> | |
9 |
|
9 | |||
10 | <%block name="header_menu"> |
|
10 | <%block name="header_menu"> | |
11 | ${self.menu('repositories')} |
|
11 | ${self.menu('repositories')} | |
12 | </%block> |
|
12 | </%block> | |
13 |
|
13 | |||
14 | <%def name="breadcrumbs_links()"> |
|
14 | <%def name="breadcrumbs_links()"> | |
15 | ${_('Delete file')} @ ${h.show_id(c.cs)} |
|
15 | ${_('Delete file')} @ ${h.show_id(c.cs)} | |
16 | </%def> |
|
16 | </%def> | |
17 |
|
17 | |||
18 | <%def name="main()"> |
|
18 | <%def name="main()"> | |
19 | ${self.repo_context_bar('files')} |
|
19 | ${self.repo_context_bar('files')} | |
20 | <div class="box"> |
|
20 | <div class="box"> | |
21 | <!-- box / title --> |
|
21 | <!-- box / title --> | |
22 | <div class="title"> |
|
22 | <div class="title"> | |
23 | ${self.breadcrumbs()} |
|
23 | ${self.breadcrumbs()} | |
24 | <ul class="links"> |
|
24 | <ul class="links"> | |
25 | <li> |
|
25 | <li> | |
26 | <span><a href="#">${_('Branch')}: ${c.cs.branch}</a></span> |
|
26 | <span><a href="#">${_('Branch')}: ${c.cs.branch}</a></span> | |
27 | </li> |
|
27 | </li> | |
28 | </ul> |
|
28 | </ul> | |
29 | </div> |
|
29 | </div> | |
30 | <div class="table" id="edit"> |
|
30 | <div class="table" id="edit"> | |
31 | <div id="files_data"> |
|
31 | <div id="files_data"> | |
32 | ${h.form(h.url.current(),method='post',class_="form-horizontal")} |
|
32 | ${h.form(h.url.current(),method='post',class_="form-horizontal")} | |
33 | <h3 class="files_location"> |
|
33 | <h3 class="files_location"> | |
34 | ${_('Delete file')}: ${h.files_breadcrumbs(c.repo_name,c.cs.raw_id,c.f_path)} |
|
34 | ${_('Delete file')}: ${h.files_breadcrumbs(c.repo_name,c.cs.raw_id,c.f_path)} | |
35 | </h3> |
|
35 | </h3> | |
36 |
|
36 | |||
37 | <div id="body" class="codeblock"> |
|
37 | <div id="body" class="codeblock"> | |
38 | <div id="editor_container"> |
|
38 | <div id="editor_container"> | |
39 | <pre id="editor_pre"></pre> |
|
39 | <pre id="editor_pre"></pre> | |
40 | <textarea id="editor" name="content" style="display:none"></textarea> |
|
40 | <textarea id="editor" name="content" style="display:none"></textarea> | |
41 | </div> |
|
41 | </div> | |
42 | <div style="padding: 10px;color:#666666">${_('Commit Message')}</div> |
|
42 | <div style="padding: 10px;color:#666666">${_('Commit Message')}</div> | |
43 | <textarea id="commit" name="message" style="height: 100px;width: 99%;margin-left:4px" placeholder="${c.default_message}"></textarea> |
|
43 | <textarea id="commit" name="message" style="height: 100px;width: 99%;margin-left:4px" placeholder="${c.default_message}"></textarea> | |
44 | </div> |
|
44 | </div> | |
45 | <div style="text-align: left;padding-top: 5px"> |
|
45 | <div style="text-align: left;padding-top: 5px"> | |
46 | ${h.submit('commit',_('Commit Changes'),class_="btn btn-small btn-success")} |
|
46 | ${h.submit('commit',_('Commit Changes'),class_="btn btn-small btn-success")} | |
47 | ${h.reset('reset',_('Reset'),class_="btn btn-small")} |
|
47 | ${h.reset('reset',_('Reset'),class_="btn btn-small")} | |
48 | </div> |
|
48 | </div> | |
49 | ${h.end_form()} |
|
49 | ${h.end_form()} | |
50 | </div> |
|
50 | </div> | |
51 | </div> |
|
51 | </div> | |
52 | </div> |
|
52 | </div> | |
53 | </%def> |
|
53 | </%def> |
@@ -1,115 +1,115 | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 |
<% |
|
3 | <%block name="title"> | |
4 | ${_('%s File Edit') % c.repo_name} |
|
4 | ${_('%s File Edit') % c.repo_name} | |
5 | %if c.site_name: |
|
5 | %if c.site_name: | |
6 | · ${c.site_name} |
|
6 | · ${c.site_name} | |
7 | %endif |
|
7 | %endif | |
8 | </%def> |
|
8 | </%block> | |
9 |
|
9 | |||
10 | <%block name="js_extra"> |
|
10 | <%block name="js_extra"> | |
11 | <script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script> |
|
11 | <script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script> | |
12 | <script type="text/javascript" src="${h.url('/js/codemirror_loadmode.js')}"></script> |
|
12 | <script type="text/javascript" src="${h.url('/js/codemirror_loadmode.js')}"></script> | |
13 | <script type="text/javascript" src="${h.url('/codemirror/mode/meta.js')}"></script> |
|
13 | <script type="text/javascript" src="${h.url('/codemirror/mode/meta.js')}"></script> | |
14 | </%block> |
|
14 | </%block> | |
15 | <%block name="css_extra"> |
|
15 | <%block name="css_extra"> | |
16 | <link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/> |
|
16 | <link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/> | |
17 | </%block> |
|
17 | </%block> | |
18 |
|
18 | |||
19 | <%block name="header_menu"> |
|
19 | <%block name="header_menu"> | |
20 | ${self.menu('repositories')} |
|
20 | ${self.menu('repositories')} | |
21 | </%block> |
|
21 | </%block> | |
22 |
|
22 | |||
23 | <%def name="breadcrumbs_links()"> |
|
23 | <%def name="breadcrumbs_links()"> | |
24 | ${_('Edit file')} @ ${h.show_id(c.cs)} |
|
24 | ${_('Edit file')} @ ${h.show_id(c.cs)} | |
25 | </%def> |
|
25 | </%def> | |
26 |
|
26 | |||
27 | <%def name="main()"> |
|
27 | <%def name="main()"> | |
28 | ${self.repo_context_bar('files')} |
|
28 | ${self.repo_context_bar('files')} | |
29 | <div class="box"> |
|
29 | <div class="box"> | |
30 | <!-- box / title --> |
|
30 | <!-- box / title --> | |
31 | <div class="title"> |
|
31 | <div class="title"> | |
32 | ${self.breadcrumbs()} |
|
32 | ${self.breadcrumbs()} | |
33 | <ul class="links"> |
|
33 | <ul class="links"> | |
34 | <li> |
|
34 | <li> | |
35 | <span><a href="#">${_('Branch')}: ${c.cs.branch}</a></span> |
|
35 | <span><a href="#">${_('Branch')}: ${c.cs.branch}</a></span> | |
36 | </li> |
|
36 | </li> | |
37 | </ul> |
|
37 | </ul> | |
38 | </div> |
|
38 | </div> | |
39 | <div class="table" id="edit"> |
|
39 | <div class="table" id="edit"> | |
40 | <div id="files_data"> |
|
40 | <div id="files_data"> | |
41 | <h3 class="files_location">${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cs.revision,c.file.path)}</h3> |
|
41 | <h3 class="files_location">${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cs.revision,c.file.path)}</h3> | |
42 | ${h.form(h.url.current(),method='post',id='eform')} |
|
42 | ${h.form(h.url.current(),method='post',id='eform')} | |
43 | <div id="body" class="codeblock"> |
|
43 | <div id="body" class="codeblock"> | |
44 | <div class="code-header"> |
|
44 | <div class="code-header"> | |
45 | <div class="stats"> |
|
45 | <div class="stats"> | |
46 | <div class="left"><i class="icon-doc-inv"></i></div> |
|
46 | <div class="left"><i class="icon-doc-inv"></i></div> | |
47 | <div class="left item">${h.link_to(h.show_id(c.file.changeset),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id))}</div> |
|
47 | <div class="left item">${h.link_to(h.show_id(c.file.changeset),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id))}</div> | |
48 | <div class="left item">${h.format_byte_size(c.file.size,binary=True)}</div> |
|
48 | <div class="left item">${h.format_byte_size(c.file.size,binary=True)}</div> | |
49 | <div class="left item last">${c.file.mimetype}</div> |
|
49 | <div class="left item last">${c.file.mimetype}</div> | |
50 | <div class="buttons"> |
|
50 | <div class="buttons"> | |
51 | ${h.link_to(_('Show Annotation'),h.url('files_annotate_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="btn btn-mini")} |
|
51 | ${h.link_to(_('Show Annotation'),h.url('files_annotate_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="btn btn-mini")} | |
52 | ${h.link_to(_('Show as Raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="btn btn-mini")} |
|
52 | ${h.link_to(_('Show as Raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="btn btn-mini")} | |
53 | ${h.link_to(_('Download as Raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="btn btn-mini")} |
|
53 | ${h.link_to(_('Download as Raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="btn btn-mini")} | |
54 | % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name): |
|
54 | % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name): | |
55 | % if not c.file.is_binary: |
|
55 | % if not c.file.is_binary: | |
56 | ${h.link_to(_('Source'),h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="btn btn-mini")} |
|
56 | ${h.link_to(_('Source'),h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="btn btn-mini")} | |
57 | % endif |
|
57 | % endif | |
58 | % endif |
|
58 | % endif | |
59 | </div> |
|
59 | </div> | |
60 | </div> |
|
60 | </div> | |
61 | <label class="commit" for="set_mode">${_('Editing file')}: ${c.file.unicode_path}</label> |
|
61 | <label class="commit" for="set_mode">${_('Editing file')}: ${c.file.unicode_path}</label> | |
62 | <select id="set_mode" name="set_mode"/> |
|
62 | <select id="set_mode" name="set_mode"/> | |
63 | </div> |
|
63 | </div> | |
64 | <pre id="editor_pre"></pre> |
|
64 | <pre id="editor_pre"></pre> | |
65 | <textarea id="editor" name="content" style="display:none">${h.escape(c.file.content)|n}</textarea> |
|
65 | <textarea id="editor" name="content" style="display:none">${h.escape(c.file.content)|n}</textarea> | |
66 | <div style="padding: 10px;color:#666666">${_('Commit Message')}</div> |
|
66 | <div style="padding: 10px;color:#666666">${_('Commit Message')}</div> | |
67 | <textarea id="commit" name="message" style="height: 60px;width: 99%;margin-left:4px" placeholder="${c.default_message}"></textarea> |
|
67 | <textarea id="commit" name="message" style="height: 60px;width: 99%;margin-left:4px" placeholder="${c.default_message}"></textarea> | |
68 | </div> |
|
68 | </div> | |
69 | <div style="text-align: left;padding-top: 5px"> |
|
69 | <div style="text-align: left;padding-top: 5px"> | |
70 | ${h.submit('commit',_('Commit Changes'),class_="btn btn-small btn-success")} |
|
70 | ${h.submit('commit',_('Commit Changes'),class_="btn btn-small btn-success")} | |
71 | ${h.reset('reset',_('Reset'),class_="btn btn-small")} |
|
71 | ${h.reset('reset',_('Reset'),class_="btn btn-small")} | |
72 | </div> |
|
72 | </div> | |
73 | ${h.end_form()} |
|
73 | ${h.end_form()} | |
74 | </div> |
|
74 | </div> | |
75 | </div> |
|
75 | </div> | |
76 | </div> |
|
76 | </div> | |
77 |
|
77 | |||
78 | <script type="text/javascript"> |
|
78 | <script type="text/javascript"> | |
79 | $(document).ready(function(){ |
|
79 | $(document).ready(function(){ | |
80 | var reset_url = "${h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.file.path)}"; |
|
80 | var reset_url = "${h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.file.path)}"; | |
81 | var myCodeMirror = initCodeMirror('editor',reset_url); |
|
81 | var myCodeMirror = initCodeMirror('editor',reset_url); | |
82 |
|
82 | |||
83 | //inject new modes, based on codeMirrors modeInfo object |
|
83 | //inject new modes, based on codeMirrors modeInfo object | |
84 | $('#set_mode').each(function(){ |
|
84 | $('#set_mode').each(function(){ | |
85 | var modes_select = this; |
|
85 | var modes_select = this; | |
86 | var index = 1; |
|
86 | var index = 1; | |
87 | for(var i=0;i<CodeMirror.modeInfo.length;i++){ |
|
87 | for(var i=0;i<CodeMirror.modeInfo.length;i++){ | |
88 | var m = CodeMirror.modeInfo[i]; |
|
88 | var m = CodeMirror.modeInfo[i]; | |
89 | var opt = new Option(m.name, m.mime); |
|
89 | var opt = new Option(m.name, m.mime); | |
90 | $(opt).attr('mode', m.mode); |
|
90 | $(opt).attr('mode', m.mode); | |
91 | if (m.mime == 'text/plain') { |
|
91 | if (m.mime == 'text/plain') { | |
92 | // default plain text |
|
92 | // default plain text | |
93 | $(opt).attr('selected', 'selected'); |
|
93 | $(opt).attr('selected', 'selected'); | |
94 | modes_select.options[0] = opt; |
|
94 | modes_select.options[0] = opt; | |
95 | } else { |
|
95 | } else { | |
96 | modes_select.options[index++] = opt; |
|
96 | modes_select.options[index++] = opt; | |
97 | } |
|
97 | } | |
98 | } |
|
98 | } | |
99 | }); |
|
99 | }); | |
100 | // try to detect the mode based on the file we edit |
|
100 | // try to detect the mode based on the file we edit | |
101 | var detected_mode = CodeMirror.findModeByExtension("${c.file.extension}"); |
|
101 | var detected_mode = CodeMirror.findModeByExtension("${c.file.extension}"); | |
102 | if(detected_mode){ |
|
102 | if(detected_mode){ | |
103 | setCodeMirrorMode(myCodeMirror, detected_mode); |
|
103 | setCodeMirrorMode(myCodeMirror, detected_mode); | |
104 | $($('#set_mode option[value="'+detected_mode.mime+'"]')[0]).attr("selected", "selected") |
|
104 | $($('#set_mode option[value="'+detected_mode.mime+'"]')[0]).attr("selected", "selected") | |
105 | } |
|
105 | } | |
106 |
|
106 | |||
107 | $('#set_mode').on('change', function(e){ |
|
107 | $('#set_mode').on('change', function(e){ | |
108 | var selected = e.currentTarget; |
|
108 | var selected = e.currentTarget; | |
109 | var node = selected.options[selected.selectedIndex]; |
|
109 | var node = selected.options[selected.selectedIndex]; | |
110 | var detected_mode = CodeMirror.findModeByMIME(node.value); |
|
110 | var detected_mode = CodeMirror.findModeByMIME(node.value); | |
111 | setCodeMirrorMode(myCodeMirror, detected_mode); |
|
111 | setCodeMirrorMode(myCodeMirror, detected_mode); | |
112 | }); |
|
112 | }); | |
113 | }) |
|
113 | }) | |
114 | </script> |
|
114 | </script> | |
115 | </%def> |
|
115 | </%def> |
@@ -1,32 +1,32 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('%s Followers') % c.repo_name} |
|
5 | ${_('%s Followers') % c.repo_name} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${_('Followers')} |
|
12 | ${_('Followers')} | |
13 | </%def> |
|
13 | </%def> | |
14 |
|
14 | |||
15 | <%block name="header_menu"> |
|
15 | <%block name="header_menu"> | |
16 | ${self.menu('repositories')} |
|
16 | ${self.menu('repositories')} | |
17 | </%block> |
|
17 | </%block> | |
18 | <%def name="main()"> |
|
18 | <%def name="main()"> | |
19 | ${self.repo_context_bar('followers')} |
|
19 | ${self.repo_context_bar('followers')} | |
20 | <div class="box"> |
|
20 | <div class="box"> | |
21 | <!-- box / title --> |
|
21 | <!-- box / title --> | |
22 | <div class="title"> |
|
22 | <div class="title"> | |
23 | ${self.breadcrumbs()} |
|
23 | ${self.breadcrumbs()} | |
24 | </div> |
|
24 | </div> | |
25 | <!-- end box / title --> |
|
25 | <!-- end box / title --> | |
26 | <div class="table"> |
|
26 | <div class="table"> | |
27 | <div id="followers"> |
|
27 | <div id="followers"> | |
28 | ${c.followers_data} |
|
28 | ${c.followers_data} | |
29 | </div> |
|
29 | </div> | |
30 | </div> |
|
30 | </div> | |
31 | </div> |
|
31 | </div> | |
32 | </%def> |
|
32 | </%def> |
@@ -1,116 +1,116 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Fork repository %s') % c.repo_name} |
|
5 | ${_('Fork repository %s') % c.repo_name} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${_('Fork')} |
|
12 | ${_('Fork')} | |
13 | </%def> |
|
13 | </%def> | |
14 |
|
14 | |||
15 | <%block name="header_menu"> |
|
15 | <%block name="header_menu"> | |
16 | ${self.menu('repositories')} |
|
16 | ${self.menu('repositories')} | |
17 | </%block> |
|
17 | </%block> | |
18 |
|
18 | |||
19 | <%def name="main()"> |
|
19 | <%def name="main()"> | |
20 | ${self.repo_context_bar('createfork')} |
|
20 | ${self.repo_context_bar('createfork')} | |
21 | <div class="box"> |
|
21 | <div class="box"> | |
22 | <!-- box / title --> |
|
22 | <!-- box / title --> | |
23 | ${h.form(url('repo_fork_create_home',repo_name=c.repo_info.repo_name))} |
|
23 | ${h.form(url('repo_fork_create_home',repo_name=c.repo_info.repo_name))} | |
24 | <div class="form"> |
|
24 | <div class="form"> | |
25 | <!-- fields --> |
|
25 | <!-- fields --> | |
26 | <div class="fields"> |
|
26 | <div class="fields"> | |
27 |
|
27 | |||
28 | <div class="field"> |
|
28 | <div class="field"> | |
29 | <div class="label"> |
|
29 | <div class="label"> | |
30 | <label for="repo_name">${_('Fork name')}:</label> |
|
30 | <label for="repo_name">${_('Fork name')}:</label> | |
31 | </div> |
|
31 | </div> | |
32 | <div class="input"> |
|
32 | <div class="input"> | |
33 | ${h.text('repo_name',class_="small")} |
|
33 | ${h.text('repo_name',class_="small")} | |
34 | ${h.hidden('repo_type',c.repo_info.repo_type)} |
|
34 | ${h.hidden('repo_type',c.repo_info.repo_type)} | |
35 | ${h.hidden('fork_parent_id',c.repo_info.repo_id)} |
|
35 | ${h.hidden('fork_parent_id',c.repo_info.repo_id)} | |
36 | </div> |
|
36 | </div> | |
37 | </div> |
|
37 | </div> | |
38 |
|
38 | |||
39 | <div class="field"> |
|
39 | <div class="field"> | |
40 | <div class="label label-textarea"> |
|
40 | <div class="label label-textarea"> | |
41 | <label for="description">${_('Description')}:</label> |
|
41 | <label for="description">${_('Description')}:</label> | |
42 | </div> |
|
42 | </div> | |
43 | <div class="textarea editor"> |
|
43 | <div class="textarea editor"> | |
44 | ${h.textarea('description')} |
|
44 | ${h.textarea('description')} | |
45 | <span class="help-block">${_('Keep it short and to the point. Use a README file for longer descriptions.')}</span> |
|
45 | <span class="help-block">${_('Keep it short and to the point. Use a README file for longer descriptions.')}</span> | |
46 | </div> |
|
46 | </div> | |
47 | </div> |
|
47 | </div> | |
48 |
|
48 | |||
49 | <div class="field"> |
|
49 | <div class="field"> | |
50 | <div class="label"> |
|
50 | <div class="label"> | |
51 | <label for="repo_group">${_('Repository group')}:</label> |
|
51 | <label for="repo_group">${_('Repository group')}:</label> | |
52 | </div> |
|
52 | </div> | |
53 | <div class="input"> |
|
53 | <div class="input"> | |
54 | ${h.select('repo_group','',c.repo_groups,class_="medium")} |
|
54 | ${h.select('repo_group','',c.repo_groups,class_="medium")} | |
55 | <span class="help-block">${_('Optionally select a group to put this repository into.')}</span> |
|
55 | <span class="help-block">${_('Optionally select a group to put this repository into.')}</span> | |
56 | </div> |
|
56 | </div> | |
57 | </div> |
|
57 | </div> | |
58 |
|
58 | |||
59 | <div class="field"> |
|
59 | <div class="field"> | |
60 | <div class="label"> |
|
60 | <div class="label"> | |
61 | <label for="landing_rev">${_('Landing revision')}:</label> |
|
61 | <label for="landing_rev">${_('Landing revision')}:</label> | |
62 | </div> |
|
62 | </div> | |
63 | <div class="input"> |
|
63 | <div class="input"> | |
64 | ${h.select('landing_rev','',c.landing_revs,class_="medium")} |
|
64 | ${h.select('landing_rev','',c.landing_revs,class_="medium")} | |
65 | <span class="help-block">${_('Default revision for files page, downloads, whoosh, and readme.')}</span> |
|
65 | <span class="help-block">${_('Default revision for files page, downloads, whoosh, and readme.')}</span> | |
66 | </div> |
|
66 | </div> | |
67 | </div> |
|
67 | </div> | |
68 |
|
68 | |||
69 | <div class="field"> |
|
69 | <div class="field"> | |
70 | <div class="label label-checkbox"> |
|
70 | <div class="label label-checkbox"> | |
71 | <label for="private">${_('Private')}:</label> |
|
71 | <label for="private">${_('Private')}:</label> | |
72 | </div> |
|
72 | </div> | |
73 | <div class="checkboxes"> |
|
73 | <div class="checkboxes"> | |
74 | ${h.checkbox('private',value="True")} |
|
74 | ${h.checkbox('private',value="True")} | |
75 | <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span> |
|
75 | <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span> | |
76 | </div> |
|
76 | </div> | |
77 | </div> |
|
77 | </div> | |
78 | <div class="field"> |
|
78 | <div class="field"> | |
79 | <div class="label label-checkbox"> |
|
79 | <div class="label label-checkbox"> | |
80 | <label for="private">${_('Copy permissions')}:</label> |
|
80 | <label for="private">${_('Copy permissions')}:</label> | |
81 | </div> |
|
81 | </div> | |
82 | <div class="checkboxes"> |
|
82 | <div class="checkboxes"> | |
83 | ${h.checkbox('copy_permissions',value="True", checked="checked")} |
|
83 | ${h.checkbox('copy_permissions',value="True", checked="checked")} | |
84 | <span class="help-block">${_('Copy permissions from forked repository')}</span> |
|
84 | <span class="help-block">${_('Copy permissions from forked repository')}</span> | |
85 | </div> |
|
85 | </div> | |
86 | </div> |
|
86 | </div> | |
87 | %if c.can_update: |
|
87 | %if c.can_update: | |
88 | <div class="field"> |
|
88 | <div class="field"> | |
89 | <div class="label label-checkbox"> |
|
89 | <div class="label label-checkbox"> | |
90 | <label for="private">${_('Update after clone')}:</label> |
|
90 | <label for="private">${_('Update after clone')}:</label> | |
91 | </div> |
|
91 | </div> | |
92 | <div class="checkboxes"> |
|
92 | <div class="checkboxes"> | |
93 | ${h.checkbox('update_after_clone',value="True")} |
|
93 | ${h.checkbox('update_after_clone',value="True")} | |
94 | <span class="help-block">${_('Checkout source after making a clone')}</span> |
|
94 | <span class="help-block">${_('Checkout source after making a clone')}</span> | |
95 | </div> |
|
95 | </div> | |
96 | </div> |
|
96 | </div> | |
97 | %endif |
|
97 | %endif | |
98 | <div class="buttons"> |
|
98 | <div class="buttons"> | |
99 | ${h.submit('',_('Fork this Repository'),class_="btn")} |
|
99 | ${h.submit('',_('Fork this Repository'),class_="btn")} | |
100 | </div> |
|
100 | </div> | |
101 | </div> |
|
101 | </div> | |
102 | </div> |
|
102 | </div> | |
103 | ${h.end_form()} |
|
103 | ${h.end_form()} | |
104 | </div> |
|
104 | </div> | |
105 | <script> |
|
105 | <script> | |
106 | $(document).ready(function(){ |
|
106 | $(document).ready(function(){ | |
107 | $("#repo_group").select2({ |
|
107 | $("#repo_group").select2({ | |
108 | 'dropdownAutoWidth': true |
|
108 | 'dropdownAutoWidth': true | |
109 | }); |
|
109 | }); | |
110 | $("#landing_rev").select2({ |
|
110 | $("#landing_rev").select2({ | |
111 | 'minimumResultsForSearch': -1 |
|
111 | 'minimumResultsForSearch': -1 | |
112 | }); |
|
112 | }); | |
113 | $('#repo_name').focus(); |
|
113 | $('#repo_name').focus(); | |
114 | }) |
|
114 | }) | |
115 | </script> |
|
115 | </script> | |
116 | </%def> |
|
116 | </%def> |
@@ -1,33 +1,33 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('%s Forks') % c.repo_name} |
|
5 | ${_('%s Forks') % c.repo_name} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | ${_('Forks')} |
|
12 | ${_('Forks')} | |
13 | </%def> |
|
13 | </%def> | |
14 |
|
14 | |||
15 | <%block name="header_menu"> |
|
15 | <%block name="header_menu"> | |
16 | ${self.menu('repositories')} |
|
16 | ${self.menu('repositories')} | |
17 | </%block> |
|
17 | </%block> | |
18 |
|
18 | |||
19 | <%def name="main()"> |
|
19 | <%def name="main()"> | |
20 | ${self.repo_context_bar('showforks')} |
|
20 | ${self.repo_context_bar('showforks')} | |
21 | <div class="box"> |
|
21 | <div class="box"> | |
22 | <!-- box / title --> |
|
22 | <!-- box / title --> | |
23 | <div class="title"> |
|
23 | <div class="title"> | |
24 | ${self.breadcrumbs()} |
|
24 | ${self.breadcrumbs()} | |
25 | </div> |
|
25 | </div> | |
26 | <!-- end box / title --> |
|
26 | <!-- end box / title --> | |
27 | <div class="table"> |
|
27 | <div class="table"> | |
28 | <div id="forks"> |
|
28 | <div id="forks"> | |
29 | ${c.forks_data} |
|
29 | ${c.forks_data} | |
30 | </div> |
|
30 | </div> | |
31 | </div> |
|
31 | </div> | |
32 | </div> |
|
32 | </div> | |
33 | </%def> |
|
33 | </%def> |
@@ -1,20 +1,20 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="base/base.html"/> |
|
2 | <%inherit file="base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Dashboard')} |
|
5 | ${_('Dashboard')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs()"> |
|
11 | <%def name="breadcrumbs()"> | |
12 | </%def> |
|
12 | </%def> | |
13 |
|
13 | |||
14 | <%block name="header_menu"> |
|
14 | <%block name="header_menu"> | |
15 | ${self.menu('repositories')} |
|
15 | ${self.menu('repositories')} | |
16 | </%block> |
|
16 | </%block> | |
17 |
|
17 | |||
18 | <%def name="main()"> |
|
18 | <%def name="main()"> | |
19 | <%include file="index_base.html" args="parent=self"/> |
|
19 | <%include file="index_base.html" args="parent=self"/> | |
20 | </%def> |
|
20 | </%def> |
@@ -1,339 +1,339 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
<% |
|
3 | <%block name="title"> | |
4 | ${_('Journal')} |
|
4 | ${_('Journal')} | |
5 | %if c.site_name: |
|
5 | %if c.site_name: | |
6 | · ${c.site_name} |
|
6 | · ${c.site_name} | |
7 | %endif |
|
7 | %endif | |
8 | </%def> |
|
8 | </%block> | |
9 | <%def name="breadcrumbs()"> |
|
9 | <%def name="breadcrumbs()"> | |
10 | <h5> |
|
10 | <h5> | |
11 | <form id="filter_form"> |
|
11 | <form id="filter_form"> | |
12 | <input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term or _('quick filter...')}"/> |
|
12 | <input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term or _('quick filter...')}"/> | |
13 | <span class="tooltip" title="${h.tooltip(h.journal_filter_help())}">?</span> |
|
13 | <span class="tooltip" title="${h.tooltip(h.journal_filter_help())}">?</span> | |
14 | <input type='submit' value="${_('Filter')}" class="btn btn-small" style="padding:0px 2px 0px 2px;margin:0px"/> |
|
14 | <input type='submit' value="${_('Filter')}" class="btn btn-small" style="padding:0px 2px 0px 2px;margin:0px"/> | |
15 | ${_('Journal')} - ${ungettext('%s Entry', '%s Entries', c.journal_pager.item_count) % (c.journal_pager.item_count)} |
|
15 | ${_('Journal')} - ${ungettext('%s Entry', '%s Entries', c.journal_pager.item_count) % (c.journal_pager.item_count)} | |
16 | </form> |
|
16 | </form> | |
17 | ${h.end_form()} |
|
17 | ${h.end_form()} | |
18 | </h5> |
|
18 | </h5> | |
19 | </%def> |
|
19 | </%def> | |
20 | <%block name="header_menu"> |
|
20 | <%block name="header_menu"> | |
21 | ${self.menu('journal')} |
|
21 | ${self.menu('journal')} | |
22 | </%block> |
|
22 | </%block> | |
23 | <%block name="head_extra"> |
|
23 | <%block name="head_extra"> | |
24 | <link href="${h.url('journal_atom', api_key=c.authuser.api_key)}" rel="alternate" title="${_('ATOM journal feed')}" type="application/atom+xml" /> |
|
24 | <link href="${h.url('journal_atom', api_key=c.authuser.api_key)}" rel="alternate" title="${_('ATOM journal feed')}" type="application/atom+xml" /> | |
25 | <link href="${h.url('journal_rss', api_key=c.authuser.api_key)}" rel="alternate" title="${_('RSS journal feed')}" type="application/rss+xml" /> |
|
25 | <link href="${h.url('journal_rss', api_key=c.authuser.api_key)}" rel="alternate" title="${_('RSS journal feed')}" type="application/rss+xml" /> | |
26 | </%block> |
|
26 | </%block> | |
27 |
|
27 | |||
28 | <%def name="main()"> |
|
28 | <%def name="main()"> | |
29 | <div class="box box-left"> |
|
29 | <div class="box box-left"> | |
30 | <!-- box / title --> |
|
30 | <!-- box / title --> | |
31 | <div class="title"> |
|
31 | <div class="title"> | |
32 | ${self.breadcrumbs()} |
|
32 | ${self.breadcrumbs()} | |
33 | <ul class="links icon-only-links"> |
|
33 | <ul class="links icon-only-links"> | |
34 | <li> |
|
34 | <li> | |
35 | <span><a id="refresh" href="${h.url('journal')}"><i class="icon-arrows-cw"></i></a></span> |
|
35 | <span><a id="refresh" href="${h.url('journal')}"><i class="icon-arrows-cw"></i></a></span> | |
36 | </li> |
|
36 | </li> | |
37 | <li> |
|
37 | <li> | |
38 | <span><a href="${h.url('journal_atom', api_key=c.authuser.api_key)}"><i class="icon-rss-squared"></i></a></span> |
|
38 | <span><a href="${h.url('journal_atom', api_key=c.authuser.api_key)}"><i class="icon-rss-squared"></i></a></span> | |
39 | </li> |
|
39 | </li> | |
40 | </ul> |
|
40 | </ul> | |
41 | </div> |
|
41 | </div> | |
42 | <div id="journal">${c.journal_data}</div> |
|
42 | <div id="journal">${c.journal_data}</div> | |
43 | </div> |
|
43 | </div> | |
44 | <div class="box box-right"> |
|
44 | <div class="box box-right"> | |
45 | <!-- box / title --> |
|
45 | <!-- box / title --> | |
46 |
|
46 | |||
47 | <div class="title"> |
|
47 | <div class="title"> | |
48 | <h5> |
|
48 | <h5> | |
49 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value="" style="display: none"/> |
|
49 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value="" style="display: none"/> | |
50 | <input class="q_filter_box" id="q_filter_watched" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value="" style="display: none"/> |
|
50 | <input class="q_filter_box" id="q_filter_watched" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value="" style="display: none"/> | |
51 | </h5> |
|
51 | </h5> | |
52 | <ul class="links nav nav-tabs"> |
|
52 | <ul class="links nav nav-tabs"> | |
53 | <li class="active" id="show_watched_li"> |
|
53 | <li class="active" id="show_watched_li"> | |
54 | <a id="show_watched" href="#watched"><i class="icon-eye"></i> ${_('Watched')}</a> |
|
54 | <a id="show_watched" href="#watched"><i class="icon-eye"></i> ${_('Watched')}</a> | |
55 | </li> |
|
55 | </li> | |
56 | <li id="show_my_li"> |
|
56 | <li id="show_my_li"> | |
57 | <a id="show_my" href="#my"><i class="icon-database"></i> ${_('My Repos')}</a> |
|
57 | <a id="show_my" href="#my"><i class="icon-database"></i> ${_('My Repos')}</a> | |
58 | </li> |
|
58 | </li> | |
59 | </ul> |
|
59 | </ul> | |
60 | </div> |
|
60 | </div> | |
61 |
|
61 | |||
62 | <!-- end box / title --> |
|
62 | <!-- end box / title --> | |
63 | <div id="my_container" style="display:none"> |
|
63 | <div id="my_container" style="display:none"> | |
64 | <div class="table-grid table yui-skin-sam" id="repos_list_wrap"></div> |
|
64 | <div class="table-grid table yui-skin-sam" id="repos_list_wrap"></div> | |
65 | <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div> |
|
65 | <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div> | |
66 | </div> |
|
66 | </div> | |
67 |
|
67 | |||
68 | <div id="watched_container"> |
|
68 | <div id="watched_container"> | |
69 | <div class="table-grid table yui-skin-sam" id="watched_repos_list_wrap"></div> |
|
69 | <div class="table-grid table yui-skin-sam" id="watched_repos_list_wrap"></div> | |
70 | <div id="watched-user-paginator" style="padding: 0px 0px 0px 20px"></div> |
|
70 | <div id="watched-user-paginator" style="padding: 0px 0px 0px 20px"></div> | |
71 | </div> |
|
71 | </div> | |
72 | </div> |
|
72 | </div> | |
73 |
|
73 | |||
74 | <script type="text/javascript"> |
|
74 | <script type="text/javascript"> | |
75 |
|
75 | |||
76 | $('#j_filter').click(function(){ |
|
76 | $('#j_filter').click(function(){ | |
77 | var $jfilter = $('#j_filter'); |
|
77 | var $jfilter = $('#j_filter'); | |
78 | if($jfilter.hasClass('initial')){ |
|
78 | if($jfilter.hasClass('initial')){ | |
79 | $jfilter.val(''); |
|
79 | $jfilter.val(''); | |
80 | } |
|
80 | } | |
81 | }); |
|
81 | }); | |
82 | var fix_j_filter_width = function(len){ |
|
82 | var fix_j_filter_width = function(len){ | |
83 | $('#j_filter').css('width', Math.max(80, len*6.50)+'px'); |
|
83 | $('#j_filter').css('width', Math.max(80, len*6.50)+'px'); | |
84 | }; |
|
84 | }; | |
85 | $('#j_filter').keyup(function(){ |
|
85 | $('#j_filter').keyup(function(){ | |
86 | fix_j_filter_width($('#j_filter').val().length); |
|
86 | fix_j_filter_width($('#j_filter').val().length); | |
87 | }); |
|
87 | }); | |
88 | $('#filter_form').submit(function(e){ |
|
88 | $('#filter_form').submit(function(e){ | |
89 | e.preventDefault(); |
|
89 | e.preventDefault(); | |
90 | var val = $('#j_filter').val(); |
|
90 | var val = $('#j_filter').val(); | |
91 | window.location = "${url.current(filter='__FILTER__')}".replace('__FILTER__',val); |
|
91 | window.location = "${url.current(filter='__FILTER__')}".replace('__FILTER__',val); | |
92 | }); |
|
92 | }); | |
93 | fix_j_filter_width($('#j_filter').val().length); |
|
93 | fix_j_filter_width($('#j_filter').val().length); | |
94 |
|
94 | |||
95 | $('#refresh').click(function(e){ |
|
95 | $('#refresh').click(function(e){ | |
96 | asynchtml("${h.url.current(filter=c.search_term)}", $("#journal"), function(){ |
|
96 | asynchtml("${h.url.current(filter=c.search_term)}", $("#journal"), function(){ | |
97 | show_more_event(); |
|
97 | show_more_event(); | |
98 | tooltip_activate(); |
|
98 | tooltip_activate(); | |
99 | show_changeset_tooltip(); |
|
99 | show_changeset_tooltip(); | |
100 | }); |
|
100 | }); | |
101 | e.preventDefault(); |
|
101 | e.preventDefault(); | |
102 | }); |
|
102 | }); | |
103 |
|
103 | |||
104 | var show_my = function(e){ |
|
104 | var show_my = function(e){ | |
105 | $('#watched_container').hide(); |
|
105 | $('#watched_container').hide(); | |
106 | $('#my_container').show(); |
|
106 | $('#my_container').show(); | |
107 | $('#q_filter').show(); |
|
107 | $('#q_filter').show(); | |
108 | $('#q_filter_watched').hide(); |
|
108 | $('#q_filter_watched').hide(); | |
109 |
|
109 | |||
110 | $('#show_my_li').addClass('active'); |
|
110 | $('#show_my_li').addClass('active'); | |
111 | $('#show_watched_li').removeClass('active'); |
|
111 | $('#show_watched_li').removeClass('active'); | |
112 | if(!$('#show_my').hasClass('loaded')){ |
|
112 | if(!$('#show_my').hasClass('loaded')){ | |
113 | table_renderer(${c.data |n}); |
|
113 | table_renderer(${c.data |n}); | |
114 | $('#show_my').addClass('loaded'); |
|
114 | $('#show_my').addClass('loaded'); | |
115 | } |
|
115 | } | |
116 | }; |
|
116 | }; | |
117 | $('#show_my').click(function(){ |
|
117 | $('#show_my').click(function(){ | |
118 | show_my(); |
|
118 | show_my(); | |
119 | }); |
|
119 | }); | |
120 | var show_watched = function(){ |
|
120 | var show_watched = function(){ | |
121 | $('#my_container').hide(); |
|
121 | $('#my_container').hide(); | |
122 | $('#watched_container').show(); |
|
122 | $('#watched_container').show(); | |
123 | $('#q_filter_watched').show(); |
|
123 | $('#q_filter_watched').show(); | |
124 | $('#q_filter').hide(); |
|
124 | $('#q_filter').hide(); | |
125 |
|
125 | |||
126 | $('#show_watched_li').addClass('active'); |
|
126 | $('#show_watched_li').addClass('active'); | |
127 | $('#show_my_li').removeClass('active'); |
|
127 | $('#show_my_li').removeClass('active'); | |
128 | if(!$('#show_watched').hasClass('loaded')){ |
|
128 | if(!$('#show_watched').hasClass('loaded')){ | |
129 | watched_renderer(${c.watched_data |n}); |
|
129 | watched_renderer(${c.watched_data |n}); | |
130 | $('#show_watched').addClass('loaded'); |
|
130 | $('#show_watched').addClass('loaded'); | |
131 | } |
|
131 | } | |
132 | }; |
|
132 | }; | |
133 | $('#show_watched').click(function(){ |
|
133 | $('#show_watched').click(function(){ | |
134 | show_watched(); |
|
134 | show_watched(); | |
135 | }); |
|
135 | }); | |
136 | //init watched |
|
136 | //init watched | |
137 | show_watched(); |
|
137 | show_watched(); | |
138 |
|
138 | |||
139 | var tabs = { |
|
139 | var tabs = { | |
140 | 'watched': show_watched, |
|
140 | 'watched': show_watched, | |
141 | 'my': show_my |
|
141 | 'my': show_my | |
142 | } |
|
142 | } | |
143 | var url = location.href.split('#'); |
|
143 | var url = location.href.split('#'); | |
144 | if (url[1]) { |
|
144 | if (url[1]) { | |
145 | //We have a hash |
|
145 | //We have a hash | |
146 | var tabHash = url[1]; |
|
146 | var tabHash = url[1]; | |
147 | var func = tabs[tabHash] |
|
147 | var func = tabs[tabHash] | |
148 | if (func){ |
|
148 | if (func){ | |
149 | func(); |
|
149 | func(); | |
150 | } |
|
150 | } | |
151 | } |
|
151 | } | |
152 | function watched_renderer(data){ |
|
152 | function watched_renderer(data){ | |
153 | var myDataSource = new YAHOO.util.DataSource(data); |
|
153 | var myDataSource = new YAHOO.util.DataSource(data); | |
154 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; |
|
154 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; | |
155 |
|
155 | |||
156 | myDataSource.responseSchema = { |
|
156 | myDataSource.responseSchema = { | |
157 | resultsList: "records", |
|
157 | resultsList: "records", | |
158 | fields: [ |
|
158 | fields: [ | |
159 | {key:"menu"}, |
|
159 | {key:"menu"}, | |
160 | {key:"raw_name"}, |
|
160 | {key:"raw_name"}, | |
161 | {key:"name"}, |
|
161 | {key:"name"}, | |
162 | {key:"last_changeset"}, |
|
162 | {key:"last_changeset"}, | |
163 | {key:"last_rev_raw"}, |
|
163 | {key:"last_rev_raw"}, | |
164 | {key:"action"} |
|
164 | {key:"action"} | |
165 | ] |
|
165 | ] | |
166 | }; |
|
166 | }; | |
167 | myDataSource.doBeforeCallback = function(req,raw,res,cb) { |
|
167 | myDataSource.doBeforeCallback = function(req,raw,res,cb) { | |
168 | // This is the filter function |
|
168 | // This is the filter function | |
169 | var data = res.results || [], |
|
169 | var data = res.results || [], | |
170 | filtered = [], |
|
170 | filtered = [], | |
171 | i,l; |
|
171 | i,l; | |
172 |
|
172 | |||
173 | if (req) { |
|
173 | if (req) { | |
174 | req = req.toLowerCase(); |
|
174 | req = req.toLowerCase(); | |
175 | for (i = 0; i<data.length; i++) { |
|
175 | for (i = 0; i<data.length; i++) { | |
176 | var pos = data[i].raw_name.toLowerCase().indexOf(req) |
|
176 | var pos = data[i].raw_name.toLowerCase().indexOf(req) | |
177 | if (pos != -1) { |
|
177 | if (pos != -1) { | |
178 | filtered.push(data[i]); |
|
178 | filtered.push(data[i]); | |
179 | } |
|
179 | } | |
180 | } |
|
180 | } | |
181 | res.results = filtered; |
|
181 | res.results = filtered; | |
182 | } |
|
182 | } | |
183 | return res; |
|
183 | return res; | |
184 | } |
|
184 | } | |
185 | // main table sorting |
|
185 | // main table sorting | |
186 | var myColumnDefs = [ |
|
186 | var myColumnDefs = [ | |
187 | {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"}, |
|
187 | {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"}, | |
188 | {key:"name",label:"${_('Name')}",sortable:true, |
|
188 | {key:"name",label:"${_('Name')}",sortable:true, | |
189 | sortOptions: { sortFunction: nameSort }}, |
|
189 | sortOptions: { sortFunction: nameSort }}, | |
190 | {key:"last_changeset",label:"${_('Tip')}",sortable:true, |
|
190 | {key:"last_changeset",label:"${_('Tip')}",sortable:true, | |
191 | sortOptions: { sortFunction: revisionSort }}, |
|
191 | sortOptions: { sortFunction: revisionSort }}, | |
192 | {key:"action",label:"${_('Action')}",sortable:false} |
|
192 | {key:"action",label:"${_('Action')}",sortable:false} | |
193 | ]; |
|
193 | ]; | |
194 |
|
194 | |||
195 | var myDataTable = new YAHOO.widget.DataTable("watched_repos_list_wrap", myColumnDefs, myDataSource,{ |
|
195 | var myDataTable = new YAHOO.widget.DataTable("watched_repos_list_wrap", myColumnDefs, myDataSource,{ | |
196 | sortedBy:{key:"name",dir:"asc"}, |
|
196 | sortedBy:{key:"name",dir:"asc"}, | |
197 | paginator: YUI_paginator(25, ['watched-user-paginator']), |
|
197 | paginator: YUI_paginator(25, ['watched-user-paginator']), | |
198 |
|
198 | |||
199 | MSG_SORTASC:"${_('Click to sort ascending')}", |
|
199 | MSG_SORTASC:"${_('Click to sort ascending')}", | |
200 | MSG_SORTDESC:"${_('Click to sort descending')}", |
|
200 | MSG_SORTDESC:"${_('Click to sort descending')}", | |
201 | MSG_EMPTY:"${_('No records found.')}", |
|
201 | MSG_EMPTY:"${_('No records found.')}", | |
202 | MSG_ERROR:"${_('Data error.')}", |
|
202 | MSG_ERROR:"${_('Data error.')}", | |
203 | MSG_LOADING:"${_('Loading...')}" |
|
203 | MSG_LOADING:"${_('Loading...')}" | |
204 | } |
|
204 | } | |
205 | ); |
|
205 | ); | |
206 | myDataTable.subscribe('postRenderEvent',function(oArgs) { |
|
206 | myDataTable.subscribe('postRenderEvent',function(oArgs) { | |
207 | tooltip_activate(); |
|
207 | tooltip_activate(); | |
208 | quick_repo_menu(); |
|
208 | quick_repo_menu(); | |
209 | }); |
|
209 | }); | |
210 |
|
210 | |||
211 | var filterTimeout = null; |
|
211 | var filterTimeout = null; | |
212 |
|
212 | |||
213 | updateFilter = function () { |
|
213 | updateFilter = function () { | |
214 | // Reset timeout |
|
214 | // Reset timeout | |
215 | filterTimeout = null; |
|
215 | filterTimeout = null; | |
216 |
|
216 | |||
217 | // Reset sort |
|
217 | // Reset sort | |
218 | var state = myDataTable.getState(); |
|
218 | var state = myDataTable.getState(); | |
219 | state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC}; |
|
219 | state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC}; | |
220 |
|
220 | |||
221 | // Get filtered data |
|
221 | // Get filtered data | |
222 | myDataSource.sendRequest(YUD.get('q_filter_watched').value,{ |
|
222 | myDataSource.sendRequest(YUD.get('q_filter_watched').value,{ | |
223 | success : myDataTable.onDataReturnInitializeTable, |
|
223 | success : myDataTable.onDataReturnInitializeTable, | |
224 | failure : myDataTable.onDataReturnInitializeTable, |
|
224 | failure : myDataTable.onDataReturnInitializeTable, | |
225 | scope : myDataTable, |
|
225 | scope : myDataTable, | |
226 | argument: state |
|
226 | argument: state | |
227 | }); |
|
227 | }); | |
228 |
|
228 | |||
229 | }; |
|
229 | }; | |
230 | $('#q_filter_watched').click(function(){ |
|
230 | $('#q_filter_watched').click(function(){ | |
231 | if(!$('#q_filter_watched').hasClass('loaded')) { |
|
231 | if(!$('#q_filter_watched').hasClass('loaded')) { | |
232 | //TODO: load here full list later to do search within groups |
|
232 | //TODO: load here full list later to do search within groups | |
233 | $('#q_filter_watched').css('loaded'); |
|
233 | $('#q_filter_watched').css('loaded'); | |
234 | } |
|
234 | } | |
235 | }); |
|
235 | }); | |
236 |
|
236 | |||
237 | $('#q_filter_watched').keyup(function(){ |
|
237 | $('#q_filter_watched').keyup(function(){ | |
238 | clearTimeout(filterTimeout); |
|
238 | clearTimeout(filterTimeout); | |
239 | filterTimeout = setTimeout(updateFilter,600); |
|
239 | filterTimeout = setTimeout(updateFilter,600); | |
240 | }); |
|
240 | }); | |
241 | } |
|
241 | } | |
242 |
|
242 | |||
243 | function table_renderer(data){ |
|
243 | function table_renderer(data){ | |
244 | var myDataSource = new YAHOO.util.DataSource(data); |
|
244 | var myDataSource = new YAHOO.util.DataSource(data); | |
245 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; |
|
245 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; | |
246 |
|
246 | |||
247 | myDataSource.responseSchema = { |
|
247 | myDataSource.responseSchema = { | |
248 | resultsList: "records", |
|
248 | resultsList: "records", | |
249 | fields: [ |
|
249 | fields: [ | |
250 | {key:"menu"}, |
|
250 | {key:"menu"}, | |
251 | {key:"raw_name"}, |
|
251 | {key:"raw_name"}, | |
252 | {key:"name"}, |
|
252 | {key:"name"}, | |
253 | {key:"last_changeset"}, |
|
253 | {key:"last_changeset"}, | |
254 | {key:"last_rev_raw"}, |
|
254 | {key:"last_rev_raw"}, | |
255 | {key:"action"} |
|
255 | {key:"action"} | |
256 | ] |
|
256 | ] | |
257 | }; |
|
257 | }; | |
258 | myDataSource.doBeforeCallback = function(req,raw,res,cb) { |
|
258 | myDataSource.doBeforeCallback = function(req,raw,res,cb) { | |
259 | // This is the filter function |
|
259 | // This is the filter function | |
260 | var data = res.results || [], |
|
260 | var data = res.results || [], | |
261 | filtered = [], |
|
261 | filtered = [], | |
262 | i,l; |
|
262 | i,l; | |
263 |
|
263 | |||
264 | if (req) { |
|
264 | if (req) { | |
265 | req = req.toLowerCase(); |
|
265 | req = req.toLowerCase(); | |
266 | for (i = 0; i<data.length; i++) { |
|
266 | for (i = 0; i<data.length; i++) { | |
267 | var pos = data[i].raw_name.toLowerCase().indexOf(req) |
|
267 | var pos = data[i].raw_name.toLowerCase().indexOf(req) | |
268 | if (pos != -1) { |
|
268 | if (pos != -1) { | |
269 | filtered.push(data[i]); |
|
269 | filtered.push(data[i]); | |
270 | } |
|
270 | } | |
271 | } |
|
271 | } | |
272 | res.results = filtered; |
|
272 | res.results = filtered; | |
273 | } |
|
273 | } | |
274 | return res; |
|
274 | return res; | |
275 | } |
|
275 | } | |
276 | // main table sorting |
|
276 | // main table sorting | |
277 | var myColumnDefs = [ |
|
277 | var myColumnDefs = [ | |
278 | {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"}, |
|
278 | {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"}, | |
279 | {key:"name",label:"${_('Name')}",sortable:true, |
|
279 | {key:"name",label:"${_('Name')}",sortable:true, | |
280 | sortOptions: { sortFunction: nameSort }}, |
|
280 | sortOptions: { sortFunction: nameSort }}, | |
281 | {key:"last_changeset",label:"${_('Tip')}",sortable:true, |
|
281 | {key:"last_changeset",label:"${_('Tip')}",sortable:true, | |
282 | sortOptions: { sortFunction: revisionSort }}, |
|
282 | sortOptions: { sortFunction: revisionSort }}, | |
283 | {key:"action",label:"${_('Action')}",sortable:false} |
|
283 | {key:"action",label:"${_('Action')}",sortable:false} | |
284 | ]; |
|
284 | ]; | |
285 |
|
285 | |||
286 | var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,{ |
|
286 | var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,{ | |
287 | sortedBy:{key:"name",dir:"asc"}, |
|
287 | sortedBy:{key:"name",dir:"asc"}, | |
288 | paginator: YUI_paginator(25, ['user-paginator']), |
|
288 | paginator: YUI_paginator(25, ['user-paginator']), | |
289 |
|
289 | |||
290 | MSG_SORTASC:"${_('Click to sort ascending')}", |
|
290 | MSG_SORTASC:"${_('Click to sort ascending')}", | |
291 | MSG_SORTDESC:"${_('Click to sort descending')}", |
|
291 | MSG_SORTDESC:"${_('Click to sort descending')}", | |
292 | MSG_EMPTY:"${_('No records found.')}", |
|
292 | MSG_EMPTY:"${_('No records found.')}", | |
293 | MSG_ERROR:"${_('Data error.')}", |
|
293 | MSG_ERROR:"${_('Data error.')}", | |
294 | MSG_LOADING:"${_('Loading...')}" |
|
294 | MSG_LOADING:"${_('Loading...')}" | |
295 | } |
|
295 | } | |
296 | ); |
|
296 | ); | |
297 | myDataTable.subscribe('postRenderEvent',function(oArgs) { |
|
297 | myDataTable.subscribe('postRenderEvent',function(oArgs) { | |
298 | tooltip_activate(); |
|
298 | tooltip_activate(); | |
299 | quick_repo_menu(); |
|
299 | quick_repo_menu(); | |
300 | }); |
|
300 | }); | |
301 |
|
301 | |||
302 | var filterTimeout = null; |
|
302 | var filterTimeout = null; | |
303 |
|
303 | |||
304 | updateFilter = function () { |
|
304 | updateFilter = function () { | |
305 | // Reset timeout |
|
305 | // Reset timeout | |
306 | filterTimeout = null; |
|
306 | filterTimeout = null; | |
307 |
|
307 | |||
308 | // Reset sort |
|
308 | // Reset sort | |
309 | var state = myDataTable.getState(); |
|
309 | var state = myDataTable.getState(); | |
310 | state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC}; |
|
310 | state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC}; | |
311 |
|
311 | |||
312 | // Get filtered data |
|
312 | // Get filtered data | |
313 | myDataSource.sendRequest(YUD.get('q_filter').value,{ |
|
313 | myDataSource.sendRequest(YUD.get('q_filter').value,{ | |
314 | success : myDataTable.onDataReturnInitializeTable, |
|
314 | success : myDataTable.onDataReturnInitializeTable, | |
315 | failure : myDataTable.onDataReturnInitializeTable, |
|
315 | failure : myDataTable.onDataReturnInitializeTable, | |
316 | scope : myDataTable, |
|
316 | scope : myDataTable, | |
317 | argument: state |
|
317 | argument: state | |
318 | }); |
|
318 | }); | |
319 |
|
319 | |||
320 | }; |
|
320 | }; | |
321 | $('#q_filter').click(function(){ |
|
321 | $('#q_filter').click(function(){ | |
322 | if(!$('#q_filter').hasClass('loaded')){ |
|
322 | if(!$('#q_filter').hasClass('loaded')){ | |
323 | //TODO: load here full list later to do search within groups |
|
323 | //TODO: load here full list later to do search within groups | |
324 | $('#q_filter').addClass('loaded'); |
|
324 | $('#q_filter').addClass('loaded'); | |
325 | } |
|
325 | } | |
326 | }); |
|
326 | }); | |
327 |
|
327 | |||
328 | $('#q_filter').keyup(function(){ |
|
328 | $('#q_filter').keyup(function(){ | |
329 | clearTimeout(filterTimeout); |
|
329 | clearTimeout(filterTimeout); | |
330 | filterTimeout = setTimeout(updateFilter,600); |
|
330 | filterTimeout = setTimeout(updateFilter,600); | |
331 | }); |
|
331 | }); | |
332 |
|
332 | |||
333 | if($('#q_filter').val()) { |
|
333 | if($('#q_filter').val()) { | |
334 | updateFilter(); |
|
334 | updateFilter(); | |
335 | } |
|
335 | } | |
336 | } |
|
336 | } | |
337 |
|
337 | |||
338 | </script> |
|
338 | </script> | |
339 | </%def> |
|
339 | </%def> |
@@ -1,37 +1,37 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
<% |
|
3 | <%block name="title"> | |
4 | ${_('Public Journal')} |
|
4 | ${_('Public Journal')} | |
5 | %if c.site_name: |
|
5 | %if c.site_name: | |
6 | · ${c.site_name} |
|
6 | · ${c.site_name} | |
7 | %endif |
|
7 | %endif | |
8 | </%def> |
|
8 | </%block> | |
9 | <%def name="breadcrumbs()"> |
|
9 | <%def name="breadcrumbs()"> | |
10 | ${c.site_name} |
|
10 | ${c.site_name} | |
11 | </%def> |
|
11 | </%def> | |
12 | <%block name="header_menu"> |
|
12 | <%block name="header_menu"> | |
13 | ${self.menu('journal')} |
|
13 | ${self.menu('journal')} | |
14 | </%block> |
|
14 | </%block> | |
15 | <%block name="head_extra"> |
|
15 | <%block name="head_extra"> | |
16 | <link href="${h.url('public_journal_atom')}" rel="alternate" title="${_('ATOM public journal feed')}" type="application/atom+xml" /> |
|
16 | <link href="${h.url('public_journal_atom')}" rel="alternate" title="${_('ATOM public journal feed')}" type="application/atom+xml" /> | |
17 | <link href="${h.url('public_journal_rss')}" rel="alternate" title="${_('RSS public journal feed')}" type="application/rss+xml" /> |
|
17 | <link href="${h.url('public_journal_rss')}" rel="alternate" title="${_('RSS public journal feed')}" type="application/rss+xml" /> | |
18 | </%block> |
|
18 | </%block> | |
19 | <%def name="main()"> |
|
19 | <%def name="main()"> | |
20 |
|
20 | |||
21 | <div class="box"> |
|
21 | <div class="box"> | |
22 | <!-- box / title --> |
|
22 | <!-- box / title --> | |
23 | <div class="title"> |
|
23 | <div class="title"> | |
24 | <h5>${_('Public Journal')}</h5> |
|
24 | <h5>${_('Public Journal')}</h5> | |
25 | <ul class="links"> |
|
25 | <ul class="links"> | |
26 | <li> |
|
26 | <li> | |
27 | <span> |
|
27 | <span> | |
28 | <a href="${h.url('public_journal_atom')}"> <i class="icon-rss-squared" style="color: #fa9b39"></i></a> |
|
28 | <a href="${h.url('public_journal_atom')}"> <i class="icon-rss-squared" style="color: #fa9b39"></i></a> | |
29 | </span> |
|
29 | </span> | |
30 | </li> |
|
30 | </li> | |
31 | </ul> |
|
31 | </ul> | |
32 | </div> |
|
32 | </div> | |
33 |
|
33 | |||
34 | <div id="journal">${c.journal_data}</div> |
|
34 | <div id="journal">${c.journal_data}</div> | |
35 | </div> |
|
35 | </div> | |
36 |
|
36 | |||
37 | </%def> |
|
37 | </%def> |
@@ -1,76 +1,76 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="base/root.html"/> |
|
2 | <%inherit file="base/root.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Log In')} |
|
5 | ${_('Log In')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <div id="login"> |
|
11 | <div id="login"> | |
12 | <%include file="/base/flash_msg.html"/> |
|
12 | <%include file="/base/flash_msg.html"/> | |
13 | <!-- login --> |
|
13 | <!-- login --> | |
14 | <div class="title withlogo"> |
|
14 | <div class="title withlogo"> | |
15 | %if c.site_name: |
|
15 | %if c.site_name: | |
16 | <h5>${_('Log In to %s') % c.site_name}</h5> |
|
16 | <h5>${_('Log In to %s') % c.site_name}</h5> | |
17 | %else: |
|
17 | %else: | |
18 | <h5>${_('Log In')}</h5> |
|
18 | <h5>${_('Log In')}</h5> | |
19 | %endif |
|
19 | %endif | |
20 | </div> |
|
20 | </div> | |
21 | <div class="inner"> |
|
21 | <div class="inner"> | |
22 | ${h.form(h.url.current(came_from=c.came_from))} |
|
22 | ${h.form(h.url.current(came_from=c.came_from))} | |
23 | <div class="form"> |
|
23 | <div class="form"> | |
24 | <i class="icon-lock"></i> |
|
24 | <i class="icon-lock"></i> | |
25 | <!-- fields --> |
|
25 | <!-- fields --> | |
26 |
|
26 | |||
27 | <div class="fields"> |
|
27 | <div class="fields"> | |
28 | <div class="field"> |
|
28 | <div class="field"> | |
29 | <div class="label"> |
|
29 | <div class="label"> | |
30 | <label for="username">${_('Username')}:</label> |
|
30 | <label for="username">${_('Username')}:</label> | |
31 | </div> |
|
31 | </div> | |
32 | <div class="input"> |
|
32 | <div class="input"> | |
33 | ${h.text('username',class_='focus large')} |
|
33 | ${h.text('username',class_='focus large')} | |
34 | </div> |
|
34 | </div> | |
35 |
|
35 | |||
36 | </div> |
|
36 | </div> | |
37 | <div class="field"> |
|
37 | <div class="field"> | |
38 | <div class="label"> |
|
38 | <div class="label"> | |
39 | <label for="password">${_('Password')}:</label> |
|
39 | <label for="password">${_('Password')}:</label> | |
40 | </div> |
|
40 | </div> | |
41 | <div class="input"> |
|
41 | <div class="input"> | |
42 | ${h.password('password',class_='focus large')} |
|
42 | ${h.password('password',class_='focus large')} | |
43 | </div> |
|
43 | </div> | |
44 |
|
44 | |||
45 | </div> |
|
45 | </div> | |
46 | <div class="field"> |
|
46 | <div class="field"> | |
47 | <div class="checkbox"> |
|
47 | <div class="checkbox"> | |
48 | <input type="checkbox" id="remember" name="remember" /> |
|
48 | <input type="checkbox" id="remember" name="remember" /> | |
49 | <label for="remember">${_('Remember me')}</label> |
|
49 | <label for="remember">${_('Remember me')}</label> | |
50 | </div> |
|
50 | </div> | |
51 | </div> |
|
51 | </div> | |
52 | <div class="buttons"> |
|
52 | <div class="buttons"> | |
53 | ${h.submit('sign_in',_('Sign In'),class_="btn")} |
|
53 | ${h.submit('sign_in',_('Sign In'),class_="btn")} | |
54 | </div> |
|
54 | </div> | |
55 | </div> |
|
55 | </div> | |
56 | <!-- end fields --> |
|
56 | <!-- end fields --> | |
57 | <!-- links --> |
|
57 | <!-- links --> | |
58 | <div class="links"> |
|
58 | <div class="links"> | |
59 | ${h.link_to(_('Forgot your password ?'),h.url('reset_password'))} |
|
59 | ${h.link_to(_('Forgot your password ?'),h.url('reset_password'))} | |
60 | %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')(): |
|
60 | %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')(): | |
61 | / |
|
61 | / | |
62 | ${h.link_to(_("Don't have an account ?"),h.url('register'))} |
|
62 | ${h.link_to(_("Don't have an account ?"),h.url('register'))} | |
63 | %endif |
|
63 | %endif | |
64 | </div> |
|
64 | </div> | |
65 |
|
65 | |||
66 | <!-- end links --> |
|
66 | <!-- end links --> | |
67 | </div> |
|
67 | </div> | |
68 | ${h.end_form()} |
|
68 | ${h.end_form()} | |
69 | <script type="text/javascript"> |
|
69 | <script type="text/javascript"> | |
70 | $(document).ready(function(){ |
|
70 | $(document).ready(function(){ | |
71 | $('#username').focus(); |
|
71 | $('#username').focus(); | |
72 | }); |
|
72 | }); | |
73 | </script> |
|
73 | </script> | |
74 | </div> |
|
74 | </div> | |
75 | <!-- end login --> |
|
75 | <!-- end login --> | |
76 | </div> |
|
76 | </div> |
@@ -1,72 +1,72 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="base/root.html"/> |
|
2 | <%inherit file="base/root.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Password Reset')} |
|
5 | ${_('Password Reset')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <div id="register"> |
|
11 | <div id="register"> | |
12 | <%include file="/base/flash_msg.html"/> |
|
12 | <%include file="/base/flash_msg.html"/> | |
13 | <div class="title withlogo"> |
|
13 | <div class="title withlogo"> | |
14 | %if c.site_name: |
|
14 | %if c.site_name: | |
15 | <h5>${_('Reset Your Password to %s') % c.site_name}</h5> |
|
15 | <h5>${_('Reset Your Password to %s') % c.site_name}</h5> | |
16 | %else: |
|
16 | %else: | |
17 | <h5>${_('Reset Your Password')}</h5> |
|
17 | <h5>${_('Reset Your Password')}</h5> | |
18 | %endif |
|
18 | %endif | |
19 | </div> |
|
19 | </div> | |
20 | <div class="inner"> |
|
20 | <div class="inner"> | |
21 | ${h.form(url('password_reset'))} |
|
21 | ${h.form(url('password_reset'))} | |
22 | <div class="form"> |
|
22 | <div class="form"> | |
23 | <!-- fields --> |
|
23 | <!-- fields --> | |
24 | <div class="fields"> |
|
24 | <div class="fields"> | |
25 |
|
25 | |||
26 | <div class="field"> |
|
26 | <div class="field"> | |
27 | <div class="label"> |
|
27 | <div class="label"> | |
28 | <label for="email">${_('Email Address')}:</label> |
|
28 | <label for="email">${_('Email Address')}:</label> | |
29 | </div> |
|
29 | </div> | |
30 | <div class="input"> |
|
30 | <div class="input"> | |
31 | ${h.text('email')} |
|
31 | ${h.text('email')} | |
32 | </div> |
|
32 | </div> | |
33 | </div> |
|
33 | </div> | |
34 |
|
34 | |||
35 | %if c.captcha_active: |
|
35 | %if c.captcha_active: | |
36 | <div class="field"> |
|
36 | <div class="field"> | |
37 | <div class="label"> |
|
37 | <div class="label"> | |
38 | <label for="email">${_('Captcha')}:</label> |
|
38 | <label for="email">${_('Captcha')}:</label> | |
39 | </div> |
|
39 | </div> | |
40 | <div class="input"> |
|
40 | <div class="input"> | |
41 | ${h.hidden('recaptcha_field')} |
|
41 | ${h.hidden('recaptcha_field')} | |
42 | <div id="recaptcha"></div> |
|
42 | <div id="recaptcha"></div> | |
43 | </div> |
|
43 | </div> | |
44 | </div> |
|
44 | </div> | |
45 | %endif |
|
45 | %endif | |
46 |
|
46 | |||
47 | <div class="buttons"> |
|
47 | <div class="buttons"> | |
48 | <div class="nohighlight"> |
|
48 | <div class="nohighlight"> | |
49 | ${h.submit('send',_('Send Password Reset Email'),class_="btn")} |
|
49 | ${h.submit('send',_('Send Password Reset Email'),class_="btn")} | |
50 | <div class="activation_msg">${_('Password reset link will be sent to the email address matching your username.')}</div> |
|
50 | <div class="activation_msg">${_('Password reset link will be sent to the email address matching your username.')}</div> | |
51 | </div> |
|
51 | </div> | |
52 | </div> |
|
52 | </div> | |
53 | </div> |
|
53 | </div> | |
54 | </div> |
|
54 | </div> | |
55 | ${h.end_form()} |
|
55 | ${h.end_form()} | |
56 | %if c.captcha_active: |
|
56 | %if c.captcha_active: | |
57 | <script type="text/javascript" src="https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script> |
|
57 | <script type="text/javascript" src="https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script> | |
58 | %endif |
|
58 | %endif | |
59 | <script type="text/javascript"> |
|
59 | <script type="text/javascript"> | |
60 | $(document).ready(function(){ |
|
60 | $(document).ready(function(){ | |
61 | $('#email').focus(); |
|
61 | $('#email').focus(); | |
62 | %if c.captcha_active: |
|
62 | %if c.captcha_active: | |
63 | Recaptcha.create("${c.captcha_public_key}", "recaptcha", |
|
63 | Recaptcha.create("${c.captcha_public_key}", "recaptcha", | |
64 | { |
|
64 | { | |
65 | theme: "white" |
|
65 | theme: "white" | |
66 | } |
|
66 | } | |
67 | ); |
|
67 | ); | |
68 | %endif |
|
68 | %endif | |
69 | }); |
|
69 | }); | |
70 | </script> |
|
70 | </script> | |
71 | </div> |
|
71 | </div> | |
72 | </div> |
|
72 | </div> |
@@ -1,271 +1,271 | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 |
<% |
|
3 | <%block name="title"> | |
4 | ${c.repo_name} ${_('New Pull Request')} |
|
4 | ${c.repo_name} ${_('New Pull Request')} | |
5 | </%def> |
|
5 | </%block> | |
6 |
|
6 | |||
7 | <%def name="breadcrumbs_links()"> |
|
7 | <%def name="breadcrumbs_links()"> | |
8 | ${_('New Pull Request')} |
|
8 | ${_('New Pull Request')} | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 | <%block name="header_menu"> |
|
11 | <%block name="header_menu"> | |
12 | ${self.menu('repositories')} |
|
12 | ${self.menu('repositories')} | |
13 | </%block> |
|
13 | </%block> | |
14 |
|
14 | |||
15 | <%def name="main()"> |
|
15 | <%def name="main()"> | |
16 | ${self.repo_context_bar('showpullrequest')} |
|
16 | ${self.repo_context_bar('showpullrequest')} | |
17 | <div class="box"> |
|
17 | <div class="box"> | |
18 | <!-- box / title --> |
|
18 | <!-- box / title --> | |
19 | <div class="title"> |
|
19 | <div class="title"> | |
20 | ${self.breadcrumbs()} |
|
20 | ${self.breadcrumbs()} | |
21 | </div> |
|
21 | </div> | |
22 |
|
22 | |||
23 | ${h.form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')} |
|
23 | ${h.form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')} | |
24 | <div class="form"> |
|
24 | <div class="form"> | |
25 | <!-- fields --> |
|
25 | <!-- fields --> | |
26 |
|
26 | |||
27 | <div class="fields" style="float:left;width:50%;padding-right:30px;"> |
|
27 | <div class="fields" style="float:left;width:50%;padding-right:30px;"> | |
28 |
|
28 | |||
29 | <div class="field"> |
|
29 | <div class="field"> | |
30 | <div class="label"> |
|
30 | <div class="label"> | |
31 | <label for="pullrequest_title">${_('Title')}:</label> |
|
31 | <label for="pullrequest_title">${_('Title')}:</label> | |
32 | </div> |
|
32 | </div> | |
33 | <div class="input"> |
|
33 | <div class="input"> | |
34 | ${h.text('pullrequest_title',class_="large",placeholder=_('Summarize the changes - or leave empty'))} |
|
34 | ${h.text('pullrequest_title',class_="large",placeholder=_('Summarize the changes - or leave empty'))} | |
35 | </div> |
|
35 | </div> | |
36 | </div> |
|
36 | </div> | |
37 |
|
37 | |||
38 | <div class="field"> |
|
38 | <div class="field"> | |
39 | <div class="label label-textarea"> |
|
39 | <div class="label label-textarea"> | |
40 | <label for="pullrequest_desc">${_('Description')}:</label> |
|
40 | <label for="pullrequest_desc">${_('Description')}:</label> | |
41 | </div> |
|
41 | </div> | |
42 | <div class="textarea text-area editor"> |
|
42 | <div class="textarea text-area editor"> | |
43 | ${h.textarea('pullrequest_desc',size=30,placeholder=_('Write a short description on this pull request'))} |
|
43 | ${h.textarea('pullrequest_desc',size=30,placeholder=_('Write a short description on this pull request'))} | |
44 | </div> |
|
44 | </div> | |
45 | </div> |
|
45 | </div> | |
46 |
|
46 | |||
47 | <div class="field"> |
|
47 | <div class="field"> | |
48 | <div class="label label-textarea"> |
|
48 | <div class="label label-textarea"> | |
49 | <label for="pullrequest_desc">${_('Changeset flow')}:</label> |
|
49 | <label for="pullrequest_desc">${_('Changeset flow')}:</label> | |
50 | </div> |
|
50 | </div> | |
51 | <div class="input"> |
|
51 | <div class="input"> | |
52 | ##ORG |
|
52 | ##ORG | |
53 | <div> |
|
53 | <div> | |
54 | <div> |
|
54 | <div> | |
55 | <div style="padding:5px 3px 3px 3px;"> |
|
55 | <div style="padding:5px 3px 3px 3px;"> | |
56 | <b>${_('Origin repository')}:</b> <span id="org_repo_desc">${c.db_repo.description.split('\n')[0]}</span> |
|
56 | <b>${_('Origin repository')}:</b> <span id="org_repo_desc">${c.db_repo.description.split('\n')[0]}</span> | |
57 | </div> |
|
57 | </div> | |
58 | <div> |
|
58 | <div> | |
59 | ${h.select('org_repo','',c.cs_repos,class_='refs')}:${h.select('org_ref',c.default_cs_ref,c.cs_refs,class_='refs')} |
|
59 | ${h.select('org_repo','',c.cs_repos,class_='refs')}:${h.select('org_ref',c.default_cs_ref,c.cs_refs,class_='refs')} | |
60 | </div> |
|
60 | </div> | |
61 | <div style="padding:5px 3px 3px 3px;"> |
|
61 | <div style="padding:5px 3px 3px 3px;"> | |
62 | <b>${_('Revision')}:</b> <span id="org_rev_span">-</span> |
|
62 | <b>${_('Revision')}:</b> <span id="org_rev_span">-</span> | |
63 | </div> |
|
63 | </div> | |
64 | </div> |
|
64 | </div> | |
65 | </div> |
|
65 | </div> | |
66 |
|
66 | |||
67 | ##OTHER, most Probably the PARENT OF THIS FORK |
|
67 | ##OTHER, most Probably the PARENT OF THIS FORK | |
68 | <div style="border-top: 1px solid #EEE; margin: 5px 0px 0px 0px"> |
|
68 | <div style="border-top: 1px solid #EEE; margin: 5px 0px 0px 0px"> | |
69 | <div> |
|
69 | <div> | |
70 | ## filled with JS |
|
70 | ## filled with JS | |
71 | <div style="padding:5px 3px 3px 3px;"> |
|
71 | <div style="padding:5px 3px 3px 3px;"> | |
72 | <b>${_('Destination repository')}:</b> <span id="other_repo_desc">${c.a_repo.description.split('\n')[0]}</span> |
|
72 | <b>${_('Destination repository')}:</b> <span id="other_repo_desc">${c.a_repo.description.split('\n')[0]}</span> | |
73 | </div> |
|
73 | </div> | |
74 | <div> |
|
74 | <div> | |
75 | ${h.select('other_repo',c.a_repo.repo_name,c.a_repos,class_='refs')}:${h.select('other_ref',c.default_a_ref,c.a_refs,class_='refs')} |
|
75 | ${h.select('other_repo',c.a_repo.repo_name,c.a_repos,class_='refs')}:${h.select('other_ref',c.default_a_ref,c.a_refs,class_='refs')} | |
76 | </div> |
|
76 | </div> | |
77 | <div style="padding:5px 3px 3px 3px;"> |
|
77 | <div style="padding:5px 3px 3px 3px;"> | |
78 | <b>${_('Revision')}:</b> <span id="other_rev_span">-</span> |
|
78 | <b>${_('Revision')}:</b> <span id="other_rev_span">-</span> | |
79 | </div> |
|
79 | </div> | |
80 | </div> |
|
80 | </div> | |
81 | </div> |
|
81 | </div> | |
82 | <div style="clear:both"></div> |
|
82 | <div style="clear:both"></div> | |
83 | </div> |
|
83 | </div> | |
84 | </div> |
|
84 | </div> | |
85 |
|
85 | |||
86 | <div class="field"> |
|
86 | <div class="field"> | |
87 | <div class="buttons"> |
|
87 | <div class="buttons"> | |
88 | ${h.submit('save',_('Create Pull Request'),class_="btn")} |
|
88 | ${h.submit('save',_('Create Pull Request'),class_="btn")} | |
89 | ${h.reset('reset',_('Reset'),class_="btn")} |
|
89 | ${h.reset('reset',_('Reset'),class_="btn")} | |
90 | </div> |
|
90 | </div> | |
91 | </div> |
|
91 | </div> | |
92 |
|
92 | |||
93 | </div> |
|
93 | </div> | |
94 |
|
94 | |||
95 | ## Reviewers |
|
95 | ## Reviewers | |
96 | <div style="float:left; border-left:1px dashed #eee"> |
|
96 | <div style="float:left; border-left:1px dashed #eee"> | |
97 | <div class="pr-details-title">${_('Pull Request Reviewers')}</div> |
|
97 | <div class="pr-details-title">${_('Pull Request Reviewers')}</div> | |
98 | <div id="reviewers" style="padding:0px 0px 0px 15px"> |
|
98 | <div id="reviewers" style="padding:0px 0px 0px 15px"> | |
99 | ## members goes here ! |
|
99 | ## members goes here ! | |
100 | <div> |
|
100 | <div> | |
101 | <ul id="review_members" class="group_members"> |
|
101 | <ul id="review_members" class="group_members"> | |
102 | %for member in [c.a_repo.user]: |
|
102 | %for member in [c.a_repo.user]: | |
103 | <li id="reviewer_${member.user_id}"> |
|
103 | <li id="reviewer_${member.user_id}"> | |
104 | <div class="reviewers_member"> |
|
104 | <div class="reviewers_member"> | |
105 | <div class="gravatar">${h.gravatar(member.email, 14)}</div> |
|
105 | <div class="gravatar">${h.gravatar(member.email, 14)}</div> | |
106 | <div style="float:left">${member.firstname} ${member.lastname} (${_('owner')})</div> |
|
106 | <div style="float:left">${member.firstname} ${member.lastname} (${_('owner')})</div> | |
107 | <input type="hidden" value="${member.user_id}" name="review_members" /> |
|
107 | <input type="hidden" value="${member.user_id}" name="review_members" /> | |
108 | <span class="action_button" style="padding: 3px" onclick="removeReviewMember(${member.user_id})" title="${_('Remove reviewer')}"> |
|
108 | <span class="action_button" style="padding: 3px" onclick="removeReviewMember(${member.user_id})" title="${_('Remove reviewer')}"> | |
109 | <i class="icon-minus-circled"></i> |
|
109 | <i class="icon-minus-circled"></i> | |
110 | </span> |
|
110 | </span> | |
111 | </div> |
|
111 | </div> | |
112 | </li> |
|
112 | </li> | |
113 | %endfor |
|
113 | %endfor | |
114 | </ul> |
|
114 | </ul> | |
115 | </div> |
|
115 | </div> | |
116 |
|
116 | |||
117 | <div class='ac'> |
|
117 | <div class='ac'> | |
118 | <div class="reviewer_ac"> |
|
118 | <div class="reviewer_ac"> | |
119 | ${h.text('user', class_='yui-ac-input',placeholder=_('Type name of reviewer to add'))} |
|
119 | ${h.text('user', class_='yui-ac-input',placeholder=_('Type name of reviewer to add'))} | |
120 | <div id="reviewers_container"></div> |
|
120 | <div id="reviewers_container"></div> | |
121 | </div> |
|
121 | </div> | |
122 | </div> |
|
122 | </div> | |
123 | </div> |
|
123 | </div> | |
124 | </div> |
|
124 | </div> | |
125 |
|
125 | |||
126 | <div style="clear:both;padding: 0 0 30px 0;"></div> |
|
126 | <div style="clear:both;padding: 0 0 30px 0;"></div> | |
127 |
|
127 | |||
128 | <h4>${_('Changesets')}</h4> |
|
128 | <h4>${_('Changesets')}</h4> | |
129 | <div style="float:left;padding:0px 30px 30px 30px"> |
|
129 | <div style="float:left;padding:0px 30px 30px 30px"> | |
130 | ## overview pulled by ajax |
|
130 | ## overview pulled by ajax | |
131 | <div style="float:left" id="pull_request_overview"></div> |
|
131 | <div style="float:left" id="pull_request_overview"></div> | |
132 | </div> |
|
132 | </div> | |
133 | <div style="clear:both;"></div> |
|
133 | <div style="clear:both;"></div> | |
134 |
|
134 | |||
135 | </div> |
|
135 | </div> | |
136 |
|
136 | |||
137 | ${h.end_form()} |
|
137 | ${h.end_form()} | |
138 |
|
138 | |||
139 | </div> |
|
139 | </div> | |
140 |
|
140 | |||
141 | <script type="text/javascript" src="${h.url('/js/graph.js', ver=c.kallithea_version)}"></script> |
|
141 | <script type="text/javascript" src="${h.url('/js/graph.js', ver=c.kallithea_version)}"></script> | |
142 | <script type="text/javascript"> |
|
142 | <script type="text/javascript"> | |
143 | var _USERS_AC_DATA = ${c.users_array|n}; |
|
143 | var _USERS_AC_DATA = ${c.users_array|n}; | |
144 | var _GROUPS_AC_DATA = ${c.user_groups_array|n}; |
|
144 | var _GROUPS_AC_DATA = ${c.user_groups_array|n}; | |
145 | PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA); |
|
145 | PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA); | |
146 |
|
146 | |||
147 | pyroutes.register('pullrequest_repo_info', "${url('pullrequest_repo_info',repo_name='%(repo_name)s')}", ['repo_name']); |
|
147 | pyroutes.register('pullrequest_repo_info', "${url('pullrequest_repo_info',repo_name='%(repo_name)s')}", ['repo_name']); | |
148 |
|
148 | |||
149 | var pendingajax = undefined; |
|
149 | var pendingajax = undefined; | |
150 | var otherrepoChanged = function(){ |
|
150 | var otherrepoChanged = function(){ | |
151 | var $other_ref = $('#other_ref'); |
|
151 | var $other_ref = $('#other_ref'); | |
152 | $other_ref.prop('disabled', true); |
|
152 | $other_ref.prop('disabled', true); | |
153 | var repo_name = $('#other_repo').val(); |
|
153 | var repo_name = $('#other_repo').val(); | |
154 | if (pendingajax) { |
|
154 | if (pendingajax) { | |
155 | pendingajax.abort(); |
|
155 | pendingajax.abort(); | |
156 | pendingajax = undefined; |
|
156 | pendingajax = undefined; | |
157 | } |
|
157 | } | |
158 | pendingajax = ajaxGET(pyroutes.url('pullrequest_repo_info', {"repo_name": repo_name}), |
|
158 | pendingajax = ajaxGET(pyroutes.url('pullrequest_repo_info', {"repo_name": repo_name}), | |
159 | function(data){ |
|
159 | function(data){ | |
160 | pendingajax = undefined; |
|
160 | pendingajax = undefined; | |
161 | $('#other_repo_desc').html(data.description); |
|
161 | $('#other_repo_desc').html(data.description); | |
162 |
|
162 | |||
163 | // replace options of other_ref with the ones for the current other_repo |
|
163 | // replace options of other_ref with the ones for the current other_repo | |
164 | $other_ref.empty(); |
|
164 | $other_ref.empty(); | |
165 | for(var i = 0; i < data.refs.length; i++) |
|
165 | for(var i = 0; i < data.refs.length; i++) | |
166 | { |
|
166 | { | |
167 | var $optgroup = $('<optgroup/>').attr('label', data.refs[i][1]); |
|
167 | var $optgroup = $('<optgroup/>').attr('label', data.refs[i][1]); | |
168 | var options = data.refs[i][0]; |
|
168 | var options = data.refs[i][0]; | |
169 | var length = options.length; |
|
169 | var length = options.length; | |
170 | for(var j = 0; j < length; j++) |
|
170 | for(var j = 0; j < length; j++) | |
171 | { |
|
171 | { | |
172 | $optgroup.append($('<option/>').text(options[j][1]).val(options[j][0])); |
|
172 | $optgroup.append($('<option/>').text(options[j][1]).val(options[j][0])); | |
173 | } |
|
173 | } | |
174 | $other_ref.append($optgroup); |
|
174 | $other_ref.append($optgroup); | |
175 | } |
|
175 | } | |
176 | $other_ref.val(data.selected_ref); |
|
176 | $other_ref.val(data.selected_ref); | |
177 |
|
177 | |||
178 | // reset && add the reviewer based on selected repo |
|
178 | // reset && add the reviewer based on selected repo | |
179 | $('#review_members').html(''); |
|
179 | $('#review_members').html(''); | |
180 | addReviewMember(data.user.user_id, data.user.firstname, |
|
180 | addReviewMember(data.user.user_id, data.user.firstname, | |
181 | data.user.lastname, data.user.username, |
|
181 | data.user.lastname, data.user.username, | |
182 | data.user.gravatar_link, data.user_gravatar_size); |
|
182 | data.user.gravatar_link, data.user_gravatar_size); | |
183 |
|
183 | |||
184 | // re-populate the select2 thingie |
|
184 | // re-populate the select2 thingie | |
185 | $("#other_ref").select2({ |
|
185 | $("#other_ref").select2({ | |
186 | dropdownAutoWidth: true |
|
186 | dropdownAutoWidth: true | |
187 | }); |
|
187 | }); | |
188 |
|
188 | |||
189 | $other_ref.prop('disabled', false); |
|
189 | $other_ref.prop('disabled', false); | |
190 | loadPreview(); |
|
190 | loadPreview(); | |
191 | }); |
|
191 | }); | |
192 | }; |
|
192 | }; | |
193 |
|
193 | |||
194 | var loadPreview = function(){ |
|
194 | var loadPreview = function(){ | |
195 | //url template |
|
195 | //url template | |
196 | var url = "${h.url('compare_url', |
|
196 | var url = "${h.url('compare_url', | |
197 | repo_name='__other_repo__', |
|
197 | repo_name='__other_repo__', | |
198 | org_ref_type='rev', |
|
198 | org_ref_type='rev', | |
199 | org_ref_name='__other_ref_name__', |
|
199 | org_ref_name='__other_ref_name__', | |
200 | other_repo='__org_repo__', |
|
200 | other_repo='__org_repo__', | |
201 | other_ref_type='rev', |
|
201 | other_ref_type='rev', | |
202 | other_ref_name='__org_ref_name__', |
|
202 | other_ref_name='__org_ref_name__', | |
203 | as_form=True, |
|
203 | as_form=True, | |
204 | merge=True, |
|
204 | merge=True, | |
205 | )}"; |
|
205 | )}"; | |
206 | var org_repo = $('#pull_request_form #org_repo').val(); |
|
206 | var org_repo = $('#pull_request_form #org_repo').val(); | |
207 | var org_ref = $('#pull_request_form #org_ref').val().split(':'); |
|
207 | var org_ref = $('#pull_request_form #org_ref').val().split(':'); | |
208 | ## TODO: make nice link like link_to_ref() do |
|
208 | ## TODO: make nice link like link_to_ref() do | |
209 | $('#org_rev_span').html(org_ref[2].substr(0,12)); |
|
209 | $('#org_rev_span').html(org_ref[2].substr(0,12)); | |
210 |
|
210 | |||
211 | var other_repo = $('#pull_request_form #other_repo').val(); |
|
211 | var other_repo = $('#pull_request_form #other_repo').val(); | |
212 | var other_ref = $('#pull_request_form #other_ref').val().split(':'); |
|
212 | var other_ref = $('#pull_request_form #other_ref').val().split(':'); | |
213 | $('#other_rev_span').html(other_ref[2].substr(0,12)); |
|
213 | $('#other_rev_span').html(other_ref[2].substr(0,12)); | |
214 |
|
214 | |||
215 | var rev_data = { |
|
215 | var rev_data = { | |
216 | '__org_repo__': org_repo, |
|
216 | '__org_repo__': org_repo, | |
217 | '__org_ref_name__': org_ref[2], |
|
217 | '__org_ref_name__': org_ref[2], | |
218 | '__other_repo__': other_repo, |
|
218 | '__other_repo__': other_repo, | |
219 | '__other_ref_name__': other_ref[2] |
|
219 | '__other_ref_name__': other_ref[2] | |
220 | }; // gather the org/other ref and repo here |
|
220 | }; // gather the org/other ref and repo here | |
221 |
|
221 | |||
222 | for (k in rev_data){ |
|
222 | for (k in rev_data){ | |
223 | url = url.replace(k,rev_data[k]); |
|
223 | url = url.replace(k,rev_data[k]); | |
224 | } |
|
224 | } | |
225 |
|
225 | |||
226 | if (pendingajax) { |
|
226 | if (pendingajax) { | |
227 | pendingajax.abort(); |
|
227 | pendingajax.abort(); | |
228 | pendingajax = undefined; |
|
228 | pendingajax = undefined; | |
229 | } |
|
229 | } | |
230 | pendingajax = asynchtml(url, $('#pull_request_overview'), function(o){ |
|
230 | pendingajax = asynchtml(url, $('#pull_request_overview'), function(o){ | |
231 | pendingajax = undefined; |
|
231 | pendingajax = undefined; | |
232 | var jsdata = eval('('+YUD.get('jsdata').innerHTML+')'); // TODO: just get json |
|
232 | var jsdata = eval('('+YUD.get('jsdata').innerHTML+')'); // TODO: just get json | |
233 | var r = new BranchRenderer('graph_canvas', 'graph_content_pr', 'chg_'); |
|
233 | var r = new BranchRenderer('graph_canvas', 'graph_content_pr', 'chg_'); | |
234 | r.render(jsdata,100); |
|
234 | r.render(jsdata,100); | |
235 | }); |
|
235 | }); | |
236 | } |
|
236 | } | |
237 |
|
237 | |||
238 | $(document).ready(function(){ |
|
238 | $(document).ready(function(){ | |
239 | $("#org_repo").select2({ |
|
239 | $("#org_repo").select2({ | |
240 | dropdownAutoWidth: true |
|
240 | dropdownAutoWidth: true | |
241 | }); |
|
241 | }); | |
242 | ## (org_repo can't change) |
|
242 | ## (org_repo can't change) | |
243 |
|
243 | |||
244 | $("#org_ref").select2({ |
|
244 | $("#org_ref").select2({ | |
245 | dropdownAutoWidth: true |
|
245 | dropdownAutoWidth: true | |
246 | }); |
|
246 | }); | |
247 | $("#org_ref").on("change", function(e){ |
|
247 | $("#org_ref").on("change", function(e){ | |
248 | loadPreview(); |
|
248 | loadPreview(); | |
249 | }); |
|
249 | }); | |
250 |
|
250 | |||
251 | $("#other_repo").select2({ |
|
251 | $("#other_repo").select2({ | |
252 | dropdownAutoWidth: true |
|
252 | dropdownAutoWidth: true | |
253 | }); |
|
253 | }); | |
254 | $("#other_repo").on("change", function(e){ |
|
254 | $("#other_repo").on("change", function(e){ | |
255 | otherrepoChanged(); |
|
255 | otherrepoChanged(); | |
256 | }); |
|
256 | }); | |
257 |
|
257 | |||
258 | $("#other_ref").select2({ |
|
258 | $("#other_ref").select2({ | |
259 | dropdownAutoWidth: true |
|
259 | dropdownAutoWidth: true | |
260 | }); |
|
260 | }); | |
261 | $("#other_ref").on("change", function(e){ |
|
261 | $("#other_ref").on("change", function(e){ | |
262 | loadPreview(); |
|
262 | loadPreview(); | |
263 | }); |
|
263 | }); | |
264 |
|
264 | |||
265 | //lazy load overview after 0.5s |
|
265 | //lazy load overview after 0.5s | |
266 | setTimeout(loadPreview, 500); |
|
266 | setTimeout(loadPreview, 500); | |
267 | }); |
|
267 | }); | |
268 |
|
268 | |||
269 | </script> |
|
269 | </script> | |
270 |
|
270 | |||
271 | </%def> |
|
271 | </%def> |
@@ -1,388 +1,388 | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 |
<% |
|
3 | <%block name="title"> | |
4 | ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)} |
|
4 | ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)} | |
5 | %if c.site_name: |
|
5 | %if c.site_name: | |
6 | · ${c.site_name} |
|
6 | · ${c.site_name} | |
7 | %endif |
|
7 | %endif | |
8 | </%def> |
|
8 | </%block> | |
9 |
|
9 | |||
10 | <%def name="breadcrumbs_links()"> |
|
10 | <%def name="breadcrumbs_links()"> | |
11 | ${_('Pull request #%s from %s#%s') % (c.pull_request.pull_request_id, c.pull_request.org_repo.repo_name, c.cs_branch_name)} |
|
11 | ${_('Pull request #%s from %s#%s') % (c.pull_request.pull_request_id, c.pull_request.org_repo.repo_name, c.cs_branch_name)} | |
12 | </%def> |
|
12 | </%def> | |
13 |
|
13 | |||
14 | <%block name="header_menu"> |
|
14 | <%block name="header_menu"> | |
15 | ${self.menu('repositories')} |
|
15 | ${self.menu('repositories')} | |
16 | </%block> |
|
16 | </%block> | |
17 |
|
17 | |||
18 | <%def name="main()"> |
|
18 | <%def name="main()"> | |
19 | <% editable = not c.pull_request.is_closed() and (h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or c.pull_request.author.user_id == c.authuser.user_id) %> |
|
19 | <% editable = not c.pull_request.is_closed() and (h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or c.pull_request.author.user_id == c.authuser.user_id) %> | |
20 | ${self.repo_context_bar('showpullrequest')} |
|
20 | ${self.repo_context_bar('showpullrequest')} | |
21 | <div class="box"> |
|
21 | <div class="box"> | |
22 | <!-- box / title --> |
|
22 | <!-- box / title --> | |
23 | <div class="title"> |
|
23 | <div class="title"> | |
24 | ${self.breadcrumbs()} |
|
24 | ${self.breadcrumbs()} | |
25 | </div> |
|
25 | </div> | |
26 |
|
26 | |||
27 | ${h.form(url('pullrequest_post', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), method='post', id='pull_request_form')} |
|
27 | ${h.form(url('pullrequest_post', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), method='post', id='pull_request_form')} | |
28 | <div class="form pr-box" style="float: left"> |
|
28 | <div class="form pr-box" style="float: left"> | |
29 | <div class="pr-details-title ${'closed' if c.pull_request.is_closed() else ''}"> |
|
29 | <div class="pr-details-title ${'closed' if c.pull_request.is_closed() else ''}"> | |
30 | ${_('Title')}: ${c.pull_request.title} |
|
30 | ${_('Title')}: ${c.pull_request.title} | |
31 | %if c.pull_request.is_closed(): |
|
31 | %if c.pull_request.is_closed(): | |
32 | (${_('Closed')}) |
|
32 | (${_('Closed')}) | |
33 | %endif |
|
33 | %endif | |
34 | </div> |
|
34 | </div> | |
35 | <div id="pr-summary" class="fields"> |
|
35 | <div id="pr-summary" class="fields"> | |
36 |
|
36 | |||
37 | <div class="field pr-not-edit" style="min-height:37px"> |
|
37 | <div class="field pr-not-edit" style="min-height:37px"> | |
38 | <div class="label-summary"> |
|
38 | <div class="label-summary"> | |
39 | <label>${_('Description')}:</label> |
|
39 | <label>${_('Description')}:</label> | |
40 | %if editable: |
|
40 | %if editable: | |
41 | <div style="margin: 5px"> |
|
41 | <div style="margin: 5px"> | |
42 | <a class="btn btn-small" onclick="YUD.setStyle('pr-edit-form','display','');YUD.setStyle(YUD.getElementsByClassName('pr-not-edit'),'display','none')">${_("Edit")}</a> |
|
42 | <a class="btn btn-small" onclick="YUD.setStyle('pr-edit-form','display','');YUD.setStyle(YUD.getElementsByClassName('pr-not-edit'),'display','none')">${_("Edit")}</a> | |
43 | </div> |
|
43 | </div> | |
44 | %endif |
|
44 | %endif | |
45 | </div> |
|
45 | </div> | |
46 | <div class="input"> |
|
46 | <div class="input"> | |
47 | <div style="white-space:pre-wrap; line-height: 14px">${h.urlify_commit(c.pull_request.description, c.pull_request.org_repo.repo_name)}</div> |
|
47 | <div style="white-space:pre-wrap; line-height: 14px">${h.urlify_commit(c.pull_request.description, c.pull_request.org_repo.repo_name)}</div> | |
48 | </div> |
|
48 | </div> | |
49 | </div> |
|
49 | </div> | |
50 |
|
50 | |||
51 | %if editable: |
|
51 | %if editable: | |
52 | <div id="pr-edit-form" style="display:none"> |
|
52 | <div id="pr-edit-form" style="display:none"> | |
53 | <div class="field"> |
|
53 | <div class="field"> | |
54 | <div class="label-summary"> |
|
54 | <div class="label-summary"> | |
55 | <label for="pullrequest_title">${_('Title')}:</label> |
|
55 | <label for="pullrequest_title">${_('Title')}:</label> | |
56 | </div> |
|
56 | </div> | |
57 | <div class="input"> |
|
57 | <div class="input"> | |
58 | ${h.text('pullrequest_title',class_="large",value=c.pull_request.title,placeholder=_('Summarize the changes'))} |
|
58 | ${h.text('pullrequest_title',class_="large",value=c.pull_request.title,placeholder=_('Summarize the changes'))} | |
59 | </div> |
|
59 | </div> | |
60 | </div> |
|
60 | </div> | |
61 |
|
61 | |||
62 | <div class="field"> |
|
62 | <div class="field"> | |
63 | <div class="label-summary label-textarea"> |
|
63 | <div class="label-summary label-textarea"> | |
64 | <label for="pullrequest_desc">${_('Description')}:</label> |
|
64 | <label for="pullrequest_desc">${_('Description')}:</label> | |
65 | </div> |
|
65 | </div> | |
66 | <div class="textarea text-area editor"> |
|
66 | <div class="textarea text-area editor"> | |
67 | ${h.textarea('pullrequest_desc',size=30,content=c.pull_request.description,placeholder=_('Write a short description on this pull request'))} |
|
67 | ${h.textarea('pullrequest_desc',size=30,content=c.pull_request.description,placeholder=_('Write a short description on this pull request'))} | |
68 | </div> |
|
68 | </div> | |
69 | </div> |
|
69 | </div> | |
70 | </div> |
|
70 | </div> | |
71 | %endif |
|
71 | %endif | |
72 |
|
72 | |||
73 | <div class="field"> |
|
73 | <div class="field"> | |
74 | <div class="label-summary"> |
|
74 | <div class="label-summary"> | |
75 | <label>${_('Reviewer voting result')}:</label> |
|
75 | <label>${_('Reviewer voting result')}:</label> | |
76 | </div> |
|
76 | </div> | |
77 | <div class="input"> |
|
77 | <div class="input"> | |
78 | <div class="changeset-status-container" style="float:none;clear:both"> |
|
78 | <div class="changeset-status-container" style="float:none;clear:both"> | |
79 | %if c.current_voting_result: |
|
79 | %if c.current_voting_result: | |
80 | <div class="changeset-status-ico" style="padding:0px 4px 0px 0px"> |
|
80 | <div class="changeset-status-ico" style="padding:0px 4px 0px 0px"> | |
81 | <i class="icon-circle changeset-status-${c.current_voting_result}" title="${_('Pull request status calculated from votes')}"></i></div> |
|
81 | <i class="icon-circle changeset-status-${c.current_voting_result}" title="${_('Pull request status calculated from votes')}"></i></div> | |
82 | <div class="changeset-status-lbl tooltip" title="${_('Pull request status calculated from votes')}"> |
|
82 | <div class="changeset-status-lbl tooltip" title="${_('Pull request status calculated from votes')}"> | |
83 | %if c.pull_request.is_closed(): |
|
83 | %if c.pull_request.is_closed(): | |
84 | ${_('Closed')}, |
|
84 | ${_('Closed')}, | |
85 | %endif |
|
85 | %endif | |
86 | ${h.changeset_status_lbl(c.current_voting_result)} |
|
86 | ${h.changeset_status_lbl(c.current_voting_result)} | |
87 | </div> |
|
87 | </div> | |
88 |
|
88 | |||
89 | %endif |
|
89 | %endif | |
90 | </div> |
|
90 | </div> | |
91 | </div> |
|
91 | </div> | |
92 | </div> |
|
92 | </div> | |
93 | <div class="field"> |
|
93 | <div class="field"> | |
94 | <div class="label-summary"> |
|
94 | <div class="label-summary"> | |
95 | <label>${_('Still not reviewed by')}:</label> |
|
95 | <label>${_('Still not reviewed by')}:</label> | |
96 | </div> |
|
96 | </div> | |
97 | <div class="input"> |
|
97 | <div class="input"> | |
98 | % if len(c.pull_request_pending_reviewers) > 0: |
|
98 | % if len(c.pull_request_pending_reviewers) > 0: | |
99 | <div class="tooltip" title="${h.tooltip(', '.join([x.username for x in c.pull_request_pending_reviewers]))}">${ungettext('%d reviewer', '%d reviewers',len(c.pull_request_pending_reviewers)) % len(c.pull_request_pending_reviewers)}</div> |
|
99 | <div class="tooltip" title="${h.tooltip(', '.join([x.username for x in c.pull_request_pending_reviewers]))}">${ungettext('%d reviewer', '%d reviewers',len(c.pull_request_pending_reviewers)) % len(c.pull_request_pending_reviewers)}</div> | |
100 | % elif len(c.pull_request_reviewers) > 0: |
|
100 | % elif len(c.pull_request_reviewers) > 0: | |
101 | <div>${_('Pull request was reviewed by all reviewers')}</div> |
|
101 | <div>${_('Pull request was reviewed by all reviewers')}</div> | |
102 | %else: |
|
102 | %else: | |
103 | <div>${_('There are no reviewers')}</div> |
|
103 | <div>${_('There are no reviewers')}</div> | |
104 | %endif |
|
104 | %endif | |
105 | </div> |
|
105 | </div> | |
106 | </div> |
|
106 | </div> | |
107 | <div class="field"> |
|
107 | <div class="field"> | |
108 | <div class="label-summary"> |
|
108 | <div class="label-summary"> | |
109 | <label>${_('Origin')}:</label> |
|
109 | <label>${_('Origin')}:</label> | |
110 | </div> |
|
110 | </div> | |
111 | <div class="input"> |
|
111 | <div class="input"> | |
112 | <div> |
|
112 | <div> | |
113 | ${h.link_to_ref(c.pull_request.org_repo.repo_name, c.cs_ref_type, c.cs_ref_name, c.cs_rev)} |
|
113 | ${h.link_to_ref(c.pull_request.org_repo.repo_name, c.cs_ref_type, c.cs_ref_name, c.cs_rev)} | |
114 | %if c.cs_ref_type != 'branch': |
|
114 | %if c.cs_ref_type != 'branch': | |
115 | ${_('on')} ${h.link_to_ref(c.pull_request.org_repo.repo_name, 'branch', c.cs_branch_name)} |
|
115 | ${_('on')} ${h.link_to_ref(c.pull_request.org_repo.repo_name, 'branch', c.cs_branch_name)} | |
116 | %endif |
|
116 | %endif | |
117 | </div> |
|
117 | </div> | |
118 | </div> |
|
118 | </div> | |
119 | </div> |
|
119 | </div> | |
120 | <div class="field"> |
|
120 | <div class="field"> | |
121 | <div class="label-summary"> |
|
121 | <div class="label-summary"> | |
122 | <label>${_('Target')}:</label> |
|
122 | <label>${_('Target')}:</label> | |
123 | </div> |
|
123 | </div> | |
124 | <div class="input"> |
|
124 | <div class="input"> | |
125 | <div> |
|
125 | <div> | |
126 | ${h.link_to_ref(c.pull_request.other_repo.repo_name, c.a_ref_type, c.a_ref_name)} |
|
126 | ${h.link_to_ref(c.pull_request.other_repo.repo_name, c.a_ref_type, c.a_ref_name)} | |
127 | ## we don't know other rev - c.a_rev is ancestor and not necessarily on other_name_branch branch |
|
127 | ## we don't know other rev - c.a_rev is ancestor and not necessarily on other_name_branch branch | |
128 | </div> |
|
128 | </div> | |
129 | </div> |
|
129 | </div> | |
130 | </div> |
|
130 | </div> | |
131 | <div class="field"> |
|
131 | <div class="field"> | |
132 | <div class="label-summary"> |
|
132 | <div class="label-summary"> | |
133 | <label>${_('Pull changes')}:</label> |
|
133 | <label>${_('Pull changes')}:</label> | |
134 | </div> |
|
134 | </div> | |
135 | <div class="input"> |
|
135 | <div class="input"> | |
136 | <div> |
|
136 | <div> | |
137 | ## TODO: use cs_ranges[-1] or org_ref_parts[1] in both cases? |
|
137 | ## TODO: use cs_ranges[-1] or org_ref_parts[1] in both cases? | |
138 | %if h.is_hg(c.pull_request.org_repo): |
|
138 | %if h.is_hg(c.pull_request.org_repo): | |
139 | <span style="font-family: monospace">hg pull ${c.pull_request.org_repo.clone_url()} -r ${h.short_id(c.cs_ranges[-1].raw_id)}</span> |
|
139 | <span style="font-family: monospace">hg pull ${c.pull_request.org_repo.clone_url()} -r ${h.short_id(c.cs_ranges[-1].raw_id)}</span> | |
140 | %elif h.is_git(c.pull_request.org_repo): |
|
140 | %elif h.is_git(c.pull_request.org_repo): | |
141 | <span style="font-family: monospace">git pull ${c.pull_request.org_repo.clone_url()} ${c.pull_request.org_ref_parts[1]}</span> |
|
141 | <span style="font-family: monospace">git pull ${c.pull_request.org_repo.clone_url()} ${c.pull_request.org_ref_parts[1]}</span> | |
142 | %endif |
|
142 | %endif | |
143 | </div> |
|
143 | </div> | |
144 | </div> |
|
144 | </div> | |
145 | </div> |
|
145 | </div> | |
146 | <div class="field"> |
|
146 | <div class="field"> | |
147 | <div class="label-summary"> |
|
147 | <div class="label-summary"> | |
148 | <label>${_('Created on')}:</label> |
|
148 | <label>${_('Created on')}:</label> | |
149 | </div> |
|
149 | </div> | |
150 | <div class="input"> |
|
150 | <div class="input"> | |
151 | <div>${h.fmt_date(c.pull_request.created_on)}</div> |
|
151 | <div>${h.fmt_date(c.pull_request.created_on)}</div> | |
152 | </div> |
|
152 | </div> | |
153 | </div> |
|
153 | </div> | |
154 | <div class="field"> |
|
154 | <div class="field"> | |
155 | <div class="label-summary"> |
|
155 | <div class="label-summary"> | |
156 | <label>${_('Created by')}:</label> |
|
156 | <label>${_('Created by')}:</label> | |
157 | </div> |
|
157 | </div> | |
158 | <div class="input"> |
|
158 | <div class="input"> | |
159 | <div class="author"> |
|
159 | <div class="author"> | |
160 | <div class="gravatar"> |
|
160 | <div class="gravatar"> | |
161 | ${h.gravatar(c.pull_request.author.email, size=20)} |
|
161 | ${h.gravatar(c.pull_request.author.email, size=20)} | |
162 | </div> |
|
162 | </div> | |
163 | <span>${c.pull_request.author.username_and_name}</span><br/> |
|
163 | <span>${c.pull_request.author.username_and_name}</span><br/> | |
164 | <span><a href="mailto:${c.pull_request.author.email}">${c.pull_request.author.email}</a></span><br/> |
|
164 | <span><a href="mailto:${c.pull_request.author.email}">${c.pull_request.author.email}</a></span><br/> | |
165 | </div> |
|
165 | </div> | |
166 | </div> |
|
166 | </div> | |
167 | </div> |
|
167 | </div> | |
168 |
|
168 | |||
169 | <div class="field"> |
|
169 | <div class="field"> | |
170 | <div class="label-summary"> |
|
170 | <div class="label-summary"> | |
171 | <label>${_('Update')}:</label> |
|
171 | <label>${_('Update')}:</label> | |
172 | </div> |
|
172 | </div> | |
173 | <div class="input"> |
|
173 | <div class="input"> | |
174 | <div class="msg-div">${c.update_msg}</div> |
|
174 | <div class="msg-div">${c.update_msg}</div> | |
175 | %if c.avail_revs: |
|
175 | %if c.avail_revs: | |
176 | <div id="updaterevs" style="max-height:200px; overflow-y:auto; overflow-x:hidden; margin-bottom: 10px"> |
|
176 | <div id="updaterevs" style="max-height:200px; overflow-y:auto; overflow-x:hidden; margin-bottom: 10px"> | |
177 | <div style="height:0"> |
|
177 | <div style="height:0"> | |
178 | <canvas id="avail_graph_canvas"></canvas> |
|
178 | <canvas id="avail_graph_canvas"></canvas> | |
179 | </div> |
|
179 | </div> | |
180 | <table id="updaterevs-table" class="noborder" style="padding-left:50px"> |
|
180 | <table id="updaterevs-table" class="noborder" style="padding-left:50px"> | |
181 | %for cnt, cs in enumerate(c.avail_cs): |
|
181 | %for cnt, cs in enumerate(c.avail_cs): | |
182 | <tr id="chg_available_${cnt+1}"> |
|
182 | <tr id="chg_available_${cnt+1}"> | |
183 | %if cs.revision == c.cs_ranges[-1].revision: |
|
183 | %if cs.revision == c.cs_ranges[-1].revision: | |
184 | <td> |
|
184 | <td> | |
185 | %if editable: |
|
185 | %if editable: | |
186 | ${h.radio(name='updaterev', value='')} |
|
186 | ${h.radio(name='updaterev', value='')} | |
187 | %endif |
|
187 | %endif | |
188 | </td> |
|
188 | </td> | |
189 | <td colspan="2">${_("Current revision - no change")}</td> |
|
189 | <td colspan="2">${_("Current revision - no change")}</td> | |
190 | %else: |
|
190 | %else: | |
191 | <td> |
|
191 | <td> | |
192 | %if editable and cs.revision in c.avail_revs: |
|
192 | %if editable and cs.revision in c.avail_revs: | |
193 | ${h.radio(name='updaterev', value=cs.raw_id)} |
|
193 | ${h.radio(name='updaterev', value=cs.raw_id)} | |
194 | %endif |
|
194 | %endif | |
195 | </td> |
|
195 | </td> | |
196 | <td>${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))}</td> |
|
196 | <td>${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))}</td> | |
197 | <td><div class="message" style="white-space:normal; height:1.1em; max-width: 500px; padding:0">${h.urlify_commit(cs.message, c.repo_name)}</div></td> |
|
197 | <td><div class="message" style="white-space:normal; height:1.1em; max-width: 500px; padding:0">${h.urlify_commit(cs.message, c.repo_name)}</div></td> | |
198 | %endif |
|
198 | %endif | |
199 | </tr> |
|
199 | </tr> | |
200 | %endfor |
|
200 | %endfor | |
201 | </table> |
|
201 | </table> | |
202 | </div> |
|
202 | </div> | |
203 | %endif |
|
203 | %endif | |
204 | <div class="msg-div">${c.update_msg_other}</div> |
|
204 | <div class="msg-div">${c.update_msg_other}</div> | |
205 | </div> |
|
205 | </div> | |
206 | </div> |
|
206 | </div> | |
207 | </div> |
|
207 | </div> | |
208 | </div> |
|
208 | </div> | |
209 | ## REVIEWERS |
|
209 | ## REVIEWERS | |
210 | <div style="float:left; border-left:1px dashed #eee"> |
|
210 | <div style="float:left; border-left:1px dashed #eee"> | |
211 | <div class="pr-details-title">${_('Pull Request Reviewers')}</div> |
|
211 | <div class="pr-details-title">${_('Pull Request Reviewers')}</div> | |
212 | <div id="reviewers" style="padding:0px 0px 5px 10px"> |
|
212 | <div id="reviewers" style="padding:0px 0px 5px 10px"> | |
213 | ## members goes here ! |
|
213 | ## members goes here ! | |
214 | <div> |
|
214 | <div> | |
215 | <ul id="review_members" class="group_members"> |
|
215 | <ul id="review_members" class="group_members"> | |
216 | %for member,status in c.pull_request_reviewers: |
|
216 | %for member,status in c.pull_request_reviewers: | |
217 | <li id="reviewer_${member.user_id}"> |
|
217 | <li id="reviewer_${member.user_id}"> | |
218 | <div class="reviewers_member"> |
|
218 | <div class="reviewers_member"> | |
219 | <div class="reviewer_status tooltip" title="${h.tooltip(h.changeset_status_lbl(status.status if status else 'not_reviewed'))}"> |
|
219 | <div class="reviewer_status tooltip" title="${h.tooltip(h.changeset_status_lbl(status.status if status else 'not_reviewed'))}"> | |
220 | <i class="icon-circle changeset-status-${status.status if status else 'not_reviewed'}"></i> |
|
220 | <i class="icon-circle changeset-status-${status.status if status else 'not_reviewed'}"></i> | |
221 | </div> |
|
221 | </div> | |
222 | <div class="reviewer_gravatar gravatar"> |
|
222 | <div class="reviewer_gravatar gravatar"> | |
223 | ${h.gravatar(member.email, size=14)} |
|
223 | ${h.gravatar(member.email, size=14)} | |
224 | </div> |
|
224 | </div> | |
225 | <div style="float:left;">${member.full_name} (${_('owner') if c.pull_request.user_id == member.user_id else _('reviewer')})</div> |
|
225 | <div style="float:left;">${member.full_name} (${_('owner') if c.pull_request.user_id == member.user_id else _('reviewer')})</div> | |
226 | <input type="hidden" value="${member.user_id}" name="review_members" /> |
|
226 | <input type="hidden" value="${member.user_id}" name="review_members" /> | |
227 | %if editable: |
|
227 | %if editable: | |
228 | <div class="reviewer_member_remove action_button" onclick="removeReviewMember(${member.user_id})" title="${_('Remove reviewer')}"> |
|
228 | <div class="reviewer_member_remove action_button" onclick="removeReviewMember(${member.user_id})" title="${_('Remove reviewer')}"> | |
229 | <i class="icon-minus-circled"></i> |
|
229 | <i class="icon-minus-circled"></i> | |
230 | </div> |
|
230 | </div> | |
231 | %endif |
|
231 | %endif | |
232 | </div> |
|
232 | </div> | |
233 | </li> |
|
233 | </li> | |
234 | %endfor |
|
234 | %endfor | |
235 | </ul> |
|
235 | </ul> | |
236 | </div> |
|
236 | </div> | |
237 | %if editable: |
|
237 | %if editable: | |
238 | <div class='ac'> |
|
238 | <div class='ac'> | |
239 | <div class="reviewer_ac"> |
|
239 | <div class="reviewer_ac"> | |
240 | ${h.text('user', class_='yui-ac-input',placeholder=_('Type name of reviewer to add'))} |
|
240 | ${h.text('user', class_='yui-ac-input',placeholder=_('Type name of reviewer to add'))} | |
241 | <div id="reviewers_container"></div> |
|
241 | <div id="reviewers_container"></div> | |
242 | </div> |
|
242 | </div> | |
243 | </div> |
|
243 | </div> | |
244 | %endif |
|
244 | %endif | |
245 | </div> |
|
245 | </div> | |
246 | </div> |
|
246 | </div> | |
247 | <div class="form" style="clear:both"> |
|
247 | <div class="form" style="clear:both"> | |
248 | <div class="fields"> |
|
248 | <div class="fields"> | |
249 | %if editable: |
|
249 | %if editable: | |
250 | <div class="buttons"> |
|
250 | <div class="buttons"> | |
251 | ${h.submit('pr-form-save',_('Save Changes'),class_="btn btn-small")} |
|
251 | ${h.submit('pr-form-save',_('Save Changes'),class_="btn btn-small")} | |
252 | ${h.submit('pr-form-clone',_('Save as New Pull Request'),class_="btn btn-small",disabled='disabled')} |
|
252 | ${h.submit('pr-form-clone',_('Save as New Pull Request'),class_="btn btn-small",disabled='disabled')} | |
253 | ${h.reset('pr-form-reset',_('Cancel Changes'),class_="btn btn-small")} |
|
253 | ${h.reset('pr-form-reset',_('Cancel Changes'),class_="btn btn-small")} | |
254 | </div> |
|
254 | </div> | |
255 | %endif |
|
255 | %endif | |
256 | </div> |
|
256 | </div> | |
257 | </div> |
|
257 | </div> | |
258 | ${h.end_form()} |
|
258 | ${h.end_form()} | |
259 | </div> |
|
259 | </div> | |
260 |
|
260 | |||
261 | <div class="box"> |
|
261 | <div class="box"> | |
262 | <div class="title"> |
|
262 | <div class="title"> | |
263 | <div class="breadcrumbs">${_('Pull Request Content')}</div> |
|
263 | <div class="breadcrumbs">${_('Pull Request Content')}</div> | |
264 | </div> |
|
264 | </div> | |
265 | <div class="table"> |
|
265 | <div class="table"> | |
266 | <div id="changeset_compare_view_content"> |
|
266 | <div id="changeset_compare_view_content"> | |
267 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px"> |
|
267 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px"> | |
268 | ${ungettext("%d comment", "%d comments", len(c.comments)) % len(c.comments)} ${ungettext("(%d inline)", "(%d inline)", c.inline_cnt) % c.inline_cnt} <span class="firstlink"></span> |
|
268 | ${ungettext("%d comment", "%d comments", len(c.comments)) % len(c.comments)} ${ungettext("(%d inline)", "(%d inline)", c.inline_cnt) % c.inline_cnt} <span class="firstlink"></span> | |
269 | </div> |
|
269 | </div> | |
270 | ##CS |
|
270 | ##CS | |
271 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px"> |
|
271 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px"> | |
272 | ${ungettext('Showing %s commit','Showing %s commits', len(c.cs_ranges)) % len(c.cs_ranges)} |
|
272 | ${ungettext('Showing %s commit','Showing %s commits', len(c.cs_ranges)) % len(c.cs_ranges)} | |
273 | </div> |
|
273 | </div> | |
274 | <%include file="/compare/compare_cs.html" /> |
|
274 | <%include file="/compare/compare_cs.html" /> | |
275 |
|
275 | |||
276 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px"> |
|
276 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px"> | |
277 | ${_('Common ancestor')}: |
|
277 | ${_('Common ancestor')}: | |
278 | ${h.link_to(h.short_id(c.a_rev),h.url('changeset_home',repo_name=c.a_repo.repo_name,revision=c.a_rev))} |
|
278 | ${h.link_to(h.short_id(c.a_rev),h.url('changeset_home',repo_name=c.a_repo.repo_name,revision=c.a_rev))} | |
279 | </div> |
|
279 | </div> | |
280 |
|
280 | |||
281 | ## FILES |
|
281 | ## FILES | |
282 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px"> |
|
282 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px"> | |
283 |
|
283 | |||
284 | % if c.limited_diff: |
|
284 | % if c.limited_diff: | |
285 | ${ungettext('%s file changed', '%s files changed', len(c.files)) % len(c.files)} |
|
285 | ${ungettext('%s file changed', '%s files changed', len(c.files)) % len(c.files)} | |
286 | % else: |
|
286 | % else: | |
287 | ${ungettext('%s file changed with %s insertions and %s deletions','%s files changed with %s insertions and %s deletions', len(c.files)) % (len(c.files),c.lines_added,c.lines_deleted)}: |
|
287 | ${ungettext('%s file changed with %s insertions and %s deletions','%s files changed with %s insertions and %s deletions', len(c.files)) % (len(c.files),c.lines_added,c.lines_deleted)}: | |
288 | %endif |
|
288 | %endif | |
289 |
|
289 | |||
290 | </div> |
|
290 | </div> | |
291 | <div class="cs_files"> |
|
291 | <div class="cs_files"> | |
292 | %if not c.files: |
|
292 | %if not c.files: | |
293 | <span class="empty_data">${_('No files')}</span> |
|
293 | <span class="empty_data">${_('No files')}</span> | |
294 | %endif |
|
294 | %endif | |
295 | %for fid, change, f, stat in c.files: |
|
295 | %for fid, change, f, stat in c.files: | |
296 | <div class="cs_${change}"> |
|
296 | <div class="cs_${change}"> | |
297 | <div class="node"> |
|
297 | <div class="node"> | |
298 | <i class="icon-diff-${change}"></i> |
|
298 | <i class="icon-diff-${change}"></i> | |
299 | ${h.link_to(h.safe_unicode(f),'#' + fid)} |
|
299 | ${h.link_to(h.safe_unicode(f),'#' + fid)} | |
300 | </div> |
|
300 | </div> | |
301 | <div class="changes">${h.fancy_file_stats(stat)}</div> |
|
301 | <div class="changes">${h.fancy_file_stats(stat)}</div> | |
302 | </div> |
|
302 | </div> | |
303 | %endfor |
|
303 | %endfor | |
304 | </div> |
|
304 | </div> | |
305 | % if c.limited_diff: |
|
305 | % if c.limited_diff: | |
306 | <h5>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h5> |
|
306 | <h5>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h5> | |
307 | % endif |
|
307 | % endif | |
308 | </div> |
|
308 | </div> | |
309 | </div> |
|
309 | </div> | |
310 | <script> |
|
310 | <script> | |
311 | var _USERS_AC_DATA = ${c.users_array|n}; |
|
311 | var _USERS_AC_DATA = ${c.users_array|n}; | |
312 | var _GROUPS_AC_DATA = ${c.user_groups_array|n}; |
|
312 | var _GROUPS_AC_DATA = ${c.user_groups_array|n}; | |
313 | // TODO: switch this to pyroutes |
|
313 | // TODO: switch this to pyroutes | |
314 | AJAX_COMMENT_URL = "${url('pullrequest_comment',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id)}"; |
|
314 | AJAX_COMMENT_URL = "${url('pullrequest_comment',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id)}"; | |
315 | AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}"; |
|
315 | AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}"; | |
316 |
|
316 | |||
317 | pyroutes.register('pullrequest_comment', "${url('pullrequest_comment',repo_name='%(repo_name)s',pull_request_id='%(pull_request_id)s')}", ['repo_name', 'pull_request_id']); |
|
317 | pyroutes.register('pullrequest_comment', "${url('pullrequest_comment',repo_name='%(repo_name)s',pull_request_id='%(pull_request_id)s')}", ['repo_name', 'pull_request_id']); | |
318 | pyroutes.register('pullrequest_comment_delete', "${url('pullrequest_comment_delete',repo_name='%(repo_name)s',comment_id='%(comment_id)s')}", ['repo_name', 'comment_id']); |
|
318 | pyroutes.register('pullrequest_comment_delete', "${url('pullrequest_comment_delete',repo_name='%(repo_name)s',comment_id='%(comment_id)s')}", ['repo_name', 'comment_id']); | |
319 |
|
319 | |||
320 | </script> |
|
320 | </script> | |
321 |
|
321 | |||
322 | ## diff block |
|
322 | ## diff block | |
323 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> |
|
323 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> | |
324 | ${diff_block.diff_block_js()} |
|
324 | ${diff_block.diff_block_js()} | |
325 | %for fid, change, f, stat in c.files: |
|
325 | %for fid, change, f, stat in c.files: | |
326 | ${diff_block.diff_block_simple([c.changes[fid]])} |
|
326 | ${diff_block.diff_block_simple([c.changes[fid]])} | |
327 | %endfor |
|
327 | %endfor | |
328 | % if c.limited_diff: |
|
328 | % if c.limited_diff: | |
329 | <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h4> |
|
329 | <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h4> | |
330 | % endif |
|
330 | % endif | |
331 |
|
331 | |||
332 |
|
332 | |||
333 | ## template for inline comment form |
|
333 | ## template for inline comment form | |
334 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
|
334 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> | |
335 | ${comment.comment_inline_form()} |
|
335 | ${comment.comment_inline_form()} | |
336 |
|
336 | |||
337 | ## render comments and inlines |
|
337 | ## render comments and inlines | |
338 | ${comment.generate_comments()} |
|
338 | ${comment.generate_comments()} | |
339 |
|
339 | |||
340 | ## main comment form and it status |
|
340 | ## main comment form and it status | |
341 | ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, |
|
341 | ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, | |
342 | pull_request_id=c.pull_request.pull_request_id), |
|
342 | pull_request_id=c.pull_request.pull_request_id), | |
343 | c.current_voting_result, |
|
343 | c.current_voting_result, | |
344 | is_pr=True, change_status=c.allowed_to_change_status)} |
|
344 | is_pr=True, change_status=c.allowed_to_change_status)} | |
345 |
|
345 | |||
346 | <script type="text/javascript"> |
|
346 | <script type="text/javascript"> | |
347 | $(document).ready(function(){ |
|
347 | $(document).ready(function(){ | |
348 | PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA); |
|
348 | PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA); | |
349 |
|
349 | |||
350 | $('.add-bubble').click(function(e){ |
|
350 | $('.add-bubble').click(function(e){ | |
351 | var tr = e.currentTarget; |
|
351 | var tr = e.currentTarget; | |
352 | injectInlineForm(tr.parentNode.parentNode); |
|
352 | injectInlineForm(tr.parentNode.parentNode); | |
353 | }); |
|
353 | }); | |
354 |
|
354 | |||
355 | var avail_jsdata = ${c.avail_jsdata|n}; |
|
355 | var avail_jsdata = ${c.avail_jsdata|n}; | |
356 | var avail_r = new BranchRenderer('avail_graph_canvas', 'updaterevs-table', 'chg_available_'); |
|
356 | var avail_r = new BranchRenderer('avail_graph_canvas', 'updaterevs-table', 'chg_available_'); | |
357 | avail_r.render(avail_jsdata,40); |
|
357 | avail_r.render(avail_jsdata,40); | |
358 |
|
358 | |||
359 | // inject comments into they proper positions |
|
359 | // inject comments into they proper positions | |
360 | var file_comments = $('.inline-comment-placeholder').toArray(); |
|
360 | var file_comments = $('.inline-comment-placeholder').toArray(); | |
361 | renderInlineComments(file_comments); |
|
361 | renderInlineComments(file_comments); | |
362 |
|
362 | |||
363 | linkInlineComments(document.getElementsByClassName('firstlink'), document.getElementsByClassName("inline-comment")); |
|
363 | linkInlineComments(document.getElementsByClassName('firstlink'), document.getElementsByClassName("inline-comment")); | |
364 |
|
364 | |||
365 | $('#updaterevs input').change(function(e){ |
|
365 | $('#updaterevs input').change(function(e){ | |
366 | var update = !!e.target.value; |
|
366 | var update = !!e.target.value; | |
367 | $('#pr-form-save').prop('disabled',update); |
|
367 | $('#pr-form-save').prop('disabled',update); | |
368 | $('#pr-form-clone').prop('disabled',!update); |
|
368 | $('#pr-form-clone').prop('disabled',!update); | |
369 | }); |
|
369 | }); | |
370 | var $org_review_members = $('#review_members').clone(); |
|
370 | var $org_review_members = $('#review_members').clone(); | |
371 | $('#pr-form-reset').click(function(e){ |
|
371 | $('#pr-form-reset').click(function(e){ | |
372 | $('#pr-edit-form').hide(); |
|
372 | $('#pr-edit-form').hide(); | |
373 | $('.pr-not-edit').show(); |
|
373 | $('.pr-not-edit').show(); | |
374 | $('#pr-form-save').prop('disabled',false); |
|
374 | $('#pr-form-save').prop('disabled',false); | |
375 | $('#pr-form-clone').prop('disabled',true); |
|
375 | $('#pr-form-clone').prop('disabled',true); | |
376 | $('#review_members').html($org_review_members); |
|
376 | $('#review_members').html($org_review_members); | |
377 | }); |
|
377 | }); | |
378 |
|
378 | |||
379 | // hack: re-navigate to target after JS is done ... if a target is set and setting href thus won't reload |
|
379 | // hack: re-navigate to target after JS is done ... if a target is set and setting href thus won't reload | |
380 | if (window.location.hash != "") { |
|
380 | if (window.location.hash != "") { | |
381 | window.location.href = window.location.href; |
|
381 | window.location.href = window.location.href; | |
382 | } |
|
382 | } | |
383 | }); |
|
383 | }); | |
384 | </script> |
|
384 | </script> | |
385 |
|
385 | |||
386 | </div> |
|
386 | </div> | |
387 |
|
387 | |||
388 | </%def> |
|
388 | </%def> |
@@ -1,60 +1,60 | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 |
<% |
|
3 | <%block name="title"> | |
4 | ${_('%s Pull Requests') % c.repo_name} |
|
4 | ${_('%s Pull Requests') % c.repo_name} | |
5 | %if c.site_name: |
|
5 | %if c.site_name: | |
6 | · ${c.site_name} |
|
6 | · ${c.site_name} | |
7 | %endif |
|
7 | %endif | |
8 | </%def> |
|
8 | </%block> | |
9 |
|
9 | |||
10 | <%def name="breadcrumbs_links()"> |
|
10 | <%def name="breadcrumbs_links()"> | |
11 | %if c.from_: |
|
11 | %if c.from_: | |
12 | ${_("Pull Requests from %s'") % c.repo_name} |
|
12 | ${_("Pull Requests from %s'") % c.repo_name} | |
13 | %else: |
|
13 | %else: | |
14 | ${_("Pull Requests to '%s'") % c.repo_name} |
|
14 | ${_("Pull Requests to '%s'") % c.repo_name} | |
15 | %endif |
|
15 | %endif | |
16 | </%def> |
|
16 | </%def> | |
17 |
|
17 | |||
18 | <%block name="header_menu"> |
|
18 | <%block name="header_menu"> | |
19 | ${self.menu('repositories')} |
|
19 | ${self.menu('repositories')} | |
20 | </%block> |
|
20 | </%block> | |
21 |
|
21 | |||
22 | <%def name="main()"> |
|
22 | <%def name="main()"> | |
23 | ${self.repo_context_bar('showpullrequest')} |
|
23 | ${self.repo_context_bar('showpullrequest')} | |
24 |
|
24 | |||
25 | <div class="box"> |
|
25 | <div class="box"> | |
26 | <!-- box / title --> |
|
26 | <!-- box / title --> | |
27 | <div class="title"> |
|
27 | <div class="title"> | |
28 | ${self.breadcrumbs()} |
|
28 | ${self.breadcrumbs()} | |
29 | <ul class="links"> |
|
29 | <ul class="links"> | |
30 | <li> |
|
30 | <li> | |
31 | %if c.authuser.username != 'default': |
|
31 | %if c.authuser.username != 'default': | |
32 | <span> |
|
32 | <span> | |
33 | <a id="open_new_pr" class="btn btn-small btn-success" href="${h.url('pullrequest_home',repo_name=c.repo_name)}"><i class="icon-plus"></i> ${_('Open New Pull Request')}</a> |
|
33 | <a id="open_new_pr" class="btn btn-small btn-success" href="${h.url('pullrequest_home',repo_name=c.repo_name)}"><i class="icon-plus"></i> ${_('Open New Pull Request')}</a> | |
34 | </span> |
|
34 | </span> | |
35 | %endif |
|
35 | %endif | |
36 | <span> |
|
36 | <span> | |
37 | %if c.from_: |
|
37 | %if c.from_: | |
38 | <a class="btn btn-small" href="${h.url('pullrequest_show_all',repo_name=c.repo_name,closed=c.closed)}"><i class="icon-git-compare"></i> ${_('Show Pull Requests to %s') % c.repo_name}</a> |
|
38 | <a class="btn btn-small" href="${h.url('pullrequest_show_all',repo_name=c.repo_name,closed=c.closed)}"><i class="icon-git-compare"></i> ${_('Show Pull Requests to %s') % c.repo_name}</a> | |
39 | %else: |
|
39 | %else: | |
40 | <a class="btn btn-small" href="${h.url('pullrequest_show_all',repo_name=c.repo_name,closed=c.closed,from_=1)}"><i class="icon-git-compare"></i> ${_("Show Pull Requests from '%s'") % c.repo_name}</a> |
|
40 | <a class="btn btn-small" href="${h.url('pullrequest_show_all',repo_name=c.repo_name,closed=c.closed,from_=1)}"><i class="icon-git-compare"></i> ${_("Show Pull Requests from '%s'") % c.repo_name}</a> | |
41 | %endif |
|
41 | %endif | |
42 | </span> |
|
42 | </span> | |
43 | </li> |
|
43 | </li> | |
44 | </ul> |
|
44 | </ul> | |
45 | </div> |
|
45 | </div> | |
46 |
|
46 | |||
47 | <div style="margin: 0 20px"> |
|
47 | <div style="margin: 0 20px"> | |
48 | <div> |
|
48 | <div> | |
49 | %if c.closed: |
|
49 | %if c.closed: | |
50 | ${h.link_to(_('Hide closed pull requests (only show open pull requests)'), h.url('pullrequest_show_all',repo_name=c.repo_name,from_=c.from_))} |
|
50 | ${h.link_to(_('Hide closed pull requests (only show open pull requests)'), h.url('pullrequest_show_all',repo_name=c.repo_name,from_=c.from_))} | |
51 | %else: |
|
51 | %else: | |
52 | ${h.link_to(_('Show closed pull requests (in addition to open pull requests)'), h.url('pullrequest_show_all',repo_name=c.repo_name,from_=c.from_,closed=1))} |
|
52 | ${h.link_to(_('Show closed pull requests (in addition to open pull requests)'), h.url('pullrequest_show_all',repo_name=c.repo_name,from_=c.from_,closed=1))} | |
53 | %endif |
|
53 | %endif | |
54 | </div> |
|
54 | </div> | |
55 | </div> |
|
55 | </div> | |
56 |
|
56 | |||
57 | ${c.pullrequest_data} |
|
57 | ${c.pullrequest_data} | |
58 |
|
58 | |||
59 | </div> |
|
59 | </div> | |
60 | </%def> |
|
60 | </%def> |
@@ -1,50 +1,50 | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 |
<% |
|
3 | <%block name="title"> | |
4 | ${_('My Pull Requests')} · ${c.site_name} |
|
4 | ${_('My Pull Requests')} · ${c.site_name} | |
5 | </%def> |
|
5 | </%block> | |
6 |
|
6 | |||
7 | <%def name="breadcrumbs_links()"> |
|
7 | <%def name="breadcrumbs_links()"> | |
8 | ${_('My Pull Requests')} |
|
8 | ${_('My Pull Requests')} | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
11 | <%block name="header_menu"> |
|
11 | <%block name="header_menu"> | |
12 | ${self.menu('my_pullrequests')} |
|
12 | ${self.menu('my_pullrequests')} | |
13 | </%block> |
|
13 | </%block> | |
14 |
|
14 | |||
15 | <%def name="main()"> |
|
15 | <%def name="main()"> | |
16 |
|
16 | |||
17 | <div class="box"> |
|
17 | <div class="box"> | |
18 | <!-- box / title --> |
|
18 | <!-- box / title --> | |
19 | <div class="title"> |
|
19 | <div class="title"> | |
20 | ${self.breadcrumbs()} |
|
20 | ${self.breadcrumbs()} | |
21 | </div> |
|
21 | </div> | |
22 |
|
22 | |||
23 | <div id="pullrequests_container" class="table"> |
|
23 | <div id="pullrequests_container" class="table"> | |
24 | ## loaded via AJAX |
|
24 | ## loaded via AJAX | |
25 | ${_('Loading...')} |
|
25 | ${_('Loading...')} | |
26 | </div> |
|
26 | </div> | |
27 |
|
27 | |||
28 | <script type="text/javascript"> |
|
28 | <script type="text/javascript"> | |
29 | pyroutes.register('my_pullrequests_data', "${url('my_pullrequests_data')}", []); |
|
29 | pyroutes.register('my_pullrequests_data', "${url('my_pullrequests_data')}", []); | |
30 |
|
30 | |||
31 | var show_pullrequests = function(e){ |
|
31 | var show_pullrequests = function(e){ | |
32 |
|
32 | |||
33 | var url = pyroutes.url('my_pullrequests_data'); |
|
33 | var url = pyroutes.url('my_pullrequests_data'); | |
34 | if ($('#show_closed').prop('checked')) { |
|
34 | if ($('#show_closed').prop('checked')) { | |
35 | var url = pyroutes.url('my_pullrequests_data', {'pr_show_closed': '1'}); |
|
35 | var url = pyroutes.url('my_pullrequests_data', {'pr_show_closed': '1'}); | |
36 | } |
|
36 | } | |
37 | asynchtml(url, $('#pullrequests_container'), function(){ |
|
37 | asynchtml(url, $('#pullrequests_container'), function(){ | |
38 | // new #show_closed has just been loaded |
|
38 | // new #show_closed has just been loaded | |
39 | $('#show_closed').change(function (e) { |
|
39 | $('#show_closed').change(function (e) { | |
40 | show_pullrequests(e); |
|
40 | show_pullrequests(e); | |
41 | }); |
|
41 | }); | |
42 | }); |
|
42 | }); | |
43 | } |
|
43 | } | |
44 | show_pullrequests() |
|
44 | show_pullrequests() | |
45 |
|
45 | |||
46 | </script> |
|
46 | </script> | |
47 |
|
47 | |||
48 | </div> |
|
48 | </div> | |
49 |
|
49 | |||
50 | </%def> |
|
50 | </%def> |
@@ -1,121 +1,121 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="base/root.html"/> |
|
2 | <%inherit file="base/root.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('Sign Up')} |
|
5 | ${_('Sign Up')} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <div id="register"> |
|
11 | <div id="register"> | |
12 | <%include file="/base/flash_msg.html"/> |
|
12 | <%include file="/base/flash_msg.html"/> | |
13 | <div class="title withlogo"> |
|
13 | <div class="title withlogo"> | |
14 | %if c.site_name: |
|
14 | %if c.site_name: | |
15 | <h5>${_('Sign Up to %s') % c.site_name}</h5> |
|
15 | <h5>${_('Sign Up to %s') % c.site_name}</h5> | |
16 | %else: |
|
16 | %else: | |
17 | <h5>${_('Sign Up')}</h5> |
|
17 | <h5>${_('Sign Up')}</h5> | |
18 | %endif |
|
18 | %endif | |
19 | </div> |
|
19 | </div> | |
20 | <div class="inner"> |
|
20 | <div class="inner"> | |
21 | ${h.form(url('register'))} |
|
21 | ${h.form(url('register'))} | |
22 | <div class="form"> |
|
22 | <div class="form"> | |
23 | <!-- fields --> |
|
23 | <!-- fields --> | |
24 | <div class="fields"> |
|
24 | <div class="fields"> | |
25 | <div class="field"> |
|
25 | <div class="field"> | |
26 | <div class="label"> |
|
26 | <div class="label"> | |
27 | <label for="username">${_('Username')}:</label> |
|
27 | <label for="username">${_('Username')}:</label> | |
28 | </div> |
|
28 | </div> | |
29 | <div class="input"> |
|
29 | <div class="input"> | |
30 | ${h.text('username',class_="medium")} |
|
30 | ${h.text('username',class_="medium")} | |
31 | </div> |
|
31 | </div> | |
32 | </div> |
|
32 | </div> | |
33 |
|
33 | |||
34 | <div class="field"> |
|
34 | <div class="field"> | |
35 | <div class="label"> |
|
35 | <div class="label"> | |
36 | <label for="password">${_('Password')}:</label> |
|
36 | <label for="password">${_('Password')}:</label> | |
37 | </div> |
|
37 | </div> | |
38 | <div class="input"> |
|
38 | <div class="input"> | |
39 | ${h.password('password',class_="medium",autocomplete="off")} |
|
39 | ${h.password('password',class_="medium",autocomplete="off")} | |
40 | </div> |
|
40 | </div> | |
41 | </div> |
|
41 | </div> | |
42 |
|
42 | |||
43 | <div class="field"> |
|
43 | <div class="field"> | |
44 | <div class="label"> |
|
44 | <div class="label"> | |
45 | <label for="password">${_('Re-enter password')}:</label> |
|
45 | <label for="password">${_('Re-enter password')}:</label> | |
46 | </div> |
|
46 | </div> | |
47 | <div class="input"> |
|
47 | <div class="input"> | |
48 | ${h.password('password_confirmation',class_="medium",autocomplete="off")} |
|
48 | ${h.password('password_confirmation',class_="medium",autocomplete="off")} | |
49 | </div> |
|
49 | </div> | |
50 | </div> |
|
50 | </div> | |
51 |
|
51 | |||
52 | <div class="field"> |
|
52 | <div class="field"> | |
53 | <div class="label"> |
|
53 | <div class="label"> | |
54 | <label for="firstname">${_('First Name')}:</label> |
|
54 | <label for="firstname">${_('First Name')}:</label> | |
55 | </div> |
|
55 | </div> | |
56 | <div class="input"> |
|
56 | <div class="input"> | |
57 | ${h.text('firstname',class_="medium")} |
|
57 | ${h.text('firstname',class_="medium")} | |
58 | </div> |
|
58 | </div> | |
59 | </div> |
|
59 | </div> | |
60 |
|
60 | |||
61 | <div class="field"> |
|
61 | <div class="field"> | |
62 | <div class="label"> |
|
62 | <div class="label"> | |
63 | <label for="lastname">${_('Last Name')}:</label> |
|
63 | <label for="lastname">${_('Last Name')}:</label> | |
64 | </div> |
|
64 | </div> | |
65 | <div class="input"> |
|
65 | <div class="input"> | |
66 | ${h.text('lastname',class_="medium")} |
|
66 | ${h.text('lastname',class_="medium")} | |
67 | </div> |
|
67 | </div> | |
68 | </div> |
|
68 | </div> | |
69 |
|
69 | |||
70 | <div class="field"> |
|
70 | <div class="field"> | |
71 | <div class="label"> |
|
71 | <div class="label"> | |
72 | <label for="email">${_('Email')}:</label> |
|
72 | <label for="email">${_('Email')}:</label> | |
73 | </div> |
|
73 | </div> | |
74 | <div class="input"> |
|
74 | <div class="input"> | |
75 | ${h.text('email',class_="medium")} |
|
75 | ${h.text('email',class_="medium")} | |
76 | </div> |
|
76 | </div> | |
77 | </div> |
|
77 | </div> | |
78 |
|
78 | |||
79 | %if c.captcha_active: |
|
79 | %if c.captcha_active: | |
80 | <div class="field"> |
|
80 | <div class="field"> | |
81 | <div class="label"> |
|
81 | <div class="label"> | |
82 | <label for="email">${_('Captcha')}:</label> |
|
82 | <label for="email">${_('Captcha')}:</label> | |
83 | </div> |
|
83 | </div> | |
84 | <div class="input"> |
|
84 | <div class="input"> | |
85 | ${h.hidden('recaptcha_field')} |
|
85 | ${h.hidden('recaptcha_field')} | |
86 | <div id="recaptcha"></div> |
|
86 | <div id="recaptcha"></div> | |
87 | </div> |
|
87 | </div> | |
88 | </div> |
|
88 | </div> | |
89 | %endif |
|
89 | %endif | |
90 |
|
90 | |||
91 | <div class="buttons"> |
|
91 | <div class="buttons"> | |
92 | <div class="nohighlight"> |
|
92 | <div class="nohighlight"> | |
93 | ${h.submit('sign_up',_('Sign Up'),class_="btn")} |
|
93 | ${h.submit('sign_up',_('Sign Up'),class_="btn")} | |
94 | %if c.auto_active: |
|
94 | %if c.auto_active: | |
95 | <div class="activation_msg">${_('Registered accounts are ready to use and need no further action.')}</div> |
|
95 | <div class="activation_msg">${_('Registered accounts are ready to use and need no further action.')}</div> | |
96 | %else: |
|
96 | %else: | |
97 | <div class="activation_msg">${_('Please wait for an administrator to activate your account.')}</div> |
|
97 | <div class="activation_msg">${_('Please wait for an administrator to activate your account.')}</div> | |
98 | %endif |
|
98 | %endif | |
99 | </div> |
|
99 | </div> | |
100 | </div> |
|
100 | </div> | |
101 | </div> |
|
101 | </div> | |
102 | </div> |
|
102 | </div> | |
103 | ${h.end_form()} |
|
103 | ${h.end_form()} | |
104 | %if c.captcha_active: |
|
104 | %if c.captcha_active: | |
105 | <script type="text/javascript" src="https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script> |
|
105 | <script type="text/javascript" src="https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script> | |
106 | %endif |
|
106 | %endif | |
107 | <script type="text/javascript"> |
|
107 | <script type="text/javascript"> | |
108 | $(document).ready(function(){ |
|
108 | $(document).ready(function(){ | |
109 | $('#username').focus(); |
|
109 | $('#username').focus(); | |
110 |
|
110 | |||
111 | %if c.captcha_active: |
|
111 | %if c.captcha_active: | |
112 | Recaptcha.create("${c.captcha_public_key}", "recaptcha", |
|
112 | Recaptcha.create("${c.captcha_public_key}", "recaptcha", | |
113 | { |
|
113 | { | |
114 | theme: "white" |
|
114 | theme: "white" | |
115 | } |
|
115 | } | |
116 | ); |
|
116 | ); | |
117 | %endif |
|
117 | %endif | |
118 | }); |
|
118 | }); | |
119 | </script> |
|
119 | </script> | |
120 | </div> |
|
120 | </div> | |
121 | </div> |
|
121 | </div> |
@@ -1,92 +1,92 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | %if c.repo_name: |
|
5 | %if c.repo_name: | |
6 | ${_('%s Search') % c.repo_name} |
|
6 | ${_('%s Search') % c.repo_name} | |
7 | %else: |
|
7 | %else: | |
8 | ${_('Search in All Repositories')} |
|
8 | ${_('Search in All Repositories')} | |
9 | %endif |
|
9 | %endif | |
10 | %if c.site_name: |
|
10 | %if c.site_name: | |
11 | · ${c.site_name} |
|
11 | · ${c.site_name} | |
12 | %endif |
|
12 | %endif | |
13 | </%def> |
|
13 | </%block> | |
14 |
|
14 | |||
15 | <%def name="breadcrumbs_links()"> |
|
15 | <%def name="breadcrumbs_links()"> | |
16 | %if c.repo_name: |
|
16 | %if c.repo_name: | |
17 | ${_('Search')} |
|
17 | ${_('Search')} | |
18 | %else: |
|
18 | %else: | |
19 | ${_('Search in All Repositories')} |
|
19 | ${_('Search in All Repositories')} | |
20 | %endif |
|
20 | %endif | |
21 | %if c.cur_query: |
|
21 | %if c.cur_query: | |
22 | » |
|
22 | » | |
23 | ${c.cur_query} |
|
23 | ${c.cur_query} | |
24 | %endif |
|
24 | %endif | |
25 | </%def> |
|
25 | </%def> | |
26 |
|
26 | |||
27 | <%block name="header_menu"> |
|
27 | <%block name="header_menu"> | |
28 | %if c.repo_name: |
|
28 | %if c.repo_name: | |
29 | ${self.menu('repositories')} |
|
29 | ${self.menu('repositories')} | |
30 | %else: |
|
30 | %else: | |
31 | ${self.menu('search')} |
|
31 | ${self.menu('search')} | |
32 | %endif |
|
32 | %endif | |
33 | </%block> |
|
33 | </%block> | |
34 | <%def name="main()"> |
|
34 | <%def name="main()"> | |
35 | %if c.repo_name: |
|
35 | %if c.repo_name: | |
36 | ${self.repo_context_bar('options')} |
|
36 | ${self.repo_context_bar('options')} | |
37 | %endif |
|
37 | %endif | |
38 | <div class="box"> |
|
38 | <div class="box"> | |
39 | <!-- box / title --> |
|
39 | <!-- box / title --> | |
40 | <div class="title"> |
|
40 | <div class="title"> | |
41 | ${self.breadcrumbs()} |
|
41 | ${self.breadcrumbs()} | |
42 | </div> |
|
42 | </div> | |
43 | <!-- end box / title --> |
|
43 | <!-- end box / title --> | |
44 | %if c.repo_name: |
|
44 | %if c.repo_name: | |
45 | ${h.form(h.url('search_repo',repo_name=c.repo_name),method='get')} |
|
45 | ${h.form(h.url('search_repo',repo_name=c.repo_name),method='get')} | |
46 | %else: |
|
46 | %else: | |
47 | ${h.form(h.url('search'),method='get')} |
|
47 | ${h.form(h.url('search'),method='get')} | |
48 | %endif |
|
48 | %endif | |
49 | <div class="form"> |
|
49 | <div class="form"> | |
50 | <div class="fields"> |
|
50 | <div class="fields"> | |
51 | <div class="field field-first field-noborder"> |
|
51 | <div class="field field-first field-noborder"> | |
52 | <div class="label"> |
|
52 | <div class="label"> | |
53 | <label for="q">${_('Search term')}:</label> |
|
53 | <label for="q">${_('Search term')}:</label> | |
54 | </div> |
|
54 | </div> | |
55 | <div class="input">${h.text('q',c.cur_query,class_="small")} |
|
55 | <div class="input">${h.text('q',c.cur_query,class_="small")} | |
56 | <div class="button highlight"> |
|
56 | <div class="button highlight"> | |
57 | <input type="submit" value="${_('Search')}" class="btn"/> |
|
57 | <input type="submit" value="${_('Search')}" class="btn"/> | |
58 | </div> |
|
58 | </div> | |
59 | </div> |
|
59 | </div> | |
60 | <div style="font-weight: bold;clear:both;margin-left:200px">${c.runtime}</div> |
|
60 | <div style="font-weight: bold;clear:both;margin-left:200px">${c.runtime}</div> | |
61 | </div> |
|
61 | </div> | |
62 |
|
62 | |||
63 | <div class="field"> |
|
63 | <div class="field"> | |
64 | <div class="label"> |
|
64 | <div class="label"> | |
65 | <label for="type">${_('Search in')}:</label> |
|
65 | <label for="type">${_('Search in')}:</label> | |
66 | </div> |
|
66 | </div> | |
67 | <div class="select"> |
|
67 | <div class="select"> | |
68 | ${h.select('type',c.cur_type,[('content',_('File contents')), |
|
68 | ${h.select('type',c.cur_type,[('content',_('File contents')), | |
69 | ('commit',_('Commit messages')), |
|
69 | ('commit',_('Commit messages')), | |
70 | ('path',_('File names')) |
|
70 | ('path',_('File names')) | |
71 | ##('repository',_('Repository names')) |
|
71 | ##('repository',_('Repository names')) | |
72 | ])} |
|
72 | ])} | |
73 | </div> |
|
73 | </div> | |
74 | </div> |
|
74 | </div> | |
75 |
|
75 | |||
76 | </div> |
|
76 | </div> | |
77 | </div> |
|
77 | </div> | |
78 | ${h.end_form()} |
|
78 | ${h.end_form()} | |
79 | <div class="search"> |
|
79 | <div class="search"> | |
80 | %if c.cur_type == 'content': |
|
80 | %if c.cur_type == 'content': | |
81 | <%include file='search_content.html'/> |
|
81 | <%include file='search_content.html'/> | |
82 | %elif c.cur_type == 'path': |
|
82 | %elif c.cur_type == 'path': | |
83 | <%include file='search_path.html'/> |
|
83 | <%include file='search_path.html'/> | |
84 | %elif c.cur_type == 'commit': |
|
84 | %elif c.cur_type == 'commit': | |
85 | <%include file='search_commit.html'/> |
|
85 | <%include file='search_commit.html'/> | |
86 | %elif c.cur_type == 'repository': |
|
86 | %elif c.cur_type == 'repository': | |
87 | <%include file='search_repository.html'/> |
|
87 | <%include file='search_repository.html'/> | |
88 | %endif |
|
88 | %endif | |
89 | </div> |
|
89 | </div> | |
90 | </div> |
|
90 | </div> | |
91 |
|
91 | |||
92 | </%def> |
|
92 | </%def> |
@@ -1,450 +1,450 | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 |
<% |
|
3 | <%block name="title"> | |
4 | ${_('%s Statistics') % c.repo_name} |
|
4 | ${_('%s Statistics') % c.repo_name} | |
5 | %if c.site_name: |
|
5 | %if c.site_name: | |
6 | · ${c.site_name} |
|
6 | · ${c.site_name} | |
7 | %endif |
|
7 | %endif | |
8 | </%def> |
|
8 | </%block> | |
9 |
|
9 | |||
10 | <%def name="breadcrumbs_links()"> |
|
10 | <%def name="breadcrumbs_links()"> | |
11 | ${_('Statistics')} |
|
11 | ${_('Statistics')} | |
12 | </%def> |
|
12 | </%def> | |
13 |
|
13 | |||
14 | <%block name="header_menu"> |
|
14 | <%block name="header_menu"> | |
15 | ${self.menu('repositories')} |
|
15 | ${self.menu('repositories')} | |
16 | </%block> |
|
16 | </%block> | |
17 |
|
17 | |||
18 | <%block name="head_extra"> |
|
18 | <%block name="head_extra"> | |
19 | <link href="${h.url('atom_feed_home',repo_name=c.db_repo.repo_name,api_key=c.authuser.api_key)}" rel="alternate" title="${_('%s ATOM feed') % c.repo_name}" type="application/atom+xml" /> |
|
19 | <link href="${h.url('atom_feed_home',repo_name=c.db_repo.repo_name,api_key=c.authuser.api_key)}" rel="alternate" title="${_('%s ATOM feed') % c.repo_name}" type="application/atom+xml" /> | |
20 | <link href="${h.url('rss_feed_home',repo_name=c.db_repo.repo_name,api_key=c.authuser.api_key)}" rel="alternate" title="${_('%s RSS feed') % c.repo_name}" type="application/rss+xml" /> |
|
20 | <link href="${h.url('rss_feed_home',repo_name=c.db_repo.repo_name,api_key=c.authuser.api_key)}" rel="alternate" title="${_('%s RSS feed') % c.repo_name}" type="application/rss+xml" /> | |
21 | </%block> |
|
21 | </%block> | |
22 |
|
22 | |||
23 | <%def name="main()"> |
|
23 | <%def name="main()"> | |
24 | ${self.repo_context_bar('summary')} |
|
24 | ${self.repo_context_bar('summary')} | |
25 | <% |
|
25 | <% | |
26 | summary = lambda n:{False:'summary-short'}.get(n) |
|
26 | summary = lambda n:{False:'summary-short'}.get(n) | |
27 | %> |
|
27 | %> | |
28 | <div class="box"> |
|
28 | <div class="box"> | |
29 | <!-- box / title --> |
|
29 | <!-- box / title --> | |
30 | <div class="title"> |
|
30 | <div class="title"> | |
31 | ${self.breadcrumbs()} |
|
31 | ${self.breadcrumbs()} | |
32 | </div> |
|
32 | </div> | |
33 |
|
33 | |||
34 | <div class="graph"> |
|
34 | <div class="graph"> | |
35 | <div style="padding:0 10px 10px 17px;"> |
|
35 | <div style="padding:0 10px 10px 17px;"> | |
36 | %if c.no_data: |
|
36 | %if c.no_data: | |
37 | ${c.no_data_msg} |
|
37 | ${c.no_data_msg} | |
38 | %if h.HasPermissionAll('hg.admin')('enable stats on from summary'): |
|
38 | %if h.HasPermissionAll('hg.admin')('enable stats on from summary'): | |
39 | ${h.link_to(_('Enable'),h.url('edit_repo',repo_name=c.repo_name),class_="btn btn-mini")} |
|
39 | ${h.link_to(_('Enable'),h.url('edit_repo',repo_name=c.repo_name),class_="btn btn-mini")} | |
40 | %endif |
|
40 | %endif | |
41 | %else: |
|
41 | %else: | |
42 | ${_('Stats gathered: ')} ${c.stats_percentage}% |
|
42 | ${_('Stats gathered: ')} ${c.stats_percentage}% | |
43 | %endif |
|
43 | %endif | |
44 | </div> |
|
44 | </div> | |
45 | <div id="commit_history" style="width:450px;height:300px;float:left"></div> |
|
45 | <div id="commit_history" style="width:450px;height:300px;float:left"></div> | |
46 | <div style="clear: both;height: 10px"></div> |
|
46 | <div style="clear: both;height: 10px"></div> | |
47 | <div id="overview" style="width:450px;height:100px;float:left"></div> |
|
47 | <div id="overview" style="width:450px;height:100px;float:left"></div> | |
48 |
|
48 | |||
49 | <div id="legend_data" style="clear:both;margin-top:10px;"> |
|
49 | <div id="legend_data" style="clear:both;margin-top:10px;"> | |
50 | <div id="legend_container"></div> |
|
50 | <div id="legend_container"></div> | |
51 | <div id="legend_choices"> |
|
51 | <div id="legend_choices"> | |
52 | <table id="legend_choices_tables" class="noborder" style="font-size:smaller;color:#545454"></table> |
|
52 | <table id="legend_choices_tables" class="noborder" style="font-size:smaller;color:#545454"></table> | |
53 | </div> |
|
53 | </div> | |
54 | </div> |
|
54 | </div> | |
55 | </div> |
|
55 | </div> | |
56 | </div> |
|
56 | </div> | |
57 |
|
57 | |||
58 | <script type="text/javascript"> |
|
58 | <script type="text/javascript"> | |
59 | var data = ${c.trending_languages|n}; |
|
59 | var data = ${c.trending_languages|n}; | |
60 | var total = 0; |
|
60 | var total = 0; | |
61 | var no_data = true; |
|
61 | var no_data = true; | |
62 | var tbl = document.createElement('table'); |
|
62 | var tbl = document.createElement('table'); | |
63 | tbl.setAttribute('class','trending_language_tbl'); |
|
63 | tbl.setAttribute('class','trending_language_tbl'); | |
64 | var cnt = 0; |
|
64 | var cnt = 0; | |
65 | for (var i=0;i<data.length;i++){ |
|
65 | for (var i=0;i<data.length;i++){ | |
66 | total+= data[i][1].count; |
|
66 | total+= data[i][1].count; | |
67 | } |
|
67 | } | |
68 | for (var i=0;i<data.length;i++){ |
|
68 | for (var i=0;i<data.length;i++){ | |
69 | cnt += 1; |
|
69 | cnt += 1; | |
70 | no_data = false; |
|
70 | no_data = false; | |
71 |
|
71 | |||
72 | var hide = cnt>2; |
|
72 | var hide = cnt>2; | |
73 | var tr = document.createElement('tr'); |
|
73 | var tr = document.createElement('tr'); | |
74 | if (hide){ |
|
74 | if (hide){ | |
75 | tr.setAttribute('style','display:none'); |
|
75 | tr.setAttribute('style','display:none'); | |
76 | tr.setAttribute('class','stats_hidden'); |
|
76 | tr.setAttribute('class','stats_hidden'); | |
77 | } |
|
77 | } | |
78 | var k = data[i][0]; |
|
78 | var k = data[i][0]; | |
79 | var obj = data[i][1]; |
|
79 | var obj = data[i][1]; | |
80 | var percentage = Math.round((obj.count/total*100),2); |
|
80 | var percentage = Math.round((obj.count/total*100),2); | |
81 |
|
81 | |||
82 | var td1 = document.createElement('td'); |
|
82 | var td1 = document.createElement('td'); | |
83 | td1.width = 150; |
|
83 | td1.width = 150; | |
84 | var trending_language_label = document.createElement('div'); |
|
84 | var trending_language_label = document.createElement('div'); | |
85 | trending_language_label.innerHTML = obj.desc+" ("+k+")"; |
|
85 | trending_language_label.innerHTML = obj.desc+" ("+k+")"; | |
86 | td1.appendChild(trending_language_label); |
|
86 | td1.appendChild(trending_language_label); | |
87 |
|
87 | |||
88 | var td2 = document.createElement('td'); |
|
88 | var td2 = document.createElement('td'); | |
89 | td2.setAttribute('style','padding-right:14px !important'); |
|
89 | td2.setAttribute('style','padding-right:14px !important'); | |
90 | var trending_language = document.createElement('div'); |
|
90 | var trending_language = document.createElement('div'); | |
91 | var nr_files = obj.count+" ${_('files')}"; |
|
91 | var nr_files = obj.count+" ${_('files')}"; | |
92 |
|
92 | |||
93 | trending_language.title = k+" "+nr_files; |
|
93 | trending_language.title = k+" "+nr_files; | |
94 |
|
94 | |||
95 | if (percentage>22){ |
|
95 | if (percentage>22){ | |
96 | trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"% "+nr_files+ "</b>"; |
|
96 | trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"% "+nr_files+ "</b>"; | |
97 | } |
|
97 | } | |
98 | else{ |
|
98 | else{ | |
99 | trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"%</b>"; |
|
99 | trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"%</b>"; | |
100 | } |
|
100 | } | |
101 |
|
101 | |||
102 | trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner'); |
|
102 | trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner'); | |
103 | trending_language.style.width=percentage+"%"; |
|
103 | trending_language.style.width=percentage+"%"; | |
104 | td2.appendChild(trending_language); |
|
104 | td2.appendChild(trending_language); | |
105 |
|
105 | |||
106 | tr.appendChild(td1); |
|
106 | tr.appendChild(td1); | |
107 | tr.appendChild(td2); |
|
107 | tr.appendChild(td2); | |
108 | tbl.appendChild(tr); |
|
108 | tbl.appendChild(tr); | |
109 | if(cnt == 3){ |
|
109 | if(cnt == 3){ | |
110 | var show_more = document.createElement('tr'); |
|
110 | var show_more = document.createElement('tr'); | |
111 | var td = document.createElement('td'); |
|
111 | var td = document.createElement('td'); | |
112 | lnk = document.createElement('a'); |
|
112 | lnk = document.createElement('a'); | |
113 |
|
113 | |||
114 | lnk.href='#'; |
|
114 | lnk.href='#'; | |
115 | lnk.innerHTML = "${_('Show more')}"; |
|
115 | lnk.innerHTML = "${_('Show more')}"; | |
116 | lnk.id='code_stats_show_more'; |
|
116 | lnk.id='code_stats_show_more'; | |
117 | td.appendChild(lnk); |
|
117 | td.appendChild(lnk); | |
118 |
|
118 | |||
119 | show_more.appendChild(td); |
|
119 | show_more.appendChild(td); | |
120 | show_more.appendChild(document.createElement('td')); |
|
120 | show_more.appendChild(document.createElement('td')); | |
121 | tbl.appendChild(show_more); |
|
121 | tbl.appendChild(show_more); | |
122 | } |
|
122 | } | |
123 |
|
123 | |||
124 | } |
|
124 | } | |
125 |
|
125 | |||
126 | </script> |
|
126 | </script> | |
127 | <script type="text/javascript"> |
|
127 | <script type="text/javascript"> | |
128 | /** |
|
128 | /** | |
129 | * Plots summary graph |
|
129 | * Plots summary graph | |
130 | * |
|
130 | * | |
131 | * @class SummaryPlot |
|
131 | * @class SummaryPlot | |
132 | * @param {from} initial from for detailed graph |
|
132 | * @param {from} initial from for detailed graph | |
133 | * @param {to} initial to for detailed graph |
|
133 | * @param {to} initial to for detailed graph | |
134 | * @param {dataset} |
|
134 | * @param {dataset} | |
135 | * @param {overview_dataset} |
|
135 | * @param {overview_dataset} | |
136 | */ |
|
136 | */ | |
137 | function SummaryPlot(from,to,dataset,overview_dataset) { |
|
137 | function SummaryPlot(from,to,dataset,overview_dataset) { | |
138 | var initial_ranges = { |
|
138 | var initial_ranges = { | |
139 | "xaxis":{ |
|
139 | "xaxis":{ | |
140 | "from":from, |
|
140 | "from":from, | |
141 | "to":to |
|
141 | "to":to | |
142 | } |
|
142 | } | |
143 | }; |
|
143 | }; | |
144 | var dataset = dataset; |
|
144 | var dataset = dataset; | |
145 | var overview_dataset = [overview_dataset]; |
|
145 | var overview_dataset = [overview_dataset]; | |
146 | var choiceContainer = YUD.get("legend_choices"); |
|
146 | var choiceContainer = YUD.get("legend_choices"); | |
147 | var choiceContainerTable = YUD.get("legend_choices_tables"); |
|
147 | var choiceContainerTable = YUD.get("legend_choices_tables"); | |
148 | var plotContainer = YUD.get('commit_history'); |
|
148 | var plotContainer = YUD.get('commit_history'); | |
149 | var overviewContainer = YUD.get('overview'); |
|
149 | var overviewContainer = YUD.get('overview'); | |
150 |
|
150 | |||
151 | var plot_options = { |
|
151 | var plot_options = { | |
152 | bars: {show:true, align: 'center', lineWidth: 4}, |
|
152 | bars: {show:true, align: 'center', lineWidth: 4}, | |
153 | legend: {show:true, container: "legend_container"}, |
|
153 | legend: {show:true, container: "legend_container"}, | |
154 | points: {show:true, radius: 0, fill: false}, |
|
154 | points: {show:true, radius: 0, fill: false}, | |
155 | yaxis: {tickDecimals: 0}, |
|
155 | yaxis: {tickDecimals: 0}, | |
156 | xaxis: { |
|
156 | xaxis: { | |
157 | mode: "time", |
|
157 | mode: "time", | |
158 | timeformat: "%d/%m", |
|
158 | timeformat: "%d/%m", | |
159 | min: from, |
|
159 | min: from, | |
160 | max: to |
|
160 | max: to | |
161 | }, |
|
161 | }, | |
162 | grid: { |
|
162 | grid: { | |
163 | hoverable: true, |
|
163 | hoverable: true, | |
164 | clickable: true, |
|
164 | clickable: true, | |
165 | autoHighlight: true, |
|
165 | autoHighlight: true, | |
166 | color: "#999" |
|
166 | color: "#999" | |
167 | }, |
|
167 | }, | |
168 | //selection: {mode: "x"} |
|
168 | //selection: {mode: "x"} | |
169 | }; |
|
169 | }; | |
170 | var overview_options = { |
|
170 | var overview_options = { | |
171 | legend:{show:false}, |
|
171 | legend:{show:false}, | |
172 | bars: {show:true, barWidth: 2}, |
|
172 | bars: {show:true, barWidth: 2}, | |
173 | shadowSize: 0, |
|
173 | shadowSize: 0, | |
174 | xaxis: {mode: "time", timeformat: "%d/%m/%y"}, |
|
174 | xaxis: {mode: "time", timeformat: "%d/%m/%y"}, | |
175 | yaxis: {ticks: 3, min: 0, tickDecimals:0}, |
|
175 | yaxis: {ticks: 3, min: 0, tickDecimals:0}, | |
176 | grid: {color: "#999"}, |
|
176 | grid: {color: "#999"}, | |
177 | selection: {mode: "x"} |
|
177 | selection: {mode: "x"} | |
178 | }; |
|
178 | }; | |
179 |
|
179 | |||
180 | /** |
|
180 | /** | |
181 | *get dummy data needed in few places |
|
181 | *get dummy data needed in few places | |
182 | */ |
|
182 | */ | |
183 | function getDummyData(label){ |
|
183 | function getDummyData(label){ | |
184 | return {"label":label, |
|
184 | return {"label":label, | |
185 | "data":[{"time":0, |
|
185 | "data":[{"time":0, | |
186 | "commits":0, |
|
186 | "commits":0, | |
187 | "added":0, |
|
187 | "added":0, | |
188 | "changed":0, |
|
188 | "changed":0, | |
189 | "removed":0 |
|
189 | "removed":0 | |
190 | }], |
|
190 | }], | |
191 | "schema":["commits"], |
|
191 | "schema":["commits"], | |
192 | "color":'#ffffff' |
|
192 | "color":'#ffffff' | |
193 | } |
|
193 | } | |
194 | } |
|
194 | } | |
195 |
|
195 | |||
196 | /** |
|
196 | /** | |
197 | * generate checkboxes accordindly to data |
|
197 | * generate checkboxes accordindly to data | |
198 | * @param keys |
|
198 | * @param keys | |
199 | * @returns |
|
199 | * @returns | |
200 | */ |
|
200 | */ | |
201 | function generateCheckboxes(data) { |
|
201 | function generateCheckboxes(data) { | |
202 | //append checkboxes |
|
202 | //append checkboxes | |
203 | var i = 0; |
|
203 | var i = 0; | |
204 | choiceContainerTable.innerHTML = ''; |
|
204 | choiceContainerTable.innerHTML = ''; | |
205 | for(var pos in data) { |
|
205 | for(var pos in data) { | |
206 |
|
206 | |||
207 | data[pos].color = i; |
|
207 | data[pos].color = i; | |
208 | i++; |
|
208 | i++; | |
209 | if(data[pos].label != ''){ |
|
209 | if(data[pos].label != ''){ | |
210 | choiceContainerTable.innerHTML += |
|
210 | choiceContainerTable.innerHTML += | |
211 | '<tr><td><input type="checkbox" id="id_user_{0}" name="{0}" checked="checked" /> \ |
|
211 | '<tr><td><input type="checkbox" id="id_user_{0}" name="{0}" checked="checked" /> \ | |
212 | <label for="id_user_{0}">{0}</label></td></tr>'.format(data[pos].label); |
|
212 | <label for="id_user_{0}">{0}</label></td></tr>'.format(data[pos].label); | |
213 | } |
|
213 | } | |
214 | } |
|
214 | } | |
215 | } |
|
215 | } | |
216 |
|
216 | |||
217 | /** |
|
217 | /** | |
218 | * ToolTip show |
|
218 | * ToolTip show | |
219 | */ |
|
219 | */ | |
220 | function showTooltip(x, y, contents) { |
|
220 | function showTooltip(x, y, contents) { | |
221 | var div=document.getElementById('tooltip'); |
|
221 | var div=document.getElementById('tooltip'); | |
222 | if(!div) { |
|
222 | if(!div) { | |
223 | div = document.createElement('div'); |
|
223 | div = document.createElement('div'); | |
224 | div.id="tooltip"; |
|
224 | div.id="tooltip"; | |
225 | div.style.position="absolute"; |
|
225 | div.style.position="absolute"; | |
226 | div.style.border='1px solid #fdd'; |
|
226 | div.style.border='1px solid #fdd'; | |
227 | div.style.padding='2px'; |
|
227 | div.style.padding='2px'; | |
228 | div.style.backgroundColor='#fee'; |
|
228 | div.style.backgroundColor='#fee'; | |
229 | document.body.appendChild(div); |
|
229 | document.body.appendChild(div); | |
230 | } |
|
230 | } | |
231 | YUD.setStyle(div, 'opacity', 0); |
|
231 | YUD.setStyle(div, 'opacity', 0); | |
232 | div.innerHTML = contents; |
|
232 | div.innerHTML = contents; | |
233 | div.style.top=(y + 5) + "px"; |
|
233 | div.style.top=(y + 5) + "px"; | |
234 | div.style.left=(x + 5) + "px"; |
|
234 | div.style.left=(x + 5) + "px"; | |
235 |
|
235 | |||
236 | var anim = new YAHOO.util.Anim(div, {opacity: {to: 0.8}}, 0.2); |
|
236 | var anim = new YAHOO.util.Anim(div, {opacity: {to: 0.8}}, 0.2); | |
237 | anim.animate(); |
|
237 | anim.animate(); | |
238 | } |
|
238 | } | |
239 |
|
239 | |||
240 | /** |
|
240 | /** | |
241 | * This function will detect if selected period has some changesets |
|
241 | * This function will detect if selected period has some changesets | |
242 | for this user if it does this data is then pushed for displaying |
|
242 | for this user if it does this data is then pushed for displaying | |
243 | Additionally it will only display users that are selected by the checkbox |
|
243 | Additionally it will only display users that are selected by the checkbox | |
244 | */ |
|
244 | */ | |
245 | function getDataAccordingToRanges(ranges) { |
|
245 | function getDataAccordingToRanges(ranges) { | |
246 |
|
246 | |||
247 | var data = []; |
|
247 | var data = []; | |
248 | var new_dataset = {}; |
|
248 | var new_dataset = {}; | |
249 | var keys = []; |
|
249 | var keys = []; | |
250 | var max_commits = 0; |
|
250 | var max_commits = 0; | |
251 | for(var key in dataset){ |
|
251 | for(var key in dataset){ | |
252 |
|
252 | |||
253 | for(var ds in dataset[key].data){ |
|
253 | for(var ds in dataset[key].data){ | |
254 | commit_data = dataset[key].data[ds]; |
|
254 | commit_data = dataset[key].data[ds]; | |
255 | if (commit_data.time >= ranges.xaxis.from && commit_data.time <= ranges.xaxis.to){ |
|
255 | if (commit_data.time >= ranges.xaxis.from && commit_data.time <= ranges.xaxis.to){ | |
256 |
|
256 | |||
257 | if(new_dataset[key] === undefined){ |
|
257 | if(new_dataset[key] === undefined){ | |
258 | new_dataset[key] = {data:[],schema:["commits"],label:key}; |
|
258 | new_dataset[key] = {data:[],schema:["commits"],label:key}; | |
259 | } |
|
259 | } | |
260 | new_dataset[key].data.push(commit_data); |
|
260 | new_dataset[key].data.push(commit_data); | |
261 | } |
|
261 | } | |
262 | } |
|
262 | } | |
263 | if (new_dataset[key] !== undefined){ |
|
263 | if (new_dataset[key] !== undefined){ | |
264 | data.push(new_dataset[key]); |
|
264 | data.push(new_dataset[key]); | |
265 | } |
|
265 | } | |
266 | } |
|
266 | } | |
267 |
|
267 | |||
268 | if (data.length > 0){ |
|
268 | if (data.length > 0){ | |
269 | return data; |
|
269 | return data; | |
270 | } |
|
270 | } | |
271 | else{ |
|
271 | else{ | |
272 | //just return dummy data for graph to plot itself |
|
272 | //just return dummy data for graph to plot itself | |
273 | return [getDummyData('')]; |
|
273 | return [getDummyData('')]; | |
274 | } |
|
274 | } | |
275 | } |
|
275 | } | |
276 |
|
276 | |||
277 | /** |
|
277 | /** | |
278 | * redraw using new checkbox data |
|
278 | * redraw using new checkbox data | |
279 | */ |
|
279 | */ | |
280 | function plotchoiced(e,args){ |
|
280 | function plotchoiced(e,args){ | |
281 | var cur_data = args[0]; |
|
281 | var cur_data = args[0]; | |
282 | var cur_ranges = args[1]; |
|
282 | var cur_ranges = args[1]; | |
283 |
|
283 | |||
284 | var new_data = []; |
|
284 | var new_data = []; | |
285 | var inputs = choiceContainer.getElementsByTagName("input"); |
|
285 | var inputs = choiceContainer.getElementsByTagName("input"); | |
286 |
|
286 | |||
287 | //show only checked labels |
|
287 | //show only checked labels | |
288 | for(var i=0; i<inputs.length; i++) { |
|
288 | for(var i=0; i<inputs.length; i++) { | |
289 | var checkbox_key = inputs[i].name; |
|
289 | var checkbox_key = inputs[i].name; | |
290 |
|
290 | |||
291 | if(inputs[i].checked){ |
|
291 | if(inputs[i].checked){ | |
292 | for(var d in cur_data){ |
|
292 | for(var d in cur_data){ | |
293 | if(cur_data[d].label == checkbox_key){ |
|
293 | if(cur_data[d].label == checkbox_key){ | |
294 | new_data.push(cur_data[d]); |
|
294 | new_data.push(cur_data[d]); | |
295 | } |
|
295 | } | |
296 | } |
|
296 | } | |
297 | } |
|
297 | } | |
298 | else{ |
|
298 | else{ | |
299 | //push dummy data to not hide the label |
|
299 | //push dummy data to not hide the label | |
300 | new_data.push(getDummyData(checkbox_key)); |
|
300 | new_data.push(getDummyData(checkbox_key)); | |
301 | } |
|
301 | } | |
302 | } |
|
302 | } | |
303 |
|
303 | |||
304 | var new_options = YAHOO.lang.merge(plot_options, { |
|
304 | var new_options = YAHOO.lang.merge(plot_options, { | |
305 | xaxis: { |
|
305 | xaxis: { | |
306 | min: cur_ranges.xaxis.from, |
|
306 | min: cur_ranges.xaxis.from, | |
307 | max: cur_ranges.xaxis.to, |
|
307 | max: cur_ranges.xaxis.to, | |
308 | mode: "time", |
|
308 | mode: "time", | |
309 | timeformat: "%d/%m" |
|
309 | timeformat: "%d/%m" | |
310 | } |
|
310 | } | |
311 | }); |
|
311 | }); | |
312 | if (!new_data){ |
|
312 | if (!new_data){ | |
313 | new_data = [[0,1]]; |
|
313 | new_data = [[0,1]]; | |
314 | } |
|
314 | } | |
315 | // do the zooming |
|
315 | // do the zooming | |
316 | plot = YAHOO.widget.Flot(plotContainer, new_data, new_options); |
|
316 | plot = YAHOO.widget.Flot(plotContainer, new_data, new_options); | |
317 |
|
317 | |||
318 | plot.subscribe("plotselected", plotselected); |
|
318 | plot.subscribe("plotselected", plotselected); | |
319 |
|
319 | |||
320 | //resubscribe plothover |
|
320 | //resubscribe plothover | |
321 | plot.subscribe("plothover", plothover); |
|
321 | plot.subscribe("plothover", plothover); | |
322 |
|
322 | |||
323 | // don't fire event on the overview to prevent eternal loop |
|
323 | // don't fire event on the overview to prevent eternal loop | |
324 | overview.setSelection(cur_ranges, true); |
|
324 | overview.setSelection(cur_ranges, true); | |
325 |
|
325 | |||
326 | } |
|
326 | } | |
327 |
|
327 | |||
328 | /** |
|
328 | /** | |
329 | * plot only selected items from overview |
|
329 | * plot only selected items from overview | |
330 | * @param ranges |
|
330 | * @param ranges | |
331 | * @returns |
|
331 | * @returns | |
332 | */ |
|
332 | */ | |
333 | function plotselected(ranges,cur_data) { |
|
333 | function plotselected(ranges,cur_data) { | |
334 | //updates the data for new plot |
|
334 | //updates the data for new plot | |
335 | var data = getDataAccordingToRanges(ranges); |
|
335 | var data = getDataAccordingToRanges(ranges); | |
336 | generateCheckboxes(data); |
|
336 | generateCheckboxes(data); | |
337 |
|
337 | |||
338 | var new_options = YAHOO.lang.merge(plot_options, { |
|
338 | var new_options = YAHOO.lang.merge(plot_options, { | |
339 | xaxis: { |
|
339 | xaxis: { | |
340 | min: ranges.xaxis.from, |
|
340 | min: ranges.xaxis.from, | |
341 | max: ranges.xaxis.to, |
|
341 | max: ranges.xaxis.to, | |
342 | mode:"time", |
|
342 | mode:"time", | |
343 | timeformat: "%d/%m" |
|
343 | timeformat: "%d/%m" | |
344 | } |
|
344 | } | |
345 | }); |
|
345 | }); | |
346 | // do the zooming |
|
346 | // do the zooming | |
347 | plot = YAHOO.widget.Flot(plotContainer, data, new_options); |
|
347 | plot = YAHOO.widget.Flot(plotContainer, data, new_options); | |
348 |
|
348 | |||
349 | plot.subscribe("plotselected", plotselected); |
|
349 | plot.subscribe("plotselected", plotselected); | |
350 |
|
350 | |||
351 | //resubscribe plothover |
|
351 | //resubscribe plothover | |
352 | plot.subscribe("plothover", plothover); |
|
352 | plot.subscribe("plothover", plothover); | |
353 |
|
353 | |||
354 | // don't fire event on the overview to prevent eternal loop |
|
354 | // don't fire event on the overview to prevent eternal loop | |
355 | overview.setSelection(ranges, true); |
|
355 | overview.setSelection(ranges, true); | |
356 |
|
356 | |||
357 | //resubscribe choiced |
|
357 | //resubscribe choiced | |
358 | YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, ranges]); |
|
358 | YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, ranges]); | |
359 | } |
|
359 | } | |
360 |
|
360 | |||
361 | var previousPoint = null; |
|
361 | var previousPoint = null; | |
362 |
|
362 | |||
363 | function plothover(o) { |
|
363 | function plothover(o) { | |
364 | var pos = o.pos; |
|
364 | var pos = o.pos; | |
365 | var item = o.item; |
|
365 | var item = o.item; | |
366 |
|
366 | |||
367 | //YUD.get("x").innerHTML = pos.x.toFixed(2); |
|
367 | //YUD.get("x").innerHTML = pos.x.toFixed(2); | |
368 | //YUD.get("y").innerHTML = pos.y.toFixed(2); |
|
368 | //YUD.get("y").innerHTML = pos.y.toFixed(2); | |
369 | if (item) { |
|
369 | if (item) { | |
370 | if (previousPoint != item.datapoint) { |
|
370 | if (previousPoint != item.datapoint) { | |
371 | previousPoint = item.datapoint; |
|
371 | previousPoint = item.datapoint; | |
372 |
|
372 | |||
373 | var tooltip = YUD.get("tooltip"); |
|
373 | var tooltip = YUD.get("tooltip"); | |
374 | if(tooltip) { |
|
374 | if(tooltip) { | |
375 | tooltip.parentNode.removeChild(tooltip); |
|
375 | tooltip.parentNode.removeChild(tooltip); | |
376 | } |
|
376 | } | |
377 | var x = item.datapoint.x.toFixed(2); |
|
377 | var x = item.datapoint.x.toFixed(2); | |
378 | var y = item.datapoint.y.toFixed(2); |
|
378 | var y = item.datapoint.y.toFixed(2); | |
379 |
|
379 | |||
380 | if (!item.series.label){ |
|
380 | if (!item.series.label){ | |
381 | item.series.label = 'commits'; |
|
381 | item.series.label = 'commits'; | |
382 | } |
|
382 | } | |
383 | var d = new Date(x*1000); |
|
383 | var d = new Date(x*1000); | |
384 | var fd = d.toDateString() |
|
384 | var fd = d.toDateString() | |
385 | var nr_commits = parseInt(y); |
|
385 | var nr_commits = parseInt(y); | |
386 |
|
386 | |||
387 | var cur_data = dataset[item.series.label].data[item.dataIndex]; |
|
387 | var cur_data = dataset[item.series.label].data[item.dataIndex]; | |
388 | var added = cur_data.added; |
|
388 | var added = cur_data.added; | |
389 | var changed = cur_data.changed; |
|
389 | var changed = cur_data.changed; | |
390 | var removed = cur_data.removed; |
|
390 | var removed = cur_data.removed; | |
391 |
|
391 | |||
392 | var nr_commits_suffix = " ${_('commits')} "; |
|
392 | var nr_commits_suffix = " ${_('commits')} "; | |
393 | var added_suffix = " ${_('files added')} "; |
|
393 | var added_suffix = " ${_('files added')} "; | |
394 | var changed_suffix = " ${_('files changed')} "; |
|
394 | var changed_suffix = " ${_('files changed')} "; | |
395 | var removed_suffix = " ${_('files removed')} "; |
|
395 | var removed_suffix = " ${_('files removed')} "; | |
396 |
|
396 | |||
397 | if(nr_commits == 1){nr_commits_suffix = " ${_('commit')} ";} |
|
397 | if(nr_commits == 1){nr_commits_suffix = " ${_('commit')} ";} | |
398 | if(added==1){added_suffix=" ${_('file added')} ";} |
|
398 | if(added==1){added_suffix=" ${_('file added')} ";} | |
399 | if(changed==1){changed_suffix=" ${_('file changed')} ";} |
|
399 | if(changed==1){changed_suffix=" ${_('file changed')} ";} | |
400 | if(removed==1){removed_suffix=" ${_('file removed')} ";} |
|
400 | if(removed==1){removed_suffix=" ${_('file removed')} ";} | |
401 |
|
401 | |||
402 | showTooltip(item.pageX, item.pageY, item.series.label + " on " + fd |
|
402 | showTooltip(item.pageX, item.pageY, item.series.label + " on " + fd | |
403 | +'<br/>'+ |
|
403 | +'<br/>'+ | |
404 | nr_commits + nr_commits_suffix+'<br/>'+ |
|
404 | nr_commits + nr_commits_suffix+'<br/>'+ | |
405 | added + added_suffix +'<br/>'+ |
|
405 | added + added_suffix +'<br/>'+ | |
406 | changed + changed_suffix + '<br/>'+ |
|
406 | changed + changed_suffix + '<br/>'+ | |
407 | removed + removed_suffix + '<br/>'); |
|
407 | removed + removed_suffix + '<br/>'); | |
408 | } |
|
408 | } | |
409 | } |
|
409 | } | |
410 | else { |
|
410 | else { | |
411 | var tooltip = YUD.get("tooltip"); |
|
411 | var tooltip = YUD.get("tooltip"); | |
412 |
|
412 | |||
413 | if(tooltip) { |
|
413 | if(tooltip) { | |
414 | tooltip.parentNode.removeChild(tooltip); |
|
414 | tooltip.parentNode.removeChild(tooltip); | |
415 | } |
|
415 | } | |
416 | previousPoint = null; |
|
416 | previousPoint = null; | |
417 | } |
|
417 | } | |
418 | } |
|
418 | } | |
419 |
|
419 | |||
420 | /** |
|
420 | /** | |
421 | * MAIN EXECUTION |
|
421 | * MAIN EXECUTION | |
422 | */ |
|
422 | */ | |
423 |
|
423 | |||
424 | var data = getDataAccordingToRanges(initial_ranges); |
|
424 | var data = getDataAccordingToRanges(initial_ranges); | |
425 | generateCheckboxes(data); |
|
425 | generateCheckboxes(data); | |
426 |
|
426 | |||
427 | //main plot |
|
427 | //main plot | |
428 | var plot = YAHOO.widget.Flot(plotContainer,data,plot_options); |
|
428 | var plot = YAHOO.widget.Flot(plotContainer,data,plot_options); | |
429 |
|
429 | |||
430 | //overview |
|
430 | //overview | |
431 | var overview = YAHOO.widget.Flot(overviewContainer, |
|
431 | var overview = YAHOO.widget.Flot(overviewContainer, | |
432 | overview_dataset, overview_options); |
|
432 | overview_dataset, overview_options); | |
433 |
|
433 | |||
434 | //show initial selection on overview |
|
434 | //show initial selection on overview | |
435 | overview.setSelection(initial_ranges); |
|
435 | overview.setSelection(initial_ranges); | |
436 |
|
436 | |||
437 | plot.subscribe("plotselected", plotselected); |
|
437 | plot.subscribe("plotselected", plotselected); | |
438 | plot.subscribe("plothover", plothover) |
|
438 | plot.subscribe("plothover", plothover) | |
439 |
|
439 | |||
440 | overview.subscribe("plotselected", function (ranges) { |
|
440 | overview.subscribe("plotselected", function (ranges) { | |
441 | plot.setSelection(ranges); |
|
441 | plot.setSelection(ranges); | |
442 | }); |
|
442 | }); | |
443 |
|
443 | |||
444 | // user choices on overview |
|
444 | // user choices on overview | |
445 | YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, initial_ranges]); |
|
445 | YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, initial_ranges]); | |
446 | } |
|
446 | } | |
447 | SummaryPlot(${c.ts_min},${c.ts_max},${c.commit_data|n},${c.overview_data|n}); |
|
447 | SummaryPlot(${c.ts_min},${c.ts_max},${c.commit_data|n},${c.overview_data|n}); | |
448 | </script> |
|
448 | </script> | |
449 |
|
449 | |||
450 | </%def> |
|
450 | </%def> |
@@ -1,399 +1,399 | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 |
<% |
|
3 | <%block name="title"> | |
4 | ${_('%s Summary') % c.repo_name} |
|
4 | ${_('%s Summary') % c.repo_name} | |
5 | %if c.site_name: |
|
5 | %if c.site_name: | |
6 | · ${c.site_name} |
|
6 | · ${c.site_name} | |
7 | %endif |
|
7 | %endif | |
8 | </%def> |
|
8 | </%block> | |
9 |
|
9 | |||
10 | <%def name="breadcrumbs_links()"> |
|
10 | <%def name="breadcrumbs_links()"> | |
11 | ${_('Summary')} |
|
11 | ${_('Summary')} | |
12 |
|
12 | |||
13 | ## locking icon |
|
13 | ## locking icon | |
14 | %if c.db_repo.enable_locking: |
|
14 | %if c.db_repo.enable_locking: | |
15 | %if c.db_repo.locked[0]: |
|
15 | %if c.db_repo.locked[0]: | |
16 | <span class="locking_locked tooltip icon-block" title="${_('Repository locked by %s') % h.person_by_id(c.db_repo.locked[0])}"></span> |
|
16 | <span class="locking_locked tooltip icon-block" title="${_('Repository locked by %s') % h.person_by_id(c.db_repo.locked[0])}"></span> | |
17 | %else: |
|
17 | %else: | |
18 | <span class="locking_unlocked tooltip icon-ok" title="${_('Repository unlocked')}"></span> |
|
18 | <span class="locking_unlocked tooltip icon-ok" title="${_('Repository unlocked')}"></span> | |
19 | %endif |
|
19 | %endif | |
20 | %endif |
|
20 | %endif | |
21 |
|
21 | |||
22 | ##FORK |
|
22 | ##FORK | |
23 | %if c.db_repo.fork: |
|
23 | %if c.db_repo.fork: | |
24 | <span> |
|
24 | <span> | |
25 | - <i class="icon-fork"></i> ${_('Fork of')} "<a href="${h.url('summary_home',repo_name=c.db_repo.fork.repo_name)}">${c.db_repo.fork.repo_name}</a>" |
|
25 | - <i class="icon-fork"></i> ${_('Fork of')} "<a href="${h.url('summary_home',repo_name=c.db_repo.fork.repo_name)}">${c.db_repo.fork.repo_name}</a>" | |
26 | </span> |
|
26 | </span> | |
27 | %endif |
|
27 | %endif | |
28 |
|
28 | |||
29 | ##REMOTE |
|
29 | ##REMOTE | |
30 | %if c.db_repo.clone_uri: |
|
30 | %if c.db_repo.clone_uri: | |
31 | <span> |
|
31 | <span> | |
32 | - <i class="icon-fork"></i> ${_('Clone from')} "<a href="${h.url(str(h.hide_credentials(c.db_repo.clone_uri)))}">${h.hide_credentials(c.db_repo.clone_uri)}</a>" |
|
32 | - <i class="icon-fork"></i> ${_('Clone from')} "<a href="${h.url(str(h.hide_credentials(c.db_repo.clone_uri)))}">${h.hide_credentials(c.db_repo.clone_uri)}</a>" | |
33 | <span> |
|
33 | <span> | |
34 | %endif |
|
34 | %endif | |
35 | </%def> |
|
35 | </%def> | |
36 |
|
36 | |||
37 | <%block name="header_menu"> |
|
37 | <%block name="header_menu"> | |
38 | ${self.menu('repositories')} |
|
38 | ${self.menu('repositories')} | |
39 | </%block> |
|
39 | </%block> | |
40 |
|
40 | |||
41 | <%block name="head_extra"> |
|
41 | <%block name="head_extra"> | |
42 | <link href="${h.url('atom_feed_home',repo_name=c.db_repo.repo_name,api_key=c.authuser.api_key)}" rel="alternate" title="${_('%s ATOM feed') % c.repo_name}" type="application/atom+xml" /> |
|
42 | <link href="${h.url('atom_feed_home',repo_name=c.db_repo.repo_name,api_key=c.authuser.api_key)}" rel="alternate" title="${_('%s ATOM feed') % c.repo_name}" type="application/atom+xml" /> | |
43 | <link href="${h.url('rss_feed_home',repo_name=c.db_repo.repo_name,api_key=c.authuser.api_key)}" rel="alternate" title="${_('%s RSS feed') % c.repo_name}" type="application/rss+xml" /> |
|
43 | <link href="${h.url('rss_feed_home',repo_name=c.db_repo.repo_name,api_key=c.authuser.api_key)}" rel="alternate" title="${_('%s RSS feed') % c.repo_name}" type="application/rss+xml" /> | |
44 |
|
44 | |||
45 | <script> |
|
45 | <script> | |
46 | redirect_hash_branch = function(){ |
|
46 | redirect_hash_branch = function(){ | |
47 | var branch = window.location.hash.replace(/^#(.*)/, '$1'); |
|
47 | var branch = window.location.hash.replace(/^#(.*)/, '$1'); | |
48 | if (branch){ |
|
48 | if (branch){ | |
49 | window.location = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}" |
|
49 | window.location = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}" | |
50 | .replace('__BRANCH__',branch); |
|
50 | .replace('__BRANCH__',branch); | |
51 | } |
|
51 | } | |
52 | } |
|
52 | } | |
53 | redirect_hash_branch(); |
|
53 | redirect_hash_branch(); | |
54 | window.onhashchange = function() { |
|
54 | window.onhashchange = function() { | |
55 | redirect_hash_branch(); |
|
55 | redirect_hash_branch(); | |
56 | }; |
|
56 | }; | |
57 | </script> |
|
57 | </script> | |
58 | </%block> |
|
58 | </%block> | |
59 |
|
59 | |||
60 | <%def name="main()"> |
|
60 | <%def name="main()"> | |
61 | ${self.repo_context_bar('summary')} |
|
61 | ${self.repo_context_bar('summary')} | |
62 | <% |
|
62 | <% | |
63 | summary = lambda n:{False:'summary-short'}.get(n) |
|
63 | summary = lambda n:{False:'summary-short'}.get(n) | |
64 | %> |
|
64 | %> | |
65 | <div class="box"> |
|
65 | <div class="box"> | |
66 | <!-- box / title --> |
|
66 | <!-- box / title --> | |
67 | <div class="title"> |
|
67 | <div class="title"> | |
68 | ${self.breadcrumbs()} |
|
68 | ${self.breadcrumbs()} | |
69 | </div> |
|
69 | </div> | |
70 | <!-- end box / title --> |
|
70 | <!-- end box / title --> | |
71 | <div class="form"> |
|
71 | <div class="form"> | |
72 | <div id="summary" class="fields"> |
|
72 | <div id="summary" class="fields"> | |
73 | <div class="field"> |
|
73 | <div class="field"> | |
74 | <div class="label-summary"> |
|
74 | <div class="label-summary"> | |
75 | <label>${_('Clone url')}:</label> |
|
75 | <label>${_('Clone url')}:</label> | |
76 | </div> |
|
76 | </div> | |
77 | <div class="input ${summary(c.show_stats)}"> |
|
77 | <div class="input ${summary(c.show_stats)}"> | |
78 | <input style="width:80%" type="text" id="clone_url" readonly="readonly" value="${c.clone_repo_url}"/> |
|
78 | <input style="width:80%" type="text" id="clone_url" readonly="readonly" value="${c.clone_repo_url}"/> | |
79 | <input style="display:none;width:80%" type="text" id="clone_url_id" readonly="readonly" value="${c.clone_repo_url_id}"/> |
|
79 | <input style="display:none;width:80%" type="text" id="clone_url_id" readonly="readonly" value="${c.clone_repo_url_id}"/> | |
80 | <div style="display:none" id="clone_by_name" class="btn btn-small">${_('Show by Name')}</div> |
|
80 | <div style="display:none" id="clone_by_name" class="btn btn-small">${_('Show by Name')}</div> | |
81 | <div id="clone_by_id" class="btn btn-small">${_('Show by ID')}</div> |
|
81 | <div id="clone_by_id" class="btn btn-small">${_('Show by ID')}</div> | |
82 | </div> |
|
82 | </div> | |
83 | </div> |
|
83 | </div> | |
84 |
|
84 | |||
85 | <div class="field"> |
|
85 | <div class="field"> | |
86 | <div class="label-summary"> |
|
86 | <div class="label-summary"> | |
87 | <label>${_('Description')}:</label> |
|
87 | <label>${_('Description')}:</label> | |
88 | </div> |
|
88 | </div> | |
89 | %if c.visual.stylify_metatags: |
|
89 | %if c.visual.stylify_metatags: | |
90 | <div class="input ${summary(c.show_stats)} desc">${h.urlify_text(h.desc_stylize(c.db_repo.description))}</div> |
|
90 | <div class="input ${summary(c.show_stats)} desc">${h.urlify_text(h.desc_stylize(c.db_repo.description))}</div> | |
91 | %else: |
|
91 | %else: | |
92 | <div class="input ${summary(c.show_stats)} desc">${h.urlify_text(c.db_repo.description)}</div> |
|
92 | <div class="input ${summary(c.show_stats)} desc">${h.urlify_text(c.db_repo.description)}</div> | |
93 | %endif |
|
93 | %endif | |
94 | </div> |
|
94 | </div> | |
95 |
|
95 | |||
96 | <div class="field"> |
|
96 | <div class="field"> | |
97 | <div class="label-summary"> |
|
97 | <div class="label-summary"> | |
98 | <label>${_('Trending files')}:</label> |
|
98 | <label>${_('Trending files')}:</label> | |
99 | </div> |
|
99 | </div> | |
100 | <div class="input ${summary(c.show_stats)}"> |
|
100 | <div class="input ${summary(c.show_stats)}"> | |
101 | %if c.show_stats: |
|
101 | %if c.show_stats: | |
102 | <div id="lang_stats"></div> |
|
102 | <div id="lang_stats"></div> | |
103 | %else: |
|
103 | %else: | |
104 | ${_('Statistics are disabled for this repository')} |
|
104 | ${_('Statistics are disabled for this repository')} | |
105 | %if h.HasPermissionAll('hg.admin')('enable stats on from summary'): |
|
105 | %if h.HasPermissionAll('hg.admin')('enable stats on from summary'): | |
106 | ${h.link_to(_('Enable'),h.url('edit_repo',repo_name=c.repo_name, anchor='repo_enable_statistics'),class_="btn btn-mini")} |
|
106 | ${h.link_to(_('Enable'),h.url('edit_repo',repo_name=c.repo_name, anchor='repo_enable_statistics'),class_="btn btn-mini")} | |
107 | %endif |
|
107 | %endif | |
108 | %endif |
|
108 | %endif | |
109 | </div> |
|
109 | </div> | |
110 | </div> |
|
110 | </div> | |
111 |
|
111 | |||
112 | <div class="field"> |
|
112 | <div class="field"> | |
113 | <div class="label-summary"> |
|
113 | <div class="label-summary"> | |
114 | <label>${_('Download')}:</label> |
|
114 | <label>${_('Download')}:</label> | |
115 | </div> |
|
115 | </div> | |
116 | <div class="input ${summary(c.show_stats)}"> |
|
116 | <div class="input ${summary(c.show_stats)}"> | |
117 | %if len(c.db_repo_scm_instance.revisions) == 0: |
|
117 | %if len(c.db_repo_scm_instance.revisions) == 0: | |
118 | ${_('There are no downloads yet')} |
|
118 | ${_('There are no downloads yet')} | |
119 | %elif not c.enable_downloads: |
|
119 | %elif not c.enable_downloads: | |
120 | ${_('Downloads are disabled for this repository')} |
|
120 | ${_('Downloads are disabled for this repository')} | |
121 | %if h.HasPermissionAll('hg.admin')('enable downloads on from summary'): |
|
121 | %if h.HasPermissionAll('hg.admin')('enable downloads on from summary'): | |
122 | ${h.link_to(_('Enable'),h.url('edit_repo',repo_name=c.repo_name, anchor='repo_enable_downloads'),class_="btn btn-mini")} |
|
122 | ${h.link_to(_('Enable'),h.url('edit_repo',repo_name=c.repo_name, anchor='repo_enable_downloads'),class_="btn btn-mini")} | |
123 | %endif |
|
123 | %endif | |
124 | %else: |
|
124 | %else: | |
125 | <span id="${'zip_link'}"> |
|
125 | <span id="${'zip_link'}"> | |
126 | <a class="btn btn-small" href="${h.url('files_archive_home',repo_name=c.db_repo.repo_name,fname='tip.zip')}"><i class="icon-file-zip"></i> ${_('Download as zip')}</a> |
|
126 | <a class="btn btn-small" href="${h.url('files_archive_home',repo_name=c.db_repo.repo_name,fname='tip.zip')}"><i class="icon-file-zip"></i> ${_('Download as zip')}</a> | |
127 | </span> |
|
127 | </span> | |
128 | ${h.hidden('download_options')} |
|
128 | ${h.hidden('download_options')} | |
129 | <span style="vertical-align: bottom"> |
|
129 | <span style="vertical-align: bottom"> | |
130 | <input id="archive_subrepos" type="checkbox" name="subrepos" /> |
|
130 | <input id="archive_subrepos" type="checkbox" name="subrepos" /> | |
131 | <label for="archive_subrepos" class="tooltip" title="${h.tooltip(_('Check this to download archive with subrepos'))}" >${_('with subrepos')}</label> |
|
131 | <label for="archive_subrepos" class="tooltip" title="${h.tooltip(_('Check this to download archive with subrepos'))}" >${_('with subrepos')}</label> | |
132 | </span> |
|
132 | </span> | |
133 | %endif |
|
133 | %endif | |
134 | </div> |
|
134 | </div> | |
135 | </div> |
|
135 | </div> | |
136 | </div> |
|
136 | </div> | |
137 | <div id="summary-menu-stats"> |
|
137 | <div id="summary-menu-stats"> | |
138 | <ul> |
|
138 | <ul> | |
139 | <li> |
|
139 | <li> | |
140 | <a title="${_('Owner')} ${c.db_repo.user.email}"> |
|
140 | <a title="${_('Owner')} ${c.db_repo.user.email}"> | |
141 | <i class="icon-user"></i> ${c.db_repo.user.username} |
|
141 | <i class="icon-user"></i> ${c.db_repo.user.username} | |
142 | <div class="gravatar" style="float: right; margin: 0px 0px 0px 0px" title="${c.db_repo.user.name} ${c.db_repo.user.lastname}"> |
|
142 | <div class="gravatar" style="float: right; margin: 0px 0px 0px 0px" title="${c.db_repo.user.name} ${c.db_repo.user.lastname}"> | |
143 | ${h.gravatar(c.db_repo.user.email, size=18)} |
|
143 | ${h.gravatar(c.db_repo.user.email, size=18)} | |
144 | </div> |
|
144 | </div> | |
145 | </a> |
|
145 | </a> | |
146 | </li> |
|
146 | </li> | |
147 | <li> |
|
147 | <li> | |
148 | <a title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}"> |
|
148 | <a title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}"> | |
149 | <i class="icon-heart"></i> ${_('Followers')} |
|
149 | <i class="icon-heart"></i> ${_('Followers')} | |
150 | <span class="stats-bullet" id="current_followers_count">${c.repository_followers}</span> |
|
150 | <span class="stats-bullet" id="current_followers_count">${c.repository_followers}</span> | |
151 | </a> |
|
151 | </a> | |
152 | </li> |
|
152 | </li> | |
153 | <li> |
|
153 | <li> | |
154 | <a title="${_('Forks')}" href="${h.url('repo_forks_home',repo_name=c.repo_name)}"> |
|
154 | <a title="${_('Forks')}" href="${h.url('repo_forks_home',repo_name=c.repo_name)}"> | |
155 | <i class="icon-fork"></i> ${_('Forks')} |
|
155 | <i class="icon-fork"></i> ${_('Forks')} | |
156 | <span class="stats-bullet">${c.repository_forks}</span> |
|
156 | <span class="stats-bullet">${c.repository_forks}</span> | |
157 | </a> |
|
157 | </a> | |
158 | </li> |
|
158 | </li> | |
159 |
|
159 | |||
160 | %if c.authuser.username != 'default': |
|
160 | %if c.authuser.username != 'default': | |
161 | <li class="repo_size"> |
|
161 | <li class="repo_size"> | |
162 | <a href="#" onclick="javascript:showRepoSize('repo_size_2','${c.db_repo.repo_name}','${str(h.get_token())}')"><i class="icon-ruler"></i> ${_('Repository Size')}</a> |
|
162 | <a href="#" onclick="javascript:showRepoSize('repo_size_2','${c.db_repo.repo_name}','${str(h.get_token())}')"><i class="icon-ruler"></i> ${_('Repository Size')}</a> | |
163 | <span class="stats-bullet" id="repo_size_2"></span> |
|
163 | <span class="stats-bullet" id="repo_size_2"></span> | |
164 | </li> |
|
164 | </li> | |
165 | %endif |
|
165 | %endif | |
166 |
|
166 | |||
167 | <li> |
|
167 | <li> | |
168 | %if c.authuser.username != 'default': |
|
168 | %if c.authuser.username != 'default': | |
169 | <a href="${h.url('atom_feed_home',repo_name=c.db_repo.repo_name,api_key=c.authuser.api_key)}"><i class="icon-rss-squared"></i> ${_('Feed')}</a> |
|
169 | <a href="${h.url('atom_feed_home',repo_name=c.db_repo.repo_name,api_key=c.authuser.api_key)}"><i class="icon-rss-squared"></i> ${_('Feed')}</a> | |
170 | %else: |
|
170 | %else: | |
171 | <a href="${h.url('atom_feed_home',repo_name=c.db_repo.repo_name)}"><i class="icon-rss-squared"></i> ${_('Feed')}</a> |
|
171 | <a href="${h.url('atom_feed_home',repo_name=c.db_repo.repo_name)}"><i class="icon-rss-squared"></i> ${_('Feed')}</a> | |
172 | %endif |
|
172 | %endif | |
173 | </li> |
|
173 | </li> | |
174 |
|
174 | |||
175 | %if c.show_stats: |
|
175 | %if c.show_stats: | |
176 | <li> |
|
176 | <li> | |
177 | <a title="${_('Statistics')}" href="${h.url('repo_stats_home',repo_name=c.repo_name)}"> |
|
177 | <a title="${_('Statistics')}" href="${h.url('repo_stats_home',repo_name=c.repo_name)}"> | |
178 | <i class="icon-graph"></i> ${_('Statistics')} |
|
178 | <i class="icon-graph"></i> ${_('Statistics')} | |
179 | </a> |
|
179 | </a> | |
180 | </li> |
|
180 | </li> | |
181 | %endif |
|
181 | %endif | |
182 | </ul> |
|
182 | </ul> | |
183 | </div> |
|
183 | </div> | |
184 | </div> |
|
184 | </div> | |
185 | </div> |
|
185 | </div> | |
186 |
|
186 | |||
187 |
|
187 | |||
188 | <div class="box"> |
|
188 | <div class="box"> | |
189 | <div class="title"> |
|
189 | <div class="title"> | |
190 | <div class="breadcrumbs"> |
|
190 | <div class="breadcrumbs"> | |
191 | %if c.repo_changesets: |
|
191 | %if c.repo_changesets: | |
192 | ${h.link_to(_('Latest Changes'),h.url('changelog_home',repo_name=c.repo_name))} |
|
192 | ${h.link_to(_('Latest Changes'),h.url('changelog_home',repo_name=c.repo_name))} | |
193 | %else: |
|
193 | %else: | |
194 | ${_('Quick Start')} |
|
194 | ${_('Quick Start')} | |
195 | %endif |
|
195 | %endif | |
196 | </div> |
|
196 | </div> | |
197 | </div> |
|
197 | </div> | |
198 | <div class="table"> |
|
198 | <div class="table"> | |
199 | <div id="shortlog_data"> |
|
199 | <div id="shortlog_data"> | |
200 | <%include file='../changelog/changelog_summary_data.html'/> |
|
200 | <%include file='../changelog/changelog_summary_data.html'/> | |
201 | </div> |
|
201 | </div> | |
202 | </div> |
|
202 | </div> | |
203 | </div> |
|
203 | </div> | |
204 |
|
204 | |||
205 | %if c.readme_data: |
|
205 | %if c.readme_data: | |
206 | <div id="readme" class="anchor"> |
|
206 | <div id="readme" class="anchor"> | |
207 | <div class="box" style="background-color: #FAFAFA"> |
|
207 | <div class="box" style="background-color: #FAFAFA"> | |
208 | <div class="title" title="${_('Readme file from revision %s:%s') % (c.db_repo.landing_rev[0], c.db_repo.landing_rev[1])}"> |
|
208 | <div class="title" title="${_('Readme file from revision %s:%s') % (c.db_repo.landing_rev[0], c.db_repo.landing_rev[1])}"> | |
209 | <div class="breadcrumbs"> |
|
209 | <div class="breadcrumbs"> | |
210 | <a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a> |
|
210 | <a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a> | |
211 | </div> |
|
211 | </div> | |
212 | </div> |
|
212 | </div> | |
213 | <div class="readme"> |
|
213 | <div class="readme"> | |
214 | <div class="readme_box"> |
|
214 | <div class="readme_box"> | |
215 | ${c.readme_data|n} |
|
215 | ${c.readme_data|n} | |
216 | </div> |
|
216 | </div> | |
217 | </div> |
|
217 | </div> | |
218 | </div> |
|
218 | </div> | |
219 | </div> |
|
219 | </div> | |
220 | %endif |
|
220 | %endif | |
221 |
|
221 | |||
222 | <script type="text/javascript"> |
|
222 | <script type="text/javascript"> | |
223 | $(document).ready(function(){ |
|
223 | $(document).ready(function(){ | |
224 | var $clone_url = $('#clone_url'); |
|
224 | var $clone_url = $('#clone_url'); | |
225 | var $clone_url_id = $('#clone_url_id'); |
|
225 | var $clone_url_id = $('#clone_url_id'); | |
226 | var $clone_by_name = $('#clone_by_name'); |
|
226 | var $clone_by_name = $('#clone_by_name'); | |
227 | var $clone_by_id = $('#clone_by_id'); |
|
227 | var $clone_by_id = $('#clone_by_id'); | |
228 | $clone_url.click(function(e){ |
|
228 | $clone_url.click(function(e){ | |
229 | if($clone_url.hasClass('selected')){ |
|
229 | if($clone_url.hasClass('selected')){ | |
230 | return ; |
|
230 | return ; | |
231 | }else{ |
|
231 | }else{ | |
232 | $clone_url.addClass('selected'); |
|
232 | $clone_url.addClass('selected'); | |
233 | $clone_url.select(); |
|
233 | $clone_url.select(); | |
234 | } |
|
234 | } | |
235 | }); |
|
235 | }); | |
236 |
|
236 | |||
237 | $clone_by_name.click(function(e){ |
|
237 | $clone_by_name.click(function(e){ | |
238 | // show url by name and hide name button |
|
238 | // show url by name and hide name button | |
239 | $clone_url.show(); |
|
239 | $clone_url.show(); | |
240 | $clone_by_name.hide(); |
|
240 | $clone_by_name.hide(); | |
241 |
|
241 | |||
242 | // hide url by id and show name button |
|
242 | // hide url by id and show name button | |
243 | $clone_by_id.show(); |
|
243 | $clone_by_id.show(); | |
244 | $clone_url_id.hide(); |
|
244 | $clone_url_id.hide(); | |
245 | }); |
|
245 | }); | |
246 |
|
246 | |||
247 | $clone_by_id.click(function(e){ |
|
247 | $clone_by_id.click(function(e){ | |
248 | // show url by id and hide id button |
|
248 | // show url by id and hide id button | |
249 | $clone_by_id.hide(); |
|
249 | $clone_by_id.hide(); | |
250 | $clone_url_id.show(); |
|
250 | $clone_url_id.show(); | |
251 |
|
251 | |||
252 | // hide url by name and show id button |
|
252 | // hide url by name and show id button | |
253 | $clone_by_name.show(); |
|
253 | $clone_by_name.show(); | |
254 | $clone_url.hide(); |
|
254 | $clone_url.hide(); | |
255 | }); |
|
255 | }); | |
256 |
|
256 | |||
257 | var cache = {} |
|
257 | var cache = {} | |
258 | $("#download_options").select2({ |
|
258 | $("#download_options").select2({ | |
259 | placeholder: _TM['Select changeset'], |
|
259 | placeholder: _TM['Select changeset'], | |
260 | dropdownAutoWidth: true, |
|
260 | dropdownAutoWidth: true, | |
261 | query: function(query){ |
|
261 | query: function(query){ | |
262 | var key = 'cache'; |
|
262 | var key = 'cache'; | |
263 | var cached = cache[key] ; |
|
263 | var cached = cache[key] ; | |
264 | if(cached) { |
|
264 | if(cached) { | |
265 | var data = {results: []}; |
|
265 | var data = {results: []}; | |
266 | //filter results |
|
266 | //filter results | |
267 | $.each(cached.results, function(){ |
|
267 | $.each(cached.results, function(){ | |
268 | var section = this.text; |
|
268 | var section = this.text; | |
269 | var children = []; |
|
269 | var children = []; | |
270 | $.each(this.children, function(){ |
|
270 | $.each(this.children, function(){ | |
271 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ |
|
271 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ | |
272 | children.push({'id': this.id, 'text': this.text}) |
|
272 | children.push({'id': this.id, 'text': this.text}) | |
273 | } |
|
273 | } | |
274 | }) |
|
274 | }) | |
275 | data.results.push({'text': section, 'children': children}) |
|
275 | data.results.push({'text': section, 'children': children}) | |
276 | }); |
|
276 | }); | |
277 | query.callback(data); |
|
277 | query.callback(data); | |
278 | }else{ |
|
278 | }else{ | |
279 | $.ajax({ |
|
279 | $.ajax({ | |
280 | url: pyroutes.url('repo_refs_data', {'repo_name': '${c.repo_name}'}), |
|
280 | url: pyroutes.url('repo_refs_data', {'repo_name': '${c.repo_name}'}), | |
281 | data: {}, |
|
281 | data: {}, | |
282 | dataType: 'json', |
|
282 | dataType: 'json', | |
283 | type: 'GET', |
|
283 | type: 'GET', | |
284 | success: function(data) { |
|
284 | success: function(data) { | |
285 | cache[key] = data; |
|
285 | cache[key] = data; | |
286 | query.callback({results: data.results}); |
|
286 | query.callback({results: data.results}); | |
287 | } |
|
287 | } | |
288 | }) |
|
288 | }) | |
289 | } |
|
289 | } | |
290 | } |
|
290 | } | |
291 | }); |
|
291 | }); | |
292 | // on change of download options |
|
292 | // on change of download options | |
293 | $('#download_options').change(function(e){ |
|
293 | $('#download_options').change(function(e){ | |
294 | var new_cs = e.added |
|
294 | var new_cs = e.added | |
295 |
|
295 | |||
296 | for(k in tmpl_links){ |
|
296 | for(k in tmpl_links){ | |
297 | var s = $('#'+k+'_link'); |
|
297 | var s = $('#'+k+'_link'); | |
298 | if(s){ |
|
298 | if(s){ | |
299 | var title_tmpl = "${_('Download %s as %s') % ('__CS_NAME__','__CS_EXT__')}"; |
|
299 | var title_tmpl = "${_('Download %s as %s') % ('__CS_NAME__','__CS_EXT__')}"; | |
300 | title_tmpl= title_tmpl.replace('__CS_NAME__',new_cs.text); |
|
300 | title_tmpl= title_tmpl.replace('__CS_NAME__',new_cs.text); | |
301 | title_tmpl = title_tmpl.replace('__CS_EXT__',k); |
|
301 | title_tmpl = title_tmpl.replace('__CS_EXT__',k); | |
302 | title_tmpl = '<i class="icon-file-zip"></i> '+ title_tmpl; |
|
302 | title_tmpl = '<i class="icon-file-zip"></i> '+ title_tmpl; | |
303 | var url = tmpl_links[k].replace('__CS__',new_cs.id); |
|
303 | var url = tmpl_links[k].replace('__CS__',new_cs.id); | |
304 | var subrepos = $('#archive_subrepos').is(':checked'); |
|
304 | var subrepos = $('#archive_subrepos').is(':checked'); | |
305 | url = url.replace('__SUB__',subrepos); |
|
305 | url = url.replace('__SUB__',subrepos); | |
306 | url = url.replace('__NAME__',title_tmpl); |
|
306 | url = url.replace('__NAME__',title_tmpl); | |
307 |
|
307 | |||
308 | s.html(url) |
|
308 | s.html(url) | |
309 | } |
|
309 | } | |
310 | } |
|
310 | } | |
311 | }); |
|
311 | }); | |
312 |
|
312 | |||
313 | var tmpl_links = {}; |
|
313 | var tmpl_links = {}; | |
314 | %for cnt,archive in enumerate(c.db_repo_scm_instance._get_archives()): |
|
314 | %for cnt,archive in enumerate(c.db_repo_scm_instance._get_archives()): | |
315 | tmpl_links["${archive['type']}"] = '${h.link_to('__NAME__', h.url('files_archive_home',repo_name=c.db_repo.repo_name, fname='__CS__'+archive['extension'],subrepos='__SUB__'),class_='btn btn-small')}'; |
|
315 | tmpl_links["${archive['type']}"] = '${h.link_to('__NAME__', h.url('files_archive_home',repo_name=c.db_repo.repo_name, fname='__CS__'+archive['extension'],subrepos='__SUB__'),class_='btn btn-small')}'; | |
316 | %endfor |
|
316 | %endfor | |
317 | }) |
|
317 | }) | |
318 | </script> |
|
318 | </script> | |
319 |
|
319 | |||
320 | %if c.show_stats: |
|
320 | %if c.show_stats: | |
321 | <script type="text/javascript"> |
|
321 | <script type="text/javascript"> | |
322 | $(document).ready(function(){ |
|
322 | $(document).ready(function(){ | |
323 | var data = ${c.trending_languages|n}; |
|
323 | var data = ${c.trending_languages|n}; | |
324 | var total = 0; |
|
324 | var total = 0; | |
325 | var no_data = true; |
|
325 | var no_data = true; | |
326 | var tbl = document.createElement('table'); |
|
326 | var tbl = document.createElement('table'); | |
327 | tbl.setAttribute('class','trending_language_tbl'); |
|
327 | tbl.setAttribute('class','trending_language_tbl'); | |
328 | var cnt = 0; |
|
328 | var cnt = 0; | |
329 | for (var i=0;i<data.length;i++){ |
|
329 | for (var i=0;i<data.length;i++){ | |
330 | total+= data[i][1].count; |
|
330 | total+= data[i][1].count; | |
331 | } |
|
331 | } | |
332 | for (var i=0;i<data.length;i++){ |
|
332 | for (var i=0;i<data.length;i++){ | |
333 | cnt += 1; |
|
333 | cnt += 1; | |
334 | no_data = false; |
|
334 | no_data = false; | |
335 |
|
335 | |||
336 | var hide = cnt>2; |
|
336 | var hide = cnt>2; | |
337 | var tr = document.createElement('tr'); |
|
337 | var tr = document.createElement('tr'); | |
338 | if (hide){ |
|
338 | if (hide){ | |
339 | tr.setAttribute('style','display:none'); |
|
339 | tr.setAttribute('style','display:none'); | |
340 | tr.setAttribute('class','stats_hidden'); |
|
340 | tr.setAttribute('class','stats_hidden'); | |
341 | } |
|
341 | } | |
342 | var k = data[i][0]; |
|
342 | var k = data[i][0]; | |
343 | var obj = data[i][1]; |
|
343 | var obj = data[i][1]; | |
344 | var percentage = Math.round((obj.count/total*100),2); |
|
344 | var percentage = Math.round((obj.count/total*100),2); | |
345 |
|
345 | |||
346 | var td1 = document.createElement('td'); |
|
346 | var td1 = document.createElement('td'); | |
347 | td1.width = 150; |
|
347 | td1.width = 150; | |
348 | var trending_language_label = document.createElement('div'); |
|
348 | var trending_language_label = document.createElement('div'); | |
349 | trending_language_label.innerHTML = obj.desc+" ("+k+")"; |
|
349 | trending_language_label.innerHTML = obj.desc+" ("+k+")"; | |
350 | td1.appendChild(trending_language_label); |
|
350 | td1.appendChild(trending_language_label); | |
351 |
|
351 | |||
352 | var td2 = document.createElement('td'); |
|
352 | var td2 = document.createElement('td'); | |
353 | td2.setAttribute('style','padding-right:14px !important'); |
|
353 | td2.setAttribute('style','padding-right:14px !important'); | |
354 | var trending_language = document.createElement('div'); |
|
354 | var trending_language = document.createElement('div'); | |
355 | var nr_files = obj.count+" ${_('files')}"; |
|
355 | var nr_files = obj.count+" ${_('files')}"; | |
356 |
|
356 | |||
357 | trending_language.title = k+" "+nr_files; |
|
357 | trending_language.title = k+" "+nr_files; | |
358 |
|
358 | |||
359 | if (percentage>22){ |
|
359 | if (percentage>22){ | |
360 | trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"% "+nr_files+ "</b>"; |
|
360 | trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"% "+nr_files+ "</b>"; | |
361 | } |
|
361 | } | |
362 | else{ |
|
362 | else{ | |
363 | trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"%</b>"; |
|
363 | trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"%</b>"; | |
364 | } |
|
364 | } | |
365 |
|
365 | |||
366 | trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner'); |
|
366 | trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner'); | |
367 | trending_language.style.width=percentage+"%"; |
|
367 | trending_language.style.width=percentage+"%"; | |
368 | td2.appendChild(trending_language); |
|
368 | td2.appendChild(trending_language); | |
369 |
|
369 | |||
370 | tr.appendChild(td1); |
|
370 | tr.appendChild(td1); | |
371 | tr.appendChild(td2); |
|
371 | tr.appendChild(td2); | |
372 | tbl.appendChild(tr); |
|
372 | tbl.appendChild(tr); | |
373 | if(cnt == 3){ |
|
373 | if(cnt == 3){ | |
374 | var show_more = document.createElement('tr'); |
|
374 | var show_more = document.createElement('tr'); | |
375 | var td = document.createElement('td'); |
|
375 | var td = document.createElement('td'); | |
376 | lnk = document.createElement('a'); |
|
376 | lnk = document.createElement('a'); | |
377 |
|
377 | |||
378 | lnk.href='#'; |
|
378 | lnk.href='#'; | |
379 | lnk.innerHTML = "${_('Show more')}"; |
|
379 | lnk.innerHTML = "${_('Show more')}"; | |
380 | lnk.id='code_stats_show_more'; |
|
380 | lnk.id='code_stats_show_more'; | |
381 | td.appendChild(lnk); |
|
381 | td.appendChild(lnk); | |
382 |
|
382 | |||
383 | show_more.appendChild(td); |
|
383 | show_more.appendChild(td); | |
384 | show_more.appendChild(document.createElement('td')); |
|
384 | show_more.appendChild(document.createElement('td')); | |
385 | tbl.appendChild(show_more); |
|
385 | tbl.appendChild(show_more); | |
386 | } |
|
386 | } | |
387 |
|
387 | |||
388 | } |
|
388 | } | |
389 |
|
389 | |||
390 | $('#lang_stats').appendChild(tbl); |
|
390 | $('#lang_stats').appendChild(tbl); | |
391 | $('#code_status_show_more').click(function(){ |
|
391 | $('#code_status_show_more').click(function(){ | |
392 | $('.stats_hidden').show(); |
|
392 | $('.stats_hidden').show(); | |
393 | $('#code_status_show_more').hide(); |
|
393 | $('#code_status_show_more').hide(); | |
394 | }); |
|
394 | }); | |
395 | }); |
|
395 | }); | |
396 | </script> |
|
396 | </script> | |
397 | %endif |
|
397 | %endif | |
398 |
|
398 | |||
399 | </%def> |
|
399 | </%def> |
@@ -1,99 +1,99 | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 |
<% |
|
4 | <%block name="title"> | |
5 | ${_('%s Tags') % c.repo_name} |
|
5 | ${_('%s Tags') % c.repo_name} | |
6 | %if c.site_name: |
|
6 | %if c.site_name: | |
7 | · ${c.site_name} |
|
7 | · ${c.site_name} | |
8 | %endif |
|
8 | %endif | |
9 | </%def> |
|
9 | </%block> | |
10 |
|
10 | |||
11 | <%def name="breadcrumbs_links()"> |
|
11 | <%def name="breadcrumbs_links()"> | |
12 | <input class="q_filter_box" id="q_filter_tags" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> |
|
12 | <input class="q_filter_box" id="q_filter_tags" size="15" type="text" name="filter" placeholder="${_('quick filter...')}" value=""/> | |
13 | ${_('Tags')} |
|
13 | ${_('Tags')} | |
14 | </%def> |
|
14 | </%def> | |
15 |
|
15 | |||
16 | <%block name="header_menu"> |
|
16 | <%block name="header_menu"> | |
17 | ${self.menu('repositories')} |
|
17 | ${self.menu('repositories')} | |
18 | </%block> |
|
18 | </%block> | |
19 |
|
19 | |||
20 | <%def name="main()"> |
|
20 | <%def name="main()"> | |
21 | ${self.repo_context_bar('switch-to')} |
|
21 | ${self.repo_context_bar('switch-to')} | |
22 | <div class="box"> |
|
22 | <div class="box"> | |
23 | <!-- box / title --> |
|
23 | <!-- box / title --> | |
24 | <div class="title"> |
|
24 | <div class="title"> | |
25 | ${self.breadcrumbs()} |
|
25 | ${self.breadcrumbs()} | |
26 | </div> |
|
26 | </div> | |
27 | <!-- end box / title --> |
|
27 | <!-- end box / title --> | |
28 | %if c.repo_tags: |
|
28 | %if c.repo_tags: | |
29 | <div class="info_box" id="compare_tags" style="clear: both;padding: 10px 19px;text-align: right;"><a href="#" class="btn btn-small">${_('Compare Tags')}</a></div> |
|
29 | <div class="info_box" id="compare_tags" style="clear: both;padding: 10px 19px;text-align: right;"><a href="#" class="btn btn-small">${_('Compare Tags')}</a></div> | |
30 | %endif |
|
30 | %endif | |
31 | <div class="table"> |
|
31 | <div class="table"> | |
32 | <%include file='tags_data.html'/> |
|
32 | <%include file='tags_data.html'/> | |
33 | </div> |
|
33 | </div> | |
34 | </div> |
|
34 | </div> | |
35 |
|
35 | |||
36 | <script type="text/javascript"> |
|
36 | <script type="text/javascript"> | |
37 | $('#compare_tags').click(function(e){ |
|
37 | $('#compare_tags').click(function(e){ | |
38 | e.preventDefault(); |
|
38 | e.preventDefault(); | |
39 | var org = $('input[name=compare_org]:checked')[0]; |
|
39 | var org = $('input[name=compare_org]:checked')[0]; | |
40 | var other = $('input[name=compare_other]:checked')[0]; |
|
40 | var other = $('input[name=compare_other]:checked')[0]; | |
41 |
|
41 | |||
42 | if(org && other){ |
|
42 | if(org && other){ | |
43 | var compare_url = "${h.url('compare_url',repo_name=c.repo_name,org_ref_type='tag',org_ref_name='__ORG__',other_ref_type='tag',other_ref_name='__OTHER__')}"; |
|
43 | var compare_url = "${h.url('compare_url',repo_name=c.repo_name,org_ref_type='tag',org_ref_name='__ORG__',other_ref_type='tag',other_ref_name='__OTHER__')}"; | |
44 | var u = compare_url.replace('__ORG__',org.value) |
|
44 | var u = compare_url.replace('__ORG__',org.value) | |
45 | .replace('__OTHER__',other.value); |
|
45 | .replace('__OTHER__',other.value); | |
46 | window.location=u; |
|
46 | window.location=u; | |
47 | } |
|
47 | } | |
48 | }); |
|
48 | }); | |
49 |
|
49 | |||
50 | // main table sorting |
|
50 | // main table sorting | |
51 | var myColumnDefs = [ |
|
51 | var myColumnDefs = [ | |
52 | {key:"name",label:"${_('Name')}",sortable:true, |
|
52 | {key:"name",label:"${_('Name')}",sortable:true, | |
53 | sortOptions: { sortFunction: nameSort }}, |
|
53 | sortOptions: { sortFunction: nameSort }}, | |
54 | {key:"date",label:"${_('Date')}",sortable:true, |
|
54 | {key:"date",label:"${_('Date')}",sortable:true, | |
55 | sortOptions: { sortFunction: dateSort }}, |
|
55 | sortOptions: { sortFunction: dateSort }}, | |
56 | {key:"author",label:"${_('Author')}",sortable:true}, |
|
56 | {key:"author",label:"${_('Author')}",sortable:true}, | |
57 | {key:"revision",label:"${_('Revision')}",sortable:true, |
|
57 | {key:"revision",label:"${_('Revision')}",sortable:true, | |
58 | sortOptions: { sortFunction: revisionSort }}, |
|
58 | sortOptions: { sortFunction: revisionSort }}, | |
59 | {key:"compare",label:"${_('Compare')}",sortable:false} |
|
59 | {key:"compare",label:"${_('Compare')}",sortable:false} | |
60 | ]; |
|
60 | ]; | |
61 |
|
61 | |||
62 | var myDataSource = new YAHOO.util.DataSource(YUD.get("tags_data")); |
|
62 | var myDataSource = new YAHOO.util.DataSource(YUD.get("tags_data")); | |
63 |
|
63 | |||
64 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; |
|
64 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; | |
65 |
|
65 | |||
66 | myDataSource.responseSchema = { |
|
66 | myDataSource.responseSchema = { | |
67 | fields: [ |
|
67 | fields: [ | |
68 | {key:"raw_name"}, |
|
68 | {key:"raw_name"}, | |
69 | {key:"name"}, |
|
69 | {key:"name"}, | |
70 | {key:"raw_date"}, |
|
70 | {key:"raw_date"}, | |
71 | {key:"date"}, |
|
71 | {key:"date"}, | |
72 | {key:"author"}, |
|
72 | {key:"author"}, | |
73 | {key:"last_rev_raw"}, |
|
73 | {key:"last_rev_raw"}, | |
74 | {key:"revision"}, |
|
74 | {key:"revision"}, | |
75 | {key:"compare"} |
|
75 | {key:"compare"} | |
76 | ] |
|
76 | ] | |
77 | }; |
|
77 | }; | |
78 |
|
78 | |||
79 | var myDataTable = new YAHOO.widget.DataTable("table_wrap", myColumnDefs, myDataSource, |
|
79 | var myDataTable = new YAHOO.widget.DataTable("table_wrap", myColumnDefs, myDataSource, | |
80 | { |
|
80 | { | |
81 | sortedBy:{key:"name",dir:"asc"}, |
|
81 | sortedBy:{key:"name",dir:"asc"}, | |
82 | MSG_SORTASC:"${_('Click to sort ascending')}", |
|
82 | MSG_SORTASC:"${_('Click to sort ascending')}", | |
83 | MSG_SORTDESC:"${_('Click to sort descending')}", |
|
83 | MSG_SORTDESC:"${_('Click to sort descending')}", | |
84 | MSG_EMPTY:"${_('No records found.')}", |
|
84 | MSG_EMPTY:"${_('No records found.')}", | |
85 | MSG_ERROR:"${_('Data error.')}", |
|
85 | MSG_ERROR:"${_('Data error.')}", | |
86 | MSG_LOADING:"${_('Loading...')}" |
|
86 | MSG_LOADING:"${_('Loading...')}" | |
87 | } |
|
87 | } | |
88 | ); |
|
88 | ); | |
89 | myDataTable.subscribe('postRenderEvent',function(oArgs) { |
|
89 | myDataTable.subscribe('postRenderEvent',function(oArgs) { | |
90 | tooltip_activate(); |
|
90 | tooltip_activate(); | |
91 | var func = function(node){ |
|
91 | var func = function(node){ | |
92 | return node.parentNode.parentNode.parentNode.parentNode.parentNode; |
|
92 | return node.parentNode.parentNode.parentNode.parentNode.parentNode; | |
93 | } |
|
93 | } | |
94 | q_filter('q_filter_tags',$('div.table tr td .logtags .tagtag a'),func); |
|
94 | q_filter('q_filter_tags',$('div.table tr td .logtags .tagtag a'),func); | |
95 | }); |
|
95 | }); | |
96 |
|
96 | |||
97 | </script> |
|
97 | </script> | |
98 |
|
98 | |||
99 | </%def> |
|
99 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now