#2460 closed enhancement (fixed)
New post shortname based on date
Reported by: | anonymous | Owned by: | osimons |
---|---|---|---|
Priority: | normal | Component: | FullBlogPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
It's not useful that new post's default shortname
fixed with "change_this_post_shortname". I guess default shortname based on date.
-
tracfullblog/core.py
10 10 (c) 2007 ::: www.CodeResort.com - BV Network AS (simon-code@bvnetwork.no) 11 11 """ 12 12 13 from time import gmtime, strftime 13 14 from genshi.builder import tag 14 15 15 16 from trac.attachment import ILegacyAttachmentPolicyDelegate … … 39 40 """Option to specify how many recent posts to display on the 40 41 front page of the Blog.""") 41 42 42 default_pagename = 'change_this_post_shortname'43 default_pagename = strftime("post_%Y%m%d%H%M%S", gmtime()) 43 44 reserved_names = ['create', 'view', 'edit', 'delete', 44 45 'archive', 'category', 'author'] 45 46 … … 182 183 # Do some more fundamental checking 183 184 if bp.name in self.reserved_names: 184 185 warnings.append((req, "'%s' is a reserved name. Please change." % bp.name)) 185 if bp.name == self.default_pagename:186 warnings.append(('post_name', "The default page shortname must be changed."))187 186 # Check if any plugins has objections with the contents 188 187 fields = { 189 188 'title': bp.title,
Attachments (0)
Change History (7)
comment:1 Changed 17 years ago by
comment:2 Changed 16 years ago by
I think it could possibly be useful to have the user name in there somewhere too - this would be useful if multiple users are going to be posting heavily to the same Trac blog.
comment:3 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Well, in [3906] I've done what you requested - and then some more :-)
I'm going to close this ticket with that change, and please open a new ticket if you discover issues with the new features.
Enjoy!
comment:4 Changed 16 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Is there a way to add the time at the end of shortname field automatically ie " $USER-%Y/%m/%d/TIME ". I wanted to act as a random number sort of.
comment:5 Changed 16 years ago by
Resolution: | → worksforme |
---|---|
Status: | reopened → closed |
Nevermind, for anyone who is curions, it is %T that's a capital!!!
comment:6 Changed 16 years ago by
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
Good thinking. Need to reopen to close the the ticket again as 'fixed'.
comment:7 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
...and back to original resolution.
I must agree with this enhancement.