Show More
@@ -1,355 +1,349 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-dd"></div> |
|
5 | <div id="header-dd"></div> | |
6 | <div id="header"> |
|
6 | <div id="header"> | |
7 | <div id="header-inner" class="title"> |
|
7 | <div id="header-inner" class="title"> | |
8 | <div id="logo"> |
|
8 | <div id="logo"> | |
9 | <h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1> |
|
9 | <h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1> | |
10 | </div> |
|
10 | </div> | |
11 | <!-- MENU --> |
|
11 | <!-- MENU --> | |
12 | ${self.page_nav()} |
|
12 | ${self.page_nav()} | |
13 | <!-- END MENU --> |
|
13 | <!-- END MENU --> | |
14 | ${self.body()} |
|
14 | ${self.body()} | |
15 | </div> |
|
15 | </div> | |
16 | </div> |
|
16 | </div> | |
17 | <!-- END HEADER --> |
|
17 | <!-- END HEADER --> | |
18 |
|
18 | |||
19 | <!-- CONTENT --> |
|
19 | <!-- CONTENT --> | |
20 | <div id="content"> |
|
20 | <div id="content"> | |
21 | <div class="flash_msg"> |
|
21 | <div class="flash_msg"> | |
22 | <% messages = h.flash.pop_messages() %> |
|
22 | <% messages = h.flash.pop_messages() %> | |
23 | % if messages: |
|
23 | % if messages: | |
24 | <ul id="flash-messages"> |
|
24 | <ul id="flash-messages"> | |
25 | % for message in messages: |
|
25 | % for message in messages: | |
26 | <li class="${message.category}_msg">${message}</li> |
|
26 | <li class="${message.category}_msg">${message}</li> | |
27 | % endfor |
|
27 | % endfor | |
28 | </ul> |
|
28 | </ul> | |
29 | % endif |
|
29 | % endif | |
30 | </div> |
|
30 | </div> | |
31 | <div id="main"> |
|
31 | <div id="main"> | |
32 | ${next.main()} |
|
32 | ${next.main()} | |
33 | </div> |
|
33 | </div> | |
34 | </div> |
|
34 | </div> | |
35 | <!-- END CONTENT --> |
|
35 | <!-- END CONTENT --> | |
36 |
|
36 | |||
37 | <!-- FOOTER --> |
|
37 | <!-- FOOTER --> | |
38 | <div id="footer"> |
|
38 | <div id="footer"> | |
39 | <div id="footer-inner" class="title"> |
|
39 | <div id="footer-inner" class="title"> | |
40 | <div> |
|
40 | <div> | |
41 | <p class="footer-link"> |
|
41 | <p class="footer-link"> | |
42 | <a href="${h.url('bugtracker')}">${_('Submit a bug')}</a> |
|
42 | <a href="${h.url('bugtracker')}">${_('Submit a bug')}</a> | |
43 | </p> |
|
43 | </p> | |
44 | <p class="footer-link-right"> |
|
44 | <p class="footer-link-right"> | |
45 | <a href="${h.url('rhodecode_official')}">RhodeCode${'-%s' % c.rhodecode_instanceid if c.rhodecode_instanceid else ''}</a> |
|
45 | <a href="${h.url('rhodecode_official')}">RhodeCode${'-%s' % c.rhodecode_instanceid if c.rhodecode_instanceid else ''}</a> | |
46 | ${c.rhodecode_version} © 2010-${h.datetime.today().year} by Marcin Kuzminski |
|
46 | ${c.rhodecode_version} © 2010-${h.datetime.today().year} by Marcin Kuzminski | |
47 | </p> |
|
47 | </p> | |
48 | </div> |
|
48 | </div> | |
49 | </div> |
|
49 | </div> | |
50 | </div> |
|
50 | </div> | |
51 | <!-- END FOOTER --> |
|
51 | <!-- END FOOTER --> | |
52 |
|
52 | |||
53 | ### MAKO DEFS ### |
|
53 | ### MAKO DEFS ### | |
54 | <%def name="page_nav()"> |
|
|||
55 | ${self.menu()} |
|
|||
56 | </%def> |
|
|||
57 |
|
||||
58 | <%def name="breadcrumbs()"> |
|
54 | <%def name="breadcrumbs()"> | |
59 | <div class="breadcrumbs"> |
|
55 | <div class="breadcrumbs"> | |
60 | ${self.breadcrumbs_links()} |
|
56 | ${self.breadcrumbs_links()} | |
61 | </div> |
|
57 | </div> | |
62 | </%def> |
|
58 | </%def> | |
63 |
|
59 | |||
64 |
<%def name="context_bar(current |
|
60 | <%def name="context_bar(current)"> | |
65 | %if c.repo_name: |
|
|||
66 | ${repo_context_bar(current)} |
|
61 | ${repo_context_bar(current)} | |
67 | %endif |
|
|||
68 | </%def> |
|
62 | </%def> | |
69 |
|
63 | |||
70 | <%def name="admin_menu()"> |
|
64 | <%def name="admin_menu()"> | |
71 | <ul class="admin_menu"> |
|
65 | <ul class="admin_menu"> | |
72 | <li>${h.link_to(_('admin journal'),h.url('admin_home'),class_='journal ')}</li> |
|
66 | <li>${h.link_to(_('admin journal'),h.url('admin_home'),class_='journal ')}</li> | |
73 | <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li> |
|
67 | <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li> | |
74 | <li>${h.link_to(_('repository groups'),h.url('repos_groups'),class_='repos_groups')}</li> |
|
68 | <li>${h.link_to(_('repository groups'),h.url('repos_groups'),class_='repos_groups')}</li> | |
75 | <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li> |
|
69 | <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li> | |
76 | <li>${h.link_to(_('user groups'),h.url('users_groups'),class_='groups')}</li> |
|
70 | <li>${h.link_to(_('user groups'),h.url('users_groups'),class_='groups')}</li> | |
77 | <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li> |
|
71 | <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li> | |
78 | <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li> |
|
72 | <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li> | |
79 | <li>${h.link_to(_('defaults'),h.url('defaults'),class_='defaults')}</li> |
|
73 | <li>${h.link_to(_('defaults'),h.url('defaults'),class_='defaults')}</li> | |
80 | <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li> |
|
74 | <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li> | |
81 | </ul> |
|
75 | </ul> | |
82 | </%def> |
|
76 | </%def> | |
83 |
|
77 | |||
84 | <%def name="admin_menu_simple()"> |
|
78 | <%def name="admin_menu_simple()"> | |
85 | <ul> |
|
79 | <ul> | |
86 | <li>${h.link_to(_('repository groups'),h.url('repos_groups'),class_='repos_groups')}</li> |
|
80 | <li>${h.link_to(_('repository groups'),h.url('repos_groups'),class_='repos_groups')}</li> | |
87 | </ul> |
|
81 | </ul> | |
88 | </%def> |
|
82 | </%def> | |
89 |
|
83 | |||
90 | <%def name="repo_context_bar(current=None)"> |
|
84 | <%def name="repo_context_bar(current=None)"> | |
91 | <% |
|
85 | <% | |
92 | def follow_class(): |
|
86 | def follow_class(): | |
93 | if c.repository_following: |
|
87 | if c.repository_following: | |
94 | return h.literal('following') |
|
88 | return h.literal('following') | |
95 | else: |
|
89 | else: | |
96 | return h.literal('follow') |
|
90 | return h.literal('follow') | |
97 | %> |
|
91 | %> | |
98 | <% |
|
92 | <% | |
99 | def is_current(selected): |
|
93 | def is_current(selected): | |
100 | if selected == current: |
|
94 | if selected == current: | |
101 | return h.literal('class="current"') |
|
95 | return h.literal('class="current"') | |
102 | %> |
|
96 | %> | |
103 |
|
97 | |||
104 | <!--- CONTEXT BAR --> |
|
98 | <!--- CONTEXT BAR --> | |
105 | <div id="context-bar" class="box"> |
|
99 | <div id="context-bar" class="box"> | |
106 | <div id="context-top"> |
|
100 | <div id="context-top"> | |
107 | <div id="breadcrumbs"> |
|
101 | <div id="breadcrumbs"> | |
108 | ${h.link_to(_(u'Repositories'),h.url('home'))} |
|
102 | ${h.link_to(_(u'Repositories'),h.url('home'))} | |
109 | » |
|
103 | » | |
110 | ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)} |
|
104 | ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)} | |
111 | </div> |
|
105 | </div> | |
112 | ## TODO: this check feels wrong, it would be better to have a check for permissions |
|
106 | ## TODO: this check feels wrong, it would be better to have a check for permissions | |
113 | ## also it feels like a job for the controller |
|
107 | ## also it feels like a job for the controller | |
114 | %if c.rhodecode_user.username != 'default': |
|
108 | %if c.rhodecode_user.username != 'default': | |
115 | <ul id="context-actions" class="horizontal-list"> |
|
109 | <ul id="context-actions" class="horizontal-list"> | |
116 | <li> |
|
110 | <li> | |
117 | <button class="${follow_class()}" onclick="javascript:toggleFollowingRepo(this,${c.rhodecode_db_repo.repo_id},'${str(h.get_token())}');"> |
|
111 | <button class="${follow_class()}" onclick="javascript:toggleFollowingRepo(this,${c.rhodecode_db_repo.repo_id},'${str(h.get_token())}');"> | |
118 | <!--span class="icon show-follow follow"></span> |
|
112 | <!--span class="icon show-follow follow"></span> | |
119 | <span class="icon show-following following"></span--> |
|
113 | <span class="icon show-following following"></span--> | |
120 | <span class="show-follow">${_('Follow')}</span> |
|
114 | <span class="show-follow">${_('Follow')}</span> | |
121 | <span class="show-following">${_('Unfollow')}</span> |
|
115 | <span class="show-following">${_('Unfollow')}</span> | |
122 | </button> |
|
116 | </button> | |
123 | </li> |
|
117 | </li> | |
124 | <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}" class="fork">${_('Fork')}</a></li> |
|
118 | <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}" class="fork">${_('Fork')}</a></li> | |
125 | %if h.is_hg(c.rhodecode_repo): |
|
119 | %if h.is_hg(c.rhodecode_repo): | |
126 | <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}" class="pull-request">${_('Create Pull Request')}</a></li> |
|
120 | <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}" class="pull-request">${_('Create Pull Request')}</a></li> | |
127 | %endif |
|
121 | %endif | |
128 | </ul> |
|
122 | </ul> | |
129 | %endif |
|
123 | %endif | |
130 | </div> |
|
124 | </div> | |
131 | <div id="context-state"> |
|
125 | <div id="context-state"> | |
132 | <ul id="context-pages" class="horizontal-list"> |
|
126 | <ul id="context-pages" class="horizontal-list"> | |
133 | <li ${is_current('summary')}><a href="${h.url('summary_home', repo_name=c.repo_name)}" class="summary">${_('Summary')}</a></li> |
|
127 | <li ${is_current('summary')}><a href="${h.url('summary_home', repo_name=c.repo_name)}" class="summary">${_('Summary')}</a></li> | |
134 | <li ${is_current('changelog')}><a href="${h.url('changelog_home', repo_name=c.repo_name)}" class="changelogs">${_('Changelog')}</a></li> |
|
128 | <li ${is_current('changelog')}><a href="${h.url('changelog_home', repo_name=c.repo_name)}" class="changelogs">${_('Changelog')}</a></li> | |
135 | <li ${is_current('files')}><a href="${h.url('files_home', repo_name=c.repo_name)}" class="files"></span>${_('Files')}</a></li> |
|
129 | <li ${is_current('files')}><a href="${h.url('files_home', repo_name=c.repo_name)}" class="files"></span>${_('Files')}</a></li> | |
136 | <li ${is_current('switch-to')}> |
|
130 | <li ${is_current('switch-to')}> | |
137 | <a href="#" id="branch_tag_switcher_2" class="dropdown switch-to"></span>${_('Switch To')}</a> |
|
131 | <a href="#" id="branch_tag_switcher_2" class="dropdown switch-to"></span>${_('Switch To')}</a> | |
138 | <ul id="switch_to_list_2" class="switch_to submenu"> |
|
132 | <ul id="switch_to_list_2" class="switch_to submenu"> | |
139 | <li><a href="#">${_('loading...')}</a></li> |
|
133 | <li><a href="#">${_('loading...')}</a></li> | |
140 | </ul> |
|
134 | </ul> | |
141 | </li> |
|
135 | </li> | |
142 | <li ${is_current('options')}> |
|
136 | <li ${is_current('options')}> | |
143 | <a href="#" class="dropdown options"></span>${_('Options')}</a> |
|
137 | <a href="#" class="dropdown options"></span>${_('Options')}</a> | |
144 | <ul> |
|
138 | <ul> | |
145 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): |
|
139 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): | |
146 | %if h.HasPermissionAll('hg.admin')('access settings on repository'): |
|
140 | %if h.HasPermissionAll('hg.admin')('access settings on repository'): | |
147 | <li>${h.link_to(_('Settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li> |
|
141 | <li>${h.link_to(_('Settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li> | |
148 | %else: |
|
142 | %else: | |
149 | <li>${h.link_to(_('Settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li> |
|
143 | <li>${h.link_to(_('Settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li> | |
150 | %endif |
|
144 | %endif | |
151 | %endif |
|
145 | %endif | |
152 | %if c.rhodecode_db_repo.fork: |
|
146 | %if c.rhodecode_db_repo.fork: | |
153 | <li>${h.link_to(_('Compare fork'),h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,org_ref_type='branch',org_ref='default',other_repo=c.repo_name,other_ref_type='branch',other_ref=request.GET.get('branch') or 'default'),class_='compare_request')}</li> |
|
147 | <li>${h.link_to(_('Compare fork'),h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,org_ref_type='branch',org_ref='default',other_repo=c.repo_name,other_ref_type='branch',other_ref=request.GET.get('branch') or 'default'),class_='compare_request')}</li> | |
154 | %endif |
|
148 | %endif | |
155 | <li>${h.link_to(_('Lightweight changelog'),h.url('shortlog_home',repo_name=c.repo_name),class_='shortlog')}</li> |
|
149 | <li>${h.link_to(_('Lightweight changelog'),h.url('shortlog_home',repo_name=c.repo_name),class_='shortlog')}</li> | |
156 | <li>${h.link_to(_('Search'),h.url('search_repo',repo_name=c.repo_name),class_='search')}</li> |
|
150 | <li>${h.link_to(_('Search'),h.url('search_repo',repo_name=c.repo_name),class_='search')}</li> | |
157 |
|
151 | |||
158 | %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking: |
|
152 | %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking: | |
159 | %if c.rhodecode_db_repo.locked[0]: |
|
153 | %if c.rhodecode_db_repo.locked[0]: | |
160 | <li>${h.link_to(_('Unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}</li> |
|
154 | <li>${h.link_to(_('Unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}</li> | |
161 | %else: |
|
155 | %else: | |
162 | <li>${h.link_to(_('Lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}</li> |
|
156 | <li>${h.link_to(_('Lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}</li> | |
163 | %endif |
|
157 | %endif | |
164 | %endif |
|
158 | %endif | |
165 | </ul> |
|
159 | </ul> | |
166 | </li> |
|
160 | </li> | |
167 | <li ${is_current('showpullrequest')}> |
|
161 | <li ${is_current('showpullrequest')}> | |
168 | <a href="${h.url('pullrequest_show_all',repo_name=c.repo_name)}" title="${_('Show Pull Requests')}" class="pull-request">${_('Pull Requests')} |
|
162 | <a href="${h.url('pullrequest_show_all',repo_name=c.repo_name)}" title="${_('Show Pull Requests')}" class="pull-request">${_('Pull Requests')} | |
169 | %if c.repository_pull_requests: |
|
163 | %if c.repository_pull_requests: | |
170 | <span>${c.repository_pull_requests}</span> |
|
164 | <span>${c.repository_pull_requests}</span> | |
171 | %endif |
|
165 | %endif | |
172 | </a> |
|
166 | </a> | |
173 | </li> |
|
167 | </li> | |
174 | </ul> |
|
168 | </ul> | |
175 | </div> |
|
169 | </div> | |
176 | </div> |
|
170 | </div> | |
177 | <script type="text/javascript"> |
|
171 | <script type="text/javascript"> | |
178 | YUE.on('branch_tag_switcher_2','mouseover',function(){ |
|
172 | YUE.on('branch_tag_switcher_2','mouseover',function(){ | |
179 | var loaded = YUD.hasClass('branch_tag_switcher_2','loaded'); |
|
173 | var loaded = YUD.hasClass('branch_tag_switcher_2','loaded'); | |
180 | if(!loaded){ |
|
174 | if(!loaded){ | |
181 | YUD.addClass('branch_tag_switcher_2','loaded'); |
|
175 | YUD.addClass('branch_tag_switcher_2','loaded'); | |
182 | ypjax("${h.url('branch_tag_switcher',repo_name=c.repo_name)}",'switch_to_list_2', |
|
176 | ypjax("${h.url('branch_tag_switcher',repo_name=c.repo_name)}",'switch_to_list_2', | |
183 | function(o){}, |
|
177 | function(o){}, | |
184 | function(o){YUD.removeClass('branch_tag_switcher_2','loaded');} |
|
178 | function(o){YUD.removeClass('branch_tag_switcher_2','loaded');} | |
185 | ,null); |
|
179 | ,null); | |
186 | } |
|
180 | } | |
187 | return false; |
|
181 | return false; | |
188 | }); |
|
182 | }); | |
189 | </script> |
|
183 | </script> | |
190 | <!--- END CONTEXT BAR --> |
|
184 | <!--- END CONTEXT BAR --> | |
191 | </%def> |
|
185 | </%def> | |
192 |
|
186 | |||
193 | <%def name="usermenu()"> |
|
187 | <%def name="usermenu()"> | |
194 | ## USER MENU |
|
188 | ## USER MENU | |
195 | <li> |
|
189 | <li> | |
196 | <a class="menu_link childs" id="quick_login_link"> |
|
190 | <a class="menu_link childs" id="quick_login_link"> | |
197 | <span class="icon"> |
|
191 | <span class="icon"> | |
198 | <img src="${h.gravatar_url(c.rhodecode_user.email,20)}" alt="avatar"> |
|
192 | <img src="${h.gravatar_url(c.rhodecode_user.email,20)}" alt="avatar"> | |
199 | </span> |
|
193 | </span> | |
200 | %if c.rhodecode_user.username != 'default': |
|
194 | %if c.rhodecode_user.username != 'default': | |
201 | <span class="menu_link_user">${c.rhodecode_user.username}</span> |
|
195 | <span class="menu_link_user">${c.rhodecode_user.username}</span> | |
202 | %if c.unread_notifications != 0: |
|
196 | %if c.unread_notifications != 0: | |
203 | <span class="menu_link_notifications">${c.unread_notifications}</span> |
|
197 | <span class="menu_link_notifications">${c.unread_notifications}</span> | |
204 | %endif |
|
198 | %endif | |
205 | %else: |
|
199 | %else: | |
206 | <span>${_('Not logged in')}</span> |
|
200 | <span>${_('Not logged in')}</span> | |
207 | %endif |
|
201 | %endif | |
208 | </a> |
|
202 | </a> | |
209 |
|
203 | |||
210 | <div class="user-menu"> |
|
204 | <div class="user-menu"> | |
211 | <div id="quick_login"> |
|
205 | <div id="quick_login"> | |
212 | %if c.rhodecode_user.username == 'default': |
|
206 | %if c.rhodecode_user.username == 'default': | |
213 | <h4>${_('Login to your account')}</h4> |
|
207 | <h4>${_('Login to your account')}</h4> | |
214 | ${h.form(h.url('login_home',came_from=h.url.current()))} |
|
208 | ${h.form(h.url('login_home',came_from=h.url.current()))} | |
215 | <div class="form"> |
|
209 | <div class="form"> | |
216 | <div class="fields"> |
|
210 | <div class="fields"> | |
217 | <div class="field"> |
|
211 | <div class="field"> | |
218 | <div class="label"> |
|
212 | <div class="label"> | |
219 | <label for="username">${_('Username')}:</label> |
|
213 | <label for="username">${_('Username')}:</label> | |
220 | </div> |
|
214 | </div> | |
221 | <div class="input"> |
|
215 | <div class="input"> | |
222 | ${h.text('username',class_='focus')} |
|
216 | ${h.text('username',class_='focus')} | |
223 | </div> |
|
217 | </div> | |
224 |
|
218 | |||
225 | </div> |
|
219 | </div> | |
226 | <div class="field"> |
|
220 | <div class="field"> | |
227 | <div class="label"> |
|
221 | <div class="label"> | |
228 | <label for="password">${_('Password')}:</label> |
|
222 | <label for="password">${_('Password')}:</label> | |
229 | </div> |
|
223 | </div> | |
230 | <div class="input"> |
|
224 | <div class="input"> | |
231 | ${h.password('password',class_='focus')} |
|
225 | ${h.password('password',class_='focus')} | |
232 | </div> |
|
226 | </div> | |
233 |
|
227 | |||
234 | </div> |
|
228 | </div> | |
235 | <div class="buttons"> |
|
229 | <div class="buttons"> | |
236 | <div class="password_forgoten">${h.link_to(_('Forgot password ?'),h.url('reset_password'))}</div> |
|
230 | <div class="password_forgoten">${h.link_to(_('Forgot password ?'),h.url('reset_password'))}</div> | |
237 | <div class="register"> |
|
231 | <div class="register"> | |
238 | %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')(): |
|
232 | %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')(): | |
239 | ${h.link_to(_("Don't have an account ?"),h.url('register'))} |
|
233 | ${h.link_to(_("Don't have an account ?"),h.url('register'))} | |
240 | %endif |
|
234 | %endif | |
241 | </div> |
|
235 | </div> | |
242 | <div class="submit"> |
|
236 | <div class="submit"> | |
243 | ${h.submit('sign_in',_('Log In'),class_="ui-btn xsmall")} |
|
237 | ${h.submit('sign_in',_('Log In'),class_="ui-btn xsmall")} | |
244 | </div> |
|
238 | </div> | |
245 | </div> |
|
239 | </div> | |
246 | </div> |
|
240 | </div> | |
247 | </div> |
|
241 | </div> | |
248 | ${h.end_form()} |
|
242 | ${h.end_form()} | |
249 | %else: |
|
243 | %else: | |
250 | <div class="links_left"> |
|
244 | <div class="links_left"> | |
251 | <div class="full_name">${c.rhodecode_user.full_name_or_username}</div> |
|
245 | <div class="full_name">${c.rhodecode_user.full_name_or_username}</div> | |
252 | <div class="email">${c.rhodecode_user.email}</div> |
|
246 | <div class="email">${c.rhodecode_user.email}</div> | |
253 | <div class="big_gravatar"><img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,48)}" /></div> |
|
247 | <div class="big_gravatar"><img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,48)}" /></div> | |
254 | ##<div class="notifications"><a href="${h.url('notifications')}">${_('Notifications')}</a></div> |
|
248 | ##<div class="notifications"><a href="${h.url('notifications')}">${_('Notifications')}</a></div> | |
255 | <div class="unread"><a href="${h.url('notifications')}">${_('Unread notifications')}: ${c.unread_notifications}</a></div> |
|
249 | <div class="unread"><a href="${h.url('notifications')}">${_('Unread notifications')}: ${c.unread_notifications}</a></div> | |
256 | </div> |
|
250 | </div> | |
257 | <div class="links_right"> |
|
251 | <div class="links_right"> | |
258 | <ol class="links"> |
|
252 | <ol class="links"> | |
259 | ##<li>${h.link_to(_(u'Home'),h.url('home'))}</li> |
|
253 | ##<li>${h.link_to(_(u'Home'),h.url('home'))}</li> | |
260 | <li>${h.link_to(_(u'Journal'),h.url('journal'))}</li> |
|
254 | <li>${h.link_to(_(u'Journal'),h.url('journal'))}</li> | |
261 | <li>${h.link_to(_(u'My account'),h.url('admin_settings_my_account'))}</li> |
|
255 | <li>${h.link_to(_(u'My account'),h.url('admin_settings_my_account'))}</li> | |
262 | <li class="logout">${h.link_to(_(u'Log Out'),h.url('logout_home'))}</li> |
|
256 | <li class="logout">${h.link_to(_(u'Log Out'),h.url('logout_home'))}</li> | |
263 | </ol> |
|
257 | </ol> | |
264 | </div> |
|
258 | </div> | |
265 | %endif |
|
259 | %endif | |
266 | </div> |
|
260 | </div> | |
267 | </div> |
|
261 | </div> | |
268 |
|
262 | |||
269 | </li> |
|
263 | </li> | |
270 | </%def> |
|
264 | </%def> | |
271 |
|
265 | |||
272 | <%def name="menu(current=None)"> |
|
266 | <%def name="menu(current=None)"> | |
273 | <% |
|
267 | <% | |
274 | def is_current(selected): |
|
268 | def is_current(selected): | |
275 | if selected == current: |
|
269 | if selected == current: | |
276 | return h.literal('class="current"') |
|
270 | return h.literal('class="current"') | |
277 | %> |
|
271 | %> | |
278 | <ul id="quick" class="horizontal-list"> |
|
272 | <ul id="quick" class="horizontal-list"> | |
279 | <!-- repo switcher --> |
|
273 | <!-- repo switcher --> | |
280 | <li ${is_current('repositories')}> |
|
274 | <li ${is_current('repositories')}> | |
281 | <a class="menu_link repo_switcher childs" id="repo_switcher" title="${_('Switch repository')}" href="${h.url('home')}"> |
|
275 | <a class="menu_link repo_switcher childs" id="repo_switcher" title="${_('Switch repository')}" href="${h.url('home')}"> | |
282 | ${_('Repositories')} |
|
276 | ${_('Repositories')} | |
283 | </a> |
|
277 | </a> | |
284 | <ul id="repo_switcher_list" class="repo_switcher"> |
|
278 | <ul id="repo_switcher_list" class="repo_switcher"> | |
285 | <li> |
|
279 | <li> | |
286 | <a href="#">${_('loading...')}</a> |
|
280 | <a href="#">${_('loading...')}</a> | |
287 | </li> |
|
281 | </li> | |
288 | </ul> |
|
282 | </ul> | |
289 | </li> |
|
283 | </li> | |
290 | ##ROOT MENU |
|
284 | ##ROOT MENU | |
291 | %if c.rhodecode_user.username != 'default': |
|
285 | %if c.rhodecode_user.username != 'default': | |
292 | <li ${is_current('journal')}> |
|
286 | <li ${is_current('journal')}> | |
293 | <a class="menu_link journal" title="${_('Show recent activity')}" href="${h.url('journal')}"> |
|
287 | <a class="menu_link journal" title="${_('Show recent activity')}" href="${h.url('journal')}"> | |
294 | ${_('Journal')} |
|
288 | ${_('Journal')} | |
295 | </a> |
|
289 | </a> | |
296 | </li> |
|
290 | </li> | |
297 | %else: |
|
291 | %else: | |
298 | <li ${is_current('journal')}> |
|
292 | <li ${is_current('journal')}> | |
299 | <a class="menu_link journal" title="${_('Public journal')}" href="${h.url('public_journal')}"> |
|
293 | <a class="menu_link journal" title="${_('Public journal')}" href="${h.url('public_journal')}"> | |
300 | ${_('Public journal')} |
|
294 | ${_('Public journal')} | |
301 | </a> |
|
295 | </a> | |
302 | </li> |
|
296 | </li> | |
303 | %endif |
|
297 | %endif | |
304 | <li ${is_current('search')}> |
|
298 | <li ${is_current('search')}> | |
305 | <a class="menu_link search" title="${_('Search in repositories')}" href="${h.url('search')}"> |
|
299 | <a class="menu_link search" title="${_('Search in repositories')}" href="${h.url('search')}"> | |
306 | ${_('Search')} |
|
300 | ${_('Search')} | |
307 | </a> |
|
301 | </a> | |
308 | </li> |
|
302 | </li> | |
309 | % if h.HasPermissionAll('hg.admin')('access admin main page'): |
|
303 | % if h.HasPermissionAll('hg.admin')('access admin main page'): | |
310 | <li ${is_current('admin')}> |
|
304 | <li ${is_current('admin')}> | |
311 | <a class="menu_link admin childs" title="${_('Admin')}" href="${h.url('admin_home')}"> |
|
305 | <a class="menu_link admin childs" title="${_('Admin')}" href="${h.url('admin_home')}"> | |
312 | ${_('Admin')} |
|
306 | ${_('Admin')} | |
313 | </a> |
|
307 | </a> | |
314 | ${admin_menu()} |
|
308 | ${admin_menu()} | |
315 | </li> |
|
309 | </li> | |
316 | % elif c.rhodecode_user.groups_admin: |
|
310 | % elif c.rhodecode_user.groups_admin: | |
317 | <li ${is_current('admin')}> |
|
311 | <li ${is_current('admin')}> | |
318 | <a class="menu_link admin childs" title="${_('Admin')}" href="${h.url('admin_home')}"> |
|
312 | <a class="menu_link admin childs" title="${_('Admin')}" href="${h.url('admin_home')}"> | |
319 | ${_('Admin')} |
|
313 | ${_('Admin')} | |
320 | </a> |
|
314 | </a> | |
321 | ${admin_menu_simple()} |
|
315 | ${admin_menu_simple()} | |
322 | </li> |
|
316 | </li> | |
323 | % endif |
|
317 | % endif | |
324 | ${usermenu()} |
|
318 | ${usermenu()} | |
325 | <script type="text/javascript"> |
|
319 | <script type="text/javascript"> | |
326 | YUE.on('repo_switcher','mouseover',function(){ |
|
320 | YUE.on('repo_switcher','mouseover',function(){ | |
327 | var target = 'q_filter_rs'; |
|
321 | var target = 'q_filter_rs'; | |
328 | var qfilter_activate = function(){ |
|
322 | var qfilter_activate = function(){ | |
329 | var nodes = YUQ('ul#repo_switcher_list li a.repo_name'); |
|
323 | var nodes = YUQ('ul#repo_switcher_list li a.repo_name'); | |
330 | var func = function(node){ |
|
324 | var func = function(node){ | |
331 | return node.parentNode; |
|
325 | return node.parentNode; | |
332 | } |
|
326 | } | |
333 | q_filter(target,nodes,func); |
|
327 | q_filter(target,nodes,func); | |
334 | } |
|
328 | } | |
335 |
|
329 | |||
336 | var loaded = YUD.hasClass('repo_switcher','loaded'); |
|
330 | var loaded = YUD.hasClass('repo_switcher','loaded'); | |
337 | if(!loaded){ |
|
331 | if(!loaded){ | |
338 | YUD.addClass('repo_switcher','loaded'); |
|
332 | YUD.addClass('repo_switcher','loaded'); | |
339 | ypjax("${h.url('repo_switcher')}",'repo_switcher_list', |
|
333 | ypjax("${h.url('repo_switcher')}",'repo_switcher_list', | |
340 | function(o){qfilter_activate();YUD.get(target).focus()}, |
|
334 | function(o){qfilter_activate();YUD.get(target).focus()}, | |
341 | function(o){YUD.removeClass('repo_switcher','loaded');} |
|
335 | function(o){YUD.removeClass('repo_switcher','loaded');} | |
342 | ,null); |
|
336 | ,null); | |
343 | }else{ |
|
337 | }else{ | |
344 | YUD.get(target).focus(); |
|
338 | YUD.get(target).focus(); | |
345 | } |
|
339 | } | |
346 | return false; |
|
340 | return false; | |
347 | }); |
|
341 | }); | |
348 |
|
342 | |||
349 | YUE.on('header-dd', 'click',function(e){ |
|
343 | YUE.on('header-dd', 'click',function(e){ | |
350 | YUD.addClass('header-inner', 'hover'); |
|
344 | YUD.addClass('header-inner', 'hover'); | |
351 | YUD.addClass('content', 'hover'); |
|
345 | YUD.addClass('content', 'hover'); | |
352 | }); |
|
346 | }); | |
353 |
|
347 | |||
354 | </script> |
|
348 | </script> | |
355 | </%def> |
|
349 | </%def> |
@@ -1,26 +1,30 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 | ${_('%s Forks') % c.repo_name} · ${c.rhodecode_name} |
|
5 | ${_('%s Forks') % c.repo_name} · ${c.rhodecode_name} | |
6 | </%def> |
|
6 | </%def> | |
7 |
|
7 | |||
8 | <%def name="breadcrumbs_links()"> |
|
8 | <%def name="breadcrumbs_links()"> | |
9 | ${_('Forks')} |
|
9 | ${_('Forks')} | |
10 | </%def> |
|
10 | </%def> | |
11 |
|
11 | |||
|
12 | <%def name="page_nav()"> | |||
|
13 | ${self.menu('repositories')} | |||
|
14 | </%def> | |||
|
15 | ||||
12 | <%def name="main()"> |
|
16 | <%def name="main()"> | |
13 | ${self.context_bar('showforks')} |
|
17 | ${self.context_bar('showforks')} | |
14 | <div class="box"> |
|
18 | <div class="box"> | |
15 | <!-- box / title --> |
|
19 | <!-- box / title --> | |
16 | <div class="title"> |
|
20 | <div class="title"> | |
17 | ${self.breadcrumbs()} |
|
21 | ${self.breadcrumbs()} | |
18 | </div> |
|
22 | </div> | |
19 | <!-- end box / title --> |
|
23 | <!-- end box / title --> | |
20 | <div class="table"> |
|
24 | <div class="table"> | |
21 | <div id="forks"> |
|
25 | <div id="forks"> | |
22 | ${c.forks_data} |
|
26 | ${c.forks_data} | |
23 | </div> |
|
27 | </div> | |
24 | </div> |
|
28 | </div> | |
25 | </div> |
|
29 | </div> | |
26 | </%def> |
|
30 | </%def> |
@@ -1,205 +1,209 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} ${_('New pull request')} |
|
4 | ${c.repo_name} ${_('New pull request')} | |
5 | </%def> |
|
5 | </%def> | |
6 |
|
6 | |||
7 | <%def name="breadcrumbs_links()"> |
|
7 | <%def name="breadcrumbs_links()"> | |
8 | ${_('New pull request')} |
|
8 | ${_('New pull request')} | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
|
11 | <%def name="page_nav()"> | |||
|
12 | ${self.menu('repositories')} | |||
|
13 | </%def> | |||
|
14 | ||||
11 | <%def name="main()"> |
|
15 | <%def name="main()"> | |
12 | ${self.context_bar('showpullrequest')} |
|
16 | ${self.context_bar('showpullrequest')} | |
13 | <div class="box"> |
|
17 | <div class="box"> | |
14 | <!-- box / title --> |
|
18 | <!-- box / title --> | |
15 | <div class="title"> |
|
19 | <div class="title"> | |
16 | ${self.breadcrumbs()} |
|
20 | ${self.breadcrumbs()} | |
17 | </div> |
|
21 | </div> | |
18 | ${h.form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')} |
|
22 | ${h.form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')} | |
19 | <div style="float:left;padding:0px 30px 30px 30px"> |
|
23 | <div style="float:left;padding:0px 30px 30px 30px"> | |
20 | ##ORG |
|
24 | ##ORG | |
21 | <div style="float:left"> |
|
25 | <div style="float:left"> | |
22 | <div> |
|
26 | <div> | |
23 | <span style="font-size: 20px"> |
|
27 | <span style="font-size: 20px"> | |
24 | ${h.select('org_repo','',c.org_repos,class_='refs')}:${h.select('org_ref',c.default_org_ref,c.org_refs,class_='refs')} |
|
28 | ${h.select('org_repo','',c.org_repos,class_='refs')}:${h.select('org_ref',c.default_org_ref,c.org_refs,class_='refs')} | |
25 | </span> |
|
29 | </span> | |
26 | <div style="padding:5px 3px 3px 20px;">${c.rhodecode_db_repo.description}</div> |
|
30 | <div style="padding:5px 3px 3px 20px;">${c.rhodecode_db_repo.description}</div> | |
27 | </div> |
|
31 | </div> | |
28 | <div style="clear:both;padding-top: 10px"></div> |
|
32 | <div style="clear:both;padding-top: 10px"></div> | |
29 | </div> |
|
33 | </div> | |
30 | <div style="float:left;font-size:24px;padding:0px 20px"> |
|
34 | <div style="float:left;font-size:24px;padding:0px 20px"> | |
31 | <img height=32 width=32 src="${h.url('/images/arrow_right_64.png')}"/> |
|
35 | <img height=32 width=32 src="${h.url('/images/arrow_right_64.png')}"/> | |
32 | </div> |
|
36 | </div> | |
33 |
|
37 | |||
34 | ##OTHER, most Probably the PARENT OF THIS FORK |
|
38 | ##OTHER, most Probably the PARENT OF THIS FORK | |
35 | <div style="float:left"> |
|
39 | <div style="float:left"> | |
36 | <div> |
|
40 | <div> | |
37 | <span style="font-size: 20px"> |
|
41 | <span style="font-size: 20px"> | |
38 | ${h.select('other_repo',c.default_other_repo,c.other_repos,class_='refs')}:${c.default_other_repo_info['revs']} |
|
42 | ${h.select('other_repo',c.default_other_repo,c.other_repos,class_='refs')}:${c.default_other_repo_info['revs']} | |
39 | </span> |
|
43 | </span> | |
40 | <div id="other_repo_desc" style="padding:5px 3px 3px 20px;"></div> |
|
44 | <div id="other_repo_desc" style="padding:5px 3px 3px 20px;"></div> | |
41 | </div> |
|
45 | </div> | |
42 | <div style="clear:both;padding-top: 10px"></div> |
|
46 | <div style="clear:both;padding-top: 10px"></div> | |
43 | </div> |
|
47 | </div> | |
44 | <div style="clear:both;padding-top: 10px"></div> |
|
48 | <div style="clear:both;padding-top: 10px"></div> | |
45 | ## overview pulled by ajax |
|
49 | ## overview pulled by ajax | |
46 | <div style="float:left" id="pull_request_overview"></div> |
|
50 | <div style="float:left" id="pull_request_overview"></div> | |
47 | <div style="float:left;clear:both;padding:10px 10px 10px 0px;display:none"> |
|
51 | <div style="float:left;clear:both;padding:10px 10px 10px 0px;display:none"> | |
48 | <a id="pull_request_overview_url" href="#">${_('Detailed compare view')}</a> |
|
52 | <a id="pull_request_overview_url" href="#">${_('Detailed compare view')}</a> | |
49 | </div> |
|
53 | </div> | |
50 | </div> |
|
54 | </div> | |
51 | <div style="float:left; border-left:1px dashed #eee"> |
|
55 | <div style="float:left; border-left:1px dashed #eee"> | |
52 | <h4>${_('Pull request reviewers')}</h4> |
|
56 | <h4>${_('Pull request reviewers')}</h4> | |
53 | <div id="reviewers" style="padding:0px 0px 0px 15px"> |
|
57 | <div id="reviewers" style="padding:0px 0px 0px 15px"> | |
54 | ## members goes here ! |
|
58 | ## members goes here ! | |
55 | <div class="group_members_wrap"> |
|
59 | <div class="group_members_wrap"> | |
56 | <ul id="review_members" class="group_members"> |
|
60 | <ul id="review_members" class="group_members"> | |
57 | %for member in [c.default_other_repo_info['user']]: |
|
61 | %for member in [c.default_other_repo_info['user']]: | |
58 | <li id="reviewer_${member['user_id']}"> |
|
62 | <li id="reviewer_${member['user_id']}"> | |
59 | <div class="reviewers_member"> |
|
63 | <div class="reviewers_member"> | |
60 | <div class="gravatar"><img alt="gravatar" src="${member['gravatar_link']}"/> </div> |
|
64 | <div class="gravatar"><img alt="gravatar" src="${member['gravatar_link']}"/> </div> | |
61 | <div style="float:left">${member['firstname']} ${member['lastname']} (${_('owner')})</div> |
|
65 | <div style="float:left">${member['firstname']} ${member['lastname']} (${_('owner')})</div> | |
62 | <input type="hidden" value="${member['user_id']}" name="review_members" /> |
|
66 | <input type="hidden" value="${member['user_id']}" name="review_members" /> | |
63 | <span class="delete_icon action_button" onclick="removeReviewMember(${member['user_id']})"></span> |
|
67 | <span class="delete_icon action_button" onclick="removeReviewMember(${member['user_id']})"></span> | |
64 | </div> |
|
68 | </div> | |
65 | </li> |
|
69 | </li> | |
66 | %endfor |
|
70 | %endfor | |
67 | </ul> |
|
71 | </ul> | |
68 | </div> |
|
72 | </div> | |
69 |
|
73 | |||
70 | <div class='ac'> |
|
74 | <div class='ac'> | |
71 | <div class="reviewer_ac"> |
|
75 | <div class="reviewer_ac"> | |
72 | ${h.text('user', class_='yui-ac-input')} |
|
76 | ${h.text('user', class_='yui-ac-input')} | |
73 | <span class="help-block">${_('Add reviewer to this pull request.')}</span> |
|
77 | <span class="help-block">${_('Add reviewer to this pull request.')}</span> | |
74 | <div id="reviewers_container"></div> |
|
78 | <div id="reviewers_container"></div> | |
75 | </div> |
|
79 | </div> | |
76 | </div> |
|
80 | </div> | |
77 | </div> |
|
81 | </div> | |
78 | </div> |
|
82 | </div> | |
79 | <h3>${_('Create new pull request')}</h3> |
|
83 | <h3>${_('Create new pull request')}</h3> | |
80 |
|
84 | |||
81 | <div class="form"> |
|
85 | <div class="form"> | |
82 | <!-- fields --> |
|
86 | <!-- fields --> | |
83 |
|
87 | |||
84 | <div class="fields"> |
|
88 | <div class="fields"> | |
85 |
|
89 | |||
86 | <div class="field"> |
|
90 | <div class="field"> | |
87 | <div class="label"> |
|
91 | <div class="label"> | |
88 | <label for="pullrequest_title">${_('Title')}:</label> |
|
92 | <label for="pullrequest_title">${_('Title')}:</label> | |
89 | </div> |
|
93 | </div> | |
90 | <div class="input"> |
|
94 | <div class="input"> | |
91 | ${h.text('pullrequest_title',size=30)} |
|
95 | ${h.text('pullrequest_title',size=30)} | |
92 | </div> |
|
96 | </div> | |
93 | </div> |
|
97 | </div> | |
94 |
|
98 | |||
95 | <div class="field"> |
|
99 | <div class="field"> | |
96 | <div class="label label-textarea"> |
|
100 | <div class="label label-textarea"> | |
97 | <label for="pullrequest_desc">${_('Description')}:</label> |
|
101 | <label for="pullrequest_desc">${_('Description')}:</label> | |
98 | </div> |
|
102 | </div> | |
99 | <div class="textarea text-area editor"> |
|
103 | <div class="textarea text-area editor"> | |
100 | ${h.textarea('pullrequest_desc',size=30)} |
|
104 | ${h.textarea('pullrequest_desc',size=30)} | |
101 | </div> |
|
105 | </div> | |
102 | </div> |
|
106 | </div> | |
103 |
|
107 | |||
104 | <div class="buttons"> |
|
108 | <div class="buttons"> | |
105 | ${h.submit('save',_('Send pull request'),class_="ui-btn large")} |
|
109 | ${h.submit('save',_('Send pull request'),class_="ui-btn large")} | |
106 | ${h.reset('reset',_('Reset'),class_="ui-btn large")} |
|
110 | ${h.reset('reset',_('Reset'),class_="ui-btn large")} | |
107 | </div> |
|
111 | </div> | |
108 | </div> |
|
112 | </div> | |
109 | </div> |
|
113 | </div> | |
110 | ${h.end_form()} |
|
114 | ${h.end_form()} | |
111 |
|
115 | |||
112 | </div> |
|
116 | </div> | |
113 |
|
117 | |||
114 | <script type="text/javascript"> |
|
118 | <script type="text/javascript"> | |
115 | var _USERS_AC_DATA = ${c.users_array|n}; |
|
119 | var _USERS_AC_DATA = ${c.users_array|n}; | |
116 | var _GROUPS_AC_DATA = ${c.users_groups_array|n}; |
|
120 | var _GROUPS_AC_DATA = ${c.users_groups_array|n}; | |
117 | PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA); |
|
121 | PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA); | |
118 |
|
122 | |||
119 | var other_repos_info = ${c.other_repos_info|n}; |
|
123 | var other_repos_info = ${c.other_repos_info|n}; | |
120 |
|
124 | |||
121 | var otherrepoChanged = function(){ |
|
125 | var otherrepoChanged = function(){ | |
122 | var sel_box = YUQ('#pull_request_form #other_repo')[0]; |
|
126 | var sel_box = YUQ('#pull_request_form #other_repo')[0]; | |
123 | var repo_name = sel_box.options[sel_box.selectedIndex].value; |
|
127 | var repo_name = sel_box.options[sel_box.selectedIndex].value; | |
124 |
|
128 | |||
125 | YUD.get('other_repo_desc').innerHTML = other_repos_info[repo_name]['description']; |
|
129 | YUD.get('other_repo_desc').innerHTML = other_repos_info[repo_name]['description']; | |
126 | // replace options of other_ref with the ones for the current other_repo |
|
130 | // replace options of other_ref with the ones for the current other_repo | |
127 | var other_ref_selector = YUD.get('other_ref'); |
|
131 | var other_ref_selector = YUD.get('other_ref'); | |
128 | var new_select = YUD.createElementFromMarkup(other_repos_info[repo_name]['revs']); |
|
132 | var new_select = YUD.createElementFromMarkup(other_repos_info[repo_name]['revs']); | |
129 | var new_selectedIndex = new_select.selectedIndex; |
|
133 | var new_selectedIndex = new_select.selectedIndex; | |
130 | other_ref_selector.innerHTML = ""; // clear old options |
|
134 | other_ref_selector.innerHTML = ""; // clear old options | |
131 | while (new_select.length > 0){ // children will be popped when appened to other_ref_selector |
|
135 | while (new_select.length > 0){ // children will be popped when appened to other_ref_selector | |
132 | other_ref_selector.appendChild(new_select.children[0]); |
|
136 | other_ref_selector.appendChild(new_select.children[0]); | |
133 | } |
|
137 | } | |
134 | // browsers lost track of selected when appendChild was used |
|
138 | // browsers lost track of selected when appendChild was used | |
135 | other_ref_selector.selectedIndex = new_selectedIndex; |
|
139 | other_ref_selector.selectedIndex = new_selectedIndex; | |
136 |
|
140 | |||
137 | // reset && add the reviewer based on selected repo |
|
141 | // reset && add the reviewer based on selected repo | |
138 | var _data = other_repos_info[repo_name]; |
|
142 | var _data = other_repos_info[repo_name]; | |
139 | YUD.get('review_members').innerHTML = ''; |
|
143 | YUD.get('review_members').innerHTML = ''; | |
140 | addReviewMember(_data.user.user_id, _data.user.firstname, |
|
144 | addReviewMember(_data.user.user_id, _data.user.firstname, | |
141 | _data.user.lastname, _data.user.username, |
|
145 | _data.user.lastname, _data.user.username, | |
142 | _data.user.gravatar_link); |
|
146 | _data.user.gravatar_link); | |
143 | } |
|
147 | } | |
144 |
|
148 | |||
145 | var loadPreview = function(){ |
|
149 | var loadPreview = function(){ | |
146 | //url template |
|
150 | //url template | |
147 | var url = "${h.url('compare_url', |
|
151 | var url = "${h.url('compare_url', | |
148 | repo_name='__other_repo__', |
|
152 | repo_name='__other_repo__', | |
149 | org_ref_type='__other_ref_type__', |
|
153 | org_ref_type='__other_ref_type__', | |
150 | org_ref='__other_ref__', |
|
154 | org_ref='__other_ref__', | |
151 | other_repo='__org_repo__', |
|
155 | other_repo='__org_repo__', | |
152 | other_ref_type='__org_ref_type__', |
|
156 | other_ref_type='__org_ref_type__', | |
153 | other_ref='__org_ref__', |
|
157 | other_ref='__org_ref__', | |
154 | as_form=True, |
|
158 | as_form=True, | |
155 | merge=True, |
|
159 | merge=True, | |
156 | )}"; |
|
160 | )}"; | |
157 | var org_repo = YUQ('#pull_request_form #org_repo')[0].value; |
|
161 | var org_repo = YUQ('#pull_request_form #org_repo')[0].value; | |
158 | var org_ref = YUQ('#pull_request_form #org_ref')[0].value.split(':'); |
|
162 | var org_ref = YUQ('#pull_request_form #org_ref')[0].value.split(':'); | |
159 |
|
163 | |||
160 | var other_repo = YUQ('#pull_request_form #other_repo')[0].value; |
|
164 | var other_repo = YUQ('#pull_request_form #other_repo')[0].value; | |
161 | var other_ref = YUQ('#pull_request_form #other_ref')[0].value.split(':'); |
|
165 | var other_ref = YUQ('#pull_request_form #other_ref')[0].value.split(':'); | |
162 |
|
166 | |||
163 | var select_refs = YUQ('#pull_request_form select.refs') |
|
167 | var select_refs = YUQ('#pull_request_form select.refs') | |
164 | var rev_data = { |
|
168 | var rev_data = { | |
165 | 'org_repo': org_repo, |
|
169 | 'org_repo': org_repo, | |
166 | 'org_ref': org_ref[2], |
|
170 | 'org_ref': org_ref[2], | |
167 | 'org_ref_type': 'rev', |
|
171 | 'org_ref_type': 'rev', | |
168 | 'other_repo': other_repo, |
|
172 | 'other_repo': other_repo, | |
169 | 'other_ref': other_ref[2], |
|
173 | 'other_ref': other_ref[2], | |
170 | 'other_ref_type': 'rev', |
|
174 | 'other_ref_type': 'rev', | |
171 | }; // gather the org/other ref and repo here |
|
175 | }; // gather the org/other ref and repo here | |
172 |
|
176 | |||
173 | for (k in rev_data){ |
|
177 | for (k in rev_data){ | |
174 | url = url.replace('__'+k+'__',rev_data[k]); |
|
178 | url = url.replace('__'+k+'__',rev_data[k]); | |
175 | } |
|
179 | } | |
176 |
|
180 | |||
177 | YUD.get('pull_request_overview').innerHTML = "${_('Loading ...')}"; |
|
181 | YUD.get('pull_request_overview').innerHTML = "${_('Loading ...')}"; | |
178 | ypjax(url,'pull_request_overview'); |
|
182 | ypjax(url,'pull_request_overview'); | |
179 |
|
183 | |||
180 | YUD.get('pull_request_overview_url').href = url; // shouldn't have as_form ... but ... |
|
184 | YUD.get('pull_request_overview_url').href = url; // shouldn't have as_form ... but ... | |
181 | YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display',''); |
|
185 | YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display',''); | |
182 | } |
|
186 | } | |
183 |
|
187 | |||
184 | ## refresh automatically when something changes (org_repo can't change) |
|
188 | ## refresh automatically when something changes (org_repo can't change) | |
185 |
|
189 | |||
186 | YUE.on('org_ref', 'change', function(e){ |
|
190 | YUE.on('org_ref', 'change', function(e){ | |
187 | loadPreview(); |
|
191 | loadPreview(); | |
188 | }); |
|
192 | }); | |
189 |
|
193 | |||
190 | YUE.on('other_repo', 'change', function(e){ |
|
194 | YUE.on('other_repo', 'change', function(e){ | |
191 | otherrepoChanged(); |
|
195 | otherrepoChanged(); | |
192 | loadPreview(); |
|
196 | loadPreview(); | |
193 | }); |
|
197 | }); | |
194 |
|
198 | |||
195 | YUE.on('other_ref', 'change', function(e){ |
|
199 | YUE.on('other_ref', 'change', function(e){ | |
196 | loadPreview(); |
|
200 | loadPreview(); | |
197 | }); |
|
201 | }); | |
198 |
|
202 | |||
199 | otherrepoChanged(); |
|
203 | otherrepoChanged(); | |
200 | //lazy load overview after 0.5s |
|
204 | //lazy load overview after 0.5s | |
201 | setTimeout(loadPreview, 500); |
|
205 | setTimeout(loadPreview, 500); | |
202 |
|
206 | |||
203 | </script> |
|
207 | </script> | |
204 |
|
208 | |||
205 | </%def> |
|
209 | </%def> |
@@ -1,244 +1,248 b'' | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 | <%def name="title()"> |
|
3 | <%def name="title()"> | |
4 | ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)} · ${c.rhodecode_name} |
|
4 | ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)} · ${c.rhodecode_name} | |
5 | </%def> |
|
5 | </%def> | |
6 |
|
6 | |||
7 | <%def name="breadcrumbs_links()"> |
|
7 | <%def name="breadcrumbs_links()"> | |
8 | ${_('Pull request #%s') % c.pull_request.pull_request_id} |
|
8 | ${_('Pull request #%s') % c.pull_request.pull_request_id} | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
|
11 | <%def name="page_nav()"> | |||
|
12 | ${self.menu('repositories')} | |||
|
13 | </%def> | |||
|
14 | ||||
11 | <%def name="main()"> |
|
15 | <%def name="main()"> | |
12 | ${self.context_bar('showpullrequest')} |
|
16 | ${self.context_bar('showpullrequest')} | |
13 | <div class="box"> |
|
17 | <div class="box"> | |
14 | <!-- box / title --> |
|
18 | <!-- box / title --> | |
15 | <div class="title"> |
|
19 | <div class="title"> | |
16 | ${self.breadcrumbs()} |
|
20 | ${self.breadcrumbs()} | |
17 | </div> |
|
21 | </div> | |
18 | %if c.pull_request.is_closed(): |
|
22 | %if c.pull_request.is_closed(): | |
19 | <div style="padding:10px; font-size:22px;width:100%;text-align: center; color:#88D882">${_('Closed %s') % (h.age(c.pull_request.updated_on))} ${_('with status %s') % h.changeset_status_lbl(c.current_changeset_status)}</div> |
|
23 | <div style="padding:10px; font-size:22px;width:100%;text-align: center; color:#88D882">${_('Closed %s') % (h.age(c.pull_request.updated_on))} ${_('with status %s') % h.changeset_status_lbl(c.current_changeset_status)}</div> | |
20 | %endif |
|
24 | %endif | |
21 | <h3> |
|
25 | <h3> | |
22 | %if c.pull_request.is_closed(): |
|
26 | %if c.pull_request.is_closed(): | |
23 | <img src="${h.url('/images/icons/lock_go.png')}" title="${_('Closed')}"/> |
|
27 | <img src="${h.url('/images/icons/lock_go.png')}" title="${_('Closed')}"/> | |
24 | %endif |
|
28 | %endif | |
25 | <img src="${h.url('/images/icons/flag_status_%s.png' % str(c.pull_request.last_review_status))}" /> |
|
29 | <img src="${h.url('/images/icons/flag_status_%s.png' % str(c.pull_request.last_review_status))}" /> | |
26 | ${_('Title')}: ${c.pull_request.title}</h3> |
|
30 | ${_('Title')}: ${c.pull_request.title}</h3> | |
27 |
|
31 | |||
28 | <div class="form"> |
|
32 | <div class="form"> | |
29 | <div id="summary" class="fields"> |
|
33 | <div id="summary" class="fields"> | |
30 | <div class="field"> |
|
34 | <div class="field"> | |
31 | <div class="label-summary"> |
|
35 | <div class="label-summary"> | |
32 | <label>${_('Review status')}:</label> |
|
36 | <label>${_('Review status')}:</label> | |
33 | </div> |
|
37 | </div> | |
34 | <div class="input"> |
|
38 | <div class="input"> | |
35 | <div class="changeset-status-container" style="float:none;clear:both"> |
|
39 | <div class="changeset-status-container" style="float:none;clear:both"> | |
36 | %if c.current_changeset_status: |
|
40 | %if c.current_changeset_status: | |
37 | <div title="${_('Pull request status')}" class="changeset-status-lbl">${h.changeset_status_lbl(c.current_changeset_status)}</div> |
|
41 | <div title="${_('Pull request status')}" class="changeset-status-lbl">${h.changeset_status_lbl(c.current_changeset_status)}</div> | |
38 | <div class="changeset-status-ico" style="padding:1px 4px"><img src="${h.url('/images/icons/flag_status_%s.png' % c.current_changeset_status)}" /></div> |
|
42 | <div class="changeset-status-ico" style="padding:1px 4px"><img src="${h.url('/images/icons/flag_status_%s.png' % c.current_changeset_status)}" /></div> | |
39 | %endif |
|
43 | %endif | |
40 | </div> |
|
44 | </div> | |
41 | </div> |
|
45 | </div> | |
42 | </div> |
|
46 | </div> | |
43 | <div class="field"> |
|
47 | <div class="field"> | |
44 | <div class="label-summary"> |
|
48 | <div class="label-summary"> | |
45 | <label>${_('Still not reviewed by')}:</label> |
|
49 | <label>${_('Still not reviewed by')}:</label> | |
46 | </div> |
|
50 | </div> | |
47 | <div class="input"> |
|
51 | <div class="input"> | |
48 | % if len(c.pull_request_pending_reviewers) > 0: |
|
52 | % if len(c.pull_request_pending_reviewers) > 0: | |
49 | <div class="tooltip" title="${h.tooltip(','.join([x.username for x in c.pull_request_pending_reviewers]))}">${ungettext('%d reviewer', '%d reviewers',len(c.pull_request_pending_reviewers)) % len(c.pull_request_pending_reviewers)}</div> |
|
53 | <div class="tooltip" title="${h.tooltip(','.join([x.username for x in c.pull_request_pending_reviewers]))}">${ungettext('%d reviewer', '%d reviewers',len(c.pull_request_pending_reviewers)) % len(c.pull_request_pending_reviewers)}</div> | |
50 | %else: |
|
54 | %else: | |
51 | <div>${_('pull request was reviewed by all reviewers')}</div> |
|
55 | <div>${_('pull request was reviewed by all reviewers')}</div> | |
52 | %endif |
|
56 | %endif | |
53 | </div> |
|
57 | </div> | |
54 | </div> |
|
58 | </div> | |
55 | <div class="field"> |
|
59 | <div class="field"> | |
56 | <div class="label-summary"> |
|
60 | <div class="label-summary"> | |
57 | <label>${_('Origin repository')}:</label> |
|
61 | <label>${_('Origin repository')}:</label> | |
58 | </div> |
|
62 | </div> | |
59 | <div class="input"> |
|
63 | <div class="input"> | |
60 | <div> |
|
64 | <div> | |
61 | ##%if h.is_hg(c.pull_request.org_repo): |
|
65 | ##%if h.is_hg(c.pull_request.org_repo): | |
62 | ## <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/> |
|
66 | ## <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/> | |
63 | ##%elif h.is_git(c.pull_request.org_repo): |
|
67 | ##%elif h.is_git(c.pull_request.org_repo): | |
64 | ## <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/> |
|
68 | ## <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/> | |
65 | ##%endif |
|
69 | ##%endif | |
66 | <span class="spantag">${c.pull_request.org_ref_parts[0]}: ${c.pull_request.org_ref_parts[1]}</span> |
|
70 | <span class="spantag">${c.pull_request.org_ref_parts[0]}: ${c.pull_request.org_ref_parts[1]}</span> | |
67 | <span><a href="${h.url('summary_home', repo_name=c.pull_request.org_repo.repo_name)}">${c.pull_request.org_repo.clone_url()}</a></span> |
|
71 | <span><a href="${h.url('summary_home', repo_name=c.pull_request.org_repo.repo_name)}">${c.pull_request.org_repo.clone_url()}</a></span> | |
68 | </div> |
|
72 | </div> | |
69 | </div> |
|
73 | </div> | |
70 | </div> |
|
74 | </div> | |
71 | <div class="field"> |
|
75 | <div class="field"> | |
72 | <div class="label-summary"> |
|
76 | <div class="label-summary"> | |
73 | <label>${_('Summary')}:</label> |
|
77 | <label>${_('Summary')}:</label> | |
74 | </div> |
|
78 | </div> | |
75 | <div class="input"> |
|
79 | <div class="input"> | |
76 | <div style="white-space:pre-wrap">${h.literal(c.pull_request.description)}</div> |
|
80 | <div style="white-space:pre-wrap">${h.literal(c.pull_request.description)}</div> | |
77 | </div> |
|
81 | </div> | |
78 | </div> |
|
82 | </div> | |
79 | <div class="field"> |
|
83 | <div class="field"> | |
80 | <div class="label-summary"> |
|
84 | <div class="label-summary"> | |
81 | <label>${_('Created on')}:</label> |
|
85 | <label>${_('Created on')}:</label> | |
82 | </div> |
|
86 | </div> | |
83 | <div class="input"> |
|
87 | <div class="input"> | |
84 | <div>${h.fmt_date(c.pull_request.created_on)}</div> |
|
88 | <div>${h.fmt_date(c.pull_request.created_on)}</div> | |
85 | </div> |
|
89 | </div> | |
86 | </div> |
|
90 | </div> | |
87 | </div> |
|
91 | </div> | |
88 | </div> |
|
92 | </div> | |
89 |
|
93 | |||
90 | <div style="overflow: auto;"> |
|
94 | <div style="overflow: auto;"> | |
91 | ##DIFF |
|
95 | ##DIFF | |
92 | <div class="table" style="float:left;clear:none"> |
|
96 | <div class="table" style="float:left;clear:none"> | |
93 | <div id="body" class="diffblock"> |
|
97 | <div id="body" class="diffblock"> | |
94 | <div style="white-space:pre-wrap;padding:5px">${_('Compare view')}</div> |
|
98 | <div style="white-space:pre-wrap;padding:5px">${_('Compare view')}</div> | |
95 | </div> |
|
99 | </div> | |
96 | <div id="changeset_compare_view_content"> |
|
100 | <div id="changeset_compare_view_content"> | |
97 | ##CS |
|
101 | ##CS | |
98 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${ungettext('Showing %s commit','Showing %s commits', len(c.cs_ranges)) % len(c.cs_ranges)}</div> |
|
102 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${ungettext('Showing %s commit','Showing %s commits', len(c.cs_ranges)) % len(c.cs_ranges)}</div> | |
99 | <%include file="/compare/compare_cs.html" /> |
|
103 | <%include file="/compare/compare_cs.html" /> | |
100 |
|
104 | |||
101 | ## FILES |
|
105 | ## FILES | |
102 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px"> |
|
106 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px"> | |
103 |
|
107 | |||
104 | % if c.limited_diff: |
|
108 | % if c.limited_diff: | |
105 | ${ungettext('%s file changed', '%s files changed', len(c.files)) % len(c.files)} |
|
109 | ${ungettext('%s file changed', '%s files changed', len(c.files)) % len(c.files)} | |
106 | % else: |
|
110 | % else: | |
107 | ${ungettext('%s file changed with %s insertions and %s deletions','%s files changed with %s insertions and %s deletions', len(c.files)) % (len(c.files),c.lines_added,c.lines_deleted)}: |
|
111 | ${ungettext('%s file changed with %s insertions and %s deletions','%s files changed with %s insertions and %s deletions', len(c.files)) % (len(c.files),c.lines_added,c.lines_deleted)}: | |
108 | %endif |
|
112 | %endif | |
109 |
|
113 | |||
110 | </div> |
|
114 | </div> | |
111 | <div class="cs_files"> |
|
115 | <div class="cs_files"> | |
112 | %if not c.files: |
|
116 | %if not c.files: | |
113 | <span class="empty_data">${_('No files')}</span> |
|
117 | <span class="empty_data">${_('No files')}</span> | |
114 | %endif |
|
118 | %endif | |
115 | %for fid, change, f, stat in c.files: |
|
119 | %for fid, change, f, stat in c.files: | |
116 | <div class="cs_${change}"> |
|
120 | <div class="cs_${change}"> | |
117 | <div class="node">${h.link_to(h.safe_unicode(f),h.url.current(anchor=fid))}</div> |
|
121 | <div class="node">${h.link_to(h.safe_unicode(f),h.url.current(anchor=fid))}</div> | |
118 | <div class="changes">${h.fancy_file_stats(stat)}</div> |
|
122 | <div class="changes">${h.fancy_file_stats(stat)}</div> | |
119 | </div> |
|
123 | </div> | |
120 | %endfor |
|
124 | %endfor | |
121 | </div> |
|
125 | </div> | |
122 | % if c.limited_diff: |
|
126 | % if c.limited_diff: | |
123 | <h5>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("confirm to show potentially huge diff")}')">${_('Show full diff')}</a></h5> |
|
127 | <h5>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("confirm to show potentially huge diff")}')">${_('Show full diff')}</a></h5> | |
124 | % endif |
|
128 | % endif | |
125 | </div> |
|
129 | </div> | |
126 | </div> |
|
130 | </div> | |
127 | ## REVIEWERS |
|
131 | ## REVIEWERS | |
128 | <div style="float:left; border-left:1px dashed #eee"> |
|
132 | <div style="float:left; border-left:1px dashed #eee"> | |
129 | <h4>${_('Pull request reviewers')}</h4> |
|
133 | <h4>${_('Pull request reviewers')}</h4> | |
130 | <div id="reviewers" style="padding:0px 0px 5px 10px"> |
|
134 | <div id="reviewers" style="padding:0px 0px 5px 10px"> | |
131 | ## members goes here ! |
|
135 | ## members goes here ! | |
132 | <div class="group_members_wrap" style="min-height:45px"> |
|
136 | <div class="group_members_wrap" style="min-height:45px"> | |
133 | <ul id="review_members" class="group_members"> |
|
137 | <ul id="review_members" class="group_members"> | |
134 | %for member,status in c.pull_request_reviewers: |
|
138 | %for member,status in c.pull_request_reviewers: | |
135 | <li id="reviewer_${member.user_id}"> |
|
139 | <li id="reviewer_${member.user_id}"> | |
136 | <div class="reviewers_member"> |
|
140 | <div class="reviewers_member"> | |
137 | <div style="float:left;padding:0px 3px 0px 0px" class="tooltip" title="${h.tooltip(h.changeset_status_lbl(status[0][1].status if status else 'not_reviewed'))}"> |
|
141 | <div style="float:left;padding:0px 3px 0px 0px" class="tooltip" title="${h.tooltip(h.changeset_status_lbl(status[0][1].status if status else 'not_reviewed'))}"> | |
138 | <img src="${h.url(str('/images/icons/flag_status_%s.png' % (status[0][1].status if status else 'not_reviewed')))}"/> |
|
142 | <img src="${h.url(str('/images/icons/flag_status_%s.png' % (status[0][1].status if status else 'not_reviewed')))}"/> | |
139 | </div> |
|
143 | </div> | |
140 | <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(member.email,14)}"/> </div> |
|
144 | <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(member.email,14)}"/> </div> | |
141 | <div style="float:left">${member.full_name} (${_('owner') if c.pull_request.user_id == member.user_id else _('reviewer')})</div> |
|
145 | <div style="float:left">${member.full_name} (${_('owner') if c.pull_request.user_id == member.user_id else _('reviewer')})</div> | |
142 | <input type="hidden" value="${member.user_id}" name="review_members" /> |
|
146 | <input type="hidden" value="${member.user_id}" name="review_members" /> | |
143 | %if not c.pull_request.is_closed() and (h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.user_id == c.rhodecode_user.user_id): |
|
147 | %if not c.pull_request.is_closed() and (h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.user_id == c.rhodecode_user.user_id): | |
144 | <span class="delete_icon action_button" onclick="removeReviewMember(${member.user_id})"></span> |
|
148 | <span class="delete_icon action_button" onclick="removeReviewMember(${member.user_id})"></span> | |
145 | %endif |
|
149 | %endif | |
146 | </div> |
|
150 | </div> | |
147 | </li> |
|
151 | </li> | |
148 | %endfor |
|
152 | %endfor | |
149 | </ul> |
|
153 | </ul> | |
150 | </div> |
|
154 | </div> | |
151 | %if not c.pull_request.is_closed(): |
|
155 | %if not c.pull_request.is_closed(): | |
152 | <div class='ac'> |
|
156 | <div class='ac'> | |
153 | %if h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.author.user_id == c.rhodecode_user.user_id: |
|
157 | %if h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.author.user_id == c.rhodecode_user.user_id: | |
154 | <div class="reviewer_ac"> |
|
158 | <div class="reviewer_ac"> | |
155 | ${h.text('user', class_='yui-ac-input')} |
|
159 | ${h.text('user', class_='yui-ac-input')} | |
156 | <span class="help-block">${_('Add or remove reviewer to this pull request.')}</span> |
|
160 | <span class="help-block">${_('Add or remove reviewer to this pull request.')}</span> | |
157 | <div id="reviewers_container"></div> |
|
161 | <div id="reviewers_container"></div> | |
158 | </div> |
|
162 | </div> | |
159 | <div style="padding:0px 10px"> |
|
163 | <div style="padding:0px 10px"> | |
160 | <span id="update_pull_request" class="ui-btn xsmall">${_('Save changes')}</span> |
|
164 | <span id="update_pull_request" class="ui-btn xsmall">${_('Save changes')}</span> | |
161 | </div> |
|
165 | </div> | |
162 | %endif |
|
166 | %endif | |
163 | </div> |
|
167 | </div> | |
164 | %endif |
|
168 | %endif | |
165 | </div> |
|
169 | </div> | |
166 | </div> |
|
170 | </div> | |
167 | </div> |
|
171 | </div> | |
168 | <script> |
|
172 | <script> | |
169 | var _USERS_AC_DATA = ${c.users_array|n}; |
|
173 | var _USERS_AC_DATA = ${c.users_array|n}; | |
170 | var _GROUPS_AC_DATA = ${c.users_groups_array|n}; |
|
174 | var _GROUPS_AC_DATA = ${c.users_groups_array|n}; | |
171 | // TODO: switch this to pyroutes |
|
175 | // TODO: switch this to pyroutes | |
172 | AJAX_COMMENT_URL = "${url('pullrequest_comment',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id)}"; |
|
176 | AJAX_COMMENT_URL = "${url('pullrequest_comment',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id)}"; | |
173 | AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}"; |
|
177 | AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}"; | |
174 |
|
178 | |||
175 | pyroutes.register('pullrequest_comment', "${url('pullrequest_comment',repo_name='%(repo_name)s',pull_request_id='%(pull_request_id)s')}", ['repo_name', 'pull_request_id']); |
|
179 | pyroutes.register('pullrequest_comment', "${url('pullrequest_comment',repo_name='%(repo_name)s',pull_request_id='%(pull_request_id)s')}", ['repo_name', 'pull_request_id']); | |
176 | pyroutes.register('pullrequest_comment_delete', "${url('pullrequest_comment_delete',repo_name='%(repo_name)s',comment_id='%(comment_id)s')}", ['repo_name', 'comment_id']); |
|
180 | pyroutes.register('pullrequest_comment_delete', "${url('pullrequest_comment_delete',repo_name='%(repo_name)s',comment_id='%(comment_id)s')}", ['repo_name', 'comment_id']); | |
177 | pyroutes.register('pullrequest_update', "${url('pullrequest_update',repo_name='%(repo_name)s',pull_request_id='%(pull_request_id)s')}", ['repo_name', 'pull_request_id']); |
|
181 | pyroutes.register('pullrequest_update', "${url('pullrequest_update',repo_name='%(repo_name)s',pull_request_id='%(pull_request_id)s')}", ['repo_name', 'pull_request_id']); | |
178 |
|
182 | |||
179 | </script> |
|
183 | </script> | |
180 |
|
184 | |||
181 | ## diff block |
|
185 | ## diff block | |
182 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> |
|
186 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> | |
183 | %for fid, change, f, stat in c.files: |
|
187 | %for fid, change, f, stat in c.files: | |
184 | ${diff_block.diff_block_simple([c.changes[fid]])} |
|
188 | ${diff_block.diff_block_simple([c.changes[fid]])} | |
185 | %endfor |
|
189 | %endfor | |
186 | % if c.limited_diff: |
|
190 | % if c.limited_diff: | |
187 | <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("confirm to show potentially huge diff")}')">${_('Show full diff')}</a></h4> |
|
191 | <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("confirm to show potentially huge diff")}')">${_('Show full diff')}</a></h4> | |
188 | % endif |
|
192 | % endif | |
189 |
|
193 | |||
190 |
|
194 | |||
191 | ## template for inline comment form |
|
195 | ## template for inline comment form | |
192 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
|
196 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> | |
193 | ${comment.comment_inline_form()} |
|
197 | ${comment.comment_inline_form()} | |
194 |
|
198 | |||
195 | ## render comments and inlines |
|
199 | ## render comments and inlines | |
196 | ${comment.generate_comments(include_pr=True)} |
|
200 | ${comment.generate_comments(include_pr=True)} | |
197 |
|
201 | |||
198 | % if not c.pull_request.is_closed(): |
|
202 | % if not c.pull_request.is_closed(): | |
199 | ## main comment form and it status |
|
203 | ## main comment form and it status | |
200 | ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, |
|
204 | ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, | |
201 | pull_request_id=c.pull_request.pull_request_id), |
|
205 | pull_request_id=c.pull_request.pull_request_id), | |
202 | c.current_changeset_status, |
|
206 | c.current_changeset_status, | |
203 | close_btn=True, change_status=c.allowed_to_change_status)} |
|
207 | close_btn=True, change_status=c.allowed_to_change_status)} | |
204 | %endif |
|
208 | %endif | |
205 |
|
209 | |||
206 | <script type="text/javascript"> |
|
210 | <script type="text/javascript"> | |
207 | YUE.onDOMReady(function(){ |
|
211 | YUE.onDOMReady(function(){ | |
208 | PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA); |
|
212 | PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA); | |
209 |
|
213 | |||
210 | YUE.on(YUQ('.show-inline-comments'),'change',function(e){ |
|
214 | YUE.on(YUQ('.show-inline-comments'),'change',function(e){ | |
211 | var show = 'none'; |
|
215 | var show = 'none'; | |
212 | var target = e.currentTarget; |
|
216 | var target = e.currentTarget; | |
213 | if(target.checked){ |
|
217 | if(target.checked){ | |
214 | var show = '' |
|
218 | var show = '' | |
215 | } |
|
219 | } | |
216 | var boxid = YUD.getAttribute(target,'id_for'); |
|
220 | var boxid = YUD.getAttribute(target,'id_for'); | |
217 | var comments = YUQ('#{0} .inline-comments'.format(boxid)); |
|
221 | var comments = YUQ('#{0} .inline-comments'.format(boxid)); | |
218 | for(c in comments){ |
|
222 | for(c in comments){ | |
219 | YUD.setStyle(comments[c],'display',show); |
|
223 | YUD.setStyle(comments[c],'display',show); | |
220 | } |
|
224 | } | |
221 | var btns = YUQ('#{0} .inline-comments-button'.format(boxid)); |
|
225 | var btns = YUQ('#{0} .inline-comments-button'.format(boxid)); | |
222 | for(c in btns){ |
|
226 | for(c in btns){ | |
223 | YUD.setStyle(btns[c],'display',show); |
|
227 | YUD.setStyle(btns[c],'display',show); | |
224 | } |
|
228 | } | |
225 | }) |
|
229 | }) | |
226 |
|
230 | |||
227 | YUE.on(YUQ('.line'),'click',function(e){ |
|
231 | YUE.on(YUQ('.line'),'click',function(e){ | |
228 | var tr = e.currentTarget; |
|
232 | var tr = e.currentTarget; | |
229 | injectInlineForm(tr); |
|
233 | injectInlineForm(tr); | |
230 | }); |
|
234 | }); | |
231 |
|
235 | |||
232 | // inject comments into they proper positions |
|
236 | // inject comments into they proper positions | |
233 | var file_comments = YUQ('.inline-comment-placeholder'); |
|
237 | var file_comments = YUQ('.inline-comment-placeholder'); | |
234 | renderInlineComments(file_comments); |
|
238 | renderInlineComments(file_comments); | |
235 |
|
239 | |||
236 | YUE.on(YUD.get('update_pull_request'),'click',function(e){ |
|
240 | YUE.on(YUD.get('update_pull_request'),'click',function(e){ | |
237 | updateReviewers(undefined, "${c.repo_name}", "${c.pull_request.pull_request_id}"); |
|
241 | updateReviewers(undefined, "${c.repo_name}", "${c.pull_request.pull_request_id}"); | |
238 | }) |
|
242 | }) | |
239 | }) |
|
243 | }) | |
240 | </script> |
|
244 | </script> | |
241 |
|
245 | |||
242 | </div> |
|
246 | </div> | |
243 |
|
247 | |||
244 | </%def> |
|
248 | </%def> |
@@ -1,38 +1,42 b'' | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 | <%def name="title()"> |
|
3 | <%def name="title()"> | |
4 | ${_('%s Pull Requests') % c.repo_name} · ${c.rhodecode_name} |
|
4 | ${_('%s Pull Requests') % c.repo_name} · ${c.rhodecode_name} | |
5 | </%def> |
|
5 | </%def> | |
6 |
|
6 | |||
7 | <%def name="breadcrumbs_links()"> |
|
7 | <%def name="breadcrumbs_links()"> | |
8 | ${_('Pull requests')} |
|
8 | ${_('Pull requests')} | |
9 | </%def> |
|
9 | </%def> | |
10 |
|
10 | |||
|
11 | <%def name="page_nav()"> | |||
|
12 | ${self.menu('repositories')} | |||
|
13 | </%def> | |||
|
14 | ||||
11 | <%def name="main()"> |
|
15 | <%def name="main()"> | |
12 | ${self.context_bar('showpullrequest')} |
|
16 | ${self.context_bar('showpullrequest')} | |
13 | <div class="box"> |
|
17 | <div class="box"> | |
14 | <!-- box / title --> |
|
18 | <!-- box / title --> | |
15 | <div class="title"> |
|
19 | <div class="title"> | |
16 | ${self.breadcrumbs()} |
|
20 | ${self.breadcrumbs()} | |
17 | </div> |
|
21 | </div> | |
18 |
|
22 | |||
19 | %for pr in c.pull_requests: |
|
23 | %for pr in c.pull_requests: | |
20 | <div> |
|
24 | <div> | |
21 | <h4 style="border:0px;padding:0px"> |
|
25 | <h4 style="border:0px;padding:0px"> | |
22 | %if pr.is_closed(): |
|
26 | %if pr.is_closed(): | |
23 | <img src="${h.url('/images/icons/lock_go.png')}" title="${_('Closed')}"/> |
|
27 | <img src="${h.url('/images/icons/lock_go.png')}" title="${_('Closed')}"/> | |
24 | %endif |
|
28 | %endif | |
25 | <img src="${h.url('/images/icons/flag_status_%s.png' % str(pr.last_review_status))}" /> |
|
29 | <img src="${h.url('/images/icons/flag_status_%s.png' % str(pr.last_review_status))}" /> | |
26 | <a href="${h.url('pullrequest_show',repo_name=c.repo_name,pull_request_id=pr.pull_request_id)}"> |
|
30 | <a href="${h.url('pullrequest_show',repo_name=c.repo_name,pull_request_id=pr.pull_request_id)}"> | |
27 | ${_('Pull request #%s opened by %s on %s') % (pr.pull_request_id, pr.author.full_name, h.fmt_date(pr.created_on))} |
|
31 | ${_('Pull request #%s opened by %s on %s') % (pr.pull_request_id, pr.author.full_name, h.fmt_date(pr.created_on))} | |
28 | </a> |
|
32 | </a> | |
29 | </h4> |
|
33 | </h4> | |
30 | <h5 style="border:0px;padding-bottom:0px">${_('Title')}: ${pr.title}</h5> |
|
34 | <h5 style="border:0px;padding-bottom:0px">${_('Title')}: ${pr.title}</h5> | |
31 | <div style="padding:0px 24px">${pr.description}</div> |
|
35 | <div style="padding:0px 24px">${pr.description}</div> | |
32 | <div style="border-bottom: 1px solid #DDD;margin:10px 20px;padding-bottom:10px"></div> |
|
36 | <div style="border-bottom: 1px solid #DDD;margin:10px 20px;padding-bottom:10px"></div> | |
33 | </div> |
|
37 | </div> | |
34 | %endfor |
|
38 | %endfor | |
35 |
|
39 | |||
36 | </div> |
|
40 | </div> | |
37 |
|
41 | |||
38 | </%def> |
|
42 | </%def> |
@@ -1,87 +1,89 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 | %if c.repo_name: |
|
5 | %if c.repo_name: | |
6 | ${_('Search repository')} ${c.repo_name} · ${c.rhodecode_name} |
|
6 | ${_('Search repository')} ${c.repo_name} · ${c.rhodecode_name} | |
7 | %else: |
|
7 | %else: | |
8 | ${_('Search in all repositories')} |
|
8 | ${_('Search in all repositories')} | |
9 | %endif |
|
9 | %endif | |
10 | </%def> |
|
10 | </%def> | |
11 |
|
11 | |||
12 | <%def name="breadcrumbs_links()"> |
|
12 | <%def name="breadcrumbs_links()"> | |
13 | %if c.repo_name: |
|
13 | %if c.repo_name: | |
14 | ${_('Search')} |
|
14 | ${_('Search')} | |
15 | %else: |
|
15 | %else: | |
16 | ${_('Search in all repositories')} |
|
16 | ${_('Search in all repositories')} | |
17 | %endif |
|
17 | %endif | |
18 | %if c.cur_query: |
|
18 | %if c.cur_query: | |
19 | » |
|
19 | » | |
20 | ${c.cur_query} |
|
20 | ${c.cur_query} | |
21 | %endif |
|
21 | %endif | |
22 | </%def> |
|
22 | </%def> | |
23 |
|
23 | |||
24 | <%def name="page_nav()"> |
|
24 | <%def name="page_nav()"> | |
25 | %if c.repo_name: |
|
25 | %if c.repo_name: | |
26 | ${self.menu('repositories')} |
|
26 | ${self.menu('repositories')} | |
27 | %else: |
|
27 | %else: | |
28 | ${self.menu('search')} |
|
28 | ${self.menu('search')} | |
29 | %endif |
|
29 | %endif | |
30 | </%def> |
|
30 | </%def> | |
31 | <%def name="main()"> |
|
31 | <%def name="main()"> | |
|
32 | %if c.repo_name: | |||
32 | ${self.context_bar('options')} |
|
33 | ${self.context_bar('options')} | |
|
34 | %endif | |||
33 | <div class="box"> |
|
35 | <div class="box"> | |
34 | <!-- box / title --> |
|
36 | <!-- box / title --> | |
35 | <div class="title"> |
|
37 | <div class="title"> | |
36 | ${self.breadcrumbs()} |
|
38 | ${self.breadcrumbs()} | |
37 | </div> |
|
39 | </div> | |
38 | <!-- end box / title --> |
|
40 | <!-- end box / title --> | |
39 | %if c.repo_name: |
|
41 | %if c.repo_name: | |
40 | ${h.form(h.url('search_repo',repo_name=c.repo_name),method='get')} |
|
42 | ${h.form(h.url('search_repo',repo_name=c.repo_name),method='get')} | |
41 | %else: |
|
43 | %else: | |
42 | ${h.form(h.url('search'),method='get')} |
|
44 | ${h.form(h.url('search'),method='get')} | |
43 | %endif |
|
45 | %endif | |
44 | <div class="form"> |
|
46 | <div class="form"> | |
45 | <div class="fields"> |
|
47 | <div class="fields"> | |
46 | <div class="field field-first field-noborder"> |
|
48 | <div class="field field-first field-noborder"> | |
47 | <div class="label"> |
|
49 | <div class="label"> | |
48 | <label for="q">${_('Search term')}</label> |
|
50 | <label for="q">${_('Search term')}</label> | |
49 | </div> |
|
51 | </div> | |
50 | <div class="input">${h.text('q',c.cur_query,class_="small")} |
|
52 | <div class="input">${h.text('q',c.cur_query,class_="small")} | |
51 | <div class="button highlight"> |
|
53 | <div class="button highlight"> | |
52 | <input type="submit" value="${_('Search')}" class="ui-button"/> |
|
54 | <input type="submit" value="${_('Search')}" class="ui-button"/> | |
53 | </div> |
|
55 | </div> | |
54 | </div> |
|
56 | </div> | |
55 | <div style="font-weight: bold;clear:Both;margin-left:200px">${c.runtime}</div> |
|
57 | <div style="font-weight: bold;clear:Both;margin-left:200px">${c.runtime}</div> | |
56 | </div> |
|
58 | </div> | |
57 |
|
59 | |||
58 | <div class="field"> |
|
60 | <div class="field"> | |
59 | <div class="label"> |
|
61 | <div class="label"> | |
60 | <label for="type">${_('Search in')}</label> |
|
62 | <label for="type">${_('Search in')}</label> | |
61 | </div> |
|
63 | </div> | |
62 | <div class="select"> |
|
64 | <div class="select"> | |
63 | ${h.select('type',c.cur_type,[('content',_('File contents')), |
|
65 | ${h.select('type',c.cur_type,[('content',_('File contents')), | |
64 | ('commit',_('Commit messages')), |
|
66 | ('commit',_('Commit messages')), | |
65 | ('path',_('File names')), |
|
67 | ('path',_('File names')), | |
66 | ##('repository',_('Repository names')), |
|
68 | ##('repository',_('Repository names')), | |
67 | ])} |
|
69 | ])} | |
68 | </div> |
|
70 | </div> | |
69 | </div> |
|
71 | </div> | |
70 |
|
72 | |||
71 | </div> |
|
73 | </div> | |
72 | </div> |
|
74 | </div> | |
73 | ${h.end_form()} |
|
75 | ${h.end_form()} | |
74 | <div class="search"> |
|
76 | <div class="search"> | |
75 | %if c.cur_type == 'content': |
|
77 | %if c.cur_type == 'content': | |
76 | <%include file='search_content.html'/> |
|
78 | <%include file='search_content.html'/> | |
77 | %elif c.cur_type == 'path': |
|
79 | %elif c.cur_type == 'path': | |
78 | <%include file='search_path.html'/> |
|
80 | <%include file='search_path.html'/> | |
79 | %elif c.cur_type == 'commit': |
|
81 | %elif c.cur_type == 'commit': | |
80 | <%include file='search_commit.html'/> |
|
82 | <%include file='search_commit.html'/> | |
81 | %elif c.cur_type == 'repository': |
|
83 | %elif c.cur_type == 'repository': | |
82 | <%include file='search_repository.html'/> |
|
84 | <%include file='search_repository.html'/> | |
83 | %endif |
|
85 | %endif | |
84 | </div> |
|
86 | </div> | |
85 | </div> |
|
87 | </div> | |
86 |
|
88 | |||
87 | </%def> |
|
89 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now