Mercurial > kallithea
annotate rhodecode/templates/admin/repos/repo_edit.html @ 1112:6d0a7284949d beta
#109, added optional clone uri when creating repo.
Cleaned up repos controller moved common code into __load_data
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 05 Mar 2011 21:59:47 +0100 |
parents | 3fe3285868d1 |
children | 4de3fa6290a7 |
rev | line source |
---|---|
216
c8162373f214
Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
Marcin Kuzminski <marcin@python-works.com>
parents:
182
diff
changeset
|
1 ## -*- coding: utf-8 -*- |
c8162373f214
Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
Marcin Kuzminski <marcin@python-works.com>
parents:
182
diff
changeset
|
2 <%inherit file="/base/base.html"/> |
c8162373f214
Cleaned the way based was used to generate submenu for admin, now it's much more clear to use submenu. Cleaned admin and added comment to middleware
Marcin Kuzminski <marcin@python-works.com>
parents:
182
diff
changeset
|
3 |
48
8e250e86a670
Css fixes, implemented removal of users, and display draft
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff
changeset
|
4 <%def name="title()"> |
619
a1ec653f5f95
#38 updated RhodeCode titles
Marcin Kuzminski <marcin@python-works.com>
parents:
581
diff
changeset
|
5 ${_('Edit repository')} ${c.repo_info.repo_name} - ${c.rhodecode_name} |
48
8e250e86a670
Css fixes, implemented removal of users, and display draft
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff
changeset
|
6 </%def> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
7 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
8 <%def name="breadcrumbs_links()"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
9 ${h.link_to(_('Admin'),h.url('admin_home'))} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
10 » |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
11 ${h.link_to(_('Repositories'),h.url('repos'))} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
12 » |
1084
17721a2dfadb
fixed breadcrumbs in few pages
Marcin Kuzminski <marcin@python-works.com>
parents:
1015
diff
changeset
|
13 ${_('edit')} » ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))} |
48
8e250e86a670
Css fixes, implemented removal of users, and display draft
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff
changeset
|
14 </%def> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
15 |
48
8e250e86a670
Css fixes, implemented removal of users, and display draft
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff
changeset
|
16 <%def name="page_nav()"> |
182
11e8eb5a92e3
new way of menu generation for base, and all admin pages
Marcin Kuzminski <marcin@python-works.com>
parents:
174
diff
changeset
|
17 ${self.menu('admin')} |
48
8e250e86a670
Css fixes, implemented removal of users, and display draft
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff
changeset
|
18 </%def> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
19 |
48
8e250e86a670
Css fixes, implemented removal of users, and display draft
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff
changeset
|
20 <%def name="main()"> |
699
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
21 <div class="box box-left"> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
22 <!-- box / title --> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
23 <div class="title"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
24 ${self.breadcrumbs()} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
25 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
26 ${h.form(url('repo', repo_name=c.repo_info.repo_name),method='put')} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
27 <div class="form"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
28 <!-- fields --> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
29 <div class="fields"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
30 <div class="field"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
31 <div class="label"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
32 <label for="repo_name">${_('Name')}:</label> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
33 </div> |
703
9c1ed03ef5db
Small templates update
Marcin Kuzminski <marcin@python-works.com>
parents:
699
diff
changeset
|
34 <div class="input"> |
699
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
35 ${h.text('repo_name',class_="medium")} |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
36 </div> |
1112
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
37 </div> |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
38 <div class="field"> |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
39 <div class="label"> |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
40 <label for="clone_uri">${_('Clone uri')}:</label> |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
41 </div> |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
42 <div class="input"> |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
43 ${h.text('clone_uri',class_="small")} |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
44 </div> |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
45 </div> |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
46 <div class="field"> |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
47 <div class="label"> |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
48 <label for="repo_group">${_('Repository group')}:</label> |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
49 </div> |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
50 <div class="input"> |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
51 ${h.select('repo_group','',c.repo_groups,class_="medium")} |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
52 <span>${h.link_to(_('add new group'),h.url(''))}</span> |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
53 </div> |
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
54 </div> |
659
758f64f3fbda
extended repo creation by repo type. fixed fork creation to maintain repo type.
Marcin Kuzminski <marcin@python-works.com>
parents:
619
diff
changeset
|
55 <div class="field"> |
758f64f3fbda
extended repo creation by repo type. fixed fork creation to maintain repo type.
Marcin Kuzminski <marcin@python-works.com>
parents:
619
diff
changeset
|
56 <div class="label"> |
758f64f3fbda
extended repo creation by repo type. fixed fork creation to maintain repo type.
Marcin Kuzminski <marcin@python-works.com>
parents:
619
diff
changeset
|
57 <label for="repo_type">${_('Type')}:</label> |
758f64f3fbda
extended repo creation by repo type. fixed fork creation to maintain repo type.
Marcin Kuzminski <marcin@python-works.com>
parents:
619
diff
changeset
|
58 </div> |
758f64f3fbda
extended repo creation by repo type. fixed fork creation to maintain repo type.
Marcin Kuzminski <marcin@python-works.com>
parents:
619
diff
changeset
|
59 <div class="input"> |
699
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
60 ${h.select('repo_type','hg',c.backends,class_="medium")} |
659
758f64f3fbda
extended repo creation by repo type. fixed fork creation to maintain repo type.
Marcin Kuzminski <marcin@python-works.com>
parents:
619
diff
changeset
|
61 </div> |
1112
6d0a7284949d
#109, added optional clone uri when creating repo.
Marcin Kuzminski <marcin@python-works.com>
parents:
1085
diff
changeset
|
62 </div> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
63 <div class="field"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
64 <div class="label label-textarea"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
65 <label for="description">${_('Description')}:</label> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
66 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
67 <div class="textarea text-area editor"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
68 ${h.textarea('description',cols=23,rows=5)} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
69 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
70 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
71 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
72 <div class="field"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
73 <div class="label label-checkbox"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
74 <label for="private">${_('Private')}:</label> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
75 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
76 <div class="checkboxes"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
77 ${h.checkbox('private',value="True")} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
78 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
79 </div> |
810
bd57d1cb9dc3
fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents:
708
diff
changeset
|
80 <div class="field"> |
bd57d1cb9dc3
fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents:
708
diff
changeset
|
81 <div class="label label-checkbox"> |
bd57d1cb9dc3
fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents:
708
diff
changeset
|
82 <label for="enable_statistics">${_('Enable statistics')}:</label> |
bd57d1cb9dc3
fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents:
708
diff
changeset
|
83 </div> |
bd57d1cb9dc3
fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents:
708
diff
changeset
|
84 <div class="checkboxes"> |
bd57d1cb9dc3
fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents:
708
diff
changeset
|
85 ${h.checkbox('enable_statistics',value="True")} |
bd57d1cb9dc3
fixes #62, added option to disable statistics for each repository
Marcin Kuzminski <marcin@python-works.com>
parents:
708
diff
changeset
|
86 </div> |
962
72f008ed9b18
implemented #84 downloads can be enabled/disabled per each repository from now.
Marcin Kuzminski <marcin@python-works.com>
parents:
888
diff
changeset
|
87 </div> |
72f008ed9b18
implemented #84 downloads can be enabled/disabled per each repository from now.
Marcin Kuzminski <marcin@python-works.com>
parents:
888
diff
changeset
|
88 <div class="field"> |
72f008ed9b18
implemented #84 downloads can be enabled/disabled per each repository from now.
Marcin Kuzminski <marcin@python-works.com>
parents:
888
diff
changeset
|
89 <div class="label label-checkbox"> |
72f008ed9b18
implemented #84 downloads can be enabled/disabled per each repository from now.
Marcin Kuzminski <marcin@python-works.com>
parents:
888
diff
changeset
|
90 <label for="enable_downloads">${_('Enable downloads')}:</label> |
72f008ed9b18
implemented #84 downloads can be enabled/disabled per each repository from now.
Marcin Kuzminski <marcin@python-works.com>
parents:
888
diff
changeset
|
91 </div> |
72f008ed9b18
implemented #84 downloads can be enabled/disabled per each repository from now.
Marcin Kuzminski <marcin@python-works.com>
parents:
888
diff
changeset
|
92 <div class="checkboxes"> |
72f008ed9b18
implemented #84 downloads can be enabled/disabled per each repository from now.
Marcin Kuzminski <marcin@python-works.com>
parents:
888
diff
changeset
|
93 ${h.checkbox('enable_downloads',value="True")} |
72f008ed9b18
implemented #84 downloads can be enabled/disabled per each repository from now.
Marcin Kuzminski <marcin@python-works.com>
parents:
888
diff
changeset
|
94 </div> |
72f008ed9b18
implemented #84 downloads can be enabled/disabled per each repository from now.
Marcin Kuzminski <marcin@python-works.com>
parents:
888
diff
changeset
|
95 </div> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
96 <div class="field"> |
581
136ad719d9e2
fixed bug when autocomplete could not display names (hidden by div)
Marcin Kuzminski <marcin@python-works.com>
parents:
562
diff
changeset
|
97 <div class="label"> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
98 <label for="user">${_('Owner')}:</label> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
99 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
100 <div class="input input-small ac"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
101 <div class="perm_ac"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
102 ${h.text('user',class_='yui-ac-input')} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
103 <div id="owner_container"></div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
104 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
105 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
106 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
107 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
108 <div class="field"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
109 <div class="label"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
110 <label for="input">${_('Permissions')}:</label> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
111 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
112 <div class="input"> |
1015
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
1012
diff
changeset
|
113 <%include file="repo_edit_perms.html"/> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
1012
diff
changeset
|
114 </div> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
115 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
116 <div class="buttons"> |
888
6b40654afa1e
css optimizations
Marcin Kuzminski <marcin@python-works.com>
parents:
810
diff
changeset
|
117 ${h.submit('save','Save',class_="ui-button")} |
6b40654afa1e
css optimizations
Marcin Kuzminski <marcin@python-works.com>
parents:
810
diff
changeset
|
118 ${h.reset('reset','Reset',class_="ui-button")} |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
119 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
120 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
121 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
122 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
123 ${h.end_form()} |
296
29370bb76fa6
first permissions commit: added permission managment on repository edit. Changed db rmissions, validators.
Marcin Kuzminski <marcin@python-works.com>
parents:
265
diff
changeset
|
124 <script type="text/javascript"> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
125 YAHOO.util.Event.onDOMReady(function(){ |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
126 var D = YAHOO.util.Dom; |
1012
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
127 if(!D.hasClass('perm_new_member_name','error')){ |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
128 D.setStyle('add_perm_input','display','none'); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
129 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
130 YAHOO.util.Event.addListener('add_perm','click',function(){ |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
131 D.setStyle('add_perm_input','display',''); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
132 D.setStyle('add_perm','opacity','0.6'); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
133 D.setStyle('add_perm','cursor','default'); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
134 }); |
296
29370bb76fa6
first permissions commit: added permission managment on repository edit. Changed db rmissions, validators.
Marcin Kuzminski <marcin@python-works.com>
parents:
265
diff
changeset
|
135 }); |
29370bb76fa6
first permissions commit: added permission managment on repository edit. Changed db rmissions, validators.
Marcin Kuzminski <marcin@python-works.com>
parents:
265
diff
changeset
|
136 </script> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
137 <script type="text/javascript"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
138 YAHOO.example.FnMultipleFields = function(){ |
1012
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
139 var myUsers = ${c.users_array|n}; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
140 var myGroups = ${c.users_groups_array|n}; |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
141 |
1012
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
142 // Define a custom search function for the DataSource of users |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
143 var matchUsers = function(sQuery) { |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
144 // Case insensitive matching |
1012
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
145 var query = sQuery.toLowerCase(); |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
146 var i=0; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
147 var l=myUsers.length; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
148 var matches = []; |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
149 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
150 // Match against each name of each contact |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
151 for(; i<l; i++) { |
1012
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
152 contact = myUsers[i]; |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
153 if((contact.fname.toLowerCase().indexOf(query) > -1) || |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
154 (contact.lname.toLowerCase().indexOf(query) > -1) || |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
155 (contact.nname && (contact.nname.toLowerCase().indexOf(query) > -1))) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
156 matches[matches.length] = contact; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
157 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
158 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
159 return matches; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
160 }; |
1012
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
161 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
162 // Define a custom search function for the DataSource of usersGroups |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
163 var matchGroups = function(sQuery) { |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
164 // Case insensitive matching |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
165 var query = sQuery.toLowerCase(); |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
166 var i=0; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
167 var l=myGroups.length; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
168 var matches = []; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
169 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
170 // Match against each name of each contact |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
171 for(; i<l; i++) { |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
172 matched_group = myGroups[i]; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
173 if(matched_group.grname.toLowerCase().indexOf(query) > -1) { |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
174 matches[matches.length] = matched_group; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
175 } |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
176 } |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
177 return matches; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
178 }; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
179 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
180 //match all |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
181 var matchAll = function(sQuery){ |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
182 u = matchUsers(sQuery); |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
183 g = matchGroups(sQuery); |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
184 return u.concat(g); |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
185 }; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
186 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
187 // DataScheme for members |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
188 var memberDS = new YAHOO.util.FunctionDataSource(matchAll); |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
189 memberDS.responseSchema = { |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
190 fields: ["id", "fname", "lname", "nname", "grname", "grmembers"] |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
191 }; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
192 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
193 // DataScheme for owner |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
194 var ownerDS = new YAHOO.util.FunctionDataSource(matchUsers); |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
195 ownerDS.responseSchema = { |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
196 fields: ["id", "fname", "lname", "nname"] |
1012
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
197 }; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
198 |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
199 // Instantiate AutoComplete for perms |
1012
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
200 var membersAC = new YAHOO.widget.AutoComplete("perm_new_member_name", "perm_container", memberDS); |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
201 membersAC.useShadow = false; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
202 membersAC.resultTypeList = false; |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
203 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
204 // Instantiate AutoComplete for owner |
1012
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
205 var ownerAC = new YAHOO.widget.AutoComplete("user", "owner_container", ownerDS); |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
206 ownerAC.useShadow = false; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
207 ownerAC.resultTypeList = false; |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
208 |
1012
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
209 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
210 // Helper highlight function for the formatter |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
211 var highlightMatch = function(full, snippet, matchindex) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
212 return full.substring(0, matchindex) + |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
213 "<span class='match'>" + |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
214 full.substr(matchindex, snippet.length) + |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
215 "</span>" + |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
216 full.substring(matchindex + snippet.length); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
217 }; |
1012
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
218 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
219 // Custom formatter to highlight the matching letters |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
220 var custom_formatter = function(oResultData, sQuery, sResultMatch) { |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
221 var query = sQuery.toLowerCase(); |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
222 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
223 if (oResultData.grname != undefined){ |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
224 var grname = oResultData.grname; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
225 var grmembers = oResultData.grmembers; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
226 var grnameMatchIndex = grname.toLowerCase().indexOf(query); |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
227 var grprefix = "${_('Group')}: "; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
228 var grsuffix = " ("+grmembers+" ${_('members')})"; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
229 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
230 if (grnameMatchIndex > -1){ |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
231 return grprefix+highlightMatch(grname,query,grnameMatchIndex)+grsuffix; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
232 } |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
233 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
234 return grprefix+oResultData.grname+grsuffix; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
235 } |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
236 else if(oResultData.fname != undefined){ |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
237 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
238 var fname = oResultData.fname, |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
239 lname = oResultData.lname, |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
240 nname = oResultData.nname || "", // Guard against null value |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
241 fnameMatchIndex = fname.toLowerCase().indexOf(query), |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
242 lnameMatchIndex = lname.toLowerCase().indexOf(query), |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
243 nnameMatchIndex = nname.toLowerCase().indexOf(query), |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
244 displayfname, displaylname, displaynname; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
245 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
246 if(fnameMatchIndex > -1) { |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
247 displayfname = highlightMatch(fname, query, fnameMatchIndex); |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
248 } |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
249 else { |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
250 displayfname = fname; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
251 } |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
252 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
253 if(lnameMatchIndex > -1) { |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
254 displaylname = highlightMatch(lname, query, lnameMatchIndex); |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
255 } |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
256 else { |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
257 displaylname = lname; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
258 } |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
259 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
260 if(nnameMatchIndex > -1) { |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
261 displaynname = "(" + highlightMatch(nname, query, nnameMatchIndex) + ")"; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
262 } |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
263 else { |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
264 displaynname = nname ? "(" + nname + ")" : ""; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
265 } |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
266 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
267 return displayfname + " " + displaylname + " " + displaynname; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
268 } |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
269 else{ |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
270 return ''; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
271 } |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
272 }; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
273 membersAC.formatResult = custom_formatter; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
274 ownerAC.formatResult = custom_formatter; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
275 |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
276 var myHandler = function(sType, aArgs) { |
1012
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
277 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
278 var myAC = aArgs[0]; // reference back to the AC instance |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
279 var elLI = aArgs[1]; // reference to the selected LI element |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
280 var oData = aArgs[2]; // object literal of selected item's result data |
1012
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
281 |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
282 //fill the autocomplete with value |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
283 if(oData.nname != undefined){ |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
284 //users |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
285 myAC.getInputEl().value = oData.nname; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
286 YUD.get('perm_new_member_type').value = 'user'; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
287 } |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
288 else{ |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
289 //groups |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
290 myAC.getInputEl().value = oData.grname; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
291 YUD.get('perm_new_member_type').value = 'users_group'; |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
292 } |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
293 |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
294 }; |
298
15e96b5a2685
autocomplete for repository managment of users
Marcin Kuzminski <marcin@python-works.com>
parents:
296
diff
changeset
|
295 |
1012
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
296 membersAC.itemSelectEvent.subscribe(myHandler); |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
297 ownerAC.itemSelectEvent.subscribe(myHandler); |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
298 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
299 return { |
1012
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
300 memberDS: memberDS, |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
301 ownerDS: ownerDS, |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
302 membersAC: membersAC, |
551c7d5ae89d
#56 added users/groups autocomplete for repository editing.
Marcin Kuzminski <marcin@python-works.com>
parents:
962
diff
changeset
|
303 ownerAC: ownerAC, |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
304 }; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
305 }(); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
306 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
307 </script> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
308 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
309 </div> |
699
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
310 |
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
311 <div class="box box-right"> |
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
312 <div class="title"> |
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
313 <h5>${_('Administration')}</h5> |
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
314 </div> |
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
315 |
708
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
316 <h3>${_('Statistics')}</h3> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
317 |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
318 ${h.form(url('repo_stats', repo_name=c.repo_info.repo_name),method='delete')} |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
319 <div class="form"> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
320 <div class="fields"> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
321 ${h.submit('reset_stats_%s' % c.repo_info.repo_name,_('Reset current statistics'),class_="refresh_icon action_button",onclick="return confirm('Confirm to remove current statistics');")} |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
322 <div class="field"> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
323 <ul> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
324 <li>${_('Fetched to rev')}: ${c.stats_revision}/${c.repo_last_rev}</li> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
325 <li>${_('Percentage of stats gathered')}: ${c.stats_percentage} %</li> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
326 </ul> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
327 </div> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
328 |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
329 </div> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
330 </div> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
331 ${h.end_form()} |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
332 |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
333 <h3>${_('Cache')}</h3> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
334 ${h.form(url('repo_cache', repo_name=c.repo_info.repo_name),method='delete')} |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
335 <div class="form"> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
336 <div class="fields"> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
337 ${h.submit('reset_cache_%s' % c.repo_info.repo_name,_('Invalidate repository cache'),class_="refresh_icon action_button",onclick="return confirm('Confirm to invalidate repository cache');")} |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
338 </div> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
339 </div> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
340 ${h.end_form()} |
699
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
341 |
1085
3fe3285868d1
implemented public journal for anonymous users, admin can control which repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
1084
diff
changeset
|
342 <h3>${_('Public journal')}</h3> |
3fe3285868d1
implemented public journal for anonymous users, admin can control which repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
1084
diff
changeset
|
343 ${h.form(url('repo_public_journal', repo_name=c.repo_info.repo_name),method='put')} |
3fe3285868d1
implemented public journal for anonymous users, admin can control which repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
1084
diff
changeset
|
344 <div class="form"> |
3fe3285868d1
implemented public journal for anonymous users, admin can control which repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
1084
diff
changeset
|
345 <div class="fields"> |
3fe3285868d1
implemented public journal for anonymous users, admin can control which repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
1084
diff
changeset
|
346 ${h.hidden('auth_token',str(h.get_token()))} |
3fe3285868d1
implemented public journal for anonymous users, admin can control which repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
1084
diff
changeset
|
347 %if c.in_public_journal: |
3fe3285868d1
implemented public journal for anonymous users, admin can control which repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
1084
diff
changeset
|
348 ${h.submit('set_public_%s' % c.repo_info.repo_name,_('Remove from public journal'),class_="stop_following_icon action_button")} |
3fe3285868d1
implemented public journal for anonymous users, admin can control which repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
1084
diff
changeset
|
349 %else: |
3fe3285868d1
implemented public journal for anonymous users, admin can control which repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
1084
diff
changeset
|
350 ${h.submit('set_public_%s' % c.repo_info.repo_name,_('Add to public journal'),class_="start_following_icon action_button")} |
3fe3285868d1
implemented public journal for anonymous users, admin can control which repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
1084
diff
changeset
|
351 %endif |
3fe3285868d1
implemented public journal for anonymous users, admin can control which repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
1084
diff
changeset
|
352 </div> |
3fe3285868d1
implemented public journal for anonymous users, admin can control which repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
1084
diff
changeset
|
353 </div> |
3fe3285868d1
implemented public journal for anonymous users, admin can control which repositories
Marcin Kuzminski <marcin@python-works.com>
parents:
1084
diff
changeset
|
354 ${h.end_form()} |
699
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
355 |
708
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
356 <h3>${_('Delete')}</h3> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
357 ${h.form(url('repo', repo_name=c.repo_info.repo_name),method='delete')} |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
358 <div class="form"> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
359 <div class="fields"> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
360 ${h.submit('remove_%s' % c.repo_info.repo_name,_('Remove this repository'),class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")} |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
361 </div> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
362 </div> |
b9bbc0d6e9f3
added cache reset, stats reset, and delete into repository settings in admin.
Marcin Kuzminski <marcin@python-works.com>
parents:
703
diff
changeset
|
363 ${h.end_form()} |
699
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
364 |
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
365 </div> |
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
366 |
52da7cba88a6
Code refactor for auth func, preparing for ldap support
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
367 |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
328
diff
changeset
|
368 </%def> |