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