Opened 10 years ago
Closed 10 years ago
#11699 closed enhancement (fixed)
Use Chrome.authorinfo in render_ticket_action_controller
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.3 |
Component: | ticket system | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
The usernames in the default workflow hints are wrapped in |
||
API Changes: |
|
||
Internal Changes: |
Description (last modified by )
In #11689 / [13000] Chrome(self.env).format_author
was utilized so that anonymous
is translated. The changes were committed to 1.0-stable. However, on the trunk we can utilize Chrome(self.env).authorinfo
so that the author is wrapped in a span with class trac-author
(#11145).
See also #11474 in which fine-grained permission checks will be properly implemented for format_author
and authorinfo
.
Attachments (0)
Change History (8)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:2 by , 10 years ago
Description: | modified (diff) |
---|
comment:3 by , 10 years ago
comment:4 by , 10 years ago
I think it would be good to wrap with trac-author-anonymous
/trac-author-none
rather than trac-author
to determine wheter username is an existent user, anonymous
or (none)
. Thoughts?
follow-up: 7 comment:5 by , 10 years ago
The additional two classes seem like a good idea. I added some changes in log:rjollos.git:t11699. With these changes anonymous
will have the class trac-author-anonymous
. The change for (none)
might be a bit more complicated.
A special case in Chrome.authorinfo
for author
having the value (none)
seems a bit ugly. It seems like it would be better if Chrome.authorinfo
returned <span author="trac-author-none">(none)</span>
when None
or the empty string is passed for author
. With that change the default_workflow
wouldn't have to worry about handling the special case either: trunk/trac/ticket/default_workflow.py@13056:236,292#L227. The code in default_workflow
would be simpler:
-formatted_current_owner = format_author(current_owner or _("(none)")) +formatted_current_owner = format_author(current_owner)
However, currently Chrome.authorinfo
returns anonymous
when author
is None
or an empty string. I haven't look closely at what the consequence throughout Trac might be for changing the behavior of Chrome.authorinfo
. I plan to do that next though.
comment:6 by , 10 years ago
Status: | new → assigned |
---|
comment:7 by , 10 years ago
Replying to rjollos:
However, currently
Chrome.authorinfo
returnsanonymous
whenauthor
isNone
or an empty string. I haven't look closely at what the consequence throughout Trac might be for changing the behavior ofChrome.authorinfo
. I plan to do that next though.
I think this change is okay. The result is an API change, but it should only affect cases in which None
or the empty string are passed in the code to Chrome.authorinfo
. The value of req.authname
should never be None
or the empty string. From what I can see, req.authname
will always be a username or anonymous
: trunk/trac/web/main.py@13117:147-149#L134.
Latest changes in log:rjollos.git:t11699.1.
comment:8 by , 10 years ago
API Changes: | modified (diff) |
---|---|
Release Notes: | modified (diff) |
Resolution: | → fixed |
Status: | assigned → closed |
Committed to trunk in [13202:13203].
An open question is whether
(none)
andanonymous
should be wrapped in a span with classtrac-author
. Changes in log:rjollos.git:t11699.