Show More
@@ -19,6 +19,7 b' news' | |||||
19 | - added help text into repo add/edit forms |
|
19 | - added help text into repo add/edit forms | |
20 | - created rcextensions module with additional mappings (ref #322) and |
|
20 | - created rcextensions module with additional mappings (ref #322) and | |
21 | post push/pull/create repo hooks callbacks |
|
21 | post push/pull/create repo hooks callbacks | |
|
22 | - implemented #377 Users view for his own permissions on account page | |||
22 |
|
23 | |||
23 | fixes |
|
24 | fixes | |
24 | +++++ |
|
25 | +++++ |
@@ -4155,6 +4155,47 b' form.comment-inline-form {' | |||||
4155 | padding:5px 0px 5px 38px; |
|
4155 | padding:5px 0px 5px 38px; | |
4156 | } |
|
4156 | } | |
4157 |
|
4157 | |||
|
4158 | /**** | |||
|
4159 | PERMS | |||
|
4160 | *****/ | |||
|
4161 | #perms .perms_section_head { | |||
|
4162 | padding:10px 10px 10px 0px; | |||
|
4163 | font-size:16px; | |||
|
4164 | font-weight: bold; | |||
|
4165 | } | |||
|
4166 | ||||
|
4167 | #perms .perm_tag{ | |||
|
4168 | padding: 1px 3px 1px 3px; | |||
|
4169 | font-size: 10px; | |||
|
4170 | font-weight: bold; | |||
|
4171 | text-transform: uppercase; | |||
|
4172 | white-space: nowrap; | |||
|
4173 | -webkit-border-radius: 3px; | |||
|
4174 | -moz-border-radius: 3px; | |||
|
4175 | border-radius: 3px; | |||
|
4176 | } | |||
|
4177 | ||||
|
4178 | #perms .perm_tag.admin{ | |||
|
4179 | background-color: #B94A48; | |||
|
4180 | color: #ffffff; | |||
|
4181 | } | |||
|
4182 | ||||
|
4183 | #perms .perm_tag.write{ | |||
|
4184 | background-color: #B94A48; | |||
|
4185 | color: #ffffff; | |||
|
4186 | } | |||
|
4187 | ||||
|
4188 | #perms .perm_tag.read{ | |||
|
4189 | background-color: #468847; | |||
|
4190 | color: #ffffff; | |||
|
4191 | } | |||
|
4192 | ||||
|
4193 | #perms .perm_tag.none{ | |||
|
4194 | background-color: #bfbfbf; | |||
|
4195 | color: #ffffff; | |||
|
4196 | } | |||
|
4197 | ||||
|
4198 | ||||
4158 |
|
4199 | |||
4159 | /***************************************************************************** |
|
4200 | /***************************************************************************** | |
4160 | DIFFS CSS |
|
4201 | DIFFS CSS |
@@ -700,6 +700,18 b' var nameSort = function(a, b, desc, fiel' | |||||
700 | return compState; |
|
700 | return compState; | |
701 | }; |
|
701 | }; | |
702 |
|
702 | |||
|
703 | var permNameSort = function(a, b, desc, field) { | |||
|
704 | var a_ = fromHTML(a.getData(field)); | |||
|
705 | var b_ = fromHTML(b.getData(field)); | |||
|
706 | // extract name from table | |||
|
707 | a_ = a_.innerHTML; | |||
|
708 | b_ = b_.innerHTML; | |||
|
709 | ||||
|
710 | var comp = YAHOO.util.Sort.compare; | |||
|
711 | var compState = comp(a_, b_, desc); | |||
|
712 | return compState; | |||
|
713 | }; | |||
|
714 | ||||
703 | var groupNameSort = function(a, b, desc, field) { |
|
715 | var groupNameSort = function(a, b, desc, field) { | |
704 | var a_ = fromHTML(a.getData(field)); |
|
716 | var a_ = fromHTML(a.getData(field)); | |
705 | var b_ = fromHTML(b.getData(field)); |
|
717 | var b_ = fromHTML(b.getData(field)); |
@@ -113,52 +113,45 b'' | |||||
113 | <div class="title"> |
|
113 | <div class="title"> | |
114 | <h5> |
|
114 | <h5> | |
115 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/> |
|
115 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}"/> | |
116 | ${_('My repositories')} |
|
116 | <a id="show_my" class="link-white" href="#my">${_('My repos')}</a> / <a id="show_perms" class="link-white" href="#perms">${_('My permissions')}</a> | |
117 | </h5> |
|
117 | </h5> | |
118 | %if h.HasPermissionAny('hg.admin','hg.create.repository')(): |
|
118 | %if h.HasPermissionAny('hg.admin','hg.create.repository')(): | |
119 | <ul class="links"> |
|
119 | <ul class="links"> | |
120 | <li> |
|
120 | <li> | |
121 |
<span>${h.link_to(_('ADD |
|
121 | <span>${h.link_to(_('ADD'),h.url('admin_settings_create_repository'))}</span> | |
122 | </li> |
|
122 | </li> | |
123 | </ul> |
|
123 | </ul> | |
124 | %endif |
|
124 | %endif | |
125 | </div> |
|
125 | </div> | |
126 | <!-- end box / title --> |
|
126 | <!-- end box / title --> | |
127 | <div class="table"> |
|
127 | <div id="my" class="table"> | |
128 | <table> |
|
128 | <div id='repos_list_wrap' class="yui-skin-sam"> | |
|
129 | <table id="repos_list"> | |||
129 | <thead> |
|
130 | <thead> | |
130 | <tr> |
|
131 | <tr> | |
|
132 | <th></th> | |||
131 | <th class="left">${_('Name')}</th> |
|
133 | <th class="left">${_('Name')}</th> | |
132 |
<th class="left">${_(' |
|
134 | <th class="left">${_('Revision')}</th> | |
133 |
<th |
|
135 | <th class="left">${_('Action')}</th> | |
|
136 | <th class="left">${_('Action')}</th> | |||
134 | </thead> |
|
137 | </thead> | |
135 | <tbody> |
|
138 | <tbody> | |
|
139 | <%namespace name="dt" file="/_data_table/_dt_elements.html"/> | |||
136 | %if c.user_repos: |
|
140 | %if c.user_repos: | |
137 | %for repo in c.user_repos: |
|
141 | %for repo in c.user_repos: | |
138 | <tr> |
|
142 | <tr> | |
139 | <td> |
|
143 | ##QUICK MENU | |
140 | %if h.is_hg(repo['dbrepo']['repo_type']): |
|
144 | <td class="quick_repo_menu"> | |
141 | <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/> |
|
145 | ${dt.quick_menu(repo['name'])} | |
142 | %elif h.is_git(repo['dbrepo']['repo_type']): |
|
146 | </td> | |
143 | <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/> |
|
147 | ##REPO NAME AND ICONS | |
144 |
|
|
148 | <td class="reponame"> | |
145 |
|
149 | ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],repo['dbrepo_fork'].get('repo_name'))} | ||
146 |
|
|
150 | </td> | |
147 | %if repo['dbrepo']['private']: |
|
151 | ##LAST REVISION | |
148 | <img class="icon" alt="${_('private')}" src="${h.url('/images/icons/lock.png')}"/> |
|
152 | <td> | |
149 | %else: |
|
153 | ${dt.revision(repo['name'],repo['rev'],repo['tip'],repo['author'],repo['last_msg'])} | |
150 | <img class="icon" alt="${_('public')}" src="${h.url('/images/icons/lock_open.png')}"/> |
|
154 | </td> | |
151 | %endif |
|
|||
152 |
|
||||
153 | ${h.link_to(repo['name'], h.url('summary_home',repo_name=repo['name']),class_="repo_name")} |
|
|||
154 | %if repo['dbrepo_fork']: |
|
|||
155 | <a href="${h.url('summary_home',repo_name=repo['dbrepo_fork']['repo_name'])}"> |
|
|||
156 | <img class="icon" alt="${_('public')}" |
|
|||
157 | title="${_('Fork of')} ${repo['dbrepo_fork']['repo_name']}" |
|
|||
158 | src="${h.url('/images/icons/arrow_divide.png')}"/></a> |
|
|||
159 | %endif |
|
|||
160 | </td> |
|
|||
161 | <td><span class="tooltip" title="${repo['last_change']}">${("r%s:%s") % (repo['rev'],h.short_id(repo['tip']))}</span></td> |
|
|||
162 | <td><a href="${h.url('repo_settings_home',repo_name=repo['name'])}" title="${_('edit')}"><img class="icon" alt="${_('private')}" src="${h.url('/images/icons/application_form_edit.png')}"/></a></td> |
|
155 | <td><a href="${h.url('repo_settings_home',repo_name=repo['name'])}" title="${_('edit')}"><img class="icon" alt="${_('private')}" src="${h.url('/images/icons/application_form_edit.png')}"/></a></td> | |
163 | <td> |
|
156 | <td> | |
164 | ${h.form(url('repo_settings_delete', repo_name=repo['name']),method='delete')} |
|
157 | ${h.form(url('repo_settings_delete', repo_name=repo['name']),method='delete')} | |
@@ -177,14 +170,127 b'' | |||||
177 | %endif |
|
170 | %endif | |
178 | </tbody> |
|
171 | </tbody> | |
179 | </table> |
|
172 | </table> | |
|
173 | </div> | |||
|
174 | </div> | |||
|
175 | <div id="perms" class="table" style="display:none"> | |||
|
176 | %for section in sorted(c.rhodecode_user.permissions.keys()): | |||
|
177 | <div class="perms_section_head">${section.replace("_"," ").capitalize()}</div> | |||
|
178 | ||||
|
179 | <div id='tbl_list_wrap_${section}' class="yui-skin-sam"> | |||
|
180 | <table id="tbl_list_${section}"> | |||
|
181 | <thead> | |||
|
182 | <tr> | |||
|
183 | <th class="left">${_('Name')}</th> | |||
|
184 | <th class="left">${_('Permission')}</th> | |||
|
185 | </thead> | |||
|
186 | <tbody> | |||
|
187 | %for k in c.rhodecode_user.permissions[section]: | |||
|
188 | <tr> | |||
|
189 | <td>${k}</td> | |||
|
190 | <td> | |||
|
191 | %if section == 'global': | |||
|
192 | ${', '.join(c.rhodecode_user.permissions[section])} | |||
|
193 | %else: | |||
|
194 | <span class="perm_tag ${c.rhodecode_user.permissions[section].get(k).split('.')[-1] }">${c.rhodecode_user.permissions[section].get(k)}</span> | |||
|
195 | %endif | |||
|
196 | </td> | |||
|
197 | </tr> | |||
|
198 | %endfor | |||
|
199 | </tbody> | |||
|
200 | </table> | |||
|
201 | </div> | |||
|
202 | %endfor | |||
180 | </div> |
|
203 | </div> | |
181 | </div> |
|
204 | </div> | |
182 | <script type="text/javascript"> |
|
205 | <script type="text/javascript"> | |
183 | var nodes = YUQ('div.table tr td a.repo_name'); |
|
206 | var filter_activate = function(){ | |
184 | var target = 'q_filter'; |
|
207 | var nodes = YUQ('#my tr td a.repo_name'); | |
185 | var func = function(node){ |
|
208 | var func = function(node){ | |
186 | return node.parentNode.parentNode; |
|
209 | return node.parentNode.parentNode.parentNode.parentNode; | |
|
210 | } | |||
|
211 | q_filter('q_filter',YUQ('#my tr td a.repo_name'),func); | |||
187 | } |
|
212 | } | |
188 | q_filter(target,nodes,func); |
|
213 | ||
|
214 | YUE.on('show_my','click',function(e){ | |||
|
215 | YUD.setStyle('perms','display','none'); | |||
|
216 | YUD.setStyle('my','display',''); | |||
|
217 | YUD.get('q_filter').removeAttribute('disabled'); | |||
|
218 | filter_activate(); | |||
|
219 | YUE.preventDefault(e); | |||
|
220 | }) | |||
|
221 | YUE.on('show_perms','click',function(e){ | |||
|
222 | YUD.setStyle('my','display','none'); | |||
|
223 | YUD.setStyle('perms','display',''); | |||
|
224 | YUD.setAttribute('q_filter','disabled','disabled'); | |||
|
225 | YUE.preventDefault(e); | |||
|
226 | }) | |||
|
227 | ||||
|
228 | ||||
|
229 | // main table sorting | |||
|
230 | var myColumnDefs = [ | |||
|
231 | {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"}, | |||
|
232 | {key:"name",label:"${_('Name')}",sortable:true, | |||
|
233 | sortOptions: { sortFunction: nameSort }}, | |||
|
234 | {key:"tip",label:"${_('Tip')}",sortable:true, | |||
|
235 | sortOptions: { sortFunction: revisionSort }}, | |||
|
236 | {key:"action1",label:"",sortable:false}, | |||
|
237 | {key:"action2",label:"",sortable:false}, | |||
|
238 | ]; | |||
|
239 | ||||
|
240 | var myDataSource = new YAHOO.util.DataSource(YUD.get("repos_list")); | |||
|
241 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; | |||
|
242 | myDataSource.responseSchema = { | |||
|
243 | fields: [ | |||
|
244 | {key:"menu"}, | |||
|
245 | {key:"name"}, | |||
|
246 | {key:"tip"}, | |||
|
247 | {key:"action1"}, | |||
|
248 | {key:"action2"}, | |||
|
249 | ] | |||
|
250 | }; | |||
|
251 | var trans_defs = { | |||
|
252 | sortedBy:{key:"name",dir:"asc"}, | |||
|
253 | MSG_SORTASC:"${_('Click to sort ascending')}", | |||
|
254 | MSG_SORTDESC:"${_('Click to sort descending')}", | |||
|
255 | MSG_EMPTY:"${_('No records found.')}", | |||
|
256 | MSG_ERROR:"${_('Data error.')}", | |||
|
257 | MSG_LOADING:"${_('Loading...')}", | |||
|
258 | } | |||
|
259 | var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,trans_defs); | |||
|
260 | myDataTable.subscribe('postRenderEvent',function(oArgs) { | |||
|
261 | tooltip_activate(); | |||
|
262 | quick_repo_menu(); | |||
|
263 | filter_activate(); | |||
|
264 | }); | |||
|
265 | ||||
|
266 | var permsColumnDefs = [ | |||
|
267 | {key:"name",label:"${_('Name')}",sortable:true, sortOptions: { sortFunction: permNameSort }}, | |||
|
268 | {key:"perm",label:"${_('Permission')}",sortable:false,}, | |||
|
269 | ]; | |||
|
270 | ||||
|
271 | // perms repos table | |||
|
272 | var myDataSource2 = new YAHOO.util.DataSource(YUD.get("tbl_list_repositories")); | |||
|
273 | myDataSource2.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; | |||
|
274 | myDataSource2.responseSchema = { | |||
|
275 | fields: [ | |||
|
276 | {key:"name"}, | |||
|
277 | {key:"perm"}, | |||
|
278 | ] | |||
|
279 | }; | |||
|
280 | ||||
|
281 | new YAHOO.widget.DataTable("tbl_list_wrap_repositories", permsColumnDefs, myDataSource2, trans_defs); | |||
|
282 | ||||
|
283 | //perms groups table | |||
|
284 | var myDataSource3 = new YAHOO.util.DataSource(YUD.get("tbl_list_repositories_groups")); | |||
|
285 | myDataSource3.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; | |||
|
286 | myDataSource3.responseSchema = { | |||
|
287 | fields: [ | |||
|
288 | {key:"name"}, | |||
|
289 | {key:"perm"}, | |||
|
290 | ] | |||
|
291 | }; | |||
|
292 | ||||
|
293 | new YAHOO.widget.DataTable("tbl_list_wrap_repositories_groups", permsColumnDefs, myDataSource3, trans_defs); | |||
|
294 | ||||
189 | </script> |
|
295 | </script> | |
190 | </%def> |
|
296 | </%def> |
@@ -48,7 +48,7 b'' | |||||
48 | <tr> |
|
48 | <tr> | |
49 | <th></th> |
|
49 | <th></th> | |
50 | <th class="left">${_('Name')}</th> |
|
50 | <th class="left">${_('Name')}</th> | |
51 |
<th class="left">${_(' |
|
51 | <th class="left">${_('Revision')}</th> | |
52 | <th class="left">${_('Action')}</th> |
|
52 | <th class="left">${_('Action')}</th> | |
53 | <th class="left">${_('Action')}</th> |
|
53 | <th class="left">${_('Action')}</th> | |
54 | </thead> |
|
54 | </thead> |
General Comments 0
You need to be logged in to leave comments.
Login now