##// END OF EJS Templates
make "Open new pull request" option lower case like other options are
Mads Kiilerich -
r3188:a51e5da0 beta
parent child Browse files
Show More
@@ -1,362 +1,362 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="root.html"/>
2 <%inherit file="root.html"/>
3
3
4 <!-- HEADER -->
4 <!-- HEADER -->
5 <div id="header">
5 <div id="header">
6 <div id="header-inner" class="title hover">
6 <div id="header-inner" class="title hover">
7 <div id="logo">
7 <div id="logo">
8 <h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1>
8 <h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1>
9 </div>
9 </div>
10 <!-- MENU -->
10 <!-- MENU -->
11 ${self.page_nav()}
11 ${self.page_nav()}
12 <!-- END MENU -->
12 <!-- END MENU -->
13 ${self.body()}
13 ${self.body()}
14 </div>
14 </div>
15 </div>
15 </div>
16 <!-- END HEADER -->
16 <!-- END HEADER -->
17
17
18 <!-- CONTENT -->
18 <!-- CONTENT -->
19 <div id="content">
19 <div id="content">
20 <div class="flash_msg">
20 <div class="flash_msg">
21 <% messages = h.flash.pop_messages() %>
21 <% messages = h.flash.pop_messages() %>
22 % if messages:
22 % if messages:
23 <ul id="flash-messages">
23 <ul id="flash-messages">
24 % for message in messages:
24 % for message in messages:
25 <li class="${message.category}_msg">${message}</li>
25 <li class="${message.category}_msg">${message}</li>
26 % endfor
26 % endfor
27 </ul>
27 </ul>
28 % endif
28 % endif
29 </div>
29 </div>
30 <div id="main">
30 <div id="main">
31 ${next.main()}
31 ${next.main()}
32 </div>
32 </div>
33 </div>
33 </div>
34 <!-- END CONTENT -->
34 <!-- END CONTENT -->
35
35
36 <!-- FOOTER -->
36 <!-- FOOTER -->
37 <div id="footer">
37 <div id="footer">
38 <div id="footer-inner" class="title">
38 <div id="footer-inner" class="title">
39 <div>
39 <div>
40 <p class="footer-link">
40 <p class="footer-link">
41 <a href="${h.url('bugtracker')}">${_('Submit a bug')}</a>
41 <a href="${h.url('bugtracker')}">${_('Submit a bug')}</a>
42 </p>
42 </p>
43 <p class="footer-link-right">
43 <p class="footer-link-right">
44 <a href="${h.url('rhodecode_official')}">RhodeCode${'-%s' % c.rhodecode_instanceid if c.rhodecode_instanceid else ''}</a>
44 <a href="${h.url('rhodecode_official')}">RhodeCode${'-%s' % c.rhodecode_instanceid if c.rhodecode_instanceid else ''}</a>
45 ${c.rhodecode_version} &copy; 2010-${h.datetime.today().year} by Marcin Kuzminski
45 ${c.rhodecode_version} &copy; 2010-${h.datetime.today().year} by Marcin Kuzminski
46 </p>
46 </p>
47 </div>
47 </div>
48 </div>
48 </div>
49 </div>
49 </div>
50 <!-- END FOOTER -->
50 <!-- END FOOTER -->
51
51
52 ### MAKO DEFS ###
52 ### MAKO DEFS ###
53 <%def name="page_nav()">
53 <%def name="page_nav()">
54 ${self.menu()}
54 ${self.menu()}
55 </%def>
55 </%def>
56
56
57 <%def name="breadcrumbs()">
57 <%def name="breadcrumbs()">
58 <div class="breadcrumbs">
58 <div class="breadcrumbs">
59 ${self.breadcrumbs_links()}
59 ${self.breadcrumbs_links()}
60 </div>
60 </div>
61 </%def>
61 </%def>
62
62
63 <%def name="usermenu()">
63 <%def name="usermenu()">
64 <div class="user-menu">
64 <div class="user-menu">
65 <div class="container">
65 <div class="container">
66 <div class="gravatar" id="quick_login_link">
66 <div class="gravatar" id="quick_login_link">
67 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,24)}" />
67 <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,24)}" />
68 </div>
68 </div>
69 %if c.rhodecode_user.username != 'default' and c.unread_notifications != 0:
69 %if c.rhodecode_user.username != 'default' and c.unread_notifications != 0:
70 <div class="notifications">
70 <div class="notifications">
71 <a id="notification_counter" href="${h.url('notifications')}">${c.unread_notifications}</a>
71 <a id="notification_counter" href="${h.url('notifications')}">${c.unread_notifications}</a>
72 </div>
72 </div>
73 %endif
73 %endif
74 </div>
74 </div>
75 <div id="quick_login" style="display:none">
75 <div id="quick_login" style="display:none">
76 %if c.rhodecode_user.username == 'default':
76 %if c.rhodecode_user.username == 'default':
77 <h4>${_('Login to your account')}</h4>
77 <h4>${_('Login to your account')}</h4>
78 ${h.form(h.url('login_home',came_from=h.url.current()))}
78 ${h.form(h.url('login_home',came_from=h.url.current()))}
79 <div class="form">
79 <div class="form">
80 <div class="fields">
80 <div class="fields">
81 <div class="field">
81 <div class="field">
82 <div class="label">
82 <div class="label">
83 <label for="username">${_('Username')}:</label>
83 <label for="username">${_('Username')}:</label>
84 </div>
84 </div>
85 <div class="input">
85 <div class="input">
86 ${h.text('username',class_='focus',size=40)}
86 ${h.text('username',class_='focus',size=40)}
87 </div>
87 </div>
88
88
89 </div>
89 </div>
90 <div class="field">
90 <div class="field">
91 <div class="label">
91 <div class="label">
92 <label for="password">${_('Password')}:</label>
92 <label for="password">${_('Password')}:</label>
93 </div>
93 </div>
94 <div class="input">
94 <div class="input">
95 ${h.password('password',class_='focus',size=40)}
95 ${h.password('password',class_='focus',size=40)}
96 </div>
96 </div>
97
97
98 </div>
98 </div>
99 <div class="buttons">
99 <div class="buttons">
100 <div class="password_forgoten">${h.link_to(_('Forgot password ?'),h.url('reset_password'))}</div>
100 <div class="password_forgoten">${h.link_to(_('Forgot password ?'),h.url('reset_password'))}</div>
101 <div class="register">
101 <div class="register">
102 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
102 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
103 ${h.link_to(_("Don't have an account ?"),h.url('register'))}
103 ${h.link_to(_("Don't have an account ?"),h.url('register'))}
104 %endif
104 %endif
105 </div>
105 </div>
106 <div class="submit">
106 <div class="submit">
107 ${h.submit('sign_in',_('Log In'),class_="ui-btn xsmall")}
107 ${h.submit('sign_in',_('Log In'),class_="ui-btn xsmall")}
108 </div>
108 </div>
109 </div>
109 </div>
110 </div>
110 </div>
111 </div>
111 </div>
112 ${h.end_form()}
112 ${h.end_form()}
113 %else:
113 %else:
114 <div class="links_left">
114 <div class="links_left">
115 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
115 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
116 <div class="email">${c.rhodecode_user.email}</div>
116 <div class="email">${c.rhodecode_user.email}</div>
117 <div class="big_gravatar"><img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,48)}" /></div>
117 <div class="big_gravatar"><img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,48)}" /></div>
118 <div class="inbox"><a href="${h.url('notifications')}">${_('Inbox')}: ${c.unread_notifications}</a></div>
118 <div class="inbox"><a href="${h.url('notifications')}">${_('Inbox')}: ${c.unread_notifications}</a></div>
119 </div>
119 </div>
120 <div class="links_right">
120 <div class="links_right">
121 <ol class="links">
121 <ol class="links">
122 <li>${h.link_to(_(u'Home'),h.url('home'))}</li>
122 <li>${h.link_to(_(u'Home'),h.url('home'))}</li>
123 <li>${h.link_to(_(u'Journal'),h.url('journal'))}</li>
123 <li>${h.link_to(_(u'Journal'),h.url('journal'))}</li>
124 <li>${h.link_to(_(u'My account'),h.url('admin_settings_my_account'))}</li>
124 <li>${h.link_to(_(u'My account'),h.url('admin_settings_my_account'))}</li>
125 <li class="logout">${h.link_to(_(u'Log Out'),h.url('logout_home'))}</li>
125 <li class="logout">${h.link_to(_(u'Log Out'),h.url('logout_home'))}</li>
126 </ol>
126 </ol>
127 </div>
127 </div>
128 %endif
128 %endif
129 </div>
129 </div>
130 </div>
130 </div>
131 </%def>
131 </%def>
132
132
133 <%def name="menu(current=None)">
133 <%def name="menu(current=None)">
134 <%
134 <%
135 def is_current(selected):
135 def is_current(selected):
136 if selected == current:
136 if selected == current:
137 return h.literal('class="current"')
137 return h.literal('class="current"')
138 %>
138 %>
139 %if current not in ['home','admin']:
139 %if current not in ['home','admin']:
140 ##REGULAR MENU
140 ##REGULAR MENU
141 <ul id="quick">
141 <ul id="quick">
142 <!-- repo switcher -->
142 <!-- repo switcher -->
143 <li>
143 <li>
144 <a class="menu_link" id="repo_switcher" title="${_('Switch repository')}" href="#">
144 <a class="menu_link" id="repo_switcher" title="${_('Switch repository')}" href="#">
145 <span class="icon">
145 <span class="icon">
146 <img src="${h.url('/images/icons/database.png')}" alt="${_('Products')}" />
146 <img src="${h.url('/images/icons/database.png')}" alt="${_('Products')}" />
147 </span>
147 </span>
148 <span>&darr;</span>
148 <span>&darr;</span>
149 </a>
149 </a>
150 <ul id="repo_switcher_list" class="repo_switcher">
150 <ul id="repo_switcher_list" class="repo_switcher">
151 <li>
151 <li>
152 <a href="#">${_('loading...')}</a>
152 <a href="#">${_('loading...')}</a>
153 </li>
153 </li>
154 </ul>
154 </ul>
155 </li>
155 </li>
156
156
157 <li ${is_current('summary')}>
157 <li ${is_current('summary')}>
158 <a class="menu_link" title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}">
158 <a class="menu_link" title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}">
159 <span class="icon">
159 <span class="icon">
160 <img src="${h.url('/images/icons/clipboard_16.png')}" alt="${_('Summary')}" />
160 <img src="${h.url('/images/icons/clipboard_16.png')}" alt="${_('Summary')}" />
161 </span>
161 </span>
162 <span>${_('Summary')}</span>
162 <span>${_('Summary')}</span>
163 </a>
163 </a>
164 </li>
164 </li>
165 <li ${is_current('changelog')}>
165 <li ${is_current('changelog')}>
166 <a class="menu_link" title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}">
166 <a class="menu_link" title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}">
167 <span class="icon">
167 <span class="icon">
168 <img src="${h.url('/images/icons/time.png')}" alt="${_('Changelog')}" />
168 <img src="${h.url('/images/icons/time.png')}" alt="${_('Changelog')}" />
169 </span>
169 </span>
170 <span>${_('Changelog')}</span>
170 <span>${_('Changelog')}</span>
171 </a>
171 </a>
172 </li>
172 </li>
173
173
174 <li ${is_current('switch_to')}>
174 <li ${is_current('switch_to')}>
175 <a class="menu_link" id="branch_tag_switcher" title="${_('Switch to')}" href="#">
175 <a class="menu_link" id="branch_tag_switcher" title="${_('Switch to')}" href="#">
176 <span class="icon">
176 <span class="icon">
177 <img src="${h.url('/images/icons/arrow_switch.png')}" alt="${_('Switch to')}" />
177 <img src="${h.url('/images/icons/arrow_switch.png')}" alt="${_('Switch to')}" />
178 </span>
178 </span>
179 <span>${_('Switch to')}</span>
179 <span>${_('Switch to')}</span>
180 </a>
180 </a>
181 <ul id="switch_to_list" class="switch_to">
181 <ul id="switch_to_list" class="switch_to">
182 <li><a href="#">${_('loading...')}</a></li>
182 <li><a href="#">${_('loading...')}</a></li>
183 </ul>
183 </ul>
184 </li>
184 </li>
185 <li ${is_current('files')}>
185 <li ${is_current('files')}>
186 <a class="menu_link" title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}">
186 <a class="menu_link" title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}">
187 <span class="icon">
187 <span class="icon">
188 <img src="${h.url('/images/icons/file.png')}" alt="${_('Files')}" />
188 <img src="${h.url('/images/icons/file.png')}" alt="${_('Files')}" />
189 </span>
189 </span>
190 <span>${_('Files')}</span>
190 <span>${_('Files')}</span>
191 </a>
191 </a>
192 </li>
192 </li>
193
193
194 <li ${is_current('options')}>
194 <li ${is_current('options')}>
195 <a class="menu_link" title="${_('Options')}" href="#">
195 <a class="menu_link" title="${_('Options')}" href="#">
196 <span class="icon">
196 <span class="icon">
197 <img src="${h.url('/images/icons/table_gear.png')}" alt="${_('Admin')}" />
197 <img src="${h.url('/images/icons/table_gear.png')}" alt="${_('Admin')}" />
198 </span>
198 </span>
199 <span>${_('Options')}</span>
199 <span>${_('Options')}</span>
200 </a>
200 </a>
201 <ul>
201 <ul>
202 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
202 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
203 %if h.HasPermissionAll('hg.admin')('access settings on repository'):
203 %if h.HasPermissionAll('hg.admin')('access settings on repository'):
204 <li>${h.link_to(_('repository settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li>
204 <li>${h.link_to(_('repository settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li>
205 %else:
205 %else:
206 <li>${h.link_to(_('repository settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
206 <li>${h.link_to(_('repository settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
207 %endif
207 %endif
208 %endif
208 %endif
209
209
210 <li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li>
210 <li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li>
211 %if h.is_hg(c.rhodecode_repo):
211 %if h.is_hg(c.rhodecode_repo):
212 <li>${h.link_to(_('Open new pull request'),h.url('pullrequest_home',repo_name=c.repo_name),class_='pull_request')}</li>
212 <li>${h.link_to(_('open new pull request'),h.url('pullrequest_home',repo_name=c.repo_name),class_='pull_request')}</li>
213 %endif
213 %endif
214 %if c.rhodecode_db_repo.fork:
214 %if c.rhodecode_db_repo.fork:
215 <li>${h.link_to(_('Compare fork'),h.url('compare_url',repo_name=c.repo_name,org_ref_type='branch',org_ref=request.GET.get('branch') or 'default',other_ref_type='branch',other_ref='default',repo=c.rhodecode_db_repo.fork.repo_name),class_='compare_request')}</li>
215 <li>${h.link_to(_('compare fork'),h.url('compare_url',repo_name=c.repo_name,org_ref_type='branch',org_ref=request.GET.get('branch') or 'default',other_ref_type='branch',other_ref='default',repo=c.rhodecode_db_repo.fork.repo_name),class_='compare_request')}</li>
216 %endif
216 %endif
217 <li>${h.link_to(_('search'),h.url('search_repo',search_repo=c.repo_name),class_='search')}</li>
217 <li>${h.link_to(_('search'),h.url('search_repo',search_repo=c.repo_name),class_='search')}</li>
218
218
219 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
219 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
220 %if c.rhodecode_db_repo.locked[0]:
220 %if c.rhodecode_db_repo.locked[0]:
221 <li>${h.link_to(_('unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}</li>
221 <li>${h.link_to(_('unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}</li>
222 %else:
222 %else:
223 <li>${h.link_to(_('lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}</li>
223 <li>${h.link_to(_('lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}</li>
224 %endif
224 %endif
225 %endif
225 %endif
226
226
227 % if h.HasPermissionAll('hg.admin')('access admin main page'):
227 % if h.HasPermissionAll('hg.admin')('access admin main page'):
228 <li>
228 <li>
229 ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')}
229 ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')}
230 <%def name="admin_menu()">
230 <%def name="admin_menu()">
231 <ul>
231 <ul>
232 <li>${h.link_to(_('journal'),h.url('admin_home'),class_='journal')}</li>
232 <li>${h.link_to(_('journal'),h.url('admin_home'),class_='journal')}</li>
233 <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li>
233 <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li>
234 <li>${h.link_to(_('repositories groups'),h.url('repos_groups'),class_='repos_groups')}</li>
234 <li>${h.link_to(_('repositories groups'),h.url('repos_groups'),class_='repos_groups')}</li>
235 <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li>
235 <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li>
236 <li>${h.link_to(_('users groups'),h.url('users_groups'),class_='groups')}</li>
236 <li>${h.link_to(_('users groups'),h.url('users_groups'),class_='groups')}</li>
237 <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li>
237 <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li>
238 <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li>
238 <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li>
239 <li>${h.link_to(_('defaults'),h.url('defaults'),class_='defaults')}</li>
239 <li>${h.link_to(_('defaults'),h.url('defaults'),class_='defaults')}</li>
240 <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li>
240 <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li>
241 </ul>
241 </ul>
242 </%def>
242 </%def>
243 ## ADMIN MENU
243 ## ADMIN MENU
244 ${admin_menu()}
244 ${admin_menu()}
245 </li>
245 </li>
246 % endif
246 % endif
247 </ul>
247 </ul>
248 </li>
248 </li>
249
249
250 <li>
250 <li>
251 <a class="menu_link" title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}">
251 <a class="menu_link" title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}">
252 <span class="icon_short">
252 <span class="icon_short">
253 <img src="${h.url('/images/icons/heart.png')}" alt="${_('Followers')}" />
253 <img src="${h.url('/images/icons/heart.png')}" alt="${_('Followers')}" />
254 </span>
254 </span>
255 <span id="current_followers_count" class="short">${c.repository_followers}</span>
255 <span id="current_followers_count" class="short">${c.repository_followers}</span>
256 </a>
256 </a>
257 </li>
257 </li>
258 <li>
258 <li>
259 <a class="menu_link" title="${_('Forks')}" href="${h.url('repo_forks_home',repo_name=c.repo_name)}">
259 <a class="menu_link" title="${_('Forks')}" href="${h.url('repo_forks_home',repo_name=c.repo_name)}">
260 <span class="icon_short">
260 <span class="icon_short">
261 <img src="${h.url('/images/icons/arrow_divide.png')}" alt="${_('Forks')}" />
261 <img src="${h.url('/images/icons/arrow_divide.png')}" alt="${_('Forks')}" />
262 </span>
262 </span>
263 <span class="short">${c.repository_forks}</span>
263 <span class="short">${c.repository_forks}</span>
264 </a>
264 </a>
265 </li>
265 </li>
266 <li>
266 <li>
267 <a class="menu_link" title="${_('Pull requests')}" href="${h.url('pullrequest_show_all',repo_name=c.repo_name)}">
267 <a class="menu_link" title="${_('Pull requests')}" href="${h.url('pullrequest_show_all',repo_name=c.repo_name)}">
268 <span class="icon_short">
268 <span class="icon_short">
269 <img src="${h.url('/images/icons/arrow_join.png')}" alt="${_('Pull requests')}" />
269 <img src="${h.url('/images/icons/arrow_join.png')}" alt="${_('Pull requests')}" />
270 </span>
270 </span>
271 <span class="short">${c.repository_pull_requests}</span>
271 <span class="short">${c.repository_pull_requests}</span>
272 </a>
272 </a>
273 </li>
273 </li>
274 ${usermenu()}
274 ${usermenu()}
275 </ul>
275 </ul>
276 <script type="text/javascript">
276 <script type="text/javascript">
277 YUE.on('repo_switcher','mouseover',function(){
277 YUE.on('repo_switcher','mouseover',function(){
278 function qfilter(){
278 function qfilter(){
279 var nodes = YUQ('ul#repo_switcher_list li a.repo_name');
279 var nodes = YUQ('ul#repo_switcher_list li a.repo_name');
280 var target = 'q_filter_rs';
280 var target = 'q_filter_rs';
281 var func = function(node){
281 var func = function(node){
282 return node.parentNode;
282 return node.parentNode;
283 }
283 }
284 q_filter(target,nodes,func);
284 q_filter(target,nodes,func);
285 }
285 }
286 var loaded = YUD.hasClass('repo_switcher','loaded');
286 var loaded = YUD.hasClass('repo_switcher','loaded');
287 if(!loaded){
287 if(!loaded){
288 YUD.addClass('repo_switcher','loaded');
288 YUD.addClass('repo_switcher','loaded');
289 ypjax("${h.url('repo_switcher')}",'repo_switcher_list',
289 ypjax("${h.url('repo_switcher')}",'repo_switcher_list',
290 function(o){qfilter();},
290 function(o){qfilter();},
291 function(o){YUD.removeClass('repo_switcher','loaded');}
291 function(o){YUD.removeClass('repo_switcher','loaded');}
292 ,null);
292 ,null);
293 }
293 }
294 return false;
294 return false;
295 });
295 });
296
296
297 YUE.on('branch_tag_switcher','mouseover',function(){
297 YUE.on('branch_tag_switcher','mouseover',function(){
298 var loaded = YUD.hasClass('branch_tag_switcher','loaded');
298 var loaded = YUD.hasClass('branch_tag_switcher','loaded');
299 if(!loaded){
299 if(!loaded){
300 YUD.addClass('branch_tag_switcher','loaded');
300 YUD.addClass('branch_tag_switcher','loaded');
301 ypjax("${h.url('branch_tag_switcher',repo_name=c.repo_name)}",'switch_to_list',
301 ypjax("${h.url('branch_tag_switcher',repo_name=c.repo_name)}",'switch_to_list',
302 function(o){},
302 function(o){},
303 function(o){YUD.removeClass('branch_tag_switcher','loaded');}
303 function(o){YUD.removeClass('branch_tag_switcher','loaded');}
304 ,null);
304 ,null);
305 }
305 }
306 return false;
306 return false;
307 });
307 });
308 </script>
308 </script>
309 %else:
309 %else:
310 ##ROOT MENU
310 ##ROOT MENU
311 <ul id="quick">
311 <ul id="quick">
312 <li>
312 <li>
313 <a class="menu_link" title="${_('Home')}" href="${h.url('home')}">
313 <a class="menu_link" title="${_('Home')}" href="${h.url('home')}">
314 <span class="icon">
314 <span class="icon">
315 <img src="${h.url('/images/icons/home_16.png')}" alt="${_('Home')}" />
315 <img src="${h.url('/images/icons/home_16.png')}" alt="${_('Home')}" />
316 </span>
316 </span>
317 <span>${_('Home')}</span>
317 <span>${_('Home')}</span>
318 </a>
318 </a>
319 </li>
319 </li>
320 %if c.rhodecode_user.username != 'default':
320 %if c.rhodecode_user.username != 'default':
321 <li>
321 <li>
322 <a class="menu_link" title="${_('Journal')}" href="${h.url('journal')}">
322 <a class="menu_link" title="${_('Journal')}" href="${h.url('journal')}">
323 <span class="icon">
323 <span class="icon">
324 <img src="${h.url('/images/icons/book.png')}" alt="${_('Journal')}" />
324 <img src="${h.url('/images/icons/book.png')}" alt="${_('Journal')}" />
325 </span>
325 </span>
326 <span>${_('Journal')}</span>
326 <span>${_('Journal')}</span>
327 </a>
327 </a>
328 </li>
328 </li>
329 %else:
329 %else:
330 <li>
330 <li>
331 <a class="menu_link" title="${_('Public journal')}" href="${h.url('public_journal')}">
331 <a class="menu_link" title="${_('Public journal')}" href="${h.url('public_journal')}">
332 <span class="icon">
332 <span class="icon">
333 <img src="${h.url('/images/icons/book.png')}" alt="${_('Public journal')}" />
333 <img src="${h.url('/images/icons/book.png')}" alt="${_('Public journal')}" />
334 </span>
334 </span>
335 <span>${_('Public journal')}</span>
335 <span>${_('Public journal')}</span>
336 </a>
336 </a>
337 </li>
337 </li>
338 %endif
338 %endif
339 <li>
339 <li>
340 <a class="menu_link" title="${_('Search')}" href="${h.url('search')}">
340 <a class="menu_link" title="${_('Search')}" href="${h.url('search')}">
341 <span class="icon">
341 <span class="icon">
342 <img src="${h.url('/images/icons/search_16.png')}" alt="${_('Search')}" />
342 <img src="${h.url('/images/icons/search_16.png')}" alt="${_('Search')}" />
343 </span>
343 </span>
344 <span>${_('Search')}</span>
344 <span>${_('Search')}</span>
345 </a>
345 </a>
346 </li>
346 </li>
347
347
348 %if h.HasPermissionAll('hg.admin')('access admin main page'):
348 %if h.HasPermissionAll('hg.admin')('access admin main page'):
349 <li ${is_current('admin')}>
349 <li ${is_current('admin')}>
350 <a class="menu_link" title="${_('Admin')}" href="${h.url('admin_home')}">
350 <a class="menu_link" title="${_('Admin')}" href="${h.url('admin_home')}">
351 <span class="icon">
351 <span class="icon">
352 <img src="${h.url('/images/icons/cog_edit.png')}" alt="${_('Admin')}" />
352 <img src="${h.url('/images/icons/cog_edit.png')}" alt="${_('Admin')}" />
353 </span>
353 </span>
354 <span>${_('Admin')}</span>
354 <span>${_('Admin')}</span>
355 </a>
355 </a>
356 ${admin_menu()}
356 ${admin_menu()}
357 </li>
357 </li>
358 %endif
358 %endif
359 ${usermenu()}
359 ${usermenu()}
360 </ul>
360 </ul>
361 %endif
361 %endif
362 </%def>
362 </%def>
@@ -1,306 +1,306 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 ${_('%s Changelog') % c.repo_name} - ${c.rhodecode_name}
6 ${_('%s Changelog') % c.repo_name} - ${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 <% size = c.size if c.size <= c.total_cs else c.total_cs %>
14 <% size = c.size if c.size <= c.total_cs else c.total_cs %>
15 ${_('Changelog')} - ${ungettext('showing %d out of %d revision', 'showing %d out of %d revisions', size) % (size, c.total_cs)}
15 ${_('Changelog')} - ${ungettext('showing %d out of %d revision', 'showing %d out of %d revisions', size) % (size, c.total_cs)}
16 </%def>
16 </%def>
17
17
18 <%def name="page_nav()">
18 <%def name="page_nav()">
19 ${self.menu('changelog')}
19 ${self.menu('changelog')}
20 </%def>
20 </%def>
21
21
22 <%def name="main()">
22 <%def name="main()">
23 <div class="box">
23 <div class="box">
24 <!-- box / title -->
24 <!-- box / title -->
25 <div class="title">
25 <div class="title">
26 ${self.breadcrumbs()}
26 ${self.breadcrumbs()}
27 </div>
27 </div>
28 <div class="table">
28 <div class="table">
29 % if c.pagination:
29 % if c.pagination:
30 <div id="graph">
30 <div id="graph">
31 <div id="graph_nodes">
31 <div id="graph_nodes">
32 <canvas id="graph_canvas"></canvas>
32 <canvas id="graph_canvas"></canvas>
33 </div>
33 </div>
34 <div id="graph_content">
34 <div id="graph_content">
35 <div class="info_box" style="clear: both;padding: 10px 6px;vertical-align: right;text-align: right;">
35 <div class="info_box" style="clear: both;padding: 10px 6px;vertical-align: right;text-align: right;">
36 <a href="#" class="ui-btn small" id="rev_range_container" style="display:none"></a>
36 <a href="#" class="ui-btn small" id="rev_range_container" style="display:none"></a>
37 <a href="#" class="ui-btn small" id="rev_range_clear" style="display:none">${_('Clear selection')}</a>
37 <a href="#" class="ui-btn small" id="rev_range_clear" style="display:none">${_('Clear selection')}</a>
38
38
39 %if c.rhodecode_db_repo.fork:
39 %if c.rhodecode_db_repo.fork:
40 <a title="${_('compare fork with %s' % c.rhodecode_db_repo.fork.repo_name)}" href="${h.url('compare_url',repo_name=c.repo_name,org_ref_type='branch',org_ref=request.GET.get('branch') or 'default',other_ref_type='branch',other_ref='default',repo=c.rhodecode_db_repo.fork.repo_name)}" class="ui-btn small">${_('Compare fork with parent')}</a>
40 <a title="${_('compare fork with %s' % c.rhodecode_db_repo.fork.repo_name)}" href="${h.url('compare_url',repo_name=c.repo_name,org_ref_type='branch',org_ref=request.GET.get('branch') or 'default',other_ref_type='branch',other_ref='default',repo=c.rhodecode_db_repo.fork.repo_name)}" class="ui-btn small">${_('Compare fork with parent')}</a>
41 %endif
41 %endif
42 %if h.is_hg(c.rhodecode_repo):
42 %if h.is_hg(c.rhodecode_repo):
43 <a id="open_new_pr" href="${h.url('pullrequest_home',repo_name=c.repo_name)}" class="ui-btn small">${_('Open new pull request')}</a>
43 <a id="open_new_pr" href="${h.url('pullrequest_home',repo_name=c.repo_name)}" class="ui-btn small">${_('open new pull request')}</a>
44 %endif
44 %endif
45 </div>
45 </div>
46 <div class="container_header">
46 <div class="container_header">
47 ${h.form(h.url.current(),method='get')}
47 ${h.form(h.url.current(),method='get')}
48 <div class="info_box" style="float:left">
48 <div class="info_box" style="float:left">
49 ${h.submit('set',_('Show'),class_="ui-btn")}
49 ${h.submit('set',_('Show'),class_="ui-btn")}
50 ${h.text('size',size=1,value=c.size)}
50 ${h.text('size',size=1,value=c.size)}
51 ${_('revisions')}
51 ${_('revisions')}
52 </div>
52 </div>
53 ${h.end_form()}
53 ${h.end_form()}
54 <div style="float:right">${h.select('branch_filter',c.branch_name,c.branch_filters)}</div>
54 <div style="float:right">${h.select('branch_filter',c.branch_name,c.branch_filters)}</div>
55 </div>
55 </div>
56
56
57 %for cnt,cs in enumerate(c.pagination):
57 %for cnt,cs in enumerate(c.pagination):
58 <div id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}">
58 <div id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}">
59 <div class="left">
59 <div class="left">
60 <div>
60 <div>
61 ${h.checkbox(cs.raw_id,class_="changeset_range")}
61 ${h.checkbox(cs.raw_id,class_="changeset_range")}
62 <span class="tooltip" title="${h.tooltip(h.age(cs.date))}"><a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"><span class="changeset_id">${cs.revision}:<span class="changeset_hash">${h.short_id(cs.raw_id)}</span></span></a></span>
62 <span class="tooltip" title="${h.tooltip(h.age(cs.date))}"><a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"><span class="changeset_id">${cs.revision}:<span class="changeset_hash">${h.short_id(cs.raw_id)}</span></span></a></span>
63 </div>
63 </div>
64 <div class="author">
64 <div class="author">
65 <div class="gravatar">
65 <div class="gravatar">
66 <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(cs.author),16)}"/>
66 <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(cs.author),16)}"/>
67 </div>
67 </div>
68 <div title="${cs.author}" class="user">${h.shorter(h.person(cs.author),22)}</div>
68 <div title="${cs.author}" class="user">${h.shorter(h.person(cs.author),22)}</div>
69 </div>
69 </div>
70 <div class="date">${h.fmt_date(cs.date)}</div>
70 <div class="date">${h.fmt_date(cs.date)}</div>
71 </div>
71 </div>
72 <div class="mid">
72 <div class="mid">
73 <div class="message">${h.urlify_commit(cs.message, c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
73 <div class="message">${h.urlify_commit(cs.message, c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
74 <div class="expand"><span class="expandtext">&darr; ${_('show more')} &darr;</span></div>
74 <div class="expand"><span class="expandtext">&darr; ${_('show more')} &darr;</span></div>
75 </div>
75 </div>
76 <div class="right">
76 <div class="right">
77 <div class="changes">
77 <div class="changes">
78 <div id="changed_total_${cs.raw_id}" style="float:right;" class="changed_total tooltip" title="${h.tooltip(_('Affected number of files, click to show more details'))}">${len(cs.affected_files)}</div>
78 <div id="changed_total_${cs.raw_id}" style="float:right;" class="changed_total tooltip" title="${h.tooltip(_('Affected number of files, click to show more details'))}">${len(cs.affected_files)}</div>
79 <div class="comments-container">
79 <div class="comments-container">
80 %if len(c.comments.get(cs.raw_id,[])) > 0:
80 %if len(c.comments.get(cs.raw_id,[])) > 0:
81 <div class="comments-cnt" title="${('comments')}">
81 <div class="comments-cnt" title="${('comments')}">
82 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}">
82 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}">
83 <div class="comments-cnt">${len(c.comments[cs.raw_id])}</div>
83 <div class="comments-cnt">${len(c.comments[cs.raw_id])}</div>
84 <img src="${h.url('/images/icons/comments.png')}">
84 <img src="${h.url('/images/icons/comments.png')}">
85 </a>
85 </a>
86 </div>
86 </div>
87 %endif
87 %endif
88 </div>
88 </div>
89 <div class="changeset-status-container">
89 <div class="changeset-status-container">
90 %if c.statuses.get(cs.raw_id):
90 %if c.statuses.get(cs.raw_id):
91 <div title="${_('Changeset status')}" class="changeset-status-lbl">${c.statuses.get(cs.raw_id)[1]}</div>
91 <div title="${_('Changeset status')}" class="changeset-status-lbl">${c.statuses.get(cs.raw_id)[1]}</div>
92 <div class="changeset-status-ico">
92 <div class="changeset-status-ico">
93 %if c.statuses.get(cs.raw_id)[2]:
93 %if c.statuses.get(cs.raw_id)[2]:
94 <a class="tooltip" title="${_('Click to open associated pull request')}" href="${h.url('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}"><img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" /></a>
94 <a class="tooltip" title="${_('Click to open associated pull request')}" href="${h.url('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}"><img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" /></a>
95 %else:
95 %else:
96 <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" />
96 <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" />
97 %endif
97 %endif
98 </div>
98 </div>
99 %endif
99 %endif
100 </div>
100 </div>
101 </div>
101 </div>
102 %if cs.parents:
102 %if cs.parents:
103 %for p_cs in reversed(cs.parents):
103 %for p_cs in reversed(cs.parents):
104 <div class="parent">${_('Parent')}
104 <div class="parent">${_('Parent')}
105 <span class="changeset_id">${p_cs.revision}:<span class="changeset_hash">${h.link_to(h.short_id(p_cs.raw_id),
105 <span class="changeset_id">${p_cs.revision}:<span class="changeset_hash">${h.link_to(h.short_id(p_cs.raw_id),
106 h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}</span></span>
106 h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}</span></span>
107 </div>
107 </div>
108 %endfor
108 %endfor
109 %else:
109 %else:
110 <div class="parent">${_('No parents')}</div>
110 <div class="parent">${_('No parents')}</div>
111 %endif
111 %endif
112
112
113 <span class="logtags">
113 <span class="logtags">
114 %if len(cs.parents)>1:
114 %if len(cs.parents)>1:
115 <span class="merge">${_('merge')}</span>
115 <span class="merge">${_('merge')}</span>
116 %endif
116 %endif
117 %if cs.branch:
117 %if cs.branch:
118 <span class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}">
118 <span class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}">
119 ${h.link_to(h.shorter(cs.branch),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
119 ${h.link_to(h.shorter(cs.branch),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
120 </span>
120 </span>
121 %endif
121 %endif
122 %if h.is_hg(c.rhodecode_repo):
122 %if h.is_hg(c.rhodecode_repo):
123 %for book in cs.bookmarks:
123 %for book in cs.bookmarks:
124 <span class="bookbook" title="${'%s %s' % (_('bookmark'),book)}">
124 <span class="bookbook" title="${'%s %s' % (_('bookmark'),book)}">
125 ${h.link_to(h.shorter(book),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
125 ${h.link_to(h.shorter(book),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
126 </span>
126 </span>
127 %endfor
127 %endfor
128 %endif
128 %endif
129 %for tag in cs.tags:
129 %for tag in cs.tags:
130 <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}">
130 <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}">
131 ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span>
131 ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span>
132 %endfor
132 %endfor
133 </span>
133 </span>
134 </div>
134 </div>
135 </div>
135 </div>
136
136
137 %endfor
137 %endfor
138 <div class="pagination-wh pagination-left">
138 <div class="pagination-wh pagination-left">
139 ${c.pagination.pager('$link_previous ~2~ $link_next')}
139 ${c.pagination.pager('$link_previous ~2~ $link_next')}
140 </div>
140 </div>
141 </div>
141 </div>
142 </div>
142 </div>
143
143
144 <script type="text/javascript" src="${h.url('/js/graph.js')}"></script>
144 <script type="text/javascript" src="${h.url('/js/graph.js')}"></script>
145 <script type="text/javascript">
145 <script type="text/javascript">
146 YAHOO.util.Event.onDOMReady(function(){
146 YAHOO.util.Event.onDOMReady(function(){
147
147
148 //Monitor range checkboxes and build a link to changesets
148 //Monitor range checkboxes and build a link to changesets
149 //ranges
149 //ranges
150 var checkboxes = YUD.getElementsByClassName('changeset_range');
150 var checkboxes = YUD.getElementsByClassName('changeset_range');
151 var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}";
151 var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}";
152 var pr_tmpl = "${h.url('pullrequest_home',repo_name=c.repo_name)}";
152 var pr_tmpl = "${h.url('pullrequest_home',repo_name=c.repo_name)}";
153 YUE.on(checkboxes,'click',function(e){
153 YUE.on(checkboxes,'click',function(e){
154 var clicked_cb = e.currentTarget;
154 var clicked_cb = e.currentTarget;
155 var checked_checkboxes = [];
155 var checked_checkboxes = [];
156 for (pos in checkboxes){
156 for (pos in checkboxes){
157 if(checkboxes[pos].checked){
157 if(checkboxes[pos].checked){
158 checked_checkboxes.push(checkboxes[pos]);
158 checked_checkboxes.push(checkboxes[pos]);
159 }
159 }
160 }
160 }
161 if(YUD.get('open_new_pr')){
161 if(YUD.get('open_new_pr')){
162 if(checked_checkboxes.length>0){
162 if(checked_checkboxes.length>0){
163 // modify open pull request to show we have selected cs
163 // modify open pull request to show we have selected cs
164 YUD.get('open_new_pr').innerHTML = _TM['Open new pull request for selected changesets'];
164 YUD.get('open_new_pr').innerHTML = _TM['Open new pull request for selected changesets'];
165
165
166 }else{
166 }else{
167 YUD.get('open_new_pr').innerHTML = _TM['Open new pull request'];
167 YUD.get('open_new_pr').innerHTML = _TM['Open new pull request'];
168 }
168 }
169 }
169 }
170
170
171 if(checked_checkboxes.length>0){
171 if(checked_checkboxes.length>0){
172 var rev_end = checked_checkboxes[0].name;
172 var rev_end = checked_checkboxes[0].name;
173 var rev_start = checked_checkboxes[checked_checkboxes.length-1].name;
173 var rev_start = checked_checkboxes[checked_checkboxes.length-1].name;
174
174
175 // now select all checkboxes in the middle.
175 // now select all checkboxes in the middle.
176 var checked = false;
176 var checked = false;
177 for (var i=0; i<checkboxes.length; i++){
177 for (var i=0; i<checkboxes.length; i++){
178 var cb = checkboxes[i];
178 var cb = checkboxes[i];
179 var rev = cb.name;
179 var rev = cb.name;
180
180
181 if (rev == rev_end){
181 if (rev == rev_end){
182 checked = true;
182 checked = true;
183 }
183 }
184 if (checked){
184 if (checked){
185 cb.checked = true;
185 cb.checked = true;
186 }
186 }
187 else{
187 else{
188 cb.checked = false;
188 cb.checked = false;
189 }
189 }
190 if (rev == rev_start){
190 if (rev == rev_start){
191 checked = false;
191 checked = false;
192 }
192 }
193
193
194 }
194 }
195
195
196 var url = url_tmpl.replace('__REVRANGE__',
196 var url = url_tmpl.replace('__REVRANGE__',
197 rev_start+'...'+rev_end);
197 rev_start+'...'+rev_end);
198
198
199 var link = _TM['Show selected changes __S -> __E'];
199 var link = _TM['Show selected changes __S -> __E'];
200 link = link.replace('__S',rev_start.substr(0,6));
200 link = link.replace('__S',rev_start.substr(0,6));
201 link = link.replace('__E',rev_end.substr(0,6));
201 link = link.replace('__E',rev_end.substr(0,6));
202 YUD.get('rev_range_container').href = url;
202 YUD.get('rev_range_container').href = url;
203 YUD.get('rev_range_container').innerHTML = link;
203 YUD.get('rev_range_container').innerHTML = link;
204 YUD.setStyle('rev_range_container','display','');
204 YUD.setStyle('rev_range_container','display','');
205 YUD.setStyle('rev_range_clear','display','');
205 YUD.setStyle('rev_range_clear','display','');
206
206
207 YUD.get('open_new_pr').href = pr_tmpl + '?rev_start={0}&rev_end={1}'.format(rev_start,rev_end);
207 YUD.get('open_new_pr').href = pr_tmpl + '?rev_start={0}&rev_end={1}'.format(rev_start,rev_end);
208
208
209 }
209 }
210 else{
210 else{
211 YUD.setStyle('rev_range_container','display','none');
211 YUD.setStyle('rev_range_container','display','none');
212 YUD.setStyle('rev_range_clear','display','none');
212 YUD.setStyle('rev_range_clear','display','none');
213 }
213 }
214 });
214 });
215 YUE.on('rev_range_clear','click',function(e){
215 YUE.on('rev_range_clear','click',function(e){
216 for (var i=0; i<checkboxes.length; i++){
216 for (var i=0; i<checkboxes.length; i++){
217 var cb = checkboxes[i];
217 var cb = checkboxes[i];
218 cb.checked = false;
218 cb.checked = false;
219 }
219 }
220 YUE.preventDefault(e);
220 YUE.preventDefault(e);
221 })
221 })
222 var msgs = YUQ('.message');
222 var msgs = YUQ('.message');
223 // get first element height
223 // get first element height
224 var el = YUQ('#graph_content .container')[0];
224 var el = YUQ('#graph_content .container')[0];
225 var row_h = el.clientHeight;
225 var row_h = el.clientHeight;
226 for(var i=0;i<msgs.length;i++){
226 for(var i=0;i<msgs.length;i++){
227 var m = msgs[i];
227 var m = msgs[i];
228
228
229 var h = m.clientHeight;
229 var h = m.clientHeight;
230 var pad = YUD.getStyle(m,'padding');
230 var pad = YUD.getStyle(m,'padding');
231 if(h > row_h){
231 if(h > row_h){
232 var offset = row_h - (h+12);
232 var offset = row_h - (h+12);
233 YUD.setStyle(m.nextElementSibling,'display','block');
233 YUD.setStyle(m.nextElementSibling,'display','block');
234 YUD.setStyle(m.nextElementSibling,'margin-top',offset+'px');
234 YUD.setStyle(m.nextElementSibling,'margin-top',offset+'px');
235 };
235 };
236 }
236 }
237 YUE.on(YUQ('.expand'),'click',function(e){
237 YUE.on(YUQ('.expand'),'click',function(e){
238 var elem = e.currentTarget.parentNode.parentNode;
238 var elem = e.currentTarget.parentNode.parentNode;
239 YUD.setStyle(e.currentTarget,'display','none');
239 YUD.setStyle(e.currentTarget,'display','none');
240 YUD.setStyle(elem,'height','auto');
240 YUD.setStyle(elem,'height','auto');
241
241
242 //redraw the graph, line_count and jsdata are global vars
242 //redraw the graph, line_count and jsdata are global vars
243 set_canvas(100);
243 set_canvas(100);
244
244
245 var r = new BranchRenderer();
245 var r = new BranchRenderer();
246 r.render(jsdata,100,line_count);
246 r.render(jsdata,100,line_count);
247
247
248 })
248 })
249
249
250 // Fetch changeset details
250 // Fetch changeset details
251 YUE.on(YUD.getElementsByClassName('changed_total'),'click',function(e){
251 YUE.on(YUD.getElementsByClassName('changed_total'),'click',function(e){
252 var id = e.currentTarget.id;
252 var id = e.currentTarget.id;
253 var url = "${h.url('changelog_details',repo_name=c.repo_name,cs='__CS__')}";
253 var url = "${h.url('changelog_details',repo_name=c.repo_name,cs='__CS__')}";
254 var url = url.replace('__CS__',id.replace('changed_total_',''));
254 var url = url.replace('__CS__',id.replace('changed_total_',''));
255 ypjax(url,id,function(){tooltip_activate()});
255 ypjax(url,id,function(){tooltip_activate()});
256 });
256 });
257
257
258 // change branch filter
258 // change branch filter
259 YUE.on(YUD.get('branch_filter'),'change',function(e){
259 YUE.on(YUD.get('branch_filter'),'change',function(e){
260 var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value;
260 var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value;
261 var url_main = "${h.url('changelog_home',repo_name=c.repo_name)}";
261 var url_main = "${h.url('changelog_home',repo_name=c.repo_name)}";
262 var url = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}";
262 var url = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}";
263 var url = url.replace('__BRANCH__',selected_branch);
263 var url = url.replace('__BRANCH__',selected_branch);
264 if(selected_branch != ''){
264 if(selected_branch != ''){
265 window.location = url;
265 window.location = url;
266 }else{
266 }else{
267 window.location = url_main;
267 window.location = url_main;
268 }
268 }
269
269
270 });
270 });
271
271
272 function set_canvas(width) {
272 function set_canvas(width) {
273 var c = document.getElementById('graph_nodes');
273 var c = document.getElementById('graph_nodes');
274 var t = document.getElementById('graph_content');
274 var t = document.getElementById('graph_content');
275 canvas = document.getElementById('graph_canvas');
275 canvas = document.getElementById('graph_canvas');
276 var div_h = t.clientHeight;
276 var div_h = t.clientHeight;
277 c.style.height=div_h+'px';
277 c.style.height=div_h+'px';
278 canvas.setAttribute('height',div_h);
278 canvas.setAttribute('height',div_h);
279 c.style.height=width+'px';
279 c.style.height=width+'px';
280 canvas.setAttribute('width',width);
280 canvas.setAttribute('width',width);
281 };
281 };
282 var heads = 1;
282 var heads = 1;
283 var line_count = 0;
283 var line_count = 0;
284 var jsdata = ${c.jsdata|n};
284 var jsdata = ${c.jsdata|n};
285
285
286 for (var i=0;i<jsdata.length;i++) {
286 for (var i=0;i<jsdata.length;i++) {
287 var in_l = jsdata[i][2];
287 var in_l = jsdata[i][2];
288 for (var j in in_l) {
288 for (var j in in_l) {
289 var m = in_l[j][1];
289 var m = in_l[j][1];
290 if (m > line_count)
290 if (m > line_count)
291 line_count = m;
291 line_count = m;
292 }
292 }
293 }
293 }
294 set_canvas(100);
294 set_canvas(100);
295
295
296 var r = new BranchRenderer();
296 var r = new BranchRenderer();
297 r.render(jsdata,100,line_count);
297 r.render(jsdata,100,line_count);
298
298
299 });
299 });
300 </script>
300 </script>
301 %else:
301 %else:
302 ${_('There are no changes yet')}
302 ${_('There are no changes yet')}
303 %endif
303 %endif
304 </div>
304 </div>
305 </div>
305 </div>
306 </%def>
306 </%def>
General Comments 0
You need to be logged in to leave comments. Login now