##// END OF EJS Templates
fixed #396 fixed problems with revoking users in nested groups
marcink -
r2126:de72388c beta
parent child Browse files
Show More
@@ -1,588 +1,589 b''
1 1 .. _changelog:
2 2
3 3 =========
4 4 Changelog
5 5 =========
6 6
7 7
8 8 1.3.4 (**2012-XX-XX**)
9 9 ----------------------
10 10
11 11 :status: in-progress
12 12 :branch: beta
13 13
14 14 news
15 15 ++++
16 16
17 17 - Whoosh logging is now controlled by the .ini files logging setup
18 18 - added clone-url into edit form on /settings page
19 19 - added help text into repo add/edit forms
20 20 - created rcextensions module with additional mappings (ref #322) and
21 21 post push/pull/create repo hooks callbacks
22 22
23 23 fixes
24 24 +++++
25 25
26 26 - fixed #390 cache invalidation problems on repos inside group
27 27 - fixed #385 clone by ID url was loosing proxy prefix in URL
28 28 - fixed some unicode problems with waitress
29 29 - fixed issue with escaping < and > in changeset commits
30 30 - fixed error occurring during recursive group creation in API
31 31 create_repo function
32 32 - fixed #393 py2.5 fixes for routes url generator
33 33 - fixed #397 Private repository groups shows up before login
34 - fixed #396 fixed problems with revoking users in nested groups
34 35
35 36 1.3.3 (**2012-03-02**)
36 37 ----------------------
37 38
38 39 news
39 40 ++++
40 41
41 42
42 43 fixes
43 44 +++++
44 45
45 46 - fixed some python2.5 compatibility issues
46 47 - fixed issues with removed repos was accidentally added as groups, after
47 48 full rescan of paths
48 49 - fixes #376 Cannot edit user (using container auth)
49 50 - fixes #378 Invalid image urls on changeset screen with proxy-prefix
50 51 configuration
51 52 - fixed initial sorting of repos inside repo group
52 53 - fixes issue when user tried to resubmit same permission into user/user_groups
53 54 - bumped beaker version that fixes #375 leap error bug
54 55 - fixed raw_changeset for git. It was generated with hg patch headers
55 56 - fixed vcs issue with last_changeset for filenodes
56 57 - fixed missing commit after hook delete
57 58 - fixed #372 issues with git operation detection that caused a security issue
58 59 for git repos
59 60
60 61 1.3.2 (**2012-02-28**)
61 62 ----------------------
62 63
63 64 news
64 65 ++++
65 66
66 67
67 68 fixes
68 69 +++++
69 70
70 71 - fixed git protocol issues with repos-groups
71 72 - fixed git remote repos validator that prevented from cloning remote git repos
72 73 - fixes #370 ending slashes fixes for repo and groups
73 74 - fixes #368 improved git-protocol detection to handle other clients
74 75 - fixes #366 When Setting Repository Group To Blank Repo Group Wont Be
75 76 Moved To Root
76 77 - fixes #371 fixed issues with beaker/sqlalchemy and non-ascii cache keys
77 78 - fixed #373 missing cascade drop on user_group_to_perm table
78 79
79 80 1.3.1 (**2012-02-27**)
80 81 ----------------------
81 82
82 83 news
83 84 ++++
84 85
85 86
86 87 fixes
87 88 +++++
88 89
89 90 - redirection loop occurs when remember-me wasn't checked during login
90 91 - fixes issues with git blob history generation
91 92 - don't fetch branch for git in file history dropdown. Causes unneeded slowness
92 93
93 94 1.3.0 (**2012-02-26**)
94 95 ----------------------
95 96
96 97 news
97 98 ++++
98 99
99 100 - code review, inspired by github code-comments
100 101 - #215 rst and markdown README files support
101 102 - #252 Container-based and proxy pass-through authentication support
102 103 - #44 branch browser. Filtering of changelog by branches
103 104 - mercurial bookmarks support
104 105 - new hover top menu, optimized to add maximum size for important views
105 106 - configurable clone url template with possibility to specify protocol like
106 107 ssh:// or http:// and also manually alter other parts of clone_url.
107 108 - enabled largefiles extension by default
108 109 - optimized summary file pages and saved a lot of unused space in them
109 110 - #239 option to manually mark repository as fork
110 111 - #320 mapping of commit authors to RhodeCode users
111 112 - #304 hashes are displayed using monospace font
112 113 - diff configuration, toggle white lines and context lines
113 114 - #307 configurable diffs, whitespace toggle, increasing context lines
114 115 - sorting on branches, tags and bookmarks using YUI datatable
115 116 - improved file filter on files page
116 117 - implements #330 api method for listing nodes ar particular revision
117 118 - #73 added linking issues in commit messages to chosen issue tracker url
118 119 based on user defined regular expression
119 120 - added linking of changesets in commit messages
120 121 - new compact changelog with expandable commit messages
121 122 - firstname and lastname are optional in user creation
122 123 - #348 added post-create repository hook
123 124 - #212 global encoding settings is now configurable from .ini files
124 125 - #227 added repository groups permissions
125 126 - markdown gets codehilite extensions
126 127 - new API methods, delete_repositories, grante/revoke permissions for groups
127 128 and repos
128 129
129 130
130 131 fixes
131 132 +++++
132 133
133 134 - rewrote dbsession management for atomic operations, and better error handling
134 135 - fixed sorting of repo tables
135 136 - #326 escape of special html entities in diffs
136 137 - normalized user_name => username in api attributes
137 138 - fixes #298 ldap created users with mixed case emails created conflicts
138 139 on saving a form
139 140 - fixes issue when owner of a repo couldn't revoke permissions for users
140 141 and groups
141 142 - fixes #271 rare JSON serialization problem with statistics
142 143 - fixes #337 missing validation check for conflicting names of a group with a
143 144 repositories group
144 145 - #340 fixed session problem for mysql and celery tasks
145 146 - fixed #331 RhodeCode mangles repository names if the a repository group
146 147 contains the "full path" to the repositories
147 148 - #355 RhodeCode doesn't store encrypted LDAP passwords
148 149
149 150 1.2.5 (**2012-01-28**)
150 151 ----------------------
151 152
152 153 news
153 154 ++++
154 155
155 156 fixes
156 157 +++++
157 158
158 159 - #340 Celery complains about MySQL server gone away, added session cleanup
159 160 for celery tasks
160 161 - #341 "scanning for repositories in None" log message during Rescan was missing
161 162 a parameter
162 163 - fixed creating archives with subrepos. Some hooks were triggered during that
163 164 operation leading to crash.
164 165 - fixed missing email in account page.
165 166 - Reverted Mercurial to 2.0.1 for windows due to bug in Mercurial that makes
166 167 forking on windows impossible
167 168
168 169 1.2.4 (**2012-01-19**)
169 170 ----------------------
170 171
171 172 news
172 173 ++++
173 174
174 175 - RhodeCode is bundled with mercurial series 2.0.X by default, with
175 176 full support to largefiles extension. Enabled by default in new installations
176 177 - #329 Ability to Add/Remove Groups to/from a Repository via AP
177 178 - added requires.txt file with requirements
178 179
179 180 fixes
180 181 +++++
181 182
182 183 - fixes db session issues with celery when emailing admins
183 184 - #331 RhodeCode mangles repository names if the a repository group
184 185 contains the "full path" to the repositories
185 186 - #298 Conflicting e-mail addresses for LDAP and RhodeCode users
186 187 - DB session cleanup after hg protocol operations, fixes issues with
187 188 `mysql has gone away` errors
188 189 - #333 doc fixes for get_repo api function
189 190 - #271 rare JSON serialization problem with statistics enabled
190 191 - #337 Fixes issues with validation of repository name conflicting with
191 192 a group name. A proper message is now displayed.
192 193 - #292 made ldap_dn in user edit readonly, to get rid of confusion that field
193 194 doesn't work
194 195 - #316 fixes issues with web description in hgrc files
195 196
196 197 1.2.3 (**2011-11-02**)
197 198 ----------------------
198 199
199 200 news
200 201 ++++
201 202
202 203 - added option to manage repos group for non admin users
203 204 - added following API methods for get_users, create_user, get_users_groups,
204 205 get_users_group, create_users_group, add_user_to_users_groups, get_repos,
205 206 get_repo, create_repo, add_user_to_repo
206 207 - implements #237 added password confirmation for my account
207 208 and admin edit user.
208 209 - implements #291 email notification for global events are now sent to all
209 210 administrator users, and global config email.
210 211
211 212 fixes
212 213 +++++
213 214
214 215 - added option for passing auth method for smtp mailer
215 216 - #276 issue with adding a single user with id>10 to usergroups
216 217 - #277 fixes windows LDAP settings in which missing values breaks the ldap auth
217 218 - #288 fixes managing of repos in a group for non admin user
218 219
219 220 1.2.2 (**2011-10-17**)
220 221 ----------------------
221 222
222 223 news
223 224 ++++
224 225
225 226 - #226 repo groups are available by path instead of numerical id
226 227
227 228 fixes
228 229 +++++
229 230
230 231 - #259 Groups with the same name but with different parent group
231 232 - #260 Put repo in group, then move group to another group -> repo becomes unavailable
232 233 - #258 RhodeCode 1.2 assumes egg folder is writable (lockfiles problems)
233 234 - #265 ldap save fails sometimes on converting attributes to booleans,
234 235 added getter and setter into model that will prevent from this on db model level
235 236 - fixed problems with timestamps issues #251 and #213
236 237 - fixes #266 RhodeCode allows to create repo with the same name and in
237 238 the same parent as group
238 239 - fixes #245 Rescan of the repositories on Windows
239 240 - fixes #248 cannot edit repos inside a group on windows
240 241 - fixes #219 forking problems on windows
241 242
242 243 1.2.1 (**2011-10-08**)
243 244 ----------------------
244 245
245 246 news
246 247 ++++
247 248
248 249
249 250 fixes
250 251 +++++
251 252
252 253 - fixed problems with basic auth and push problems
253 254 - gui fixes
254 255 - fixed logger
255 256
256 257 1.2.0 (**2011-10-07**)
257 258 ----------------------
258 259
259 260 news
260 261 ++++
261 262
262 263 - implemented #47 repository groups
263 264 - implemented #89 Can setup google analytics code from settings menu
264 265 - implemented #91 added nicer looking archive urls with more download options
265 266 like tags, branches
266 267 - implemented #44 into file browsing, and added follow branch option
267 268 - implemented #84 downloads can be enabled/disabled for each repository
268 269 - anonymous repository can be cloned without having to pass default:default
269 270 into clone url
270 271 - fixed #90 whoosh indexer can index chooses repositories passed in command
271 272 line
272 273 - extended journal with day aggregates and paging
273 274 - implemented #107 source code lines highlight ranges
274 275 - implemented #93 customizable changelog on combined revision ranges -
275 276 equivalent of githubs compare view
276 277 - implemented #108 extended and more powerful LDAP configuration
277 278 - implemented #56 users groups
278 279 - major code rewrites optimized codes for speed and memory usage
279 280 - raw and diff downloads are now in git format
280 281 - setup command checks for write access to given path
281 282 - fixed many issues with international characters and unicode. It uses utf8
282 283 decode with replace to provide less errors even with non utf8 encoded strings
283 284 - #125 added API KEY access to feeds
284 285 - #109 Repository can be created from external Mercurial link (aka. remote
285 286 repository, and manually updated (via pull) from admin panel
286 287 - beta git support - push/pull server + basic view for git repos
287 288 - added followers page and forks page
288 289 - server side file creation (with binary file upload interface)
289 290 and edition with commits powered by codemirror
290 291 - #111 file browser file finder, quick lookup files on whole file tree
291 292 - added quick login sliding menu into main page
292 293 - changelog uses lazy loading of affected files details, in some scenarios
293 294 this can improve speed of changelog page dramatically especially for
294 295 larger repositories.
295 296 - implements #214 added support for downloading subrepos in download menu.
296 297 - Added basic API for direct operations on rhodecode via JSON
297 298 - Implemented advanced hook management
298 299
299 300 fixes
300 301 +++++
301 302
302 303 - fixed file browser bug, when switching into given form revision the url was
303 304 not changing
304 305 - fixed propagation to error controller on simplehg and simplegit middlewares
305 306 - fixed error when trying to make a download on empty repository
306 307 - fixed problem with '[' chars in commit messages in journal
307 308 - fixed #99 Unicode errors, on file node paths with non utf-8 characters
308 309 - journal fork fixes
309 310 - removed issue with space inside renamed repository after deletion
310 311 - fixed strange issue on formencode imports
311 312 - fixed #126 Deleting repository on Windows, rename used incompatible chars.
312 313 - #150 fixes for errors on repositories mapped in db but corrupted in
313 314 filesystem
314 315 - fixed problem with ascendant characters in realm #181
315 316 - fixed problem with sqlite file based database connection pool
316 317 - whoosh indexer and code stats share the same dynamic extensions map
317 318 - fixes #188 - relationship delete of repo_to_perm entry on user removal
318 319 - fixes issue #189 Trending source files shows "show more" when no more exist
319 320 - fixes issue #197 Relative paths for pidlocks
320 321 - fixes issue #198 password will require only 3 chars now for login form
321 322 - fixes issue #199 wrong redirection for non admin users after creating a repository
322 323 - fixes issues #202, bad db constraint made impossible to attach same group
323 324 more than one time. Affects only mysql/postgres
324 325 - fixes #218 os.kill patch for windows was missing sig param
325 326 - improved rendering of dag (they are not trimmed anymore when number of
326 327 heads exceeds 5)
327 328
328 329 1.1.8 (**2011-04-12**)
329 330 ----------------------
330 331
331 332 news
332 333 ++++
333 334
334 335 - improved windows support
335 336
336 337 fixes
337 338 +++++
338 339
339 340 - fixed #140 freeze of python dateutil library, since new version is python2.x
340 341 incompatible
341 342 - setup-app will check for write permission in given path
342 343 - cleaned up license info issue #149
343 344 - fixes for issues #137,#116 and problems with unicode and accented characters.
344 345 - fixes crashes on gravatar, when passed in email as unicode
345 346 - fixed tooltip flickering problems
346 347 - fixed came_from redirection on windows
347 348 - fixed logging modules, and sql formatters
348 349 - windows fixes for os.kill issue #133
349 350 - fixes path splitting for windows issues #148
350 351 - fixed issue #143 wrong import on migration to 1.1.X
351 352 - fixed problems with displaying binary files, thanks to Thomas Waldmann
352 353 - removed name from archive files since it's breaking ui for long repo names
353 354 - fixed issue with archive headers sent to browser, thanks to Thomas Waldmann
354 355 - fixed compatibility for 1024px displays, and larger dpi settings, thanks to
355 356 Thomas Waldmann
356 357 - fixed issue #166 summary pager was skipping 10 revisions on second page
357 358
358 359
359 360 1.1.7 (**2011-03-23**)
360 361 ----------------------
361 362
362 363 news
363 364 ++++
364 365
365 366 fixes
366 367 +++++
367 368
368 369 - fixed (again) #136 installation support for FreeBSD
369 370
370 371
371 372 1.1.6 (**2011-03-21**)
372 373 ----------------------
373 374
374 375 news
375 376 ++++
376 377
377 378 fixes
378 379 +++++
379 380
380 381 - fixed #136 installation support for FreeBSD
381 382 - RhodeCode will check for python version during installation
382 383
383 384 1.1.5 (**2011-03-17**)
384 385 ----------------------
385 386
386 387 news
387 388 ++++
388 389
389 390 - basic windows support, by exchanging pybcrypt into sha256 for windows only
390 391 highly inspired by idea of mantis406
391 392
392 393 fixes
393 394 +++++
394 395
395 396 - fixed sorting by author in main page
396 397 - fixed crashes with diffs on binary files
397 398 - fixed #131 problem with boolean values for LDAP
398 399 - fixed #122 mysql problems thanks to striker69
399 400 - fixed problem with errors on calling raw/raw_files/annotate functions
400 401 with unknown revisions
401 402 - fixed returned rawfiles attachment names with international character
402 403 - cleaned out docs, big thanks to Jason Harris
403 404
404 405 1.1.4 (**2011-02-19**)
405 406 ----------------------
406 407
407 408 news
408 409 ++++
409 410
410 411 fixes
411 412 +++++
412 413
413 414 - fixed formencode import problem on settings page, that caused server crash
414 415 when that page was accessed as first after server start
415 416 - journal fixes
416 417 - fixed option to access repository just by entering http://server/<repo_name>
417 418
418 419 1.1.3 (**2011-02-16**)
419 420 ----------------------
420 421
421 422 news
422 423 ++++
423 424
424 425 - implemented #102 allowing the '.' character in username
425 426 - added option to access repository just by entering http://server/<repo_name>
426 427 - celery task ignores result for better performance
427 428
428 429 fixes
429 430 +++++
430 431
431 432 - fixed ehlo command and non auth mail servers on smtp_lib. Thanks to
432 433 apollo13 and Johan Walles
433 434 - small fixes in journal
434 435 - fixed problems with getting setting for celery from .ini files
435 436 - registration, password reset and login boxes share the same title as main
436 437 application now
437 438 - fixed #113: to high permissions to fork repository
438 439 - fixed problem with '[' chars in commit messages in journal
439 440 - removed issue with space inside renamed repository after deletion
440 441 - db transaction fixes when filesystem repository creation failed
441 442 - fixed #106 relation issues on databases different than sqlite
442 443 - fixed static files paths links to use of url() method
443 444
444 445 1.1.2 (**2011-01-12**)
445 446 ----------------------
446 447
447 448 news
448 449 ++++
449 450
450 451
451 452 fixes
452 453 +++++
453 454
454 455 - fixes #98 protection against float division of percentage stats
455 456 - fixed graph bug
456 457 - forced webhelpers version since it was making troubles during installation
457 458
458 459 1.1.1 (**2011-01-06**)
459 460 ----------------------
460 461
461 462 news
462 463 ++++
463 464
464 465 - added force https option into ini files for easier https usage (no need to
465 466 set server headers with this options)
466 467 - small css updates
467 468
468 469 fixes
469 470 +++++
470 471
471 472 - fixed #96 redirect loop on files view on repositories without changesets
472 473 - fixed #97 unicode string passed into server header in special cases (mod_wsgi)
473 474 and server crashed with errors
474 475 - fixed large tooltips problems on main page
475 476 - fixed #92 whoosh indexer is more error proof
476 477
477 478 1.1.0 (**2010-12-18**)
478 479 ----------------------
479 480
480 481 news
481 482 ++++
482 483
483 484 - rewrite of internals for vcs >=0.1.10
484 485 - uses mercurial 1.7 with dotencode disabled for maintaining compatibility
485 486 with older clients
486 487 - anonymous access, authentication via ldap
487 488 - performance upgrade for cached repos list - each repository has its own
488 489 cache that's invalidated when needed.
489 490 - performance upgrades on repositories with large amount of commits (20K+)
490 491 - main page quick filter for filtering repositories
491 492 - user dashboards with ability to follow chosen repositories actions
492 493 - sends email to admin on new user registration
493 494 - added cache/statistics reset options into repository settings
494 495 - more detailed action logger (based on hooks) with pushed changesets lists
495 496 and options to disable those hooks from admin panel
496 497 - introduced new enhanced changelog for merges that shows more accurate results
497 498 - new improved and faster code stats (based on pygments lexers mapping tables,
498 499 showing up to 10 trending sources for each repository. Additionally stats
499 500 can be disabled in repository settings.
500 501 - gui optimizations, fixed application width to 1024px
501 502 - added cut off (for large files/changesets) limit into config files
502 503 - whoosh, celeryd, upgrade moved to paster command
503 504 - other than sqlite database backends can be used
504 505
505 506 fixes
506 507 +++++
507 508
508 509 - fixes #61 forked repo was showing only after cache expired
509 510 - fixes #76 no confirmation on user deletes
510 511 - fixes #66 Name field misspelled
511 512 - fixes #72 block user removal when he owns repositories
512 513 - fixes #69 added password confirmation fields
513 514 - fixes #87 RhodeCode crashes occasionally on updating repository owner
514 515 - fixes #82 broken annotations on files with more than 1 blank line at the end
515 516 - a lot of fixes and tweaks for file browser
516 517 - fixed detached session issues
517 518 - fixed when user had no repos he would see all repos listed in my account
518 519 - fixed ui() instance bug when global hgrc settings was loaded for server
519 520 instance and all hgrc options were merged with our db ui() object
520 521 - numerous small bugfixes
521 522
522 523 (special thanks for TkSoh for detailed feedback)
523 524
524 525
525 526 1.0.2 (**2010-11-12**)
526 527 ----------------------
527 528
528 529 news
529 530 ++++
530 531
531 532 - tested under python2.7
532 533 - bumped sqlalchemy and celery versions
533 534
534 535 fixes
535 536 +++++
536 537
537 538 - fixed #59 missing graph.js
538 539 - fixed repo_size crash when repository had broken symlinks
539 540 - fixed python2.5 crashes.
540 541
541 542
542 543 1.0.1 (**2010-11-10**)
543 544 ----------------------
544 545
545 546 news
546 547 ++++
547 548
548 549 - small css updated
549 550
550 551 fixes
551 552 +++++
552 553
553 554 - fixed #53 python2.5 incompatible enumerate calls
554 555 - fixed #52 disable mercurial extension for web
555 556 - fixed #51 deleting repositories don't delete it's dependent objects
556 557
557 558
558 559 1.0.0 (**2010-11-02**)
559 560 ----------------------
560 561
561 562 - security bugfix simplehg wasn't checking for permissions on commands
562 563 other than pull or push.
563 564 - fixed doubled messages after push or pull in admin journal
564 565 - templating and css corrections, fixed repo switcher on chrome, updated titles
565 566 - admin menu accessible from options menu on repository view
566 567 - permissions cached queries
567 568
568 569 1.0.0rc4 (**2010-10-12**)
569 570 --------------------------
570 571
571 572 - fixed python2.5 missing simplejson imports (thanks to Jens BΓ€ckman)
572 573 - removed cache_manager settings from sqlalchemy meta
573 574 - added sqlalchemy cache settings to ini files
574 575 - validated password length and added second try of failure on paster setup-app
575 576 - fixed setup database destroy prompt even when there was no db
576 577
577 578
578 579 1.0.0rc3 (**2010-10-11**)
579 580 -------------------------
580 581
581 582 - fixed i18n during installation.
582 583
583 584 1.0.0rc2 (**2010-10-11**)
584 585 -------------------------
585 586
586 587 - Disabled dirsize in file browser, it's causing nasty bug when dir renames
587 588 occure. After vcs is fixed it'll be put back again.
588 589 - templating/css rewrites, optimized css. No newline at end of file
@@ -1,270 +1,270 b''
1 1 <table id="permissions_manage" class="noborder">
2 2 <tr>
3 3 <td>${_('none')}</td>
4 4 <td>${_('read')}</td>
5 5 <td>${_('write')}</td>
6 6 <td>${_('admin')}</td>
7 7 <td>${_('member')}</td>
8 8 <td></td>
9 9 </tr>
10 10 ## USERS
11 11 %for r2p in c.repos_group.repo_group_to_perm:
12 12 <tr id="id${id(r2p.user.username)}">
13 13 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.none')}</td>
14 14 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.read')}</td>
15 15 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.write')}</td>
16 16 <td>${h.radio('u_perm_%s' % r2p.user.username,'group.admin')}</td>
17 17 <td style="white-space: nowrap;">
18 18 <img style="vertical-align:bottom" src="${h.url('/images/icons/user.png')}"/>${r2p.user.username}
19 19 </td>
20 20 <td>
21 21 %if r2p.user.username !='default':
22 22 <span class="delete_icon action_button" onclick="ajaxActionUser(${r2p.user.user_id},'${'id%s'%id(r2p.user.username)}')">
23 23 ${_('revoke')}
24 24 </span>
25 25 %endif
26 26 </td>
27 27 </tr>
28 28 %endfor
29 29
30 30 ## USERS GROUPS
31 31 %for g2p in c.repos_group.users_group_to_perm:
32 32 <tr id="id${id(g2p.users_group.users_group_name)}">
33 33 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.none')}</td>
34 34 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.read')}</td>
35 35 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.write')}</td>
36 36 <td>${h.radio('g_perm_%s' % g2p.users_group.users_group_name,'group.admin')}</td>
37 37 <td style="white-space: nowrap;">
38 38 <img style="vertical-align:bottom" src="${h.url('/images/icons/group.png')}"/>${g2p.users_group.users_group_name}
39 39 </td>
40 40 <td>
41 41 <span class="delete_icon action_button" onclick="ajaxActionUsersGroup(${g2p.users_group.users_group_id},'${'id%s'%id(g2p.users_group.users_group_name)}')">
42 42 ${_('revoke')}
43 43 </span>
44 44 </td>
45 45 </tr>
46 46 %endfor
47 47 <tr id="add_perm_input">
48 48 <td>${h.radio('perm_new_member','group.none')}</td>
49 49 <td>${h.radio('perm_new_member','group.read')}</td>
50 50 <td>${h.radio('perm_new_member','group.write')}</td>
51 51 <td>${h.radio('perm_new_member','group.admin')}</td>
52 52 <td class='ac'>
53 53 <div class="perm_ac" id="perm_ac">
54 54 ${h.text('perm_new_member_name',class_='yui-ac-input')}
55 55 ${h.hidden('perm_new_member_type')}
56 56 <div id="perm_container"></div>
57 57 </div>
58 58 </td>
59 59 <td></td>
60 60 </tr>
61 61 <tr>
62 62 <td colspan="6">
63 63 <span id="add_perm" class="add_icon" style="cursor: pointer;">
64 64 ${_('Add another member')}
65 65 </span>
66 66 </td>
67 67 </tr>
68 68 </table>
69 69 <script type="text/javascript">
70 70 function ajaxActionUser(user_id, field_id) {
71 var sUrl = "${h.url('delete_repos_group_user_perm',group_name=c.repos_group.name)}";
71 var sUrl = "${h.url('delete_repos_group_user_perm',group_name=c.repos_group.group_name)}";
72 72 var callback = {
73 73 success: function (o) {
74 74 var tr = YUD.get(String(field_id));
75 75 tr.parentNode.removeChild(tr);
76 76 },
77 77 failure: function (o) {
78 78 alert("${_('Failed to remove user')}");
79 79 },
80 80 };
81 81 var postData = '_method=delete&user_id=' + user_id;
82 82 var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);
83 83 };
84 84
85 85 function ajaxActionUsersGroup(users_group_id,field_id){
86 var sUrl = "${h.url('delete_repos_group_users_group_perm',group_name=c.repos_group.name)}";
86 var sUrl = "${h.url('delete_repos_group_users_group_perm',group_name=c.repos_group.group_name)}";
87 87 var callback = {
88 88 success:function(o){
89 89 var tr = YUD.get(String(field_id));
90 90 tr.parentNode.removeChild(tr);
91 91 },
92 92 failure:function(o){
93 93 alert("${_('Failed to remove users group')}");
94 94 },
95 95 };
96 96 var postData = '_method=delete&users_group_id='+users_group_id;
97 97 var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);
98 98 };
99 99
100 100 YUE.onDOMReady(function () {
101 101 if (!YUD.hasClass('perm_new_member_name', 'error')) {
102 102 YUD.setStyle('add_perm_input', 'display', 'none');
103 103 }
104 104 YAHOO.util.Event.addListener('add_perm', 'click', function () {
105 105 YUD.setStyle('add_perm_input', 'display', '');
106 106 YUD.setStyle('add_perm', 'opacity', '0.6');
107 107 YUD.setStyle('add_perm', 'cursor', 'default');
108 108 });
109 109 });
110 110
111 111 YAHOO.example.FnMultipleFields = function () {
112 112 var myUsers = ${c.users_array|n};
113 113 var myGroups = ${c.users_groups_array|n};
114 114
115 115 // Define a custom search function for the DataSource of users
116 116 var matchUsers = function (sQuery) {
117 117 // Case insensitive matching
118 118 var query = sQuery.toLowerCase();
119 119 var i = 0;
120 120 var l = myUsers.length;
121 121 var matches = [];
122 122
123 123 // Match against each name of each contact
124 124 for (; i < l; i++) {
125 125 contact = myUsers[i];
126 126 if ((contact.fname.toLowerCase().indexOf(query) > -1) || (contact.lname.toLowerCase().indexOf(query) > -1) || (contact.nname && (contact.nname.toLowerCase().indexOf(query) > -1))) {
127 127 matches[matches.length] = contact;
128 128 }
129 129 }
130 130 return matches;
131 131 };
132 132
133 133 // Define a custom search function for the DataSource of usersGroups
134 134 var matchGroups = function (sQuery) {
135 135 // Case insensitive matching
136 136 var query = sQuery.toLowerCase();
137 137 var i = 0;
138 138 var l = myGroups.length;
139 139 var matches = [];
140 140
141 141 // Match against each name of each contact
142 142 for (; i < l; i++) {
143 143 matched_group = myGroups[i];
144 144 if (matched_group.grname.toLowerCase().indexOf(query) > -1) {
145 145 matches[matches.length] = matched_group;
146 146 }
147 147 }
148 148 return matches;
149 149 };
150 150
151 151 //match all
152 152 var matchAll = function (sQuery) {
153 153 u = matchUsers(sQuery);
154 154 g = matchGroups(sQuery);
155 155 return u.concat(g);
156 156 };
157 157
158 158 // DataScheme for members
159 159 var memberDS = new YAHOO.util.FunctionDataSource(matchAll);
160 160 memberDS.responseSchema = {
161 161 fields: ["id", "fname", "lname", "nname", "grname", "grmembers"]
162 162 };
163 163
164 164 // DataScheme for owner
165 165 var ownerDS = new YAHOO.util.FunctionDataSource(matchUsers);
166 166 ownerDS.responseSchema = {
167 167 fields: ["id", "fname", "lname", "nname"]
168 168 };
169 169
170 170 // Instantiate AutoComplete for perms
171 171 var membersAC = new YAHOO.widget.AutoComplete("perm_new_member_name", "perm_container", memberDS);
172 172 membersAC.useShadow = false;
173 173 membersAC.resultTypeList = false;
174 174
175 175 // Instantiate AutoComplete for owner
176 176 var ownerAC = new YAHOO.widget.AutoComplete("user", "owner_container", ownerDS);
177 177 ownerAC.useShadow = false;
178 178 ownerAC.resultTypeList = false;
179 179
180 180
181 181 // Helper highlight function for the formatter
182 182 var highlightMatch = function (full, snippet, matchindex) {
183 183 return full.substring(0, matchindex) + "<span class='match'>" + full.substr(matchindex, snippet.length) + "</span>" + full.substring(matchindex + snippet.length);
184 184 };
185 185
186 186 // Custom formatter to highlight the matching letters
187 187 var custom_formatter = function (oResultData, sQuery, sResultMatch) {
188 188 var query = sQuery.toLowerCase();
189 189
190 190 if (oResultData.grname != undefined) {
191 191 var grname = oResultData.grname;
192 192 var grmembers = oResultData.grmembers;
193 193 var grnameMatchIndex = grname.toLowerCase().indexOf(query);
194 194 var grprefix = "${_('Group')}: ";
195 195 var grsuffix = " (" + grmembers + " ${_('members')})";
196 196
197 197 if (grnameMatchIndex > -1) {
198 198 return grprefix + highlightMatch(grname, query, grnameMatchIndex) + grsuffix;
199 199 }
200 200
201 201 return grprefix + oResultData.grname + grsuffix;
202 202 } else if (oResultData.fname != undefined) {
203 203
204 204 var fname = oResultData.fname,
205 205 lname = oResultData.lname,
206 206 nname = oResultData.nname || "",
207 207 // Guard against null value
208 208 fnameMatchIndex = fname.toLowerCase().indexOf(query),
209 209 lnameMatchIndex = lname.toLowerCase().indexOf(query),
210 210 nnameMatchIndex = nname.toLowerCase().indexOf(query),
211 211 displayfname, displaylname, displaynname;
212 212
213 213 if (fnameMatchIndex > -1) {
214 214 displayfname = highlightMatch(fname, query, fnameMatchIndex);
215 215 } else {
216 216 displayfname = fname;
217 217 }
218 218
219 219 if (lnameMatchIndex > -1) {
220 220 displaylname = highlightMatch(lname, query, lnameMatchIndex);
221 221 } else {
222 222 displaylname = lname;
223 223 }
224 224
225 225 if (nnameMatchIndex > -1) {
226 226 displaynname = "(" + highlightMatch(nname, query, nnameMatchIndex) + ")";
227 227 } else {
228 228 displaynname = nname ? "(" + nname + ")" : "";
229 229 }
230 230
231 231 return displayfname + " " + displaylname + " " + displaynname;
232 232 } else {
233 233 return '';
234 234 }
235 235 };
236 236 membersAC.formatResult = custom_formatter;
237 237 ownerAC.formatResult = custom_formatter;
238 238
239 239 var myHandler = function (sType, aArgs) {
240 240
241 241 var myAC = aArgs[0]; // reference back to the AC instance
242 242 var elLI = aArgs[1]; // reference to the selected LI element
243 243 var oData = aArgs[2]; // object literal of selected item's result data
244 244 //fill the autocomplete with value
245 245 if (oData.nname != undefined) {
246 246 //users
247 247 myAC.getInputEl().value = oData.nname;
248 248 YUD.get('perm_new_member_type').value = 'user';
249 249 } else {
250 250 //groups
251 251 myAC.getInputEl().value = oData.grname;
252 252 YUD.get('perm_new_member_type').value = 'users_group';
253 253 }
254 254
255 255 };
256 256
257 257 membersAC.itemSelectEvent.subscribe(myHandler);
258 258 if(ownerAC.itemSelectEvent){
259 259 ownerAC.itemSelectEvent.subscribe(myHandler);
260 260 }
261 261
262 262 return {
263 263 memberDS: memberDS,
264 264 ownerDS: ownerDS,
265 265 membersAC: membersAC,
266 266 ownerAC: ownerAC,
267 267 };
268 268 }();
269 269
270 270 </script>
General Comments 0
You need to be logged in to leave comments. Login now