Mercurial > kallithea
annotate rhodecode/templates/settings/repo_settings.html @ 1015:65129c332d37 beta
#56 added ajax removal of users groups,
fixed permission edition templates by regular non admin users
found bugfixes in forms for users groups
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 09 Feb 2011 17:41:27 +0100 |
parents | 6b40654afa1e |
children | 17721a2dfadb |
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()"> |
619
a1ec653f5f95
#38 updated RhodeCode titles
Marcin Kuzminski <marcin@python-works.com>
parents:
579
diff
changeset
|
5 ${c.repo_name} ${_('Settings')} - ${c.rhodecode_name} |
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')} |
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
|
12 </%def> |
579
6d0474c7e645
more templates updates
Marcin Kuzminski <marcin@python-works.com>
parents:
562
diff
changeset
|
13 |
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
|
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"> |
562
1a77a0c350f5
extended size of some input fields
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
32 ${h.text('repo_name',class_="small")} |
362
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"> |
1015
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
888
diff
changeset
|
59 <%include file="../admin/repos/repo_edit_perms.html"/> |
65129c332d37
#56 added ajax removal of users groups,
Marcin Kuzminski <marcin@python-works.com>
parents:
888
diff
changeset
|
60 </div> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
61 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
62 <div class="buttons"> |
888
6b40654afa1e
css optimizations
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
63 ${h.submit('update','Update',class_="ui-button")} |
6b40654afa1e
css optimizations
Marcin Kuzminski <marcin@python-works.com>
parents:
698
diff
changeset
|
64 ${h.reset('reset','Reset',class_="ui-button")} |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
65 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
66 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
67 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
68 ${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
|
69 <script type="text/javascript"> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
70 YAHOO.util.Event.onDOMReady(function(){ |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
71 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
|
72 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
|
73 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
|
74 } |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
75 YAHOO.util.Event.addListener('add_perm','click',function(){ |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
76 D.setStyle('add_perm_input','display',''); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
77 D.setStyle('add_perm','opacity','0.6'); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
78 D.setStyle('add_perm','cursor','default'); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
79 }); |
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
|
80 }); |
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
|
81 </script> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
82 <script type="text/javascript"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
83 YAHOO.example.FnMultipleFields = function(){ |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
84 var myContacts = ${c.users_array|n} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
85 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
86 // Define a custom search function for the DataSource |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
87 var matchNames = function(sQuery) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
88 // Case insensitive matching |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
89 var query = sQuery.toLowerCase(), |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
90 contact, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
91 i=0, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
92 l=myContacts.length, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
93 matches = []; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
94 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
95 // Match against each name of each contact |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
96 for(; i<l; i++) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
97 contact = myContacts[i]; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
98 if((contact.fname.toLowerCase().indexOf(query) > -1) || |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
99 (contact.lname.toLowerCase().indexOf(query) > -1) || |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
100 (contact.nname && (contact.nname.toLowerCase().indexOf(query) > -1))) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
101 matches[matches.length] = contact; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
102 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
103 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
104 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
105 return matches; |
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 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
108 // Use a FunctionDataSource |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
109 var oDS = new YAHOO.util.FunctionDataSource(matchNames); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
110 oDS.responseSchema = { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
111 fields: ["id", "fname", "lname", "nname"] |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
112 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
113 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
114 // Instantiate AutoComplete for perms |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
115 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
|
116 oAC_perms.useShadow = false; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
117 oAC_perms.resultTypeList = false; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
118 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
119 // Instantiate AutoComplete for owner |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
120 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
|
121 oAC_owner.useShadow = false; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
122 oAC_owner.resultTypeList = false; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
123 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
124 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
125 // Custom formatter to highlight the matching letters |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
126 var custom_formatter = function(oResultData, sQuery, sResultMatch) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
127 var query = sQuery.toLowerCase(), |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
128 fname = oResultData.fname, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
129 lname = oResultData.lname, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
130 nname = oResultData.nname || "", // Guard against null value |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
131 query = sQuery.toLowerCase(), |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
132 fnameMatchIndex = fname.toLowerCase().indexOf(query), |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
133 lnameMatchIndex = lname.toLowerCase().indexOf(query), |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
134 nnameMatchIndex = nname.toLowerCase().indexOf(query), |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
135 displayfname, displaylname, displaynname; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
136 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
137 if(fnameMatchIndex > -1) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
138 displayfname = highlightMatch(fname, query, fnameMatchIndex); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
139 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
140 else { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
141 displayfname = fname; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
142 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
143 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
144 if(lnameMatchIndex > -1) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
145 displaylname = highlightMatch(lname, query, lnameMatchIndex); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
146 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
147 else { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
148 displaylname = lname; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
149 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
150 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
151 if(nnameMatchIndex > -1) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
152 displaynname = "(" + highlightMatch(nname, query, nnameMatchIndex) + ")"; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
153 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
154 else { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
155 displaynname = nname ? "(" + nname + ")" : ""; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
156 } |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
157 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
158 return displayfname + " " + displaylname + " " + displaynname; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
159 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
160 }; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
161 oAC_perms.formatResult = custom_formatter; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
162 oAC_owner.formatResult = custom_formatter; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
163 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
164 // Helper function for the formatter |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
165 var highlightMatch = function(full, snippet, matchindex) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
166 return full.substring(0, matchindex) + |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
167 "<span class='match'>" + |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
168 full.substr(matchindex, snippet.length) + |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
169 "</span>" + |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
170 full.substring(matchindex + snippet.length); |
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 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
173 var myHandler = function(sType, aArgs) { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
174 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
|
175 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
|
176 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
|
177 myAC.getInputEl().value = oData.nname; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
178 }; |
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
|
179 |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
180 oAC_perms.itemSelectEvent.subscribe(myHandler); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
181 //oAC_owner.itemSelectEvent.subscribe(myHandler); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
182 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
183 return { |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
184 oDS: oDS, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
185 oAC_perms: oAC_perms, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
186 oAC_owner: oAC_owner, |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
187 }; |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
188 }(); |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
189 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
190 </script> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
191 </div> |
579
6d0474c7e645
more templates updates
Marcin Kuzminski <marcin@python-works.com>
parents:
562
diff
changeset
|
192 </div> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
193 </%def> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
194 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
320
diff
changeset
|
195 |