##// END OF EJS Templates
rhodecode release 1.1.3 changes part2
marcink -
r1058:4fa80e04 rhodecode-0.0.1.1.3 default
parent child Browse files
Show More
@@ -1,179 +1,177 b''
1 .. _changelog:
1 .. _changelog:
2
2
3 Changelog
3 Changelog
4 =========
4 =========
5
5
6 1.1.3 (**2011-02-15**)
6 1.1.3 (**2011-02-16**)
7 ======================
7 ======================
8
8
9 news
9 news
10 ----
10 ----
11
11
12 - implemented #102 allowing '.' in username
12 - implemented #102 allowing the '.' character in username
13 - added option to access repository just by entering http://server/<repo_name>
13 - added option to access repository just by entering http://server/<repo_name>
14 - celery task ignores result for better performance
14 - celery task ignores result for better performance
15
15
16 fixes
16 fixes
17 -----
17 -----
18
18
19 - fixed ehlo command and non auth mail servers on smtp_lib. Thanks to
19 - fixed ehlo command and non auth mail servers on smtp_lib. Thanks to
20 apollo13 and Johan Walles
20 apollo13 and Johan Walles
21 - small fixes in journal
21 - small fixes in journal
22 - fixed problems with getting setting for celery from .ini files
22 - fixed problems with getting setting for celery from .ini files
23 - registration, password reset and login boxes share the same title as main
23 - registration, password reset and login boxes share the same title as main
24 application now
24 application now
25 - fixed #113: to high permissions to fork repository
25 - fixed #113: to high permissions to fork repository
26 - fixed problem with '[' chars in commit messages in journal
26 - fixed problem with '[' chars in commit messages in journal
27 - removed issue with space inside renamed repository after deletion
27 - removed issue with space inside renamed repository after deletion
28 - db transaction fixes when filesystem repository creation failed
28 - db transaction fixes when filesystem repository creation failed
29 - fixed #106 relation issues on databases different than sqlite
29 - fixed #106 relation issues on databases different than sqlite
30
31 - fixed static files paths links to use of url() method
30 - fixed static files paths links to use of url() method
32
31
33
32
34
35 1.1.2 (**2011-01-12**)
33 1.1.2 (**2011-01-12**)
36 ======================
34 ======================
37
35
38 news
36 news
39 ----
37 ----
40
38
41
39
42 fixes
40 fixes
43 -----
41 -----
44
42
45 - fixes #98 protection against float division of percentage stats
43 - fixes #98 protection against float division of percentage stats
46 - fixed graph bug
44 - fixed graph bug
47 - forced webhelpers version since it was making troubles during installation
45 - forced webhelpers version since it was making troubles during installation
48
46
49 1.1.1 (**2011-01-06**)
47 1.1.1 (**2011-01-06**)
50 ======================
48 ======================
51
49
52 news
50 news
53 ----
51 ----
54
52
55 - added force https option into ini files for easier https usage (no need to
53 - added force https option into ini files for easier https usage (no need to
56 set server headers with this options)
54 set server headers with this options)
57 - small css updates
55 - small css updates
58
56
59 fixes
57 fixes
60 -----
58 -----
61
59
62 - fixed #96 redirect loop on files view on repositories without changesets
60 - fixed #96 redirect loop on files view on repositories without changesets
63 - fixed #97 unicode string passed into server header in special cases (mod_wsgi)
61 - fixed #97 unicode string passed into server header in special cases (mod_wsgi)
64 and server crashed with errors
62 and server crashed with errors
65 - fixed large tooltips problems on main page
63 - fixed large tooltips problems on main page
66 - fixed #92 whoosh indexer is more error proof
64 - fixed #92 whoosh indexer is more error proof
67
65
68 1.1.0 (**2010-12-18**)
66 1.1.0 (**2010-12-18**)
69 ======================
67 ======================
70
68
71 news
69 news
72 ----
70 ----
73
71
74 - rewrite of internals for vcs >=0.1.10
72 - rewrite of internals for vcs >=0.1.10
75 - uses mercurial 1.7 with dotencode disabled for maintaining compatibility
73 - uses mercurial 1.7 with dotencode disabled for maintaining compatibility
76 with older clients
74 with older clients
77 - anonymous access, authentication via ldap
75 - anonymous access, authentication via ldap
78 - performance upgrade for cached repos list - each repository has it's own
76 - performance upgrade for cached repos list - each repository has it's own
79 cache that's invalidated when needed.
77 cache that's invalidated when needed.
80 - performance upgrades on repositories with large amount of commits (20K+)
78 - performance upgrades on repositories with large amount of commits (20K+)
81 - main page quick filter for filtering repositories
79 - main page quick filter for filtering repositories
82 - user dashboards with ability to follow chosen repositories actions
80 - user dashboards with ability to follow chosen repositories actions
83 - sends email to admin on new user registration
81 - sends email to admin on new user registration
84 - added cache/statistics reset options into repository settings
82 - added cache/statistics reset options into repository settings
85 - more detailed action logger (based on hooks) with pushed changesets lists
83 - more detailed action logger (based on hooks) with pushed changesets lists
86 and options to disable those hooks from admin panel
84 and options to disable those hooks from admin panel
87 - introduced new enhanced changelog for merges that shows more accurate results
85 - introduced new enhanced changelog for merges that shows more accurate results
88 - new improved and faster code stats (based on pygments lexers mapping tables,
86 - new improved and faster code stats (based on pygments lexers mapping tables,
89 showing up to 10 trending sources for each repository. Additionally stats
87 showing up to 10 trending sources for each repository. Additionally stats
90 can be disabled in repository settings.
88 can be disabled in repository settings.
91 - gui optimizations, fixed application width to 1024px
89 - gui optimizations, fixed application width to 1024px
92 - added cut off (for large files/changesets) limit into config files
90 - added cut off (for large files/changesets) limit into config files
93 - whoosh, celeryd, upgrade moved to paster command
91 - whoosh, celeryd, upgrade moved to paster command
94 - other than sqlite database backends can be used
92 - other than sqlite database backends can be used
95
93
96 fixes
94 fixes
97 -----
95 -----
98
96
99 - fixes #61 forked repo was showing only after cache expired
97 - fixes #61 forked repo was showing only after cache expired
100 - fixes #76 no confirmation on user deletes
98 - fixes #76 no confirmation on user deletes
101 - fixes #66 Name field misspelled
99 - fixes #66 Name field misspelled
102 - fixes #72 block user removal when he owns repositories
100 - fixes #72 block user removal when he owns repositories
103 - fixes #69 added password confirmation fields
101 - fixes #69 added password confirmation fields
104 - fixes #87 RhodeCode crashes occasionally on updating repository owner
102 - fixes #87 RhodeCode crashes occasionally on updating repository owner
105 - fixes #82 broken annotations on files with more than 1 blank line at the end
103 - fixes #82 broken annotations on files with more than 1 blank line at the end
106 - a lot of fixes and tweaks for file browser
104 - a lot of fixes and tweaks for file browser
107 - fixed detached session issues
105 - fixed detached session issues
108 - fixed when user had no repos he would see all repos listed in my account
106 - fixed when user had no repos he would see all repos listed in my account
109 - fixed ui() instance bug when global hgrc settings was loaded for server
107 - fixed ui() instance bug when global hgrc settings was loaded for server
110 instance and all hgrc options were merged with our db ui() object
108 instance and all hgrc options were merged with our db ui() object
111 - numerous small bugfixes
109 - numerous small bugfixes
112
110
113 (special thanks for TkSoh for detailed feedback)
111 (special thanks for TkSoh for detailed feedback)
114
112
115
113
116 1.0.2 (**2010-11-12**)
114 1.0.2 (**2010-11-12**)
117 ======================
115 ======================
118
116
119 news
117 news
120 ----
118 ----
121
119
122 - tested under python2.7
120 - tested under python2.7
123 - bumped sqlalchemy and celery versions
121 - bumped sqlalchemy and celery versions
124
122
125 fixes
123 fixes
126 -----
124 -----
127
125
128 - fixed #59 missing graph.js
126 - fixed #59 missing graph.js
129 - fixed repo_size crash when repository had broken symlinks
127 - fixed repo_size crash when repository had broken symlinks
130 - fixed python2.5 crashes.
128 - fixed python2.5 crashes.
131
129
132
130
133 1.0.1 (**2010-11-10**)
131 1.0.1 (**2010-11-10**)
134 ======================
132 ======================
135
133
136 news
134 news
137 ----
135 ----
138
136
139 - small css updated
137 - small css updated
140
138
141 fixes
139 fixes
142 -----
140 -----
143
141
144 - fixed #53 python2.5 incompatible enumerate calls
142 - fixed #53 python2.5 incompatible enumerate calls
145 - fixed #52 disable mercurial extension for web
143 - fixed #52 disable mercurial extension for web
146 - fixed #51 deleting repositories don't delete it's dependent objects
144 - fixed #51 deleting repositories don't delete it's dependent objects
147
145
148
146
149 1.0.0 (**2010-11-02**)
147 1.0.0 (**2010-11-02**)
150 ======================
148 ======================
151
149
152 - security bugfix simplehg wasn't checking for permissions on commands
150 - security bugfix simplehg wasn't checking for permissions on commands
153 other than pull or push.
151 other than pull or push.
154 - fixed doubled messages after push or pull in admin journal
152 - fixed doubled messages after push or pull in admin journal
155 - templating and css corrections, fixed repo switcher on chrome, updated titles
153 - templating and css corrections, fixed repo switcher on chrome, updated titles
156 - admin menu accessible from options menu on repository view
154 - admin menu accessible from options menu on repository view
157 - permissions cached queries
155 - permissions cached queries
158
156
159 1.0.0rc4 (**2010-10-12**)
157 1.0.0rc4 (**2010-10-12**)
160 ==========================
158 ==========================
161
159
162 - fixed python2.5 missing simplejson imports (thanks to Jens BΓ€ckman)
160 - fixed python2.5 missing simplejson imports (thanks to Jens BΓ€ckman)
163 - removed cache_manager settings from sqlalchemy meta
161 - removed cache_manager settings from sqlalchemy meta
164 - added sqlalchemy cache settings to ini files
162 - added sqlalchemy cache settings to ini files
165 - validated password length and added second try of failure on paster setup-app
163 - validated password length and added second try of failure on paster setup-app
166 - fixed setup database destroy prompt even when there was no db
164 - fixed setup database destroy prompt even when there was no db
167
165
168
166
169 1.0.0rc3 (**2010-10-11**)
167 1.0.0rc3 (**2010-10-11**)
170 =========================
168 =========================
171
169
172 - fixed i18n during installation.
170 - fixed i18n during installation.
173
171
174 1.0.0rc2 (**2010-10-11**)
172 1.0.0rc2 (**2010-10-11**)
175 =========================
173 =========================
176
174
177 - Disabled dirsize in file browser, it's causing nasty bug when dir renames
175 - Disabled dirsize in file browser, it's causing nasty bug when dir renames
178 occure. After vcs is fixed it'll be put back again.
176 occure. After vcs is fixed it'll be put back again.
179 - templating/css rewrites, optimized css. No newline at end of file
177 - templating/css rewrites, optimized css.
@@ -1,557 +1,557 b''
1 """Helper functions
1 """Helper functions
2
2
3 Consists of functions to typically be used within templates, but also
3 Consists of functions to typically be used within templates, but also
4 available to Controllers. This module is available to both as 'h'.
4 available to Controllers. This module is available to both as 'h'.
5 """
5 """
6 import random
6 import random
7 import hashlib
7 import hashlib
8 from pygments.formatters import HtmlFormatter
8 from pygments.formatters import HtmlFormatter
9 from pygments import highlight as code_highlight
9 from pygments import highlight as code_highlight
10 from pylons import url, app_globals as g
10 from pylons import url, app_globals as g
11 from pylons.i18n.translation import _, ungettext
11 from pylons.i18n.translation import _, ungettext
12 from vcs.utils.annotate import annotate_highlight
12 from vcs.utils.annotate import annotate_highlight
13 from webhelpers.html import literal, HTML, escape
13 from webhelpers.html import literal, HTML, escape
14 from webhelpers.html.tools import *
14 from webhelpers.html.tools import *
15 from webhelpers.html.builder import make_tag
15 from webhelpers.html.builder import make_tag
16 from webhelpers.html.tags import auto_discovery_link, checkbox, css_classes, \
16 from webhelpers.html.tags import auto_discovery_link, checkbox, css_classes, \
17 end_form, file, form, hidden, image, javascript_link, link_to, link_to_if, \
17 end_form, file, form, hidden, image, javascript_link, link_to, link_to_if, \
18 link_to_unless, ol, required_legend, select, stylesheet_link, submit, text, \
18 link_to_unless, ol, required_legend, select, stylesheet_link, submit, text, \
19 password, textarea, title, ul, xml_declaration, radio
19 password, textarea, title, ul, xml_declaration, radio
20 from webhelpers.html.tools import auto_link, button_to, highlight, js_obfuscate, \
20 from webhelpers.html.tools import auto_link, button_to, highlight, js_obfuscate, \
21 mail_to, strip_links, strip_tags, tag_re
21 mail_to, strip_links, strip_tags, tag_re
22 from webhelpers.number import format_byte_size, format_bit_size
22 from webhelpers.number import format_byte_size, format_bit_size
23 from webhelpers.pylonslib import Flash as _Flash
23 from webhelpers.pylonslib import Flash as _Flash
24 from webhelpers.pylonslib.secure_form import secure_form
24 from webhelpers.pylonslib.secure_form import secure_form
25 from webhelpers.text import chop_at, collapse, convert_accented_entities, \
25 from webhelpers.text import chop_at, collapse, convert_accented_entities, \
26 convert_misc_entities, lchop, plural, rchop, remove_formatting, \
26 convert_misc_entities, lchop, plural, rchop, remove_formatting, \
27 replace_whitespace, urlify, truncate, wrap_paragraphs
27 replace_whitespace, urlify, truncate, wrap_paragraphs
28 from webhelpers.date import time_ago_in_words
28 from webhelpers.date import time_ago_in_words
29
29
30 from webhelpers.html.tags import _set_input_attrs, _set_id_attr, \
30 from webhelpers.html.tags import _set_input_attrs, _set_id_attr, \
31 convert_boolean_attrs, NotGiven
31 convert_boolean_attrs, NotGiven
32
32
33 def _reset(name, value=None, id=NotGiven, type="reset", **attrs):
33 def _reset(name, value=None, id=NotGiven, type="reset", **attrs):
34 _set_input_attrs(attrs, type, name, value)
34 _set_input_attrs(attrs, type, name, value)
35 _set_id_attr(attrs, id, name)
35 _set_id_attr(attrs, id, name)
36 convert_boolean_attrs(attrs, ["disabled"])
36 convert_boolean_attrs(attrs, ["disabled"])
37 return HTML.input(**attrs)
37 return HTML.input(**attrs)
38
38
39 reset = _reset
39 reset = _reset
40
40
41
41
42 def get_token():
42 def get_token():
43 """Return the current authentication token, creating one if one doesn't
43 """Return the current authentication token, creating one if one doesn't
44 already exist.
44 already exist.
45 """
45 """
46 token_key = "_authentication_token"
46 token_key = "_authentication_token"
47 from pylons import session
47 from pylons import session
48 if not token_key in session:
48 if not token_key in session:
49 try:
49 try:
50 token = hashlib.sha1(str(random.getrandbits(128))).hexdigest()
50 token = hashlib.sha1(str(random.getrandbits(128))).hexdigest()
51 except AttributeError: # Python < 2.4
51 except AttributeError: # Python < 2.4
52 token = hashlib.sha1(str(random.randrange(2 ** 128))).hexdigest()
52 token = hashlib.sha1(str(random.randrange(2 ** 128))).hexdigest()
53 session[token_key] = token
53 session[token_key] = token
54 if hasattr(session, 'save'):
54 if hasattr(session, 'save'):
55 session.save()
55 session.save()
56 return session[token_key]
56 return session[token_key]
57
57
58
58
59 #Custom helpers here :)
59 #Custom helpers here :)
60 class _Link(object):
60 class _Link(object):
61 '''
61 '''
62 Make a url based on label and url with help of url_for
62 Make a url based on label and url with help of url_for
63 :param label:name of link if not defined url is used
63 :param label:name of link if not defined url is used
64 :param url: the url for link
64 :param url: the url for link
65 '''
65 '''
66
66
67 def __call__(self, label='', *url_, **urlargs):
67 def __call__(self, label='', *url_, **urlargs):
68 if label is None or '':
68 if label is None or '':
69 label = url
69 label = url
70 link_fn = link_to(label, url(*url_, **urlargs))
70 link_fn = link_to(label, url(*url_, **urlargs))
71 return link_fn
71 return link_fn
72
72
73 link = _Link()
73 link = _Link()
74
74
75 class _GetError(object):
75 class _GetError(object):
76
76
77 def __call__(self, field_name, form_errors):
77 def __call__(self, field_name, form_errors):
78 tmpl = """<span class="error_msg">%s</span>"""
78 tmpl = """<span class="error_msg">%s</span>"""
79 if form_errors and form_errors.has_key(field_name):
79 if form_errors and form_errors.has_key(field_name):
80 return literal(tmpl % form_errors.get(field_name))
80 return literal(tmpl % form_errors.get(field_name))
81
81
82 get_error = _GetError()
82 get_error = _GetError()
83
83
84 def recursive_replace(str, replace=' '):
84 def recursive_replace(str, replace=' '):
85 """
85 """
86 Recursive replace of given sign to just one instance
86 Recursive replace of given sign to just one instance
87 :param str: given string
87 :param str: given string
88 :param replace:char to find and replace multiple instances
88 :param replace:char to find and replace multiple instances
89
89
90 Examples::
90 Examples::
91 >>> recursive_replace("Mighty---Mighty-Bo--sstones",'-')
91 >>> recursive_replace("Mighty---Mighty-Bo--sstones",'-')
92 'Mighty-Mighty-Bo-sstones'
92 'Mighty-Mighty-Bo-sstones'
93 """
93 """
94
94
95 if str.find(replace * 2) == -1:
95 if str.find(replace * 2) == -1:
96 return str
96 return str
97 else:
97 else:
98 str = str.replace(replace * 2, replace)
98 str = str.replace(replace * 2, replace)
99 return recursive_replace(str, replace)
99 return recursive_replace(str, replace)
100
100
101 class _ToolTip(object):
101 class _ToolTip(object):
102
102
103 def __call__(self, tooltip_title, trim_at=50):
103 def __call__(self, tooltip_title, trim_at=50):
104 """
104 """
105 Special function just to wrap our text into nice formatted autowrapped
105 Special function just to wrap our text into nice formatted autowrapped
106 text
106 text
107 :param tooltip_title:
107 :param tooltip_title:
108 """
108 """
109
109
110 return wrap_paragraphs(escape(tooltip_title), trim_at)\
110 return wrap_paragraphs(escape(tooltip_title), trim_at)\
111 .replace('\n', '<br/>')
111 .replace('\n', '<br/>')
112
112
113 def activate(self):
113 def activate(self):
114 """
114 """
115 Adds tooltip mechanism to the given Html all tooltips have to have
115 Adds tooltip mechanism to the given Html all tooltips have to have
116 set class tooltip and set attribute tooltip_title.
116 set class tooltip and set attribute tooltip_title.
117 Then a tooltip will be generated based on that
117 Then a tooltip will be generated based on that
118 All with yui js tooltip
118 All with yui js tooltip
119 """
119 """
120
120
121 js = '''
121 js = '''
122 YAHOO.util.Event.onDOMReady(function(){
122 YAHOO.util.Event.onDOMReady(function(){
123 function toolTipsId(){
123 function toolTipsId(){
124 var ids = [];
124 var ids = [];
125 var tts = YAHOO.util.Dom.getElementsByClassName('tooltip');
125 var tts = YAHOO.util.Dom.getElementsByClassName('tooltip');
126
126
127 for (var i = 0; i < tts.length; i++) {
127 for (var i = 0; i < tts.length; i++) {
128 //if element doesn't not have and id autogenerate one for tooltip
128 //if element doesn't not have and id autogenerate one for tooltip
129
129
130 if (!tts[i].id){
130 if (!tts[i].id){
131 tts[i].id='tt'+i*100;
131 tts[i].id='tt'+i*100;
132 }
132 }
133 ids.push(tts[i].id);
133 ids.push(tts[i].id);
134 }
134 }
135 return ids
135 return ids
136 };
136 };
137 var myToolTips = new YAHOO.widget.Tooltip("tooltip", {
137 var myToolTips = new YAHOO.widget.Tooltip("tooltip", {
138 context: toolTipsId(),
138 context: toolTipsId(),
139 monitorresize:false,
139 monitorresize:false,
140 xyoffset :[0,0],
140 xyoffset :[0,0],
141 autodismissdelay:300000,
141 autodismissdelay:300000,
142 hidedelay:5,
142 hidedelay:5,
143 showdelay:20,
143 showdelay:20,
144 });
144 });
145
145
146 //Mouse Over event disabled for new repositories since they don't
146 //Mouse Over event disabled for new repositories since they don't
147 //have last commit message
147 //have last commit message
148 myToolTips.contextMouseOverEvent.subscribe(
148 myToolTips.contextMouseOverEvent.subscribe(
149 function(type, args) {
149 function(type, args) {
150 var context = args[0];
150 var context = args[0];
151 var txt = context.getAttribute('tooltip_title');
151 var txt = context.getAttribute('tooltip_title');
152 if(txt){
152 if(txt){
153 return true;
153 return true;
154 }
154 }
155 else{
155 else{
156 return false;
156 return false;
157 }
157 }
158 });
158 });
159
159
160
160
161 // Set the text for the tooltip just before we display it. Lazy method
161 // Set the text for the tooltip just before we display it. Lazy method
162 myToolTips.contextTriggerEvent.subscribe(
162 myToolTips.contextTriggerEvent.subscribe(
163 function(type, args) {
163 function(type, args) {
164
164
165
165
166 var context = args[0];
166 var context = args[0];
167
167
168 var txt = context.getAttribute('tooltip_title');
168 var txt = context.getAttribute('tooltip_title');
169 this.cfg.setProperty("text", txt);
169 this.cfg.setProperty("text", txt);
170
170
171
171
172 // positioning of tooltip
172 // positioning of tooltip
173 var tt_w = this.element.clientWidth;
173 var tt_w = this.element.clientWidth;
174 var tt_h = this.element.clientHeight;
174 var tt_h = this.element.clientHeight;
175
175
176 var context_w = context.offsetWidth;
176 var context_w = context.offsetWidth;
177 var context_h = context.offsetHeight;
177 var context_h = context.offsetHeight;
178
178
179 var pos_x = YAHOO.util.Dom.getX(context);
179 var pos_x = YAHOO.util.Dom.getX(context);
180 var pos_y = YAHOO.util.Dom.getY(context);
180 var pos_y = YAHOO.util.Dom.getY(context);
181
181
182 var display_strategy = 'top';
182 var display_strategy = 'top';
183 var xy_pos = [0,0];
183 var xy_pos = [0,0];
184 switch (display_strategy){
184 switch (display_strategy){
185
185
186 case 'top':
186 case 'top':
187 var cur_x = (pos_x+context_w/2)-(tt_w/2);
187 var cur_x = (pos_x+context_w/2)-(tt_w/2);
188 var cur_y = (pos_y-tt_h-4);
188 var cur_y = (pos_y-tt_h-4);
189 xy_pos = [cur_x,cur_y];
189 xy_pos = [cur_x,cur_y];
190 break;
190 break;
191 case 'bottom':
191 case 'bottom':
192 var cur_x = (pos_x+context_w/2)-(tt_w/2);
192 var cur_x = (pos_x+context_w/2)-(tt_w/2);
193 var cur_y = pos_y+context_h+4;
193 var cur_y = pos_y+context_h+4;
194 xy_pos = [cur_x,cur_y];
194 xy_pos = [cur_x,cur_y];
195 break;
195 break;
196 case 'left':
196 case 'left':
197 var cur_x = (pos_x-tt_w-4);
197 var cur_x = (pos_x-tt_w-4);
198 var cur_y = pos_y-((tt_h/2)-context_h/2);
198 var cur_y = pos_y-((tt_h/2)-context_h/2);
199 xy_pos = [cur_x,cur_y];
199 xy_pos = [cur_x,cur_y];
200 break;
200 break;
201 case 'right':
201 case 'right':
202 var cur_x = (pos_x+context_w+4);
202 var cur_x = (pos_x+context_w+4);
203 var cur_y = pos_y-((tt_h/2)-context_h/2);
203 var cur_y = pos_y-((tt_h/2)-context_h/2);
204 xy_pos = [cur_x,cur_y];
204 xy_pos = [cur_x,cur_y];
205 break;
205 break;
206 default:
206 default:
207 var cur_x = (pos_x+context_w/2)-(tt_w/2);
207 var cur_x = (pos_x+context_w/2)-(tt_w/2);
208 var cur_y = pos_y-tt_h-4;
208 var cur_y = pos_y-tt_h-4;
209 xy_pos = [cur_x,cur_y];
209 xy_pos = [cur_x,cur_y];
210 break;
210 break;
211
211
212 }
212 }
213
213
214 this.cfg.setProperty("xy",xy_pos);
214 this.cfg.setProperty("xy",xy_pos);
215
215
216 });
216 });
217
217
218 //Mouse out
218 //Mouse out
219 myToolTips.contextMouseOutEvent.subscribe(
219 myToolTips.contextMouseOutEvent.subscribe(
220 function(type, args) {
220 function(type, args) {
221 var context = args[0];
221 var context = args[0];
222
222
223 });
223 });
224 });
224 });
225 '''
225 '''
226 return literal(js)
226 return literal(js)
227
227
228 tooltip = _ToolTip()
228 tooltip = _ToolTip()
229
229
230 class _FilesBreadCrumbs(object):
230 class _FilesBreadCrumbs(object):
231
231
232 def __call__(self, repo_name, rev, paths):
232 def __call__(self, repo_name, rev, paths):
233 url_l = [link_to(repo_name, url('files_home',
233 url_l = [link_to(repo_name, url('files_home',
234 repo_name=repo_name,
234 repo_name=repo_name,
235 revision=rev, f_path=''))]
235 revision=rev, f_path=''))]
236 paths_l = paths.split('/')
236 paths_l = paths.split('/')
237
237
238 for cnt, p in enumerate(paths_l):
238 for cnt, p in enumerate(paths_l):
239 if p != '':
239 if p != '':
240 url_l.append(link_to(p, url('files_home',
240 url_l.append(link_to(p, url('files_home',
241 repo_name=repo_name,
241 repo_name=repo_name,
242 revision=rev,
242 revision=rev,
243 f_path='/'.join(paths_l[:cnt + 1]))))
243 f_path='/'.join(paths_l[:cnt + 1]))))
244
244
245 return literal('/'.join(url_l))
245 return literal('/'.join(url_l))
246
246
247 files_breadcrumbs = _FilesBreadCrumbs()
247 files_breadcrumbs = _FilesBreadCrumbs()
248 class CodeHtmlFormatter(HtmlFormatter):
248 class CodeHtmlFormatter(HtmlFormatter):
249
249
250 def wrap(self, source, outfile):
250 def wrap(self, source, outfile):
251 return self._wrap_div(self._wrap_pre(self._wrap_code(source)))
251 return self._wrap_div(self._wrap_pre(self._wrap_code(source)))
252
252
253 def _wrap_code(self, source):
253 def _wrap_code(self, source):
254 for cnt, it in enumerate(source):
254 for cnt, it in enumerate(source):
255 i, t = it
255 i, t = it
256 t = '<div id="#S-%s">%s</div>' % (cnt + 1, t)
256 t = '<div id="#S-%s">%s</div>' % (cnt + 1, t)
257 yield i, t
257 yield i, t
258 def pygmentize(filenode, **kwargs):
258 def pygmentize(filenode, **kwargs):
259 """
259 """
260 pygmentize function using pygments
260 pygmentize function using pygments
261 :param filenode:
261 :param filenode:
262 """
262 """
263 return literal(code_highlight(filenode.content,
263 return literal(code_highlight(filenode.content,
264 filenode.lexer, CodeHtmlFormatter(**kwargs)))
264 filenode.lexer, CodeHtmlFormatter(**kwargs)))
265
265
266 def pygmentize_annotation(filenode, **kwargs):
266 def pygmentize_annotation(filenode, **kwargs):
267 """
267 """
268 pygmentize function for annotation
268 pygmentize function for annotation
269 :param filenode:
269 :param filenode:
270 """
270 """
271
271
272 color_dict = {}
272 color_dict = {}
273 def gen_color():
273 def gen_color():
274 """generator for getting 10k of evenly distibuted colors using hsv color
274 """generator for getting 10k of evenly distibuted colors using hsv color
275 and golden ratio.
275 and golden ratio.
276 """
276 """
277 import colorsys
277 import colorsys
278 n = 10000
278 n = 10000
279 golden_ratio = 0.618033988749895
279 golden_ratio = 0.618033988749895
280 h = 0.22717784590367374
280 h = 0.22717784590367374
281 #generate 10k nice web friendly colors in the same order
281 #generate 10k nice web friendly colors in the same order
282 for c in xrange(n):
282 for c in xrange(n):
283 h += golden_ratio
283 h += golden_ratio
284 h %= 1
284 h %= 1
285 HSV_tuple = [h, 0.95, 0.95]
285 HSV_tuple = [h, 0.95, 0.95]
286 RGB_tuple = colorsys.hsv_to_rgb(*HSV_tuple)
286 RGB_tuple = colorsys.hsv_to_rgb(*HSV_tuple)
287 yield map(lambda x:str(int(x * 256)), RGB_tuple)
287 yield map(lambda x:str(int(x * 256)), RGB_tuple)
288
288
289 cgenerator = gen_color()
289 cgenerator = gen_color()
290
290
291 def get_color_string(cs):
291 def get_color_string(cs):
292 if color_dict.has_key(cs):
292 if color_dict.has_key(cs):
293 col = color_dict[cs]
293 col = color_dict[cs]
294 else:
294 else:
295 col = color_dict[cs] = cgenerator.next()
295 col = color_dict[cs] = cgenerator.next()
296 return "color: rgb(%s)! important;" % (', '.join(col))
296 return "color: rgb(%s)! important;" % (', '.join(col))
297
297
298 def url_func(changeset):
298 def url_func(changeset):
299 tooltip_html = "<div style='font-size:0.8em'><b>Author:</b>" + \
299 tooltip_html = "<div style='font-size:0.8em'><b>Author:</b>" + \
300 " %s<br/><b>Date:</b> %s</b><br/><b>Message:</b> %s<br/></div>"
300 " %s<br/><b>Date:</b> %s</b><br/><b>Message:</b> %s<br/></div>"
301
301
302 tooltip_html = tooltip_html % (changeset.author,
302 tooltip_html = tooltip_html % (changeset.author,
303 changeset.date,
303 changeset.date,
304 tooltip(changeset.message))
304 tooltip(changeset.message))
305 lnk_format = '%5s:%s' % ('r%s' % changeset.revision,
305 lnk_format = '%5s:%s' % ('r%s' % changeset.revision,
306 short_id(changeset.raw_id))
306 short_id(changeset.raw_id))
307 uri = link_to(
307 uri = link_to(
308 lnk_format,
308 lnk_format,
309 url('changeset_home', repo_name=changeset.repository.name,
309 url('changeset_home', repo_name=changeset.repository.name,
310 revision=changeset.raw_id),
310 revision=changeset.raw_id),
311 style=get_color_string(changeset.raw_id),
311 style=get_color_string(changeset.raw_id),
312 class_='tooltip',
312 class_='tooltip',
313 tooltip_title=tooltip_html
313 tooltip_title=tooltip_html
314 )
314 )
315
315
316 uri += '\n'
316 uri += '\n'
317 return uri
317 return uri
318 return literal(annotate_highlight(filenode, url_func, **kwargs))
318 return literal(annotate_highlight(filenode, url_func, **kwargs))
319
319
320 def repo_name_slug(value):
320 def repo_name_slug(value):
321 """Return slug of name of repository
321 """Return slug of name of repository
322 This function is called on each creation/modification
322 This function is called on each creation/modification
323 of repository to prevent bad names in repo
323 of repository to prevent bad names in repo
324 """
324 """
325 slug = remove_formatting(value)
325 slug = remove_formatting(value)
326 slug = strip_tags(slug)
326 slug = strip_tags(slug)
327
327
328 for c in """=[]\;'"<>,/~!@#$%^&*()+{}|: """:
328 for c in """=[]\;'"<>,/~!@#$%^&*()+{}|: """:
329 slug = slug.replace(c, '-')
329 slug = slug.replace(c, '-')
330 slug = recursive_replace(slug, '-')
330 slug = recursive_replace(slug, '-')
331 slug = collapse(slug, '-')
331 slug = collapse(slug, '-')
332 return slug
332 return slug
333
333
334 def get_changeset_safe(repo, rev):
334 def get_changeset_safe(repo, rev):
335 from vcs.backends.base import BaseRepository
335 from vcs.backends.base import BaseRepository
336 from vcs.exceptions import RepositoryError
336 from vcs.exceptions import RepositoryError
337 if not isinstance(repo, BaseRepository):
337 if not isinstance(repo, BaseRepository):
338 raise Exception('You must pass an Repository '
338 raise Exception('You must pass an Repository '
339 'object as first argument got %s', type(repo))
339 'object as first argument got %s', type(repo))
340
340
341 try:
341 try:
342 cs = repo.get_changeset(rev)
342 cs = repo.get_changeset(rev)
343 except RepositoryError:
343 except RepositoryError:
344 from rhodecode.lib.utils import EmptyChangeset
344 from rhodecode.lib.utils import EmptyChangeset
345 cs = EmptyChangeset()
345 cs = EmptyChangeset()
346 return cs
346 return cs
347
347
348
348
349 flash = _Flash()
349 flash = _Flash()
350
350
351
351
352 #==============================================================================
352 #==============================================================================
353 # MERCURIAL FILTERS available via h.
353 # MERCURIAL FILTERS available via h.
354 #==============================================================================
354 #==============================================================================
355 from mercurial import util
355 from mercurial import util
356 from mercurial.templatefilters import person as _person
356 from mercurial.templatefilters import person as _person
357
357
358
358
359
359
360 def _age(curdate):
360 def _age(curdate):
361 """turns a datetime into an age string."""
361 """turns a datetime into an age string."""
362
362
363 if not curdate:
363 if not curdate:
364 return ''
364 return ''
365
365
366 from datetime import timedelta, datetime
366 from datetime import timedelta, datetime
367
367
368 agescales = [("year", 3600 * 24 * 365),
368 agescales = [("year", 3600 * 24 * 365),
369 ("month", 3600 * 24 * 30),
369 ("month", 3600 * 24 * 30),
370 ("day", 3600 * 24),
370 ("day", 3600 * 24),
371 ("hour", 3600),
371 ("hour", 3600),
372 ("minute", 60),
372 ("minute", 60),
373 ("second", 1), ]
373 ("second", 1), ]
374
374
375 age = datetime.now() - curdate
375 age = datetime.now() - curdate
376 age_seconds = (age.days * agescales[2][1]) + age.seconds
376 age_seconds = (age.days * agescales[2][1]) + age.seconds
377 pos = 1
377 pos = 1
378 for scale in agescales:
378 for scale in agescales:
379 if scale[1] <= age_seconds:
379 if scale[1] <= age_seconds:
380 if pos == 6:pos = 5
380 if pos == 6:pos = 5
381 return time_ago_in_words(curdate, agescales[pos][0]) + ' ' + _('ago')
381 return time_ago_in_words(curdate, agescales[pos][0]) + ' ' + _('ago')
382 pos += 1
382 pos += 1
383
383
384 return _('just now')
384 return _('just now')
385
385
386 age = lambda x:_age(x)
386 age = lambda x:_age(x)
387 capitalize = lambda x: x.capitalize()
387 capitalize = lambda x: x.capitalize()
388 email = util.email
388 email = util.email
389 email_or_none = lambda x: util.email(x) if util.email(x) != x else None
389 email_or_none = lambda x: util.email(x) if util.email(x) != x else None
390 person = lambda x: _person(x)
390 person = lambda x: _person(x)
391 short_id = lambda x: x[:12]
391 short_id = lambda x: x[:12]
392
392
393
393
394 def bool2icon(value):
394 def bool2icon(value):
395 """
395 """
396 Returns True/False values represented as small html image of true/false
396 Returns True/False values represented as small html image of true/false
397 icons
397 icons
398 :param value: bool value
398 :param value: bool value
399 """
399 """
400
400
401 if value is True:
401 if value is True:
402 return HTML.tag('img', src="/images/icons/accept.png", alt=_('True'))
402 return HTML.tag('img', src=url("/images/icons/accept.png"), alt=_('True'))
403
403
404 if value is False:
404 if value is False:
405 return HTML.tag('img', src="/images/icons/cancel.png", alt=_('False'))
405 return HTML.tag('img', src=url("/images/icons/cancel.png"), alt=_('False'))
406
406
407 return value
407 return value
408
408
409
409
410 def action_parser(user_log):
410 def action_parser(user_log):
411 """
411 """
412 This helper will map the specified string action into translated
412 This helper will map the specified string action into translated
413 fancy names with icons and links
413 fancy names with icons and links
414
414
415 @param action:
415 @param action:
416 """
416 """
417 action = user_log.action
417 action = user_log.action
418 action_params = ' '
418 action_params = ' '
419
419
420 x = action.split(':')
420 x = action.split(':')
421
421
422 if len(x) > 1:
422 if len(x) > 1:
423 action, action_params = x
423 action, action_params = x
424
424
425 def get_cs_links():
425 def get_cs_links():
426 if action == 'push':
426 if action == 'push':
427 revs_limit = 5
427 revs_limit = 5
428 revs = action_params.split(',')
428 revs = action_params.split(',')
429 cs_links = " " + ', '.join ([link(rev,
429 cs_links = " " + ', '.join ([link(rev,
430 url('changeset_home',
430 url('changeset_home',
431 repo_name=user_log.repository.repo_name,
431 repo_name=user_log.repository.repo_name,
432 revision=rev)) for rev in revs[:revs_limit] ])
432 revision=rev)) for rev in revs[:revs_limit] ])
433 if len(revs) > revs_limit:
433 if len(revs) > revs_limit:
434 uniq_id = revs[0]
434 uniq_id = revs[0]
435 html_tmpl = ('<span> %s '
435 html_tmpl = ('<span> %s '
436 '<a class="show_more" id="_%s" href="#">%s</a> '
436 '<a class="show_more" id="_%s" href="#">%s</a> '
437 '%s</span>')
437 '%s</span>')
438 cs_links += html_tmpl % (_('and'), uniq_id, _('%s more') \
438 cs_links += html_tmpl % (_('and'), uniq_id, _('%s more') \
439 % (len(revs) - revs_limit),
439 % (len(revs) - revs_limit),
440 _('revisions'))
440 _('revisions'))
441
441
442 html_tmpl = '<span id="%s" style="display:none"> %s </span>'
442 html_tmpl = '<span id="%s" style="display:none"> %s </span>'
443 cs_links += html_tmpl % (uniq_id, ', '.join([link(rev,
443 cs_links += html_tmpl % (uniq_id, ', '.join([link(rev,
444 url('changeset_home',
444 url('changeset_home',
445 repo_name=user_log.repository.repo_name,
445 repo_name=user_log.repository.repo_name,
446 revision=rev)) for rev in revs[revs_limit:] ]))
446 revision=rev)) for rev in revs[revs_limit:] ]))
447
447
448 return cs_links
448 return cs_links
449 return ''
449 return ''
450
450
451 def get_fork_name():
451 def get_fork_name():
452 repo_name = action_params
452 repo_name = action_params
453 return str(link_to(action_params, url('summary_home',
453 return str(link_to(action_params, url('summary_home',
454 repo_name=repo_name,)))
454 repo_name=repo_name,)))
455
455
456 map = {'user_deleted_repo':(_('[deleted] repository'), None),
456 map = {'user_deleted_repo':(_('[deleted] repository'), None),
457 'user_created_repo':(_('[created] repository'), None),
457 'user_created_repo':(_('[created] repository'), None),
458 'user_forked_repo':(_('[forked] repository'), get_fork_name),
458 'user_forked_repo':(_('[forked] repository'), get_fork_name),
459 'user_updated_repo':(_('[updated] repository'), None),
459 'user_updated_repo':(_('[updated] repository'), None),
460 'admin_deleted_repo':(_('[delete] repository'), None),
460 'admin_deleted_repo':(_('[delete] repository'), None),
461 'admin_created_repo':(_('[created] repository'), None),
461 'admin_created_repo':(_('[created] repository'), None),
462 'admin_forked_repo':(_('[forked] repository'), None),
462 'admin_forked_repo':(_('[forked] repository'), None),
463 'admin_updated_repo':(_('[updated] repository'), None),
463 'admin_updated_repo':(_('[updated] repository'), None),
464 'push':(_('[pushed] into'), get_cs_links),
464 'push':(_('[pushed] into'), get_cs_links),
465 'pull':(_('[pulled] from'), None),
465 'pull':(_('[pulled] from'), None),
466 'started_following_repo':(_('[started following] repository'), None),
466 'started_following_repo':(_('[started following] repository'), None),
467 'stopped_following_repo':(_('[stopped following] repository'), None),
467 'stopped_following_repo':(_('[stopped following] repository'), None),
468 }
468 }
469
469
470 action_str = map.get(action, action)
470 action_str = map.get(action, action)
471 action = action_str[0].replace('[', '<span class="journal_highlight">')\
471 action = action_str[0].replace('[', '<span class="journal_highlight">')\
472 .replace(']', '</span>')
472 .replace(']', '</span>')
473 action_params_func = lambda :""
473 action_params_func = lambda :""
474
474
475 if action_str[1] is not None:
475 if action_str[1] is not None:
476 action_params_func = action_str[1]
476 action_params_func = action_str[1]
477
477
478 return literal(action +" "+ action_params_func())
478 return literal(action + " " + action_params_func())
479
479
480 def action_parser_icon(user_log):
480 def action_parser_icon(user_log):
481 action = user_log.action
481 action = user_log.action
482 action_params = None
482 action_params = None
483 x = action.split(':')
483 x = action.split(':')
484
484
485 if len(x) > 1:
485 if len(x) > 1:
486 action, action_params = x
486 action, action_params = x
487
487
488 tmpl = """<img src="%s/%s" alt="%s"/>"""
488 tmpl = """<img src="%s/%s" alt="%s"/>"""
489 map = {'user_deleted_repo':'database_delete.png',
489 map = {'user_deleted_repo':'database_delete.png',
490 'user_created_repo':'database_add.png',
490 'user_created_repo':'database_add.png',
491 'user_forked_repo':'arrow_divide.png',
491 'user_forked_repo':'arrow_divide.png',
492 'user_updated_repo':'database_edit.png',
492 'user_updated_repo':'database_edit.png',
493 'admin_deleted_repo':'database_delete.png',
493 'admin_deleted_repo':'database_delete.png',
494 'admin_created_repo':'database_add.png',
494 'admin_created_repo':'database_add.png',
495 'admin_forked_repo':'arrow_divide.png',
495 'admin_forked_repo':'arrow_divide.png',
496 'admin_updated_repo':'database_edit.png',
496 'admin_updated_repo':'database_edit.png',
497 'push':'script_add.png',
497 'push':'script_add.png',
498 'pull':'down_16.png',
498 'pull':'down_16.png',
499 'started_following_repo':'heart_add.png',
499 'started_following_repo':'heart_add.png',
500 'stopped_following_repo':'heart_delete.png',
500 'stopped_following_repo':'heart_delete.png',
501 }
501 }
502 return literal(tmpl % ((url('/images/icons/')),
502 return literal(tmpl % ((url('/images/icons/')),
503 map.get(action, action), action))
503 map.get(action, action), action))
504
504
505
505
506 #==============================================================================
506 #==============================================================================
507 # PERMS
507 # PERMS
508 #==============================================================================
508 #==============================================================================
509 from rhodecode.lib.auth import HasPermissionAny, HasPermissionAll, \
509 from rhodecode.lib.auth import HasPermissionAny, HasPermissionAll, \
510 HasRepoPermissionAny, HasRepoPermissionAll
510 HasRepoPermissionAny, HasRepoPermissionAll
511
511
512 #==============================================================================
512 #==============================================================================
513 # GRAVATAR URL
513 # GRAVATAR URL
514 #==============================================================================
514 #==============================================================================
515 import hashlib
515 import hashlib
516 import urllib
516 import urllib
517 from pylons import request
517 from pylons import request
518
518
519 def gravatar_url(email_address, size=30):
519 def gravatar_url(email_address, size=30):
520 ssl_enabled = 'https' == request.environ.get('wsgi.url_scheme')
520 ssl_enabled = 'https' == request.environ.get('wsgi.url_scheme')
521 default = 'identicon'
521 default = 'identicon'
522 baseurl_nossl = "http://www.gravatar.com/avatar/"
522 baseurl_nossl = "http://www.gravatar.com/avatar/"
523 baseurl_ssl = "https://secure.gravatar.com/avatar/"
523 baseurl_ssl = "https://secure.gravatar.com/avatar/"
524 baseurl = baseurl_ssl if ssl_enabled else baseurl_nossl
524 baseurl = baseurl_ssl if ssl_enabled else baseurl_nossl
525
525
526
526
527 # construct the url
527 # construct the url
528 gravatar_url = baseurl + hashlib.md5(email_address.lower()).hexdigest() + "?"
528 gravatar_url = baseurl + hashlib.md5(email_address.lower()).hexdigest() + "?"
529 gravatar_url += urllib.urlencode({'d':default, 's':str(size)})
529 gravatar_url += urllib.urlencode({'d':default, 's':str(size)})
530
530
531 return gravatar_url
531 return gravatar_url
532
532
533 def safe_unicode(str):
533 def safe_unicode(str):
534 """safe unicode function. In case of UnicodeDecode error we try to return
534 """safe unicode function. In case of UnicodeDecode error we try to return
535 unicode with errors replace, if this failes we return unicode with
535 unicode with errors replace, if this failes we return unicode with
536 string_escape decoding """
536 string_escape decoding """
537
537
538 try:
538 try:
539 u_str = unicode(str)
539 u_str = unicode(str)
540 except UnicodeDecodeError:
540 except UnicodeDecodeError:
541 try:
541 try:
542 u_str = unicode(str, 'utf-8', 'replace')
542 u_str = unicode(str, 'utf-8', 'replace')
543 except UnicodeDecodeError:
543 except UnicodeDecodeError:
544 #incase we have a decode error just represent as byte string
544 #incase we have a decode error just represent as byte string
545 u_str = unicode(str(str).encode('string_escape'))
545 u_str = unicode(str(str).encode('string_escape'))
546
546
547 return u_str
547 return u_str
548
548
549 def changed_tooltip(nodes):
549 def changed_tooltip(nodes):
550 if nodes:
550 if nodes:
551 pref = ': <br/> '
551 pref = ': <br/> '
552 suf = ''
552 suf = ''
553 if len(nodes) > 30:
553 if len(nodes) > 30:
554 suf = '<br/>' + _(' and %s more') % (len(nodes) - 30)
554 suf = '<br/>' + _(' and %s more') % (len(nodes) - 30)
555 return literal(pref + '<br/> '.join([x.path for x in nodes[:30]]) + suf)
555 return literal(pref + '<br/> '.join([x.path for x in nodes[:30]]) + suf)
556 else:
556 else:
557 return ': ' + _('No Files')
557 return ': ' + _('No Files')
@@ -1,88 +1,88 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.html"/>
2 <%inherit file="/base/base.html"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('Repositories administration')} - ${c.rhodecode_name}
5 ${_('Repositories administration')} - ${c.rhodecode_name}
6 </%def>
6 </%def>
7
7
8
8
9 <%def name="breadcrumbs_links()">
9 <%def name="breadcrumbs_links()">
10 ${h.link_to(_('Admin'),h.url('admin_home'))} &raquo; ${_('Repositories')}
10 ${h.link_to(_('Admin'),h.url('admin_home'))} &raquo; ${_('Repositories')}
11 </%def>
11 </%def>
12 <%def name="page_nav()">
12 <%def name="page_nav()">
13 ${self.menu('admin')}
13 ${self.menu('admin')}
14 </%def>
14 </%def>
15 <%def name="main()">
15 <%def name="main()">
16 <div class="box">
16 <div class="box">
17 <!-- box / title -->
17 <!-- box / title -->
18 <div class="title">
18 <div class="title">
19 ${self.breadcrumbs()}
19 ${self.breadcrumbs()}
20 <ul class="links">
20 <ul class="links">
21 <li>
21 <li>
22 <span>${h.link_to(u'ADD NEW REPOSITORY',h.url('new_repo'))}</span>
22 <span>${h.link_to(u'ADD NEW REPOSITORY',h.url('new_repo'))}</span>
23 </li>
23 </li>
24 </ul>
24 </ul>
25 </div>
25 </div>
26 <!-- end box / title -->
26 <!-- end box / title -->
27 <div class="table">
27 <div class="table">
28 <table class="table_disp">
28 <table class="table_disp">
29 <tr class="header">
29 <tr class="header">
30 <th class="left">${_('Name')}</th>
30 <th class="left">${_('Name')}</th>
31 <th class="left">${_('Description')}</th>
31 <th class="left">${_('Description')}</th>
32 <th class="left">${_('Last change')}</th>
32 <th class="left">${_('Last change')}</th>
33 <th class="left">${_('Tip')}</th>
33 <th class="left">${_('Tip')}</th>
34 <th class="left">${_('Contact')}</th>
34 <th class="left">${_('Contact')}</th>
35 <th class="left">${_('action')}</th>
35 <th class="left">${_('action')}</th>
36 </tr>
36 </tr>
37 %for cnt,repo in enumerate(c.repos_list):
37 %for cnt,repo in enumerate(c.repos_list):
38 <tr class="parity${cnt%2}">
38 <tr class="parity${cnt%2}">
39 <td>
39 <td>
40 ## TYPE OF REPO
40 ## TYPE OF REPO
41 %if repo['repo'].dbrepo.repo_type =='hg':
41 %if repo['repo'].dbrepo.repo_type =='hg':
42 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/>
42 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url("/images/icons/hgicon.png")}"/>
43 %elif repo['repo'].dbrepo.repo_type =='git':
43 %elif repo['repo'].dbrepo.repo_type =='git':
44 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="/images/icons/giticon.png"/>
44 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url("/images/icons/giticon.png")}"/>
45 %else:
45 %else:
46
46
47 %endif
47 %endif
48
48
49 ## PRIVATE/PUBLIC REPO
49 ## PRIVATE/PUBLIC REPO
50 %if repo['repo'].dbrepo.private:
50 %if repo['repo'].dbrepo.private:
51 <img alt="${_('private')}" src="/images/icons/lock.png"/>
51 <img alt="${_('private')}" src="${h.url("/images/icons/lock.png")}"/>
52 %else:
52 %else:
53 <img alt="${_('public')}" src="/images/icons/lock_open.png"/>
53 <img alt="${_('public')}" src="${h.url("/images/icons/lock_open.png")}"/>
54 %endif
54 %endif
55 ${h.link_to(repo['name'],h.url('edit_repo',repo_name=repo['name']))}
55 ${h.link_to(repo['name'],h.url('edit_repo',repo_name=repo['name']))}
56
56
57 %if repo['repo'].dbrepo.fork:
57 %if repo['repo'].dbrepo.fork:
58 <a href="${h.url('summary_home',repo_name=repo['repo'].dbrepo.fork.repo_name)}">
58 <a href="${h.url('summary_home',repo_name=repo['repo'].dbrepo.fork.repo_name)}">
59 <img class="icon" alt="${_('public')}"
59 <img class="icon" alt="${_('public')}"
60 title="${_('Fork of')} ${repo['repo'].dbrepo.fork.repo_name}"
60 title="${_('Fork of')} ${repo['repo'].dbrepo.fork.repo_name}"
61 src="/images/icons/arrow_divide.png"/></a>
61 src="${h.url("/images/icons/arrow_divide.png")}"/></a>
62 %endif
62 %endif
63 </td>
63 </td>
64 <td title="${repo['description']}">${h.truncate(repo['description'],60)}</td>
64 <td title="${repo['description']}">${h.truncate(repo['description'],60)}</td>
65 <td>${h.age(repo['last_change'])}</td>
65 <td>${h.age(repo['last_change'])}</td>
66 <td>
66 <td>
67 %if repo['rev']>=0:
67 %if repo['rev']>=0:
68 ${h.link_to('r%s:%s' % (repo['rev'],h.short_id(repo['tip'])),
68 ${h.link_to('r%s:%s' % (repo['rev'],h.short_id(repo['tip'])),
69 h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']),
69 h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']),
70 class_="tooltip",
70 class_="tooltip",
71 tooltip_title=h.tooltip(repo['last_msg']))}
71 tooltip_title=h.tooltip(repo['last_msg']))}
72 %else:
72 %else:
73 ${_('No changesets yet')}
73 ${_('No changesets yet')}
74 %endif
74 %endif
75 </td>
75 </td>
76 <td title="${repo['contact']}">${h.person(repo['contact'])}</td>
76 <td title="${repo['contact']}">${h.person(repo['contact'])}</td>
77 <td>
77 <td>
78 ${h.form(url('repo', repo_name=repo['name']),method='delete')}
78 ${h.form(url('repo', repo_name=repo['name']),method='delete')}
79 ${h.submit('remove_%s' % repo['name'],'delete',class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")}
79 ${h.submit('remove_%s' % repo['name'],'delete',class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")}
80 ${h.end_form()}
80 ${h.end_form()}
81 </td>
81 </td>
82 </tr>
82 </tr>
83 %endfor
83 %endfor
84 </table>
84 </table>
85 </div>
85 </div>
86 </div>
86 </div>
87
87
88 </%def>
88 </%def>
@@ -1,210 +1,210 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.html"/>
2 <%inherit file="/base/base.html"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('My account')} ${c.rhodecode_user.username} - ${c.rhodecode_name}
5 ${_('My account')} ${c.rhodecode_user.username} - ${c.rhodecode_name}
6 </%def>
6 </%def>
7
7
8 <%def name="breadcrumbs_links()">
8 <%def name="breadcrumbs_links()">
9 ${_('My Account')}
9 ${_('My Account')}
10 </%def>
10 </%def>
11
11
12 <%def name="page_nav()">
12 <%def name="page_nav()">
13 ${self.menu('admin')}
13 ${self.menu('admin')}
14 </%def>
14 </%def>
15
15
16 <%def name="main()">
16 <%def name="main()">
17
17
18 <div class="box box-left">
18 <div class="box box-left">
19 <!-- box / title -->
19 <!-- box / title -->
20 <div class="title">
20 <div class="title">
21 ${self.breadcrumbs()}
21 ${self.breadcrumbs()}
22 </div>
22 </div>
23 <!-- end box / title -->
23 <!-- end box / title -->
24 <div class="ui-tabs-panel ui-widget-content ui-corner-bottom">
24 <div class="ui-tabs-panel ui-widget-content ui-corner-bottom">
25 ${h.form(url('admin_settings_my_account_update'),method='put')}
25 ${h.form(url('admin_settings_my_account_update'),method='put')}
26 <div class="form">
26 <div class="form">
27
27
28 <div class="field">
28 <div class="field">
29 <div class="gravatar_box">
29 <div class="gravatar_box">
30 <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(c.user.email)}"/></div>
30 <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(c.user.email)}"/></div>
31 <p>
31 <p>
32 <strong>Change your avatar at <a href="http://gravatar.com">gravatar.com</a></strong><br/>
32 <strong>Change your avatar at <a href="http://gravatar.com">gravatar.com</a></strong><br/>
33 ${_('Using')} ${c.user.email}
33 ${_('Using')} ${c.user.email}
34 </p>
34 </p>
35 </div>
35 </div>
36 </div>
36 </div>
37
37
38 <div class="fields">
38 <div class="fields">
39 <div class="field">
39 <div class="field">
40 <div class="label">
40 <div class="label">
41 <label for="username">${_('Username')}:</label>
41 <label for="username">${_('Username')}:</label>
42 </div>
42 </div>
43 <div class="input">
43 <div class="input">
44 ${h.text('username',class_="medium")}
44 ${h.text('username',class_="medium")}
45 </div>
45 </div>
46 </div>
46 </div>
47
47
48 <div class="field">
48 <div class="field">
49 <div class="label">
49 <div class="label">
50 <label for="new_password">${_('New password')}:</label>
50 <label for="new_password">${_('New password')}:</label>
51 </div>
51 </div>
52 <div class="input">
52 <div class="input">
53 ${h.password('new_password',class_="medium")}
53 ${h.password('new_password',class_="medium")}
54 </div>
54 </div>
55 </div>
55 </div>
56
56
57 <div class="field">
57 <div class="field">
58 <div class="label">
58 <div class="label">
59 <label for="name">${_('First Name')}:</label>
59 <label for="name">${_('First Name')}:</label>
60 </div>
60 </div>
61 <div class="input">
61 <div class="input">
62 ${h.text('name',class_="medium")}
62 ${h.text('name',class_="medium")}
63 </div>
63 </div>
64 </div>
64 </div>
65
65
66 <div class="field">
66 <div class="field">
67 <div class="label">
67 <div class="label">
68 <label for="lastname">${_('Last Name')}:</label>
68 <label for="lastname">${_('Last Name')}:</label>
69 </div>
69 </div>
70 <div class="input">
70 <div class="input">
71 ${h.text('lastname',class_="medium")}
71 ${h.text('lastname',class_="medium")}
72 </div>
72 </div>
73 </div>
73 </div>
74
74
75 <div class="field">
75 <div class="field">
76 <div class="label">
76 <div class="label">
77 <label for="email">${_('Email')}:</label>
77 <label for="email">${_('Email')}:</label>
78 </div>
78 </div>
79 <div class="input">
79 <div class="input">
80 ${h.text('email',class_="medium")}
80 ${h.text('email',class_="medium")}
81 </div>
81 </div>
82 </div>
82 </div>
83
83
84 <div class="buttons">
84 <div class="buttons">
85 ${h.submit('save','Save',class_="ui-button ui-widget ui-state-default ui-corner-all")}
85 ${h.submit('save','Save',class_="ui-button ui-widget ui-state-default ui-corner-all")}
86 ${h.reset('reset','Reset',class_="ui-button ui-widget ui-state-default ui-corner-all")}
86 ${h.reset('reset','Reset',class_="ui-button ui-widget ui-state-default ui-corner-all")}
87
87
88
88
89
89
90 </div>
90 </div>
91 </div>
91 </div>
92 </div>
92 </div>
93 ${h.end_form()}
93 ${h.end_form()}
94 </div>
94 </div>
95 </div>
95 </div>
96
96
97 <div class="box box-right">
97 <div class="box box-right">
98 <!-- box / title -->
98 <!-- box / title -->
99 <div class="title">
99 <div class="title">
100 <h5>${_('My repositories')}
100 <h5>${_('My repositories')}
101 <input class="top-right-rounded-corner top-left-rounded-corner bottom-left-rounded-corner bottom-right-rounded-corner" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/>
101 <input class="top-right-rounded-corner top-left-rounded-corner bottom-left-rounded-corner bottom-right-rounded-corner" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/>
102 </h5>
102 </h5>
103 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
103 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
104 <ul class="links">
104 <ul class="links">
105 <li>
105 <li>
106 <span>${h.link_to(_('ADD REPOSITORY'),h.url('admin_settings_create_repository'))}</span>
106 <span>${h.link_to(_('ADD REPOSITORY'),h.url('admin_settings_create_repository'))}</span>
107 </li>
107 </li>
108 </ul>
108 </ul>
109 %endif
109 %endif
110 </div>
110 </div>
111 <!-- end box / title -->
111 <!-- end box / title -->
112 <div class="table">
112 <div class="table">
113 <table>
113 <table>
114 <thead>
114 <thead>
115 <tr>
115 <tr>
116 <th class="left">${_('Name')}</th>
116 <th class="left">${_('Name')}</th>
117 <th class="left">${_('revision')}</th>
117 <th class="left">${_('revision')}</th>
118 <th colspan="2" class="left">${_('action')}</th>
118 <th colspan="2" class="left">${_('action')}</th>
119 </thead>
119 </thead>
120 <tbody>
120 <tbody>
121 %if c.user_repos:
121 %if c.user_repos:
122 %for repo in c.user_repos:
122 %for repo in c.user_repos:
123 <tr>
123 <tr>
124 <td>
124 <td>
125 %if repo['repo'].dbrepo.repo_type =='hg':
125 %if repo['repo'].dbrepo.repo_type =='hg':
126 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/>
126 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url("/images/icons/hgicon.png")}"/>
127 %elif repo['repo'].dbrepo.repo_type =='git':
127 %elif repo['repo'].dbrepo.repo_type =='git':
128 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="/images/icons/giticon.png"/>
128 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url("/images/icons/giticon.png")}"/>
129 %else:
129 %else:
130
130
131 %endif
131 %endif
132 %if repo['repo'].dbrepo.private:
132 %if repo['repo'].dbrepo.private:
133 <img class="icon" alt="${_('private')}" src="/images/icons/lock.png"/>
133 <img class="icon" alt="${_('private')}" src="${h.url("/images/icons/lock.png")}"/>
134 %else:
134 %else:
135 <img class="icon" alt="${_('public')}" src="/images/icons/lock_open.png"/>
135 <img class="icon" alt="${_('public')}" src="${h.url("/images/icons/lock_open.png")}"/>
136 %endif
136 %endif
137
137
138 ${h.link_to(repo['repo'].name, h.url('summary_home',repo_name=repo['repo'].name),class_="repo_name")}
138 ${h.link_to(repo['repo'].name, h.url('summary_home',repo_name=repo['repo'].name),class_="repo_name")}
139 %if repo['repo'].dbrepo.fork:
139 %if repo['repo'].dbrepo.fork:
140 <a href="${h.url('summary_home',repo_name=repo['repo'].dbrepo.fork.repo_name)}">
140 <a href="${h.url('summary_home',repo_name=repo['repo'].dbrepo.fork.repo_name)}">
141 <img class="icon" alt="${_('public')}"
141 <img class="icon" alt="${_('public')}"
142 title="${_('Fork of')} ${repo['repo'].dbrepo.fork.repo_name}"
142 title="${_('Fork of')} ${repo['repo'].dbrepo.fork.repo_name}"
143 src="/images/icons/arrow_divide.png"/></a>
143 src="${h.url("/images/icons/arrow_divide.png")}"/></a>
144 %endif
144 %endif
145 </td>
145 </td>
146 <td><span class="tooltip" tooltip_title="${repo['repo'].last_change}">${("r%s:%s") % (h.get_changeset_safe(repo['repo'],'tip').revision,h.short_id(h.get_changeset_safe(repo['repo'],'tip').raw_id))}</span></td>
146 <td><span class="tooltip" tooltip_title="${repo['repo'].last_change}">${("r%s:%s") % (h.get_changeset_safe(repo['repo'],'tip').revision,h.short_id(h.get_changeset_safe(repo['repo'],'tip').raw_id))}</span></td>
147 <td><a href="${h.url('repo_settings_home',repo_name=repo['repo'].name)}" title="${_('edit')}"><img class="icon" alt="${_('private')}" src="/images/icons/application_form_edit.png"/></a></td>
147 <td><a href="${h.url('repo_settings_home',repo_name=repo['repo'].name)}" title="${_('edit')}"><img class="icon" alt="${_('private')}" src="${h.url("/images/icons/application_form_edit.png")}"/></a></td>
148 <td>
148 <td>
149 ${h.form(url('repo_settings_delete', repo_name=repo['repo'].name),method='delete')}
149 ${h.form(url('repo_settings_delete', repo_name=repo['repo'].name),method='delete')}
150 ${h.submit('remove_%s' % repo['repo'].name,'',class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")}
150 ${h.submit('remove_%s' % repo['repo'].name,'',class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")}
151 ${h.end_form()}
151 ${h.end_form()}
152 </td>
152 </td>
153 </tr>
153 </tr>
154 %endfor
154 %endfor
155 %else:
155 %else:
156 ${_('No repositories yet')}
156 ${_('No repositories yet')}
157 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
157 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
158 ${h.link_to(_('create one now'),h.url('admin_settings_create_repository'))}
158 ${h.link_to(_('create one now'),h.url('admin_settings_create_repository'))}
159 %endif
159 %endif
160 %endif
160 %endif
161 </tbody>
161 </tbody>
162 </table>
162 </table>
163 </div>
163 </div>
164
164
165 </div>
165 </div>
166 <script type="text/javascript">
166 <script type="text/javascript">
167 var D = YAHOO.util.Dom;
167 var D = YAHOO.util.Dom;
168 var E = YAHOO.util.Event;
168 var E = YAHOO.util.Event;
169 var S = YAHOO.util.Selector;
169 var S = YAHOO.util.Selector;
170
170
171 var q_filter = D.get('q_filter');
171 var q_filter = D.get('q_filter');
172 var F = YAHOO.namespace('q_filter');
172 var F = YAHOO.namespace('q_filter');
173
173
174 E.on(q_filter,'click',function(){
174 E.on(q_filter,'click',function(){
175 q_filter.value = '';
175 q_filter.value = '';
176 });
176 });
177
177
178 F.filterTimeout = null;
178 F.filterTimeout = null;
179
179
180 F.updateFilter = function() {
180 F.updateFilter = function() {
181 // Reset timeout
181 // Reset timeout
182 F.filterTimeout = null;
182 F.filterTimeout = null;
183
183
184 var obsolete = [];
184 var obsolete = [];
185 var nodes = S.query('div.table tr td a.repo_name');
185 var nodes = S.query('div.table tr td a.repo_name');
186 var req = D.get('q_filter').value;
186 var req = D.get('q_filter').value;
187 for (n in nodes){
187 for (n in nodes){
188 D.setStyle(nodes[n].parentNode.parentNode,'display','')
188 D.setStyle(nodes[n].parentNode.parentNode,'display','')
189 }
189 }
190 if (req){
190 if (req){
191 for (n in nodes){
191 for (n in nodes){
192 if (nodes[n].innerHTML.toLowerCase().indexOf(req) == -1) {
192 if (nodes[n].innerHTML.toLowerCase().indexOf(req) == -1) {
193 obsolete.push(nodes[n]);
193 obsolete.push(nodes[n]);
194 }
194 }
195 }
195 }
196 if(obsolete){
196 if(obsolete){
197 for (n in obsolete){
197 for (n in obsolete){
198 D.setStyle(obsolete[n].parentNode.parentNode,'display','none');
198 D.setStyle(obsolete[n].parentNode.parentNode,'display','none');
199 }
199 }
200 }
200 }
201 }
201 }
202 }
202 }
203
203
204 E.on(q_filter,'keyup',function(e){
204 E.on(q_filter,'keyup',function(e){
205 clearTimeout(F.filterTimeout);
205 clearTimeout(F.filterTimeout);
206 setTimeout(F.updateFilter,600);
206 setTimeout(F.updateFilter,600);
207 });
207 });
208
208
209 </script>
209 </script>
210 </%def> No newline at end of file
210 </%def>
@@ -1,375 +1,375 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="mainhtml">
4 <head>
4 <head>
5 <title>${next.title()}</title>
5 <title>${next.title()}</title>
6 <link rel="icon" href="${h.url('/images/icons/database_gear.png')}" type="image/png" />
6 <link rel="icon" href="${h.url('/images/icons/database_gear.png')}" type="image/png" />
7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8 <meta name="robots" content="index, nofollow"/>
8 <meta name="robots" content="index, nofollow"/>
9 <!-- stylesheets -->
9 <!-- stylesheets -->
10 ${self.css()}
10 ${self.css()}
11 <!-- scripts -->
11 <!-- scripts -->
12 ${self.js()}
12 ${self.js()}
13 </head>
13 </head>
14 <body>
14 <body>
15 <!-- header -->
15 <!-- header -->
16 <div id="header">
16 <div id="header">
17 <!-- user -->
17 <!-- user -->
18 <ul id="logged-user">
18 <ul id="logged-user">
19 <li class="first">
19 <li class="first">
20 <div class="gravatar">
20 <div class="gravatar">
21 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,20)}" />
21 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,20)}" />
22 </div>
22 </div>
23 <div class="account">
23 <div class="account">
24 %if c.rhodecode_user.username == 'default':
24 %if c.rhodecode_user.username == 'default':
25 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
25 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
26 ${h.link_to('anonymous',h.url('register'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
26 ${h.link_to('anonymous',h.url('register'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
27 %else:
27 %else:
28 ${h.link_to('anonymous',h.url('#'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
28 ${h.link_to('anonymous',h.url('#'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
29 %endif
29 %endif
30
30
31 %else:
31 %else:
32 ${h.link_to(c.rhodecode_user.username,h.url('admin_settings_my_account'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
32 ${h.link_to(c.rhodecode_user.username,h.url('admin_settings_my_account'),title='%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname))}
33 %endif
33 %endif
34 </div>
34 </div>
35 </li>
35 </li>
36 <li>
36 <li>
37 <a href="${h.url('home')}">${_('Home')}</a>
37 <a href="${h.url('home')}">${_('Home')}</a>
38 </li>
38 </li>
39 %if c.rhodecode_user.username != 'default':
39 %if c.rhodecode_user.username != 'default':
40 <li>
40 <li>
41 <a href="${h.url('journal')}">${_('Journal')}</a>
41 <a href="${h.url('journal')}">${_('Journal')}</a>
42 ##(${c.unread_journal})</a>
42 ##(${c.unread_journal})</a>
43 </li>
43 </li>
44 %endif
44 %endif
45 %if c.rhodecode_user.username == 'default':
45 %if c.rhodecode_user.username == 'default':
46 <li class="last highlight">${h.link_to(u'Login',h.url('login_home'))}</li>
46 <li class="last highlight">${h.link_to(u'Login',h.url('login_home'))}</li>
47 %else:
47 %else:
48 <li class="last highlight">${h.link_to(u'Log Out',h.url('logout_home'))}</li>
48 <li class="last highlight">${h.link_to(u'Log Out',h.url('logout_home'))}</li>
49 %endif
49 %endif
50 </ul>
50 </ul>
51 <!-- end user -->
51 <!-- end user -->
52 <div id="header-inner" class="title top-left-rounded-corner top-right-rounded-corner">
52 <div id="header-inner" class="title top-left-rounded-corner top-right-rounded-corner">
53 <!-- logo -->
53 <!-- logo -->
54 <div id="logo">
54 <div id="logo">
55 <h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1>
55 <h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1>
56 </div>
56 </div>
57 <!-- end logo -->
57 <!-- end logo -->
58 <!-- menu -->
58 <!-- menu -->
59 ${self.page_nav()}
59 ${self.page_nav()}
60 <!-- quick -->
60 <!-- quick -->
61 </div>
61 </div>
62 </div>
62 </div>
63 <!-- end header -->
63 <!-- end header -->
64
64
65 <!-- CONTENT -->
65 <!-- CONTENT -->
66 <div id="content">
66 <div id="content">
67 <div class="flash_msg">
67 <div class="flash_msg">
68 <% messages = h.flash.pop_messages() %>
68 <% messages = h.flash.pop_messages() %>
69 % if messages:
69 % if messages:
70 <ul id="flash-messages">
70 <ul id="flash-messages">
71 % for message in messages:
71 % for message in messages:
72 <li class="${message.category}_msg">${message}</li>
72 <li class="${message.category}_msg">${message}</li>
73 % endfor
73 % endfor
74 </ul>
74 </ul>
75 % endif
75 % endif
76 </div>
76 </div>
77 <div id="main">
77 <div id="main">
78 ${next.main()}
78 ${next.main()}
79 </div>
79 </div>
80 </div>
80 </div>
81 <!-- END CONTENT -->
81 <!-- END CONTENT -->
82
82
83 <!-- footer -->
83 <!-- footer -->
84 <div id="footer">
84 <div id="footer">
85 <div id="footer-inner" class="title bottom-left-rounded-corner bottom-right-rounded-corner">
85 <div id="footer-inner" class="title bottom-left-rounded-corner bottom-right-rounded-corner">
86 <div>
86 <div>
87 <p class="footer-link">${h.link_to(_('Submit a bug'),h.url('bugtracker'))}</p>
87 <p class="footer-link">${h.link_to(_('Submit a bug'),h.url('bugtracker'))}</p>
88 <p class="footer-link">${h.link_to(_('GPL license'),h.url('gpl_license'))}</p>
88 <p class="footer-link">${h.link_to(_('GPL license'),h.url('gpl_license'))}</p>
89 <p>RhodeCode ${c.rhodecode_version} &copy; 2010-2011 by Marcin Kuzminski</p>
89 <p>RhodeCode ${c.rhodecode_version} &copy; 2010-2011 by Marcin Kuzminski</p>
90 </div>
90 </div>
91 </div>
91 </div>
92 <script type="text/javascript">
92 <script type="text/javascript">
93 function tooltip_activate(){
93 function tooltip_activate(){
94 ${h.tooltip.activate()}
94 ${h.tooltip.activate()}
95 }
95 }
96 tooltip_activate();
96 tooltip_activate();
97 </script>
97 </script>
98 </div>
98 </div>
99 <!-- end footer -->
99 <!-- end footer -->
100 </body>
100 </body>
101
101
102 </html>
102 </html>
103
103
104 ### MAKO DEFS ###
104 ### MAKO DEFS ###
105 <%def name="page_nav()">
105 <%def name="page_nav()">
106 ${self.menu()}
106 ${self.menu()}
107 </%def>
107 </%def>
108
108
109 <%def name="menu(current=None)">
109 <%def name="menu(current=None)">
110 <%
110 <%
111 def is_current(selected):
111 def is_current(selected):
112 if selected == current:
112 if selected == current:
113 return h.literal('class="current"')
113 return h.literal('class="current"')
114 %>
114 %>
115 %if current not in ['home','admin']:
115 %if current not in ['home','admin']:
116 ##REGULAR MENU
116 ##REGULAR MENU
117 <ul id="quick">
117 <ul id="quick">
118 <!-- repo switcher -->
118 <!-- repo switcher -->
119 <li>
119 <li>
120 <a id="repo_switcher" title="${_('Switch repository')}" href="#">
120 <a id="repo_switcher" title="${_('Switch repository')}" href="#">
121 <span class="icon">
121 <span class="icon">
122 <img src="${h.url("/images/icons/database.png")}" alt="${_('Products')}" />
122 <img src="${h.url("/images/icons/database.png")}" alt="${_('Products')}" />
123 </span>
123 </span>
124 <span>&darr;</span>
124 <span>&darr;</span>
125 </a>
125 </a>
126 <ul class="repo_switcher">
126 <ul class="repo_switcher">
127 %for repo in c.cached_repo_list:
127 %for repo in c.cached_repo_list:
128
128
129 %if repo['repo'].dbrepo.private:
129 %if repo['repo'].dbrepo.private:
130 <li><img src="/images/icons/lock.png" alt="${_('Private repository')}" class="repo_switcher_type"/>${h.link_to(repo['repo'].name,h.url('summary_home',repo_name=repo['repo'].name),class_="%s" % repo['repo'].dbrepo.repo_type)}</li>
130 <li><img src="${h.url("/images/icons/lock.png")}" alt="${_('Private repository')}" class="repo_switcher_type"/>${h.link_to(repo['repo'].name,h.url('summary_home',repo_name=repo['repo'].name),class_="%s" % repo['repo'].dbrepo.repo_type)}</li>
131 %else:
131 %else:
132 <li><img src="${h.url("/images/icons/lock_open.png")}" alt="${_('Public repository')}" class="repo_switcher_type" />${h.link_to(repo['repo'].name,h.url('summary_home',repo_name=repo['repo'].name),class_="%s" % repo['repo'].dbrepo.repo_type)}</li>
132 <li><img src="${h.url("/images/icons/lock_open.png")}" alt="${_('Public repository')}" class="repo_switcher_type" />${h.link_to(repo['repo'].name,h.url('summary_home',repo_name=repo['repo'].name),class_="%s" % repo['repo'].dbrepo.repo_type)}</li>
133 %endif
133 %endif
134 %endfor
134 %endfor
135 </ul>
135 </ul>
136 </li>
136 </li>
137
137
138 <li ${is_current('summary')}>
138 <li ${is_current('summary')}>
139 <a title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}">
139 <a title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}">
140 <span class="icon">
140 <span class="icon">
141 <img src="${h.url("/images/icons/clipboard_16.png")}" alt="${_('Summary')}" />
141 <img src="${h.url("/images/icons/clipboard_16.png")}" alt="${_('Summary')}" />
142 </span>
142 </span>
143 <span>${_('Summary')}</span>
143 <span>${_('Summary')}</span>
144 </a>
144 </a>
145 </li>
145 </li>
146 ##<li ${is_current('shortlog')}>
146 ##<li ${is_current('shortlog')}>
147 ## <a title="${_('Shortlog')}" href="${h.url('shortlog_home',repo_name=c.repo_name)}">
147 ## <a title="${_('Shortlog')}" href="${h.url('shortlog_home',repo_name=c.repo_name)}">
148 ## <span class="icon">
148 ## <span class="icon">
149 ## <img src="${h.url("/images/icons/application_view_list.png")}" alt="${_('Shortlog')}" />
149 ## <img src="${h.url("/images/icons/application_view_list.png")}" alt="${_('Shortlog')}" />
150 ## </span>
150 ## </span>
151 ## <span>${_('Shortlog')}</span>
151 ## <span>${_('Shortlog')}</span>
152 ## </a>
152 ## </a>
153 ##</li>
153 ##</li>
154 <li ${is_current('changelog')}>
154 <li ${is_current('changelog')}>
155 <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}">
155 <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}">
156 <span class="icon">
156 <span class="icon">
157 <img src="${h.url("/images/icons/time.png")}" alt="${_('Changelog')}" />
157 <img src="${h.url("/images/icons/time.png")}" alt="${_('Changelog')}" />
158 </span>
158 </span>
159 <span>${_('Changelog')}</span>
159 <span>${_('Changelog')}</span>
160 </a>
160 </a>
161 </li>
161 </li>
162
162
163 <li ${is_current('switch_to')}>
163 <li ${is_current('switch_to')}>
164 <a title="${_('Switch to')}" href="#">
164 <a title="${_('Switch to')}" href="#">
165 <span class="icon">
165 <span class="icon">
166 <img src="${h.url("/images/icons/arrow_switch.png")}" alt="${_('Switch to')}" />
166 <img src="${h.url("/images/icons/arrow_switch.png")}" alt="${_('Switch to')}" />
167 </span>
167 </span>
168 <span>${_('Switch to')}</span>
168 <span>${_('Switch to')}</span>
169 </a>
169 </a>
170 <ul>
170 <ul>
171 <li>
171 <li>
172 ${h.link_to('%s (%s)' % (_('branches'),len(c.repository_branches.values()),),h.url('branches_home',repo_name=c.repo_name),class_='branches childs')}
172 ${h.link_to('%s (%s)' % (_('branches'),len(c.repository_branches.values()),),h.url('branches_home',repo_name=c.repo_name),class_='branches childs')}
173 <ul>
173 <ul>
174 %if c.repository_branches.values():
174 %if c.repository_branches.values():
175 %for cnt,branch in enumerate(c.repository_branches.items()):
175 %for cnt,branch in enumerate(c.repository_branches.items()):
176 <li>${h.link_to('%s - %s' % (branch[0],h.short_id(branch[1])),h.url('files_home',repo_name=c.repo_name,revision=branch[1]))}</li>
176 <li>${h.link_to('%s - %s' % (branch[0],h.short_id(branch[1])),h.url('files_home',repo_name=c.repo_name,revision=branch[1]))}</li>
177 %endfor
177 %endfor
178 %else:
178 %else:
179 <li>${h.link_to(_('There are no branches yet'),'#')}</li>
179 <li>${h.link_to(_('There are no branches yet'),'#')}</li>
180 %endif
180 %endif
181 </ul>
181 </ul>
182 </li>
182 </li>
183 <li>
183 <li>
184 ${h.link_to('%s (%s)' % (_('tags'),len(c.repository_tags.values()),),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
184 ${h.link_to('%s (%s)' % (_('tags'),len(c.repository_tags.values()),),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
185 <ul>
185 <ul>
186 %if c.repository_tags.values():
186 %if c.repository_tags.values():
187 %for cnt,tag in enumerate(c.repository_tags.items()):
187 %for cnt,tag in enumerate(c.repository_tags.items()):
188 <li>${h.link_to('%s - %s' % (tag[0],h.short_id(tag[1])),h.url('files_home',repo_name=c.repo_name,revision=tag[1]))}</li>
188 <li>${h.link_to('%s - %s' % (tag[0],h.short_id(tag[1])),h.url('files_home',repo_name=c.repo_name,revision=tag[1]))}</li>
189 %endfor
189 %endfor
190 %else:
190 %else:
191 <li>${h.link_to(_('There are no tags yet'),'#')}</li>
191 <li>${h.link_to(_('There are no tags yet'),'#')}</li>
192 %endif
192 %endif
193 </ul>
193 </ul>
194 </li>
194 </li>
195 </ul>
195 </ul>
196 </li>
196 </li>
197 <li ${is_current('files')}>
197 <li ${is_current('files')}>
198 <a title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}">
198 <a title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}">
199 <span class="icon">
199 <span class="icon">
200 <img src="${h.url("/images/icons/file.png")}" alt="${_('Files')}" />
200 <img src="${h.url("/images/icons/file.png")}" alt="${_('Files')}" />
201 </span>
201 </span>
202 <span>${_('Files')}</span>
202 <span>${_('Files')}</span>
203 </a>
203 </a>
204 </li>
204 </li>
205
205
206 <li ${is_current('options')}>
206 <li ${is_current('options')}>
207 <a title="${_('Options')}" href="#">
207 <a title="${_('Options')}" href="#">
208 <span class="icon">
208 <span class="icon">
209 <img src="${h.url("/images/icons/table_gear.png")}" alt="${_('Admin')}" />
209 <img src="${h.url("/images/icons/table_gear.png")}" alt="${_('Admin')}" />
210 </span>
210 </span>
211 <span>${_('Options')}</span>
211 <span>${_('Options')}</span>
212 </a>
212 </a>
213 <ul>
213 <ul>
214 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
214 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
215 %if h.HasPermissionAll('hg.admin')('access settings on repository'):
215 %if h.HasPermissionAll('hg.admin')('access settings on repository'):
216 <li>${h.link_to(_('settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li>
216 <li>${h.link_to(_('settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li>
217 %else:
217 %else:
218 <li>${h.link_to(_('settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
218 <li>${h.link_to(_('settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
219 %endif
219 %endif
220 %endif
220 %endif
221 <li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li>
221 <li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li>
222 <li>${h.link_to(_('search'),h.url('search_repo',search_repo=c.repo_name),class_='search')}</li>
222 <li>${h.link_to(_('search'),h.url('search_repo',search_repo=c.repo_name),class_='search')}</li>
223
223
224 %if h.HasPermissionAll('hg.admin')('access admin main page'):
224 %if h.HasPermissionAll('hg.admin')('access admin main page'):
225 <li>
225 <li>
226 ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')}
226 ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')}
227 <%def name="admin_menu()">
227 <%def name="admin_menu()">
228 <ul>
228 <ul>
229 <li>${h.link_to(_('journal'),h.url('admin_home'),class_='journal')}</li>
229 <li>${h.link_to(_('journal'),h.url('admin_home'),class_='journal')}</li>
230 <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li>
230 <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li>
231 <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li>
231 <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li>
232 <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li>
232 <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li>
233 <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li>
233 <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li>
234 <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li>
234 <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li>
235 </ul>
235 </ul>
236 </%def>
236 </%def>
237
237
238 ${admin_menu()}
238 ${admin_menu()}
239 </li>
239 </li>
240 %endif
240 %endif
241
241
242 </ul>
242 </ul>
243 </li>
243 </li>
244
244
245 <li>
245 <li>
246 <a title="${_('Followers')}" href="#">
246 <a title="${_('Followers')}" href="#">
247 <span class="icon_short">
247 <span class="icon_short">
248 <img src="${h.url("/images/icons/heart.png")}" alt="${_('Followers')}" />
248 <img src="${h.url("/images/icons/heart.png")}" alt="${_('Followers')}" />
249 </span>
249 </span>
250 <span class="short">${c.repository_followers}</span>
250 <span class="short">${c.repository_followers}</span>
251 </a>
251 </a>
252 </li>
252 </li>
253 <li>
253 <li>
254 <a title="${_('Forks')}" href="#">
254 <a title="${_('Forks')}" href="#">
255 <span class="icon_short">
255 <span class="icon_short">
256 <img src="${h.url("/images/icons/arrow_divide.png")}" alt="${_('Forks')}" />
256 <img src="${h.url("/images/icons/arrow_divide.png")}" alt="${_('Forks')}" />
257 </span>
257 </span>
258 <span class="short">${c.repository_forks}</span>
258 <span class="short">${c.repository_forks}</span>
259 </a>
259 </a>
260 </li>
260 </li>
261
261
262
262
263
263
264 </ul>
264 </ul>
265 %else:
265 %else:
266 ##ROOT MENU
266 ##ROOT MENU
267 <ul id="quick">
267 <ul id="quick">
268 <li>
268 <li>
269 <a title="${_('Home')}" href="${h.url('home')}">
269 <a title="${_('Home')}" href="${h.url('home')}">
270 <span class="icon">
270 <span class="icon">
271 <img src="${h.url("/images/icons/home_16.png")}" alt="${_('Home')}" />
271 <img src="${h.url("/images/icons/home_16.png")}" alt="${_('Home')}" />
272 </span>
272 </span>
273 <span>${_('Home')}</span>
273 <span>${_('Home')}</span>
274 </a>
274 </a>
275 </li>
275 </li>
276 %if c.rhodecode_user.username != 'default':
276 %if c.rhodecode_user.username != 'default':
277 <li>
277 <li>
278 <a title="${_('Journal')}" href="${h.url('journal')}">
278 <a title="${_('Journal')}" href="${h.url('journal')}">
279 <span class="icon">
279 <span class="icon">
280 <img src="${h.url("/images/icons/book.png")}" alt="${_('Journal')}" />
280 <img src="${h.url("/images/icons/book.png")}" alt="${_('Journal')}" />
281 </span>
281 </span>
282 <span>${_('Journal')}</span>
282 <span>${_('Journal')}</span>
283 </a>
283 </a>
284 </li>
284 </li>
285 %endif
285 %endif
286 <li>
286 <li>
287 <a title="${_('Search')}" href="${h.url('search')}">
287 <a title="${_('Search')}" href="${h.url('search')}">
288 <span class="icon">
288 <span class="icon">
289 <img src="${h.url("/images/icons/search_16.png")}" alt="${_('Search')}" />
289 <img src="${h.url("/images/icons/search_16.png")}" alt="${_('Search')}" />
290 </span>
290 </span>
291 <span>${_('Search')}</span>
291 <span>${_('Search')}</span>
292 </a>
292 </a>
293 </li>
293 </li>
294
294
295 %if h.HasPermissionAll('hg.admin')('access admin main page'):
295 %if h.HasPermissionAll('hg.admin')('access admin main page'):
296 <li ${is_current('admin')}>
296 <li ${is_current('admin')}>
297 <a title="${_('Admin')}" href="${h.url('admin_home')}">
297 <a title="${_('Admin')}" href="${h.url('admin_home')}">
298 <span class="icon">
298 <span class="icon">
299 <img src="${h.url("/images/icons/cog_edit.png")}" alt="${_('Admin')}" />
299 <img src="${h.url("/images/icons/cog_edit.png")}" alt="${_('Admin')}" />
300 </span>
300 </span>
301 <span>${_('Admin')}</span>
301 <span>${_('Admin')}</span>
302 </a>
302 </a>
303 ${admin_menu()}
303 ${admin_menu()}
304 </li>
304 </li>
305 %endif
305 %endif
306 </ul>
306 </ul>
307 %endif
307 %endif
308 </%def>
308 </%def>
309
309
310
310
311 <%def name="css()">
311 <%def name="css()">
312 <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css')}" media="screen" />
312 <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css')}" media="screen" />
313 <link rel="stylesheet" type="text/css" href="${h.url('/css/pygments.css')}" />
313 <link rel="stylesheet" type="text/css" href="${h.url('/css/pygments.css')}" />
314 <link rel="stylesheet" type="text/css" href="${h.url('/css/diff.css')}" />
314 <link rel="stylesheet" type="text/css" href="${h.url('/css/diff.css')}" />
315 </%def>
315 </%def>
316
316
317 <%def name="js()">
317 <%def name="js()">
318 ##<script type="text/javascript" src="${h.url('/js/yui/utilities/utilities.js')}"></script>
318 ##<script type="text/javascript" src="${h.url('/js/yui/utilities/utilities.js')}"></script>
319 ##<script type="text/javascript" src="${h.url('/js/yui/container/container.js')}"></script>
319 ##<script type="text/javascript" src="${h.url('/js/yui/container/container.js')}"></script>
320 ##<script type="text/javascript" src="${h.url('/js/yui/datasource/datasource.js')}"></script>
320 ##<script type="text/javascript" src="${h.url('/js/yui/datasource/datasource.js')}"></script>
321 ##<script type="text/javascript" src="${h.url('/js/yui/autocomplete/autocomplete.js')}"></script>
321 ##<script type="text/javascript" src="${h.url('/js/yui/autocomplete/autocomplete.js')}"></script>
322 ##<script type="text/javascript" src="${h.url('/js/yui/selector/selector-min.js')}"></script>
322 ##<script type="text/javascript" src="${h.url('/js/yui/selector/selector-min.js')}"></script>
323
323
324 <script type="text/javascript" src="${h.url('/js/yui2a.js')}"></script>
324 <script type="text/javascript" src="${h.url('/js/yui2a.js')}"></script>
325 <!--[if IE]><script language="javascript" type="text/javascript" src="${h.url('/js/excanvas.min.js')}"></script><![endif]-->
325 <!--[if IE]><script language="javascript" type="text/javascript" src="${h.url('/js/excanvas.min.js')}"></script><![endif]-->
326 <script type="text/javascript" src="${h.url('/js/yui.flot.js')}"></script>
326 <script type="text/javascript" src="${h.url('/js/yui.flot.js')}"></script>
327
327
328 <script type="text/javascript">
328 <script type="text/javascript">
329 var base_url = "${h.url('toggle_following')}";
329 var base_url = "${h.url('toggle_following')}";
330 var YUC = YAHOO.util.Connect;
330 var YUC = YAHOO.util.Connect;
331 var YUD = YAHOO.util.Dom;
331 var YUD = YAHOO.util.Dom;
332 var YUE = YAHOO.util.Event;
332 var YUE = YAHOO.util.Event;
333
333
334 function onSuccess(target){
334 function onSuccess(target){
335
335
336 var f = YUD.get(target.id);
336 var f = YUD.get(target.id);
337 if(f.getAttribute('class')=='follow'){
337 if(f.getAttribute('class')=='follow'){
338 f.setAttribute('class','following');
338 f.setAttribute('class','following');
339 f.setAttribute('title',"${_('Stop following this repository')}");
339 f.setAttribute('title',"${_('Stop following this repository')}");
340 }
340 }
341 else{
341 else{
342 f.setAttribute('class','follow');
342 f.setAttribute('class','follow');
343 f.setAttribute('title',"${_('Start following this repository')}");
343 f.setAttribute('title',"${_('Start following this repository')}");
344 }
344 }
345 }
345 }
346
346
347 function toggleFollowingUser(fallows_user_id,token){
347 function toggleFollowingUser(fallows_user_id,token){
348 args = 'follows_user_id='+fallows_user_id;
348 args = 'follows_user_id='+fallows_user_id;
349 args+= '&amp;auth_token='+token;
349 args+= '&amp;auth_token='+token;
350 YUC.asyncRequest('POST',base_url,{
350 YUC.asyncRequest('POST',base_url,{
351 success:function(o){
351 success:function(o){
352 onSuccess();
352 onSuccess();
353 }
353 }
354 },args); return false;
354 },args); return false;
355 }
355 }
356
356
357 function toggleFollowingRepo(target,fallows_repo_id,token){
357 function toggleFollowingRepo(target,fallows_repo_id,token){
358
358
359 args = 'follows_repo_id='+fallows_repo_id;
359 args = 'follows_repo_id='+fallows_repo_id;
360 args+= '&amp;auth_token='+token;
360 args+= '&amp;auth_token='+token;
361 YUC.asyncRequest('POST',base_url,{
361 YUC.asyncRequest('POST',base_url,{
362 success:function(o){
362 success:function(o){
363 onSuccess(target);
363 onSuccess(target);
364 }
364 }
365 },args); return false;
365 },args); return false;
366 }
366 }
367 </script>
367 </script>
368
368
369 </%def>
369 </%def>
370
370
371 <%def name="breadcrumbs()">
371 <%def name="breadcrumbs()">
372 <div class="breadcrumbs">
372 <div class="breadcrumbs">
373 ${self.breadcrumbs_links()}
373 ${self.breadcrumbs_links()}
374 </div>
374 </div>
375 </%def> No newline at end of file
375 </%def>
@@ -1,136 +1,136 b''
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 <%def name="title()">
5 <%def name="title()">
6 ${c.repo_name} ${_('Changelog')} - ${c.rhodecode_name}
6 ${c.repo_name} ${_('Changelog')} - ${c.rhodecode_name}
7 </%def>
7 </%def>
8
8
9 <%def name="breadcrumbs_links()">
9 <%def name="breadcrumbs_links()">
10 ${h.link_to(u'Home',h.url('/'))}
10 ${h.link_to(u'Home',h.url('/'))}
11 &raquo;
11 &raquo;
12 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
12 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
13 &raquo;
13 &raquo;
14 ${_('Changelog')} - ${_('showing ')} ${c.size if c.size <= c.total_cs else c.total_cs} ${_('out of')} ${c.total_cs} ${_('revisions')}
14 ${_('Changelog')} - ${_('showing ')} ${c.size if c.size <= c.total_cs else c.total_cs} ${_('out of')} ${c.total_cs} ${_('revisions')}
15 </%def>
15 </%def>
16
16
17 <%def name="page_nav()">
17 <%def name="page_nav()">
18 ${self.menu('changelog')}
18 ${self.menu('changelog')}
19 </%def>
19 </%def>
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 % if c.pagination:
28 % if c.pagination:
29 <div id="graph">
29 <div id="graph">
30 <div id="graph_nodes">
30 <div id="graph_nodes">
31 <canvas id="graph_canvas"></canvas>
31 <canvas id="graph_canvas"></canvas>
32 </div>
32 </div>
33 <div id="graph_content">
33 <div id="graph_content">
34 <div class="container_header">
34 <div class="container_header">
35
35
36 ${h.form(h.url.current(),method='get')}
36 ${h.form(h.url.current(),method='get')}
37 <div class="info_box">
37 <div class="info_box">
38 <span>${_('Show')}:</span>
38 <span>${_('Show')}:</span>
39 ${h.text('size',size=1,value=c.size)}
39 ${h.text('size',size=1,value=c.size)}
40 <span>${_('revisions')}</span>
40 <span>${_('revisions')}</span>
41 ${h.submit('set',_('set'))}
41 ${h.submit('set',_('set'))}
42 </div>
42 </div>
43 ${h.end_form()}
43 ${h.end_form()}
44
44
45 </div>
45 </div>
46 %for cnt,cs in enumerate(c.pagination):
46 %for cnt,cs in enumerate(c.pagination):
47 <div id="chg_${cnt+1}" class="container">
47 <div id="chg_${cnt+1}" class="container">
48 <div class="left">
48 <div class="left">
49 <div class="date">${_('commit')} ${cs.revision}: ${h.short_id(cs.raw_id)}@${cs.date}</div>
49 <div class="date">${_('commit')} ${cs.revision}: ${h.short_id(cs.raw_id)}@${cs.date}</div>
50 <div class="author">
50 <div class="author">
51 <div class="gravatar">
51 <div class="gravatar">
52 <img alt="gravatar" src="${h.gravatar_url(h.email(cs.author),20)}"/>
52 <img alt="gravatar" src="${h.gravatar_url(h.email(cs.author),20)}"/>
53 </div>
53 </div>
54 <span>${h.person(cs.author)}</span><br/>
54 <span>${h.person(cs.author)}</span><br/>
55 <span><a href="mailto:${h.email_or_none(cs.author)}">${h.email_or_none(cs.author)}</a></span><br/>
55 <span><a href="mailto:${h.email_or_none(cs.author)}">${h.email_or_none(cs.author)}</a></span><br/>
56 </div>
56 </div>
57 <div class="message">${h.link_to(h.wrap_paragraphs(cs.message),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
57 <div class="message">${h.link_to(h.wrap_paragraphs(cs.message),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
58 </div>
58 </div>
59 <div class="right">
59 <div class="right">
60 <div class="changes">
60 <div class="changes">
61
61
62 <%
62 <%
63 def changed_tooltip(cs):
63 def changed_tooltip(cs):
64 if cs:
64 if cs:
65 pref = ': '
65 pref = ': '
66 suf = ''
66 suf = ''
67 if len(cs) > 30:
67 if len(cs) > 30:
68 suf='<br/>'+_(' and %s more') % (len(cs) - 30)
68 suf='<br/>'+_(' and %s more') % (len(cs) - 30)
69 return pref+'<br/> '.join([x.path for x in cs[:30]]) + suf
69 return pref+'<br/> '.join([x.path for x in cs[:30]]) + suf
70 else:
70 else:
71 return ': '+_('No Files')
71 return ': '+_('No Files')
72 %>
72 %>
73
73
74 <span class="removed tooltip" tooltip_title="${_('removed')}${h.literal(changed_tooltip(cs.removed))}">${len(cs.removed)}</span>
74 <span class="removed tooltip" tooltip_title="${_('removed')}${h.literal(changed_tooltip(cs.removed))}">${len(cs.removed)}</span>
75 <span class="changed tooltip" tooltip_title="${_('changed')}${h.literal(changed_tooltip(cs.changed))}">${len(cs.changed)}</span>
75 <span class="changed tooltip" tooltip_title="${_('changed')}${h.literal(changed_tooltip(cs.changed))}">${len(cs.changed)}</span>
76 <span class="added tooltip" tooltip_title="${_('added')}${h.literal(changed_tooltip(cs.added))}">${len(cs.added)}</span>
76 <span class="added tooltip" tooltip_title="${_('added')}${h.literal(changed_tooltip(cs.added))}">${len(cs.added)}</span>
77 </div>
77 </div>
78 %if len(cs.parents)>1:
78 %if len(cs.parents)>1:
79 <div class="merge">
79 <div class="merge">
80 ${_('merge')}<img alt="merge" src="/images/icons/arrow_join.png"/>
80 ${_('merge')}<img alt="merge" src="${h.url("/images/icons/arrow_join.png")}"/>
81 </div>
81 </div>
82 %endif
82 %endif
83 %if cs.parents:
83 %if cs.parents:
84 %for p_cs in reversed(cs.parents):
84 %for p_cs in reversed(cs.parents):
85 <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(h.short_id(p_cs.raw_id),
85 <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(h.short_id(p_cs.raw_id),
86 h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}
86 h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}
87 </div>
87 </div>
88 %endfor
88 %endfor
89 %else:
89 %else:
90 <div class="parent">${_('No parents')}</div>
90 <div class="parent">${_('No parents')}</div>
91 %endif
91 %endif
92
92
93 <span class="logtags">
93 <span class="logtags">
94 %if cs.branch:
94 %if cs.branch:
95 <span class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}">
95 <span class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}">
96 ${h.link_to(cs.branch,h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span>
96 ${h.link_to(cs.branch,h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span>
97 %endif
97 %endif
98 %for tag in cs.tags:
98 %for tag in cs.tags:
99 <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}">
99 <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}">
100 ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span>
100 ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span>
101 %endfor
101 %endfor
102 </span>
102 </span>
103 </div>
103 </div>
104 </div>
104 </div>
105
105
106 %endfor
106 %endfor
107 <div class="pagination-wh pagination-left">
107 <div class="pagination-wh pagination-left">
108 ${c.pagination.pager('$link_previous ~2~ $link_next')}
108 ${c.pagination.pager('$link_previous ~2~ $link_next')}
109 </div>
109 </div>
110 </div>
110 </div>
111 </div>
111 </div>
112
112
113 <script type="text/javascript" src="${h.url("/js/graph.js")}"></script>
113 <script type="text/javascript" src="${h.url("/js/graph.js")}"></script>
114 <script type="text/javascript">
114 <script type="text/javascript">
115 YAHOO.util.Event.onDOMReady(function(){
115 YAHOO.util.Event.onDOMReady(function(){
116 function set_canvas() {
116 function set_canvas() {
117 var c = document.getElementById('graph_nodes');
117 var c = document.getElementById('graph_nodes');
118 var t = document.getElementById('graph_content');
118 var t = document.getElementById('graph_content');
119 canvas = document.getElementById('graph_canvas');
119 canvas = document.getElementById('graph_canvas');
120 var div_h = t.clientHeight;
120 var div_h = t.clientHeight;
121 c.style.height=div_h+'px';
121 c.style.height=div_h+'px';
122 canvas.setAttribute('height',div_h);
122 canvas.setAttribute('height',div_h);
123 canvas.setAttribute('width',160);
123 canvas.setAttribute('width',160);
124 };
124 };
125 set_canvas();
125 set_canvas();
126 var jsdata = ${c.jsdata|n};
126 var jsdata = ${c.jsdata|n};
127 var r = new BranchRenderer();
127 var r = new BranchRenderer();
128 r.render(jsdata);
128 r.render(jsdata);
129 });
129 });
130 </script>
130 </script>
131 %else:
131 %else:
132 ${_('There are no changes yet')}
132 ${_('There are no changes yet')}
133 %endif
133 %endif
134 </div>
134 </div>
135 </div>
135 </div>
136 </%def> No newline at end of file
136 </%def>
@@ -1,124 +1,124 b''
1 <%inherit file="/base/base.html"/>
1 <%inherit file="/base/base.html"/>
2
2
3 <%def name="title()">
3 <%def name="title()">
4 ${c.repo_name} ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)} - ${c.rhodecode_name}
4 ${c.repo_name} ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)} - ${c.rhodecode_name}
5 </%def>
5 </%def>
6
6
7 <%def name="breadcrumbs_links()">
7 <%def name="breadcrumbs_links()">
8 ${h.link_to(u'Home',h.url('/'))}
8 ${h.link_to(u'Home',h.url('/'))}
9 &raquo;
9 &raquo;
10 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
10 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
11 &raquo;
11 &raquo;
12 ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)}
12 ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)}
13 </%def>
13 </%def>
14
14
15 <%def name="page_nav()">
15 <%def name="page_nav()">
16 ${self.menu('changelog')}
16 ${self.menu('changelog')}
17 </%def>
17 </%def>
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 <div class="table">
25 <div class="table">
26 <div id="body" class="diffblock">
26 <div id="body" class="diffblock">
27 <div class="code-header">
27 <div class="code-header">
28 <div>
28 <div>
29 ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)}
29 ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)}
30 &raquo; <span>${h.link_to(_('raw diff'),
30 &raquo; <span>${h.link_to(_('raw diff'),
31 h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show'))}</span>
31 h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show'))}</span>
32 &raquo; <span>${h.link_to(_('download diff'),
32 &raquo; <span>${h.link_to(_('download diff'),
33 h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download'))}</span>
33 h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download'))}</span>
34 </div>
34 </div>
35 </div>
35 </div>
36 </div>
36 </div>
37 <div id="changeset_content">
37 <div id="changeset_content">
38 <div class="container">
38 <div class="container">
39 <div class="left">
39 <div class="left">
40 <div class="date">${_('commit')} ${c.changeset.revision}: ${h.short_id(c.changeset.raw_id)}@${c.changeset.date}</div>
40 <div class="date">${_('commit')} ${c.changeset.revision}: ${h.short_id(c.changeset.raw_id)}@${c.changeset.date}</div>
41 <div class="author">
41 <div class="author">
42 <div class="gravatar">
42 <div class="gravatar">
43 <img alt="gravatar" src="${h.gravatar_url(h.email(c.changeset.author),20)}"/>
43 <img alt="gravatar" src="${h.gravatar_url(h.email(c.changeset.author),20)}"/>
44 </div>
44 </div>
45 <span>${h.person(c.changeset.author)}</span><br/>
45 <span>${h.person(c.changeset.author)}</span><br/>
46 <span><a href="mailto:${h.email_or_none(c.changeset.author)}">${h.email_or_none(c.changeset.author)}</a></span><br/>
46 <span><a href="mailto:${h.email_or_none(c.changeset.author)}">${h.email_or_none(c.changeset.author)}</a></span><br/>
47 </div>
47 </div>
48 <div class="message">${h.link_to(h.wrap_paragraphs(c.changeset.message),h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</div>
48 <div class="message">${h.link_to(h.wrap_paragraphs(c.changeset.message),h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</div>
49 </div>
49 </div>
50 <div class="right">
50 <div class="right">
51 <div class="changes">
51 <div class="changes">
52 <span class="removed" title="${_('removed')}">${len(c.changeset.removed)}</span>
52 <span class="removed" title="${_('removed')}">${len(c.changeset.removed)}</span>
53 <span class="changed" title="${_('changed')}">${len(c.changeset.changed)}</span>
53 <span class="changed" title="${_('changed')}">${len(c.changeset.changed)}</span>
54 <span class="added" title="${_('added')}">${len(c.changeset.added)}</span>
54 <span class="added" title="${_('added')}">${len(c.changeset.added)}</span>
55 </div>
55 </div>
56 %if len(c.changeset.parents)>1:
56 %if len(c.changeset.parents)>1:
57 <div class="merge">
57 <div class="merge">
58 ${_('merge')}<img alt="merge" src="/images/icons/arrow_join.png"/>
58 ${_('merge')}<img alt="merge" src="${h.url("/images/icons/arrow_join.png")}"/>
59 </div>
59 </div>
60 %endif
60 %endif
61
61
62 %if c.changeset.parents:
62 %if c.changeset.parents:
63 %for p_cs in reversed(c.changeset.parents):
63 %for p_cs in reversed(c.changeset.parents):
64 <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(h.short_id(p_cs.raw_id),
64 <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(h.short_id(p_cs.raw_id),
65 h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}
65 h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}
66 </div>
66 </div>
67 %endfor
67 %endfor
68 %else:
68 %else:
69 <div class="parent">${_('No parents')}</div>
69 <div class="parent">${_('No parents')}</div>
70 %endif
70 %endif
71 <span class="logtags">
71 <span class="logtags">
72 <span class="branchtag" title="${'%s %s' % (_('branch'),c.changeset.branch)}">
72 <span class="branchtag" title="${'%s %s' % (_('branch'),c.changeset.branch)}">
73 ${h.link_to(c.changeset.branch,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span>
73 ${h.link_to(c.changeset.branch,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span>
74 %for tag in c.changeset.tags:
74 %for tag in c.changeset.tags:
75 <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}">
75 <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}">
76 ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span>
76 ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span>
77 %endfor
77 %endfor
78 </span>
78 </span>
79 </div>
79 </div>
80 </div>
80 </div>
81 <span style="font-size:1.1em;font-weight: bold">${_('Files affected')}</span>
81 <span style="font-size:1.1em;font-weight: bold">${_('Files affected')}</span>
82 <div class="cs_files">
82 <div class="cs_files">
83 %for change,filenode,diff,cs1,cs2 in c.changes:
83 %for change,filenode,diff,cs1,cs2 in c.changes:
84 <div class="cs_${change}">${h.link_to(filenode.path,h.url.current(anchor='CHANGE-%s'%filenode.path))}</div>
84 <div class="cs_${change}">${h.link_to(filenode.path,h.url.current(anchor='CHANGE-%s'%filenode.path))}</div>
85 %endfor
85 %endfor
86 </div>
86 </div>
87 </div>
87 </div>
88
88
89 </div>
89 </div>
90
90
91 %for change,filenode,diff,cs1,cs2 in c.changes:
91 %for change,filenode,diff,cs1,cs2 in c.changes:
92 %if change !='removed':
92 %if change !='removed':
93 <div style="clear:both;height:10px"></div>
93 <div style="clear:both;height:10px"></div>
94 <div id="body" class="diffblock">
94 <div id="body" class="diffblock">
95 <div id="${'CHANGE-%s'%filenode.path}" class="code-header">
95 <div id="${'CHANGE-%s'%filenode.path}" class="code-header">
96 <div class="changeset_header">
96 <div class="changeset_header">
97 <span class="changeset_file">
97 <span class="changeset_file">
98 ${h.link_to_if(change!='removed',filenode.path,h.url('files_home',repo_name=c.repo_name,
98 ${h.link_to_if(change!='removed',filenode.path,h.url('files_home',repo_name=c.repo_name,
99 revision=filenode.changeset.raw_id,f_path=filenode.path))}
99 revision=filenode.changeset.raw_id,f_path=filenode.path))}
100 </span>
100 </span>
101 %if 1:
101 %if 1:
102 &raquo; <span>${h.link_to(_('diff'),
102 &raquo; <span>${h.link_to(_('diff'),
103 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='diff'))}</span>
103 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='diff'))}</span>
104 &raquo; <span>${h.link_to(_('raw diff'),
104 &raquo; <span>${h.link_to(_('raw diff'),
105 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='raw'))}</span>
105 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='raw'))}</span>
106 &raquo; <span>${h.link_to(_('download diff'),
106 &raquo; <span>${h.link_to(_('download diff'),
107 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='download'))}</span>
107 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='download'))}</span>
108 %endif
108 %endif
109 </div>
109 </div>
110 </div>
110 </div>
111 <div class="code-body">
111 <div class="code-body">
112 %if diff:
112 %if diff:
113 ${diff|n}
113 ${diff|n}
114 %else:
114 %else:
115 ${_('No changes in this file')}
115 ${_('No changes in this file')}
116 %endif
116 %endif
117 </div>
117 </div>
118 </div>
118 </div>
119 %endif
119 %endif
120 %endfor
120 %endfor
121 </div>
121 </div>
122 </div>
122 </div>
123
123
124 </%def> No newline at end of file
124 </%def>
@@ -1,168 +1,168 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base/base.html"/>
2 <%inherit file="base/base.html"/>
3 <%def name="title()">
3 <%def name="title()">
4 ${_('Dashboard')} - ${c.rhodecode_name}
4 ${_('Dashboard')} - ${c.rhodecode_name}
5 </%def>
5 </%def>
6 <%def name="breadcrumbs()">
6 <%def name="breadcrumbs()">
7 ${c.rhodecode_name}
7 ${c.rhodecode_name}
8 </%def>
8 </%def>
9 <%def name="page_nav()">
9 <%def name="page_nav()">
10 ${self.menu('home')}
10 ${self.menu('home')}
11 </%def>
11 </%def>
12 <%def name="main()">
12 <%def name="main()">
13 <%def name="get_sort(name)">
13 <%def name="get_sort(name)">
14 <%name_slug = name.lower().replace(' ','_') %>
14 <%name_slug = name.lower().replace(' ','_') %>
15
15
16 %if name_slug == c.sort_slug:
16 %if name_slug == c.sort_slug:
17 %if c.sort_by.startswith('-'):
17 %if c.sort_by.startswith('-'):
18 <a href="?sort=${name_slug}">${name}&uarr;</a>
18 <a href="?sort=${name_slug}">${name}&uarr;</a>
19 %else:
19 %else:
20 <a href="?sort=-${name_slug}">${name}&darr;</a>
20 <a href="?sort=-${name_slug}">${name}&darr;</a>
21 %endif:
21 %endif:
22 %else:
22 %else:
23 <a href="?sort=${name_slug}">${name}</a>
23 <a href="?sort=${name_slug}">${name}</a>
24 %endif
24 %endif
25 </%def>
25 </%def>
26
26
27 <div class="box">
27 <div class="box">
28 <!-- box / title -->
28 <!-- box / title -->
29 <div class="title">
29 <div class="title">
30 <h5>${_('Dashboard')}
30 <h5>${_('Dashboard')}
31 <input class="top-right-rounded-corner top-left-rounded-corner bottom-left-rounded-corner bottom-right-rounded-corner" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/>
31 <input class="top-right-rounded-corner top-left-rounded-corner bottom-left-rounded-corner bottom-right-rounded-corner" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/>
32 </h5>
32 </h5>
33 %if c.rhodecode_user.username != 'default':
33 %if c.rhodecode_user.username != 'default':
34 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
34 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
35 <ul class="links">
35 <ul class="links">
36 <li>
36 <li>
37 <span>${h.link_to(_('ADD NEW REPOSITORY'),h.url('admin_settings_create_repository'))}</span>
37 <span>${h.link_to(_('ADD NEW REPOSITORY'),h.url('admin_settings_create_repository'))}</span>
38 </li>
38 </li>
39 </ul>
39 </ul>
40 %endif
40 %endif
41 %endif
41 %endif
42 </div>
42 </div>
43 <!-- end box / title -->
43 <!-- end box / title -->
44 <div class="table">
44 <div class="table">
45 <table>
45 <table>
46 <thead>
46 <thead>
47 <tr>
47 <tr>
48 <th class="left">${get_sort(_('Name'))}</th>
48 <th class="left">${get_sort(_('Name'))}</th>
49 <th class="left">${get_sort(_('Description'))}</th>
49 <th class="left">${get_sort(_('Description'))}</th>
50 <th class="left">${get_sort(_('Last change'))}</th>
50 <th class="left">${get_sort(_('Last change'))}</th>
51 <th class="left">${get_sort(_('Tip'))}</th>
51 <th class="left">${get_sort(_('Tip'))}</th>
52 <th class="left">${get_sort(_('Owner'))}</th>
52 <th class="left">${get_sort(_('Owner'))}</th>
53 <th class="left">${_('RSS')}</th>
53 <th class="left">${_('RSS')}</th>
54 <th class="left">${_('Atom')}</th>
54 <th class="left">${_('Atom')}</th>
55 </tr>
55 </tr>
56 </thead>
56 </thead>
57 <tbody>
57 <tbody>
58 %for cnt,repo in enumerate(c.repos_list):
58 %for cnt,repo in enumerate(c.repos_list):
59 <tr class="parity${cnt%2}">
59 <tr class="parity${cnt%2}">
60 <td>
60 <td>
61 <div style="white-space: nowrap">
61 <div style="white-space: nowrap">
62 ## TYPE OF REPO
62 ## TYPE OF REPO
63 %if repo['repo'].dbrepo.repo_type =='hg':
63 %if repo['repo'].dbrepo.repo_type =='hg':
64 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/>
64 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url("/images/icons/hgicon.png")}"/>
65 %elif repo['repo'].dbrepo.repo_type =='git':
65 %elif repo['repo'].dbrepo.repo_type =='git':
66 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="/images/icons/giticon.png"/>
66 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url("/images/icons/giticon.png")}"/>
67 %else:
67 %else:
68
68
69 %endif
69 %endif
70
70
71 ##PRIVATE/PUBLIC
71 ##PRIVATE/PUBLIC
72 %if repo['repo'].dbrepo.private:
72 %if repo['repo'].dbrepo.private:
73 <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="/images/icons/lock.png"/>
73 <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url("/images/icons/lock.png")}"/>
74 %else:
74 %else:
75 <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="/images/icons/lock_open.png"/>
75 <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url("/images/icons/lock_open.png")}"/>
76 %endif
76 %endif
77
77
78 ##NAME
78 ##NAME
79 ${h.link_to(repo['name'],
79 ${h.link_to(repo['name'],
80 h.url('summary_home',repo_name=repo['name']),class_="repo_name")}
80 h.url('summary_home',repo_name=repo['name']),class_="repo_name")}
81 %if repo['repo'].dbrepo.fork:
81 %if repo['repo'].dbrepo.fork:
82 <a href="${h.url('summary_home',repo_name=repo['repo'].dbrepo.fork.repo_name)}">
82 <a href="${h.url('summary_home',repo_name=repo['repo'].dbrepo.fork.repo_name)}">
83 <img class="icon" alt="${_('fork')}"
83 <img class="icon" alt="${_('fork')}"
84 title="${_('Fork of')} ${repo['repo'].dbrepo.fork.repo_name}"
84 title="${_('Fork of')} ${repo['repo'].dbrepo.fork.repo_name}"
85 src="/images/icons/arrow_divide.png"/></a>
85 src="${h.url("/images/icons/arrow_divide.png")}"/></a>
86 %endif
86 %endif
87 </div>
87 </div>
88 </td>
88 </td>
89 ##DESCRIPTION
89 ##DESCRIPTION
90 <td><span class="tooltip" tooltip_title="${h.tooltip(repo['description'])}">
90 <td><span class="tooltip" tooltip_title="${h.tooltip(repo['description'])}">
91 ${h.truncate(repo['description'],60)}</span>
91 ${h.truncate(repo['description'],60)}</span>
92 </td>
92 </td>
93 ##LAST CHANGE
93 ##LAST CHANGE
94 <td>
94 <td>
95 <span class="tooltip" tooltip_title="${repo['last_change']}">
95 <span class="tooltip" tooltip_title="${repo['last_change']}">
96 ${h.age(repo['last_change'])}</span>
96 ${h.age(repo['last_change'])}</span>
97 </td>
97 </td>
98 <td>
98 <td>
99 %if repo['rev']>=0:
99 %if repo['rev']>=0:
100 ${h.link_to('r%s:%s' % (repo['rev'],h.short_id(repo['tip'])),
100 ${h.link_to('r%s:%s' % (repo['rev'],h.short_id(repo['tip'])),
101 h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']),
101 h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']),
102 class_="tooltip",
102 class_="tooltip",
103 tooltip_title=h.tooltip(repo['last_msg']))}
103 tooltip_title=h.tooltip(repo['last_msg']))}
104 %else:
104 %else:
105 ${_('No changesets yet')}
105 ${_('No changesets yet')}
106 %endif
106 %endif
107 </td>
107 </td>
108 <td title="${repo['contact']}">${h.person(repo['contact'])}</td>
108 <td title="${repo['contact']}">${h.person(repo['contact'])}</td>
109 <td>
109 <td>
110 <a title="${_('Subscribe to %s rss feed')%repo['name']}" class="rss_icon" href="${h.url('rss_feed_home',repo_name=repo['name'])}"></a>
110 <a title="${_('Subscribe to %s rss feed')%repo['name']}" class="rss_icon" href="${h.url('rss_feed_home',repo_name=repo['name'])}"></a>
111 </td>
111 </td>
112 <td>
112 <td>
113 <a title="${_('Subscribe to %s atom feed')%repo['name']}" class="atom_icon" href="${h.url('atom_feed_home',repo_name=repo['name'])}"></a>
113 <a title="${_('Subscribe to %s atom feed')%repo['name']}" class="atom_icon" href="${h.url('atom_feed_home',repo_name=repo['name'])}"></a>
114 </td>
114 </td>
115 </tr>
115 </tr>
116 %endfor
116 %endfor
117 </tbody>
117 </tbody>
118 </table>
118 </table>
119 </div>
119 </div>
120 </div>
120 </div>
121
121
122
122
123 <script type="text/javascript">
123 <script type="text/javascript">
124 var D = YAHOO.util.Dom;
124 var D = YAHOO.util.Dom;
125 var E = YAHOO.util.Event;
125 var E = YAHOO.util.Event;
126 var S = YAHOO.util.Selector;
126 var S = YAHOO.util.Selector;
127
127
128 var q_filter = D.get('q_filter');
128 var q_filter = D.get('q_filter');
129 var F = YAHOO.namespace('q_filter');
129 var F = YAHOO.namespace('q_filter');
130
130
131 E.on(q_filter,'click',function(){
131 E.on(q_filter,'click',function(){
132 q_filter.value = '';
132 q_filter.value = '';
133 });
133 });
134
134
135 F.filterTimeout = null;
135 F.filterTimeout = null;
136
136
137 F.updateFilter = function() {
137 F.updateFilter = function() {
138 // Reset timeout
138 // Reset timeout
139 F.filterTimeout = null;
139 F.filterTimeout = null;
140
140
141 var obsolete = [];
141 var obsolete = [];
142 var nodes = S.query('div.table tr td div a.repo_name');
142 var nodes = S.query('div.table tr td div a.repo_name');
143 var req = D.get('q_filter').value;
143 var req = D.get('q_filter').value;
144 for (n in nodes){
144 for (n in nodes){
145 D.setStyle(nodes[n].parentNode.parentNode.parentNode,'display','')
145 D.setStyle(nodes[n].parentNode.parentNode.parentNode,'display','')
146 }
146 }
147 if (req){
147 if (req){
148 for (n in nodes){
148 for (n in nodes){
149 if (nodes[n].innerHTML.toLowerCase().indexOf(req) == -1) {
149 if (nodes[n].innerHTML.toLowerCase().indexOf(req) == -1) {
150 obsolete.push(nodes[n]);
150 obsolete.push(nodes[n]);
151 }
151 }
152 }
152 }
153 if(obsolete){
153 if(obsolete){
154 for (n in obsolete){
154 for (n in obsolete){
155 D.setStyle(obsolete[n].parentNode.parentNode.parentNode,'display','none');
155 D.setStyle(obsolete[n].parentNode.parentNode.parentNode,'display','none');
156 }
156 }
157 }
157 }
158 }
158 }
159 }
159 }
160
160
161 E.on(q_filter,'keyup',function(e){
161 E.on(q_filter,'keyup',function(e){
162 clearTimeout(F.filterTimeout);
162 clearTimeout(F.filterTimeout);
163 setTimeout(F.updateFilter,600);
163 setTimeout(F.updateFilter,600);
164 });
164 });
165
165
166 </script>
166 </script>
167
167
168 </%def>
168 </%def>
@@ -1,92 +1,92 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base/base.html"/>
2 <%inherit file="base/base.html"/>
3 <%def name="title()">
3 <%def name="title()">
4 ${_('Journal')} - ${c.rhodecode_name}
4 ${_('Journal')} - ${c.rhodecode_name}
5 </%def>
5 </%def>
6 <%def name="breadcrumbs()">
6 <%def name="breadcrumbs()">
7 ${c.rhodecode_name}
7 ${c.rhodecode_name}
8 </%def>
8 </%def>
9 <%def name="page_nav()">
9 <%def name="page_nav()">
10 ${self.menu('home')}
10 ${self.menu('home')}
11 </%def>
11 </%def>
12 <%def name="main()">
12 <%def name="main()">
13
13
14 <div class="box box-left">
14 <div class="box box-left">
15 <!-- box / title -->
15 <!-- box / title -->
16 <div class="title">
16 <div class="title">
17 <h5>${_('Journal')}</h5>
17 <h5>${_('Journal')}</h5>
18 </div>
18 </div>
19 <div>
19 <div>
20 %if c.journal:
20 %if c.journal:
21 %for entry in c.journal:
21 %for entry in c.journal:
22 <div style="padding:10px">
22 <div style="padding:10px">
23 <div class="gravatar">
23 <div class="gravatar">
24 <img alt="gravatar" src="${h.gravatar_url(entry.user.email)}"/>
24 <img alt="gravatar" src="${h.gravatar_url(entry.user.email)}"/>
25 </div>
25 </div>
26 <div>${entry.user.name} ${entry.user.lastname}</div>
26 <div>${entry.user.name} ${entry.user.lastname}</div>
27 <div style="padding-left: 45px;padding-top:5px;min-height:20px">${h.action_parser(entry)}</div>
27 <div style="padding-left: 45px;padding-top:5px;min-height:20px">${h.action_parser(entry)}</div>
28 <div style="float: left; padding-top: 8px;padding-left:18px">
28 <div style="float: left; padding-top: 8px;padding-left:18px">
29 ${h.action_parser_icon(entry)}
29 ${h.action_parser_icon(entry)}
30 </div>
30 </div>
31 <div style="margin-left: 45px;padding-top: 10px">
31 <div style="margin-left: 45px;padding-top: 10px">
32 <span style="font-weight: bold;font-size: 1.1em">
32 <span style="font-weight: bold;font-size: 1.1em">
33 %if entry.repository:
33 %if entry.repository:
34 ${h.link_to(entry.repository.repo_name,
34 ${h.link_to(entry.repository.repo_name,
35 h.url('summary_home',repo_name=entry.repository.repo_name))}
35 h.url('summary_home',repo_name=entry.repository.repo_name))}
36 %else:
36 %else:
37 ${entry.repository_name}
37 ${entry.repository_name}
38 %endif
38 %endif
39 </span> - <span title="${entry.action_date}">${h.age(entry.action_date)}</span>
39 </span> - <span title="${entry.action_date}">${h.age(entry.action_date)}</span>
40 </div>
40 </div>
41 </div>
41 </div>
42 <div style="clear:both;border-bottom:1px dashed #DDD;padding:3px 3px;margin:0px 10px 0px 10px"></div>
42 <div style="clear:both;border-bottom:1px dashed #DDD;padding:3px 3px;margin:0px 10px 0px 10px"></div>
43 %endfor
43 %endfor
44 %else:
44 %else:
45 ${_('No entries yet')}
45 ${_('No entries yet')}
46 %endif
46 %endif
47 </div>
47 </div>
48 </div>
48 </div>
49
49
50 <div class="box box-right">
50 <div class="box box-right">
51 <!-- box / title -->
51 <!-- box / title -->
52 <div class="title">
52 <div class="title">
53 <h5>${_('Following')}</h5>
53 <h5>${_('Following')}</h5>
54 </div>
54 </div>
55 <div>
55 <div>
56 %if c.following:
56 %if c.following:
57 %for entry in c.following:
57 %for entry in c.following:
58 <div class="currently_following">
58 <div class="currently_following">
59 %if entry.follows_user_id:
59 %if entry.follows_user_id:
60 <img title="${_('following user')}" alt="${_('user')}" src="/images/icons/user.png"/>
60 <img title="${_('following user')}" alt="${_('user')}" src="${h.url("/images/icons/user.png")}"/>
61 ${entry.follows_user.full_contact}
61 ${entry.follows_user.full_contact}
62 %endif
62 %endif
63
63
64 %if entry.follows_repo_id:
64 %if entry.follows_repo_id:
65
65
66 %if entry.follows_repository.private:
66 %if entry.follows_repository.private:
67 <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="/images/icons/lock.png"/>
67 <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url("/images/icons/lock.png")}"/>
68 %else:
68 %else:
69 <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="/images/icons/lock_open.png"/>
69 <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url("/images/icons/lock_open.png")}"/>
70 %endif
70 %endif
71
71
72 ${h.link_to(entry.follows_repository.repo_name,h.url('summary_home',
72 ${h.link_to(entry.follows_repository.repo_name,h.url('summary_home',
73 repo_name=entry.follows_repository.repo_name))}
73 repo_name=entry.follows_repository.repo_name))}
74
74
75 %endif
75 %endif
76 </div>
76 </div>
77 %endfor
77 %endfor
78 %else:
78 %else:
79 ${_('You are not following any users or repositories')}
79 ${_('You are not following any users or repositories')}
80 %endif
80 %endif
81 </div>
81 </div>
82 </div>
82 </div>
83
83
84 <script type="text/javascript">
84 <script type="text/javascript">
85 YUE.on(YUD.getElementsByClassName('show_more'),'click',function(e){
85 YUE.on(YUD.getElementsByClassName('show_more'),'click',function(e){
86 var el = e.target;
86 var el = e.target;
87 YUD.setStyle(YUD.get(el.id.substring(1)),'display','');
87 YUD.setStyle(YUD.get(el.id.substring(1)),'display','');
88 YUD.setStyle(el.parentNode,'display','none');
88 YUD.setStyle(el.parentNode,'display','none');
89 });
89 });
90 </script>
90 </script>
91
91
92 </%def>
92 </%def>
@@ -1,643 +1,643 b''
1 <%inherit file="/base/base.html"/>
1 <%inherit file="/base/base.html"/>
2
2
3 <%def name="title()">
3 <%def name="title()">
4 ${c.repo_name} ${_('Summary')} - ${c.rhodecode_name}
4 ${c.repo_name} ${_('Summary')} - ${c.rhodecode_name}
5 </%def>
5 </%def>
6
6
7 <%def name="breadcrumbs_links()">
7 <%def name="breadcrumbs_links()">
8 ${h.link_to(u'Home',h.url('/'))}
8 ${h.link_to(u'Home',h.url('/'))}
9 &raquo;
9 &raquo;
10 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
10 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
11 &raquo;
11 &raquo;
12 ${_('summary')}
12 ${_('summary')}
13 </%def>
13 </%def>
14
14
15 <%def name="page_nav()">
15 <%def name="page_nav()">
16 ${self.menu('summary')}
16 ${self.menu('summary')}
17 </%def>
17 </%def>
18
18
19 <%def name="main()">
19 <%def name="main()">
20 <div class="box box-left">
20 <div class="box box-left">
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="form">
26 <div class="form">
27 <div class="fields">
27 <div class="fields">
28
28
29 <div class="field">
29 <div class="field">
30 <div class="label">
30 <div class="label">
31 <label>${_('Name')}:</label>
31 <label>${_('Name')}:</label>
32 </div>
32 </div>
33 <div class="input-short">
33 <div class="input-short">
34 %if c.repo_info.dbrepo.repo_type =='hg':
34 %if c.repo_info.dbrepo.repo_type =='hg':
35 <img style="margin-bottom:2px" class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/>
35 <img style="margin-bottom:2px" class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url("/images/icons/hgicon.png")}"/>
36 %endif
36 %endif
37 %if c.repo_info.dbrepo.repo_type =='git':
37 %if c.repo_info.dbrepo.repo_type =='git':
38 <img style="margin-bottom:2px" class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="/images/icons/giticon.png"/>
38 <img style="margin-bottom:2px" class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url("/images/icons/giticon.png")}"/>
39 %endif
39 %endif
40
40
41 %if c.repo_info.dbrepo.private:
41 %if c.repo_info.dbrepo.private:
42 <img style="margin-bottom:2px" class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="/images/icons/lock.png"/>
42 <img style="margin-bottom:2px" class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url("/images/icons/lock.png")}"/>
43 %else:
43 %else:
44 <img style="margin-bottom:2px" class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="/images/icons/lock_open.png"/>
44 <img style="margin-bottom:2px" class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url("/images/icons/lock_open.png")}"/>
45 %endif
45 %endif
46 <span style="font-size: 1.6em;font-weight: bold;vertical-align: baseline;">${c.repo_info.name}</span>
46 <span style="font-size: 1.6em;font-weight: bold;vertical-align: baseline;">${c.repo_info.name}</span>
47 %if c.rhodecode_user.username != 'default':
47 %if c.rhodecode_user.username != 'default':
48 %if c.following:
48 %if c.following:
49 <span id="follow_toggle" class="following" title="${_('Stop following this repository')}"
49 <span id="follow_toggle" class="following" title="${_('Stop following this repository')}"
50 onclick="javascript:toggleFollowingRepo(this,${c.repo_info.dbrepo.repo_id},'${str(h.get_token())}')">
50 onclick="javascript:toggleFollowingRepo(this,${c.repo_info.dbrepo.repo_id},'${str(h.get_token())}')">
51 </span>
51 </span>
52 %else:
52 %else:
53 <span id="follow_toggle" class="follow" title="${_('Start following this repository')}"
53 <span id="follow_toggle" class="follow" title="${_('Start following this repository')}"
54 onclick="javascript:toggleFollowingRepo(this,${c.repo_info.dbrepo.repo_id},'${str(h.get_token())}')">
54 onclick="javascript:toggleFollowingRepo(this,${c.repo_info.dbrepo.repo_id},'${str(h.get_token())}')">
55 </span>
55 </span>
56 %endif
56 %endif
57 %endif:
57 %endif:
58 <br/>
58 <br/>
59 %if c.repo_info.dbrepo.fork:
59 %if c.repo_info.dbrepo.fork:
60 <span style="margin-top:5px">
60 <span style="margin-top:5px">
61 <a href="${h.url('summary_home',repo_name=c.repo_info.dbrepo.fork.repo_name)}">
61 <a href="${h.url('summary_home',repo_name=c.repo_info.dbrepo.fork.repo_name)}">
62 <img class="icon" alt="${_('public')}"
62 <img class="icon" alt="${_('public')}"
63 title="${_('Fork of')} ${c.repo_info.dbrepo.fork.repo_name}"
63 title="${_('Fork of')} ${c.repo_info.dbrepo.fork.repo_name}"
64 src="${h.url("/images/icons/arrow_divide.png")}"/>
64 src="${h.url("/images/icons/arrow_divide.png")}"/>
65 ${_('Fork of')} ${c.repo_info.dbrepo.fork.repo_name}
65 ${_('Fork of')} ${c.repo_info.dbrepo.fork.repo_name}
66 </a>
66 </a>
67 </span>
67 </span>
68 %endif
68 %endif
69 </div>
69 </div>
70 </div>
70 </div>
71
71
72
72
73 <div class="field">
73 <div class="field">
74 <div class="label">
74 <div class="label">
75 <label>${_('Description')}:</label>
75 <label>${_('Description')}:</label>
76 </div>
76 </div>
77 <div class="input-short">
77 <div class="input-short">
78 ${c.repo_info.dbrepo.description}
78 ${c.repo_info.dbrepo.description}
79 </div>
79 </div>
80 </div>
80 </div>
81
81
82
82
83 <div class="field">
83 <div class="field">
84 <div class="label">
84 <div class="label">
85 <label>${_('Contact')}:</label>
85 <label>${_('Contact')}:</label>
86 </div>
86 </div>
87 <div class="input-short">
87 <div class="input-short">
88 <div class="gravatar">
88 <div class="gravatar">
89 <img alt="gravatar" src="${h.gravatar_url(c.repo_info.dbrepo.user.email)}"/>
89 <img alt="gravatar" src="${h.gravatar_url(c.repo_info.dbrepo.user.email)}"/>
90 </div>
90 </div>
91 ${_('Username')}: ${c.repo_info.dbrepo.user.username}<br/>
91 ${_('Username')}: ${c.repo_info.dbrepo.user.username}<br/>
92 ${_('Name')}: ${c.repo_info.dbrepo.user.name} ${c.repo_info.dbrepo.user.lastname}<br/>
92 ${_('Name')}: ${c.repo_info.dbrepo.user.name} ${c.repo_info.dbrepo.user.lastname}<br/>
93 ${_('Email')}: <a href="mailto:${c.repo_info.dbrepo.user.email}">${c.repo_info.dbrepo.user.email}</a>
93 ${_('Email')}: <a href="mailto:${c.repo_info.dbrepo.user.email}">${c.repo_info.dbrepo.user.email}</a>
94 </div>
94 </div>
95 </div>
95 </div>
96
96
97 <div class="field">
97 <div class="field">
98 <div class="label">
98 <div class="label">
99 <label>${_('Last change')}:</label>
99 <label>${_('Last change')}:</label>
100 </div>
100 </div>
101 <div class="input-short">
101 <div class="input-short">
102 ${h.age(c.repo_info.last_change)} - ${c.repo_info.last_change}
102 ${h.age(c.repo_info.last_change)} - ${c.repo_info.last_change}
103 ${_('by')} ${h.get_changeset_safe(c.repo_info,'tip').author}
103 ${_('by')} ${h.get_changeset_safe(c.repo_info,'tip').author}
104
104
105 </div>
105 </div>
106 </div>
106 </div>
107
107
108 <div class="field">
108 <div class="field">
109 <div class="label">
109 <div class="label">
110 <label>${_('Clone url')}:</label>
110 <label>${_('Clone url')}:</label>
111 </div>
111 </div>
112 <div class="input-short">
112 <div class="input-short">
113 <input type="text" id="clone_url" readonly="readonly" value="hg clone ${c.clone_repo_url}" size="70"/>
113 <input type="text" id="clone_url" readonly="readonly" value="hg clone ${c.clone_repo_url}" size="70"/>
114 </div>
114 </div>
115 </div>
115 </div>
116
116
117 <div class="field">
117 <div class="field">
118 <div class="label">
118 <div class="label">
119 <label>${_('Trending source files')}:</label>
119 <label>${_('Trending source files')}:</label>
120 </div>
120 </div>
121 <div class="input-short">
121 <div class="input-short">
122 <div id="lang_stats">
122 <div id="lang_stats">
123
123
124 </div>
124 </div>
125 <script type="text/javascript">
125 <script type="text/javascript">
126 YUE.onDOMReady(function(e){
126 YUE.onDOMReady(function(e){
127 id = 'clone_url';
127 id = 'clone_url';
128 YUE.on(id,'click',function(e){
128 YUE.on(id,'click',function(e){
129 YUD.get('clone_url').select();
129 YUD.get('clone_url').select();
130 })
130 })
131 })
131 })
132 var data = ${c.trending_languages|n};
132 var data = ${c.trending_languages|n};
133 var total = 0;
133 var total = 0;
134 var no_data = true;
134 var no_data = true;
135 for (k in data){
135 for (k in data){
136 total += data[k];
136 total += data[k];
137 no_data = false;
137 no_data = false;
138 }
138 }
139 var tbl = document.createElement('table');
139 var tbl = document.createElement('table');
140 tbl.setAttribute('class','trending_language_tbl');
140 tbl.setAttribute('class','trending_language_tbl');
141 var cnt =0;
141 var cnt =0;
142 for (k in data){
142 for (k in data){
143 cnt+=1;
143 cnt+=1;
144 var hide = cnt>2;
144 var hide = cnt>2;
145 var tr = document.createElement('tr');
145 var tr = document.createElement('tr');
146 if (hide){
146 if (hide){
147 tr.setAttribute('style','display:none');
147 tr.setAttribute('style','display:none');
148 tr.setAttribute('class','stats_hidden');
148 tr.setAttribute('class','stats_hidden');
149 }
149 }
150 var percentage = Math.round((data[k]/total*100),2);
150 var percentage = Math.round((data[k]/total*100),2);
151 var value = data[k];
151 var value = data[k];
152 var td1 = document.createElement('td');
152 var td1 = document.createElement('td');
153 td1.width=150;
153 td1.width=150;
154 var trending_language_label = document.createElement('div');
154 var trending_language_label = document.createElement('div');
155 trending_language_label.innerHTML = k;
155 trending_language_label.innerHTML = k;
156 td1.appendChild(trending_language_label);
156 td1.appendChild(trending_language_label);
157
157
158 var td2 = document.createElement('td');
158 var td2 = document.createElement('td');
159 td2.setAttribute('style','padding-right:14px !important');
159 td2.setAttribute('style','padding-right:14px !important');
160 var trending_language = document.createElement('div');
160 var trending_language = document.createElement('div');
161 var nr_files = value+" ${_('files')}";
161 var nr_files = value+" ${_('files')}";
162
162
163 trending_language.title = k+" "+nr_files;
163 trending_language.title = k+" "+nr_files;
164
164
165 if (percentage>20){
165 if (percentage>20){
166 trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"% "+nr_files+ "</b>";
166 trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"% "+nr_files+ "</b>";
167 }
167 }
168 else{
168 else{
169 trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"%</b>";
169 trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"%</b>";
170 }
170 }
171
171
172 trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner');
172 trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner');
173 trending_language.style.width=percentage+"%";
173 trending_language.style.width=percentage+"%";
174 td2.appendChild(trending_language);
174 td2.appendChild(trending_language);
175
175
176 tr.appendChild(td1);
176 tr.appendChild(td1);
177 tr.appendChild(td2);
177 tr.appendChild(td2);
178 tbl.appendChild(tr);
178 tbl.appendChild(tr);
179 if(cnt == 2){
179 if(cnt == 2){
180 var show_more = document.createElement('tr');
180 var show_more = document.createElement('tr');
181 var td=document.createElement('td');
181 var td=document.createElement('td');
182 lnk = document.createElement('a');
182 lnk = document.createElement('a');
183 lnk.href='#';
183 lnk.href='#';
184 lnk.innerHTML = "${_("show more")}";
184 lnk.innerHTML = "${_("show more")}";
185 lnk.id='code_stats_show_more';
185 lnk.id='code_stats_show_more';
186 td.appendChild(lnk);
186 td.appendChild(lnk);
187 show_more.appendChild(td);
187 show_more.appendChild(td);
188 show_more.appendChild(document.createElement('td'));
188 show_more.appendChild(document.createElement('td'));
189 tbl.appendChild(show_more);
189 tbl.appendChild(show_more);
190 }
190 }
191
191
192 }
192 }
193 if(no_data){
193 if(no_data){
194 var tr = document.createElement('tr');
194 var tr = document.createElement('tr');
195 var td1 = document.createElement('td');
195 var td1 = document.createElement('td');
196 td1.innerHTML = "${c.no_data_msg}";
196 td1.innerHTML = "${c.no_data_msg}";
197 tr.appendChild(td1);
197 tr.appendChild(td1);
198 tbl.appendChild(tr);
198 tbl.appendChild(tr);
199 }
199 }
200 YUD.get('lang_stats').appendChild(tbl);
200 YUD.get('lang_stats').appendChild(tbl);
201 YUE.on('code_stats_show_more','click',function(){
201 YUE.on('code_stats_show_more','click',function(){
202 l = YUD.getElementsByClassName('stats_hidden')
202 l = YUD.getElementsByClassName('stats_hidden')
203 for (e in l){
203 for (e in l){
204 YUD.setStyle(l[e],'display','');
204 YUD.setStyle(l[e],'display','');
205 };
205 };
206 YUD.setStyle(YUD.get('code_stats_show_more'),
206 YUD.setStyle(YUD.get('code_stats_show_more'),
207 'display','none');
207 'display','none');
208 })
208 })
209
209
210 </script>
210 </script>
211
211
212 </div>
212 </div>
213 </div>
213 </div>
214
214
215 <div class="field">
215 <div class="field">
216 <div class="label">
216 <div class="label">
217 <label>${_('Download')}:</label>
217 <label>${_('Download')}:</label>
218 </div>
218 </div>
219 <div class="input-short">
219 <div class="input-short">
220 %for cnt,archive in enumerate(c.repo_info._get_archives()):
220 %for cnt,archive in enumerate(c.repo_info._get_archives()):
221 %if cnt >=1:
221 %if cnt >=1:
222 |
222 |
223 %endif
223 %endif
224 ${h.link_to(c.repo_info.name+'.'+archive['type'],
224 ${h.link_to(c.repo_info.name+'.'+archive['type'],
225 h.url('files_archive_home',repo_name=c.repo_info.name,
225 h.url('files_archive_home',repo_name=c.repo_info.name,
226 revision='tip',fileformat=archive['extension']),class_="archive_icon")}
226 revision='tip',fileformat=archive['extension']),class_="archive_icon")}
227 %endfor
227 %endfor
228 </div>
228 </div>
229 </div>
229 </div>
230
230
231 <div class="field">
231 <div class="field">
232 <div class="label">
232 <div class="label">
233 <label>${_('Feeds')}:</label>
233 <label>${_('Feeds')}:</label>
234 </div>
234 </div>
235 <div class="input-short">
235 <div class="input-short">
236 ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.repo_info.name),class_='rss_icon')}
236 ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.repo_info.name),class_='rss_icon')}
237 ${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.repo_info.name),class_='atom_icon')}
237 ${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.repo_info.name),class_='atom_icon')}
238 </div>
238 </div>
239 </div>
239 </div>
240 </div>
240 </div>
241 </div>
241 </div>
242 </div>
242 </div>
243
243
244 <div class="box box-right" style="min-height:455px">
244 <div class="box box-right" style="min-height:455px">
245 <!-- box / title -->
245 <!-- box / title -->
246 <div class="title">
246 <div class="title">
247 <h5>${_('Commit activity by day / author')}</h5>
247 <h5>${_('Commit activity by day / author')}</h5>
248 </div>
248 </div>
249
249
250 <div class="table">
250 <div class="table">
251
251
252 %if c.no_data:
252 %if c.no_data:
253 <div style="padding:0 10px 10px 15px;font-size: 1.2em;">${c.no_data_msg}</div>
253 <div style="padding:0 10px 10px 15px;font-size: 1.2em;">${c.no_data_msg}</div>
254 %endif:
254 %endif:
255 <div id="commit_history" style="width:460px;height:300px;float:left"></div>
255 <div id="commit_history" style="width:460px;height:300px;float:left"></div>
256 <div style="clear: both;height: 10px"></div>
256 <div style="clear: both;height: 10px"></div>
257 <div id="overview" style="width:460px;height:100px;float:left"></div>
257 <div id="overview" style="width:460px;height:100px;float:left"></div>
258
258
259 <div id="legend_data" style="clear:both;margin-top:10px;">
259 <div id="legend_data" style="clear:both;margin-top:10px;">
260 <div id="legend_container"></div>
260 <div id="legend_container"></div>
261 <div id="legend_choices">
261 <div id="legend_choices">
262 <table id="legend_choices_tables" style="font-size:smaller;color:#545454"></table>
262 <table id="legend_choices_tables" style="font-size:smaller;color:#545454"></table>
263 </div>
263 </div>
264 </div>
264 </div>
265 <script type="text/javascript">
265 <script type="text/javascript">
266 /**
266 /**
267 * Plots summary graph
267 * Plots summary graph
268 *
268 *
269 * @class SummaryPlot
269 * @class SummaryPlot
270 * @param {from} initial from for detailed graph
270 * @param {from} initial from for detailed graph
271 * @param {to} initial to for detailed graph
271 * @param {to} initial to for detailed graph
272 * @param {dataset}
272 * @param {dataset}
273 * @param {overview_dataset}
273 * @param {overview_dataset}
274 */
274 */
275 function SummaryPlot(from,to,dataset,overview_dataset) {
275 function SummaryPlot(from,to,dataset,overview_dataset) {
276 var initial_ranges = {
276 var initial_ranges = {
277 "xaxis":{
277 "xaxis":{
278 "from":from,
278 "from":from,
279 "to":to,
279 "to":to,
280 },
280 },
281 };
281 };
282 var dataset = dataset;
282 var dataset = dataset;
283 var overview_dataset = [overview_dataset];
283 var overview_dataset = [overview_dataset];
284 var choiceContainer = YUD.get("legend_choices");
284 var choiceContainer = YUD.get("legend_choices");
285 var choiceContainerTable = YUD.get("legend_choices_tables");
285 var choiceContainerTable = YUD.get("legend_choices_tables");
286 var plotContainer = YUD.get('commit_history');
286 var plotContainer = YUD.get('commit_history');
287 var overviewContainer = YUD.get('overview');
287 var overviewContainer = YUD.get('overview');
288
288
289 var plot_options = {
289 var plot_options = {
290 bars: {show:true,align:'center',lineWidth:4},
290 bars: {show:true,align:'center',lineWidth:4},
291 legend: {show:true, container:"legend_container"},
291 legend: {show:true, container:"legend_container"},
292 points: {show:true,radius:0,fill:false},
292 points: {show:true,radius:0,fill:false},
293 yaxis: {tickDecimals:0,},
293 yaxis: {tickDecimals:0,},
294 xaxis: {
294 xaxis: {
295 mode: "time",
295 mode: "time",
296 timeformat: "%d/%m",
296 timeformat: "%d/%m",
297 min:from,
297 min:from,
298 max:to,
298 max:to,
299 },
299 },
300 grid: {
300 grid: {
301 hoverable: true,
301 hoverable: true,
302 clickable: true,
302 clickable: true,
303 autoHighlight:true,
303 autoHighlight:true,
304 color: "#999"
304 color: "#999"
305 },
305 },
306 //selection: {mode: "x"}
306 //selection: {mode: "x"}
307 };
307 };
308 var overview_options = {
308 var overview_options = {
309 legend:{show:false},
309 legend:{show:false},
310 bars: {show:true,barWidth: 2,},
310 bars: {show:true,barWidth: 2,},
311 shadowSize: 0,
311 shadowSize: 0,
312 xaxis: {mode: "time", timeformat: "%d/%m/%y",},
312 xaxis: {mode: "time", timeformat: "%d/%m/%y",},
313 yaxis: {ticks: 3, min: 0,tickDecimals:0,},
313 yaxis: {ticks: 3, min: 0,tickDecimals:0,},
314 grid: {color: "#999",},
314 grid: {color: "#999",},
315 selection: {mode: "x"}
315 selection: {mode: "x"}
316 };
316 };
317
317
318 /**
318 /**
319 *get dummy data needed in few places
319 *get dummy data needed in few places
320 */
320 */
321 function getDummyData(label){
321 function getDummyData(label){
322 return {"label":label,
322 return {"label":label,
323 "data":[{"time":0,
323 "data":[{"time":0,
324 "commits":0,
324 "commits":0,
325 "added":0,
325 "added":0,
326 "changed":0,
326 "changed":0,
327 "removed":0,
327 "removed":0,
328 }],
328 }],
329 "schema":["commits"],
329 "schema":["commits"],
330 "color":'#ffffff',
330 "color":'#ffffff',
331 }
331 }
332 }
332 }
333
333
334 /**
334 /**
335 * generate checkboxes accordindly to data
335 * generate checkboxes accordindly to data
336 * @param keys
336 * @param keys
337 * @returns
337 * @returns
338 */
338 */
339 function generateCheckboxes(data) {
339 function generateCheckboxes(data) {
340 //append checkboxes
340 //append checkboxes
341 var i = 0;
341 var i = 0;
342 choiceContainerTable.innerHTML = '';
342 choiceContainerTable.innerHTML = '';
343 for(var pos in data) {
343 for(var pos in data) {
344
344
345 data[pos].color = i;
345 data[pos].color = i;
346 i++;
346 i++;
347 if(data[pos].label != ''){
347 if(data[pos].label != ''){
348 choiceContainerTable.innerHTML += '<tr><td>'+
348 choiceContainerTable.innerHTML += '<tr><td>'+
349 '<input type="checkbox" name="' + data[pos].label +'" checked="checked" />'
349 '<input type="checkbox" name="' + data[pos].label +'" checked="checked" />'
350 +data[pos].label+
350 +data[pos].label+
351 '</td></tr>';
351 '</td></tr>';
352 }
352 }
353 }
353 }
354 }
354 }
355
355
356 /**
356 /**
357 * ToolTip show
357 * ToolTip show
358 */
358 */
359 function showTooltip(x, y, contents) {
359 function showTooltip(x, y, contents) {
360 var div=document.getElementById('tooltip');
360 var div=document.getElementById('tooltip');
361 if(!div) {
361 if(!div) {
362 div = document.createElement('div');
362 div = document.createElement('div');
363 div.id="tooltip";
363 div.id="tooltip";
364 div.style.position="absolute";
364 div.style.position="absolute";
365 div.style.border='1px solid #fdd';
365 div.style.border='1px solid #fdd';
366 div.style.padding='2px';
366 div.style.padding='2px';
367 div.style.backgroundColor='#fee';
367 div.style.backgroundColor='#fee';
368 document.body.appendChild(div);
368 document.body.appendChild(div);
369 }
369 }
370 YUD.setStyle(div, 'opacity', 0);
370 YUD.setStyle(div, 'opacity', 0);
371 div.innerHTML = contents;
371 div.innerHTML = contents;
372 div.style.top=(y + 5) + "px";
372 div.style.top=(y + 5) + "px";
373 div.style.left=(x + 5) + "px";
373 div.style.left=(x + 5) + "px";
374
374
375 var anim = new YAHOO.util.Anim(div, {opacity: {to: 0.8}}, 0.2);
375 var anim = new YAHOO.util.Anim(div, {opacity: {to: 0.8}}, 0.2);
376 anim.animate();
376 anim.animate();
377 }
377 }
378
378
379 /**
379 /**
380 * This function will detect if selected period has some changesets
380 * This function will detect if selected period has some changesets
381 for this user if it does this data is then pushed for displaying
381 for this user if it does this data is then pushed for displaying
382 Additionally it will only display users that are selected by the checkbox
382 Additionally it will only display users that are selected by the checkbox
383 */
383 */
384 function getDataAccordingToRanges(ranges) {
384 function getDataAccordingToRanges(ranges) {
385
385
386 var data = [];
386 var data = [];
387 var keys = [];
387 var keys = [];
388 for(var key in dataset){
388 for(var key in dataset){
389 var push = false;
389 var push = false;
390
390
391 //method1 slow !!
391 //method1 slow !!
392 //*
392 //*
393 for(var ds in dataset[key].data){
393 for(var ds in dataset[key].data){
394 commit_data = dataset[key].data[ds];
394 commit_data = dataset[key].data[ds];
395 if (commit_data.time >= ranges.xaxis.from && commit_data.time <= ranges.xaxis.to){
395 if (commit_data.time >= ranges.xaxis.from && commit_data.time <= ranges.xaxis.to){
396 push = true;
396 push = true;
397 break;
397 break;
398 }
398 }
399 }
399 }
400 //*/
400 //*/
401
401
402 /*//method2 sorted commit data !!!
402 /*//method2 sorted commit data !!!
403
403
404 var first_commit = dataset[key].data[0].time;
404 var first_commit = dataset[key].data[0].time;
405 var last_commit = dataset[key].data[dataset[key].data.length-1].time;
405 var last_commit = dataset[key].data[dataset[key].data.length-1].time;
406
406
407 if (first_commit >= ranges.xaxis.from && last_commit <= ranges.xaxis.to){
407 if (first_commit >= ranges.xaxis.from && last_commit <= ranges.xaxis.to){
408 push = true;
408 push = true;
409 }
409 }
410 //*/
410 //*/
411
411
412 if(push){
412 if(push){
413 data.push(dataset[key]);
413 data.push(dataset[key]);
414 }
414 }
415 }
415 }
416 if(data.length >= 1){
416 if(data.length >= 1){
417 return data;
417 return data;
418 }
418 }
419 else{
419 else{
420 //just return dummy data for graph to plot itself
420 //just return dummy data for graph to plot itself
421 return [getDummyData('')];
421 return [getDummyData('')];
422 }
422 }
423
423
424 }
424 }
425
425
426 /**
426 /**
427 * redraw using new checkbox data
427 * redraw using new checkbox data
428 */
428 */
429 function plotchoiced(e,args){
429 function plotchoiced(e,args){
430 var cur_data = args[0];
430 var cur_data = args[0];
431 var cur_ranges = args[1];
431 var cur_ranges = args[1];
432
432
433 var new_data = [];
433 var new_data = [];
434 var inputs = choiceContainer.getElementsByTagName("input");
434 var inputs = choiceContainer.getElementsByTagName("input");
435
435
436 //show only checked labels
436 //show only checked labels
437 for(var i=0; i<inputs.length; i++) {
437 for(var i=0; i<inputs.length; i++) {
438 var checkbox_key = inputs[i].name;
438 var checkbox_key = inputs[i].name;
439
439
440 if(inputs[i].checked){
440 if(inputs[i].checked){
441 for(var d in cur_data){
441 for(var d in cur_data){
442 if(cur_data[d].label == checkbox_key){
442 if(cur_data[d].label == checkbox_key){
443 new_data.push(cur_data[d]);
443 new_data.push(cur_data[d]);
444 }
444 }
445 }
445 }
446 }
446 }
447 else{
447 else{
448 //push dummy data to not hide the label
448 //push dummy data to not hide the label
449 new_data.push(getDummyData(checkbox_key));
449 new_data.push(getDummyData(checkbox_key));
450 }
450 }
451 }
451 }
452
452
453 var new_options = YAHOO.lang.merge(plot_options, {
453 var new_options = YAHOO.lang.merge(plot_options, {
454 xaxis: {
454 xaxis: {
455 min: cur_ranges.xaxis.from,
455 min: cur_ranges.xaxis.from,
456 max: cur_ranges.xaxis.to,
456 max: cur_ranges.xaxis.to,
457 mode:"time",
457 mode:"time",
458 timeformat: "%d/%m",
458 timeformat: "%d/%m",
459 },
459 },
460 });
460 });
461 if (!new_data){
461 if (!new_data){
462 new_data = [[0,1]];
462 new_data = [[0,1]];
463 }
463 }
464 // do the zooming
464 // do the zooming
465 plot = YAHOO.widget.Flot(plotContainer, new_data, new_options);
465 plot = YAHOO.widget.Flot(plotContainer, new_data, new_options);
466
466
467 plot.subscribe("plotselected", plotselected);
467 plot.subscribe("plotselected", plotselected);
468
468
469 //resubscribe plothover
469 //resubscribe plothover
470 plot.subscribe("plothover", plothover);
470 plot.subscribe("plothover", plothover);
471
471
472 // don't fire event on the overview to prevent eternal loop
472 // don't fire event on the overview to prevent eternal loop
473 overview.setSelection(cur_ranges, true);
473 overview.setSelection(cur_ranges, true);
474
474
475 }
475 }
476
476
477 /**
477 /**
478 * plot only selected items from overview
478 * plot only selected items from overview
479 * @param ranges
479 * @param ranges
480 * @returns
480 * @returns
481 */
481 */
482 function plotselected(ranges,cur_data) {
482 function plotselected(ranges,cur_data) {
483 //updates the data for new plot
483 //updates the data for new plot
484 data = getDataAccordingToRanges(ranges);
484 data = getDataAccordingToRanges(ranges);
485 generateCheckboxes(data);
485 generateCheckboxes(data);
486
486
487 var new_options = YAHOO.lang.merge(plot_options, {
487 var new_options = YAHOO.lang.merge(plot_options, {
488 xaxis: {
488 xaxis: {
489 min: ranges.xaxis.from,
489 min: ranges.xaxis.from,
490 max: ranges.xaxis.to,
490 max: ranges.xaxis.to,
491 mode:"time",
491 mode:"time",
492 timeformat: "%d/%m",
492 timeformat: "%d/%m",
493 },
493 },
494 yaxis: {
494 yaxis: {
495 min: ranges.yaxis.from,
495 min: ranges.yaxis.from,
496 max: ranges.yaxis.to,
496 max: ranges.yaxis.to,
497 },
497 },
498
498
499 });
499 });
500 // do the zooming
500 // do the zooming
501 plot = YAHOO.widget.Flot(plotContainer, data, new_options);
501 plot = YAHOO.widget.Flot(plotContainer, data, new_options);
502
502
503 plot.subscribe("plotselected", plotselected);
503 plot.subscribe("plotselected", plotselected);
504
504
505 //resubscribe plothover
505 //resubscribe plothover
506 plot.subscribe("plothover", plothover);
506 plot.subscribe("plothover", plothover);
507
507
508 // don't fire event on the overview to prevent eternal loop
508 // don't fire event on the overview to prevent eternal loop
509 overview.setSelection(ranges, true);
509 overview.setSelection(ranges, true);
510
510
511 //resubscribe choiced
511 //resubscribe choiced
512 YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, ranges]);
512 YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, ranges]);
513 }
513 }
514
514
515 var previousPoint = null;
515 var previousPoint = null;
516
516
517 function plothover(o) {
517 function plothover(o) {
518 var pos = o.pos;
518 var pos = o.pos;
519 var item = o.item;
519 var item = o.item;
520
520
521 //YUD.get("x").innerHTML = pos.x.toFixed(2);
521 //YUD.get("x").innerHTML = pos.x.toFixed(2);
522 //YUD.get("y").innerHTML = pos.y.toFixed(2);
522 //YUD.get("y").innerHTML = pos.y.toFixed(2);
523 if (item) {
523 if (item) {
524 if (previousPoint != item.datapoint) {
524 if (previousPoint != item.datapoint) {
525 previousPoint = item.datapoint;
525 previousPoint = item.datapoint;
526
526
527 var tooltip = YUD.get("tooltip");
527 var tooltip = YUD.get("tooltip");
528 if(tooltip) {
528 if(tooltip) {
529 tooltip.parentNode.removeChild(tooltip);
529 tooltip.parentNode.removeChild(tooltip);
530 }
530 }
531 var x = item.datapoint.x.toFixed(2);
531 var x = item.datapoint.x.toFixed(2);
532 var y = item.datapoint.y.toFixed(2);
532 var y = item.datapoint.y.toFixed(2);
533
533
534 if (!item.series.label){
534 if (!item.series.label){
535 item.series.label = 'commits';
535 item.series.label = 'commits';
536 }
536 }
537 var d = new Date(x*1000);
537 var d = new Date(x*1000);
538 var fd = d.toDateString()
538 var fd = d.toDateString()
539 var nr_commits = parseInt(y);
539 var nr_commits = parseInt(y);
540
540
541 var cur_data = dataset[item.series.label].data[item.dataIndex];
541 var cur_data = dataset[item.series.label].data[item.dataIndex];
542 var added = cur_data.added;
542 var added = cur_data.added;
543 var changed = cur_data.changed;
543 var changed = cur_data.changed;
544 var removed = cur_data.removed;
544 var removed = cur_data.removed;
545
545
546 var nr_commits_suffix = " ${_('commits')} ";
546 var nr_commits_suffix = " ${_('commits')} ";
547 var added_suffix = " ${_('files added')} ";
547 var added_suffix = " ${_('files added')} ";
548 var changed_suffix = " ${_('files changed')} ";
548 var changed_suffix = " ${_('files changed')} ";
549 var removed_suffix = " ${_('files removed')} ";
549 var removed_suffix = " ${_('files removed')} ";
550
550
551
551
552 if(nr_commits == 1){nr_commits_suffix = " ${_('commit')} ";}
552 if(nr_commits == 1){nr_commits_suffix = " ${_('commit')} ";}
553 if(added==1){added_suffix=" ${_('file added')} ";}
553 if(added==1){added_suffix=" ${_('file added')} ";}
554 if(changed==1){changed_suffix=" ${_('file changed')} ";}
554 if(changed==1){changed_suffix=" ${_('file changed')} ";}
555 if(removed==1){removed_suffix=" ${_('file removed')} ";}
555 if(removed==1){removed_suffix=" ${_('file removed')} ";}
556
556
557 showTooltip(item.pageX, item.pageY, item.series.label + " on " + fd
557 showTooltip(item.pageX, item.pageY, item.series.label + " on " + fd
558 +'<br/>'+
558 +'<br/>'+
559 nr_commits + nr_commits_suffix+'<br/>'+
559 nr_commits + nr_commits_suffix+'<br/>'+
560 added + added_suffix +'<br/>'+
560 added + added_suffix +'<br/>'+
561 changed + changed_suffix + '<br/>'+
561 changed + changed_suffix + '<br/>'+
562 removed + removed_suffix + '<br/>');
562 removed + removed_suffix + '<br/>');
563 }
563 }
564 }
564 }
565 else {
565 else {
566 var tooltip = YUD.get("tooltip");
566 var tooltip = YUD.get("tooltip");
567
567
568 if(tooltip) {
568 if(tooltip) {
569 tooltip.parentNode.removeChild(tooltip);
569 tooltip.parentNode.removeChild(tooltip);
570 }
570 }
571 previousPoint = null;
571 previousPoint = null;
572 }
572 }
573 }
573 }
574
574
575 /**
575 /**
576 * MAIN EXECUTION
576 * MAIN EXECUTION
577 */
577 */
578
578
579 var data = getDataAccordingToRanges(initial_ranges);
579 var data = getDataAccordingToRanges(initial_ranges);
580 generateCheckboxes(data);
580 generateCheckboxes(data);
581
581
582 //main plot
582 //main plot
583 var plot = YAHOO.widget.Flot(plotContainer,data,plot_options);
583 var plot = YAHOO.widget.Flot(plotContainer,data,plot_options);
584
584
585 //overview
585 //overview
586 var overview = YAHOO.widget.Flot(overviewContainer, overview_dataset, overview_options);
586 var overview = YAHOO.widget.Flot(overviewContainer, overview_dataset, overview_options);
587
587
588 //show initial selection on overview
588 //show initial selection on overview
589 overview.setSelection(initial_ranges);
589 overview.setSelection(initial_ranges);
590
590
591 plot.subscribe("plotselected", plotselected);
591 plot.subscribe("plotselected", plotselected);
592
592
593 overview.subscribe("plotselected", function (ranges) {
593 overview.subscribe("plotselected", function (ranges) {
594 plot.setSelection(ranges);
594 plot.setSelection(ranges);
595 });
595 });
596
596
597 plot.subscribe("plothover", plothover);
597 plot.subscribe("plothover", plothover);
598
598
599 YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, initial_ranges]);
599 YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, initial_ranges]);
600 }
600 }
601 SummaryPlot(${c.ts_min},${c.ts_max},${c.commit_data|n},${c.overview_data|n});
601 SummaryPlot(${c.ts_min},${c.ts_max},${c.commit_data|n},${c.overview_data|n});
602 </script>
602 </script>
603
603
604 </div>
604 </div>
605 </div>
605 </div>
606
606
607 <div class="box">
607 <div class="box">
608 <div class="title">
608 <div class="title">
609 <div class="breadcrumbs">${h.link_to(_('Shortlog'),h.url('shortlog_home',repo_name=c.repo_name))}</div>
609 <div class="breadcrumbs">${h.link_to(_('Shortlog'),h.url('shortlog_home',repo_name=c.repo_name))}</div>
610 </div>
610 </div>
611 <div class="table">
611 <div class="table">
612 <div id="shortlog_data">
612 <div id="shortlog_data">
613 <%include file='../shortlog/shortlog_data.html'/>
613 <%include file='../shortlog/shortlog_data.html'/>
614 </div>
614 </div>
615 ##%if c.repo_changesets:
615 ##%if c.repo_changesets:
616 ## ${h.link_to(_('show more'),h.url('changelog_home',repo_name=c.repo_name))}
616 ## ${h.link_to(_('show more'),h.url('changelog_home',repo_name=c.repo_name))}
617 ##%endif
617 ##%endif
618 </div>
618 </div>
619 </div>
619 </div>
620 <div class="box">
620 <div class="box">
621 <div class="title">
621 <div class="title">
622 <div class="breadcrumbs">${h.link_to(_('Tags'),h.url('tags_home',repo_name=c.repo_name))}</div>
622 <div class="breadcrumbs">${h.link_to(_('Tags'),h.url('tags_home',repo_name=c.repo_name))}</div>
623 </div>
623 </div>
624 <div class="table">
624 <div class="table">
625 <%include file='../tags/tags_data.html'/>
625 <%include file='../tags/tags_data.html'/>
626 %if c.repo_changesets:
626 %if c.repo_changesets:
627 ${h.link_to(_('show more'),h.url('tags_home',repo_name=c.repo_name))}
627 ${h.link_to(_('show more'),h.url('tags_home',repo_name=c.repo_name))}
628 %endif
628 %endif
629 </div>
629 </div>
630 </div>
630 </div>
631 <div class="box">
631 <div class="box">
632 <div class="title">
632 <div class="title">
633 <div class="breadcrumbs">${h.link_to(_('Branches'),h.url('branches_home',repo_name=c.repo_name))}</div>
633 <div class="breadcrumbs">${h.link_to(_('Branches'),h.url('branches_home',repo_name=c.repo_name))}</div>
634 </div>
634 </div>
635 <div class="table">
635 <div class="table">
636 <%include file='../branches/branches_data.html'/>
636 <%include file='../branches/branches_data.html'/>
637 %if c.repo_changesets:
637 %if c.repo_changesets:
638 ${h.link_to(_('show more'),h.url('branches_home',repo_name=c.repo_name))}
638 ${h.link_to(_('show more'),h.url('branches_home',repo_name=c.repo_name))}
639 %endif
639 %endif
640 </div>
640 </div>
641 </div>
641 </div>
642
642
643 </%def>
643 </%def>
General Comments 0
You need to be logged in to leave comments. Login now