Mercurial > kallithea
annotate pylons_app/templates/settings/repo_settings.html @ 526:804a14e086dc
added tags/branches icons in changelog and moved them to right to save some space
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 30 Sep 2010 10:31:37 +0200 |
parents | 63212fea2471 |
children |
rev | line source |
---|---|
320
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
1 ## -*- coding: utf-8 -*- |
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
2 <%inherit file="/base/base.html"/> |
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
3 |
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
4 <%def name="title()"> |
524
63212fea2471
a lot of fixes in templates,
Marcin Kuzminski <marcin@python-works.com>
parents:
399
diff
changeset
|
5 ${_('Repository settings')} |
320
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
6 </%def> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
7 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
8 <%def name="breadcrumbs_links()"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
9 ${h.link_to(c.repo_info.repo_name,h.url('summary_home',repo_name=c.repo_info.repo_name))} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
10 » |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
11 ${_('Settings')} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
12 |
320
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
13 </%def> |
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
14 <%def name="page_nav()"> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
15 ${self.menu('settings')} |
320
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
16 </%def> |
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
17 <%def name="main()"> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
18 <div class="box"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
19 <!-- box / title --> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
20 <div class="title"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
21 ${self.breadcrumbs()} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
22 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
23 ${h.form(url('repo_settings_update', repo_name=c.repo_info.repo_name),method='put')} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
24 <div class="form"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
25 <!-- fields --> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
26 <div class="fields"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
27 <div class="field"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
28 <div class="label"> |
366
0f35fa0f4eb8
fixed some html and styles, added owner into admin repo list
Marcin Kuzminski <marcin@python-works.com>
parents:
362
diff
changeset
|
29 <label for="repo_name">${_('Name')}:</label> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
30 </div> |
366
0f35fa0f4eb8
fixed some html and styles, added owner into admin repo list
Marcin Kuzminski <marcin@python-works.com>
parents:
362
diff
changeset
|
31 <div class="input input-medium"> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
32 ${h.text('repo_name')} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
33 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
34 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
35 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
36 <div class="field"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
37 <div class="label label-textarea"> |
366
0f35fa0f4eb8
fixed some html and styles, added owner into admin repo list
Marcin Kuzminski <marcin@python-works.com>
parents:
362
diff
changeset
|
38 <label for="description">${_('Description')}:</label> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
39 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
40 <div class="textarea text-area editor"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
41 ${h.textarea('description',cols=23,rows=5)} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
42 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
43 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
44 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
45 <div class="field"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
46 <div class="label label-checkbox"> |
366
0f35fa0f4eb8
fixed some html and styles, added owner into admin repo list
Marcin Kuzminski <marcin@python-works.com>
parents:
362
diff
changeset
|
47 <label for="private">${_('Private')}:</label> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
48 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
49 <div class="checkboxes"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
50 ${h.checkbox('private',value="True")} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
51 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
52 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
53 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
54 <div class="field"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
55 <div class="label"> |
366
0f35fa0f4eb8
fixed some html and styles, added owner into admin repo list
Marcin Kuzminski <marcin@python-works.com>
parents:
362
diff
changeset
|
56 <label for="">${_('Permissions')}:</label> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
57 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
58 <div class="input"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
59 <table id="permissions_manage"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
60 <tr> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
61 <td>${_('none')}</td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
62 <td>${_('read')}</td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
63 <td>${_('write')}</td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
64 <td>${_('admin')}</td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
65 <td>${_('user')}</td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
66 <td></td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
67 </tr> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
68 |
399
f5c1eec9f376
rename repo2perm into repo_to_perm
Marcin Kuzminski <marcin@python-works.com>
parents:
366
diff
changeset
|
69 %for r2p in c.repo_info.repo_to_perm: |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
70 %if r2p.user.username =='default' and c.repo_info.private: |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
71 <tr> |
366
0f35fa0f4eb8
fixed some html and styles, added owner into admin repo list
Marcin Kuzminski <marcin@python-works.com>
parents:
362
diff
changeset
|
72 <td colspan="4"> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
73 <span class="private_repo_msg"> |
366
0f35fa0f4eb8
fixed some html and styles, added owner into admin repo list
Marcin Kuzminski <marcin@python-works.com>
parents:
362
diff
changeset
|
74 ${_('private repository')} |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
75 </span> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
76 </td> |
366
0f35fa0f4eb8
fixed some html and styles, added owner into admin repo list
Marcin Kuzminski <marcin@python-works.com>
parents:
362
diff
changeset
|
77 <td class="private_repo_msg">${r2p.user.username}</td> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
78 </tr> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
79 %else: |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
80 <tr id="id${id(r2p.user.username)}"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
81 <td>${h.radio('perm_%s' % r2p.user.username,'repository.none')}</td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
82 <td>${h.radio('perm_%s' % r2p.user.username,'repository.read')}</td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
83 <td>${h.radio('perm_%s' % r2p.user.username,'repository.write')}</td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
84 <td>${h.radio('perm_%s' % r2p.user.username,'repository.admin')}</td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
85 <td>${r2p.user.username}</td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
86 <td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
87 %if r2p.user.username !='default': |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
88 <span class="delete_icon action_button" onclick="ajaxAction(${r2p.user.user_id},'${'id%s'%id(r2p.user.username)}')"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
89 <script type="text/javascript"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
90 function ajaxAction(user_id,field_id){ |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
91 var sUrl = "${h.url('delete_repo_user',repo_name=c.repo_name)}"; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
92 var callback = { success:function(o){ |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
93 var tr = YAHOO.util.Dom.get(String(field_id)); |
366
0f35fa0f4eb8
fixed some html and styles, added owner into admin repo list
Marcin Kuzminski <marcin@python-works.com>
parents:
362
diff
changeset
|
94 tr.parentNode.removeChild(tr);},failure:function(o){ |
0f35fa0f4eb8
fixed some html and styles, added owner into admin repo list
Marcin Kuzminski <marcin@python-works.com>
parents:
362
diff
changeset
|
95 alert("${_('Failed to remove user')}");},}; |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
96 var postData = '_method=delete&user_id='+user_id; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
97 var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);}; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
98 </script> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
99 </span> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
100 %endif |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
101 </td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
102 </tr> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
103 %endif |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
104 %endfor |
320
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
105 |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
106 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
107 <tr id="add_perm_input"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
108 <td>${h.radio('perm_new_user','repository.none')}</td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
109 <td>${h.radio('perm_new_user','repository.read')}</td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
110 <td>${h.radio('perm_new_user','repository.write')}</td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
111 <td>${h.radio('perm_new_user','repository.admin')}</td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
112 <td class='ac'> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
113 <div class="perm_ac" id="perm_ac"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
114 ${h.text('perm_new_user_name',class_='yui-ac-input')} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
115 <div id="perm_container"></div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
116 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
117 </td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
118 <td></td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
119 </tr> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
120 <tr> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
121 <td colspan="6"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
122 <span id="add_perm" class="add_icon" style="cursor: pointer;"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
123 ${_('Add another user')} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
124 </span> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
125 </td> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
126 </tr> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
127 </table> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
128 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
129 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
130 <div class="buttons"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
131 ${h.submit('update','update',class_="ui-button ui-widget ui-state-default ui-corner-all")} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
132 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
133 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
134 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
135 ${h.end_form()} |
320
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
136 <script type="text/javascript"> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
137 YAHOO.util.Event.onDOMReady(function(){ |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
138 var D = YAHOO.util.Dom; |
366
0f35fa0f4eb8
fixed some html and styles, added owner into admin repo list
Marcin Kuzminski <marcin@python-works.com>
parents:
362
diff
changeset
|
139 if(!D.hasClass('perm_new_user_name','error')){ |
0f35fa0f4eb8
fixed some html and styles, added owner into admin repo list
Marcin Kuzminski <marcin@python-works.com>
parents:
362
diff
changeset
|
140 D.setStyle('add_perm_input','display','none'); |
0f35fa0f4eb8
fixed some html and styles, added owner into admin repo list
Marcin Kuzminski <marcin@python-works.com>
parents:
362
diff
changeset
|
141 } |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
142 YAHOO.util.Event.addListener('add_perm','click',function(){ |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
143 D.setStyle('add_perm_input','display',''); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
144 D.setStyle('add_perm','opacity','0.6'); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
145 D.setStyle('add_perm','cursor','default'); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
146 }); |
320
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
147 }); |
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
148 </script> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
149 <script type="text/javascript"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
150 YAHOO.example.FnMultipleFields = function(){ |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
151 var myContacts = ${c.users_array|n} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
152 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
153 // Define a custom search function for the DataSource |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
154 var matchNames = function(sQuery) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
155 // Case insensitive matching |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
156 var query = sQuery.toLowerCase(), |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
157 contact, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
158 i=0, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
159 l=myContacts.length, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
160 matches = []; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
161 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
162 // Match against each name of each contact |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
163 for(; i<l; i++) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
164 contact = myContacts[i]; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
165 if((contact.fname.toLowerCase().indexOf(query) > -1) || |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
166 (contact.lname.toLowerCase().indexOf(query) > -1) || |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
167 (contact.nname && (contact.nname.toLowerCase().indexOf(query) > -1))) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
168 matches[matches.length] = contact; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
169 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
170 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
171 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
172 return matches; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
173 }; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
174 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
175 // Use a FunctionDataSource |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
176 var oDS = new YAHOO.util.FunctionDataSource(matchNames); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
177 oDS.responseSchema = { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
178 fields: ["id", "fname", "lname", "nname"] |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
179 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
180 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
181 // Instantiate AutoComplete for perms |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
182 var oAC_perms = new YAHOO.widget.AutoComplete("perm_new_user_name", "perm_container", oDS); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
183 oAC_perms.useShadow = false; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
184 oAC_perms.resultTypeList = false; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
185 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
186 // Instantiate AutoComplete for owner |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
187 var oAC_owner = new YAHOO.widget.AutoComplete("user", "owner_container", oDS); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
188 oAC_owner.useShadow = false; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
189 oAC_owner.resultTypeList = false; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
190 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
191 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
192 // Custom formatter to highlight the matching letters |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
193 var custom_formatter = function(oResultData, sQuery, sResultMatch) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
194 var query = sQuery.toLowerCase(), |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
195 fname = oResultData.fname, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
196 lname = oResultData.lname, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
197 nname = oResultData.nname || "", // Guard against null value |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
198 query = sQuery.toLowerCase(), |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
199 fnameMatchIndex = fname.toLowerCase().indexOf(query), |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
200 lnameMatchIndex = lname.toLowerCase().indexOf(query), |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
201 nnameMatchIndex = nname.toLowerCase().indexOf(query), |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
202 displayfname, displaylname, displaynname; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
203 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
204 if(fnameMatchIndex > -1) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
205 displayfname = highlightMatch(fname, query, fnameMatchIndex); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
206 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
207 else { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
208 displayfname = fname; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
209 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
210 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
211 if(lnameMatchIndex > -1) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
212 displaylname = highlightMatch(lname, query, lnameMatchIndex); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
213 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
214 else { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
215 displaylname = lname; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
216 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
217 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
218 if(nnameMatchIndex > -1) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
219 displaynname = "(" + highlightMatch(nname, query, nnameMatchIndex) + ")"; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
220 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
221 else { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
222 displaynname = nname ? "(" + nname + ")" : ""; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
223 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
224 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
225 return displayfname + " " + displaylname + " " + displaynname; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
226 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
227 }; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
228 oAC_perms.formatResult = custom_formatter; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
229 oAC_owner.formatResult = custom_formatter; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
230 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
231 // Helper function for the formatter |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
232 var highlightMatch = function(full, snippet, matchindex) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
233 return full.substring(0, matchindex) + |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
234 "<span class='match'>" + |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
235 full.substr(matchindex, snippet.length) + |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
236 "</span>" + |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
237 full.substring(matchindex + snippet.length); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
238 }; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
239 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
240 var myHandler = function(sType, aArgs) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
241 var myAC = aArgs[0]; // reference back to the AC instance |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
242 var elLI = aArgs[1]; // reference to the selected LI element |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
243 var oData = aArgs[2]; // object literal of selected item's result data |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
244 myAC.getInputEl().value = oData.nname; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
245 }; |
320
05b212954275
Implemented owner settings, as separete posibility to edit repositry by non administrative owner of repository
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
246 |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
247 oAC_perms.itemSelectEvent.subscribe(myHandler); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
248 //oAC_owner.itemSelectEvent.subscribe(myHandler); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
249 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
250 return { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
251 oDS: oDS, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
252 oAC_perms: oAC_perms, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
253 oAC_owner: oAC_owner, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
254 }; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
255 }(); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
256 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
257 </script> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
258 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
259 </%def> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
260 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
261 |