#11853 closed enhancement (fixed)
Modular preference pages with child panels
Reported by: | Peter Suter | Owned by: | Peter Suter |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.3 |
Component: | notification | Version: | |
Severity: | normal | Keywords: | preferences |
Cc: | Branch: | ||
Release Notes: |
Preference panels now support modular child panels. |
||
API Changes: |
|
||
Internal Changes: |
Description (last modified by )
th:AnnouncerPlugin has IAnnouncementPreferenceProvider
to allow components to add "boxes" to shared pages from IPreferencePanelProvider
. Multiple plugins can provide a coherent user interface to notification preferences without impairing modularity in code.
For the Advanced Notification proposal we could instead simply extend IPreferencePanelProvider
itself slightly to allow child panels.
Proposed changes: changeset:advanced-notification-preferences.4/psuter.hg
Attachments (0)
Change History (9)
comment:1 by , 10 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:2 by , 10 years ago
comment:3 by , 10 years ago
Description: | modified (diff) |
---|
comment:4 by , 10 years ago
API Changes: | modified (diff) |
---|---|
Release Notes: | modified (diff) |
Resolution: | → fixed |
Status: | assigned → closed |
Committed in [13510].
follow-up: 7 comment:5 by , 10 years ago
Sorry for late response.
}#content.prefs ...
in prefs.css
should be split by line separator.
-}#content.prefs tr.field { height: 30px; } +} +#content.prefs tr.field { height: 30px; }
panel
parameter of IPreferencePanelProvider.get_preference_panels()
is used without changes in id attribute of h2 element in prefs.html
. I think we should prepend userprefs_
to the id like <h2 id="userprefs_$name">
.
At trunk/trac/prefs/templates/prefs.html@13510:34#L31, tab_
prefix is used for id attribute in tabs list.
comment:6 by , 10 years ago
Or I think it should be like this.
-
trac/prefs/templates/prefs.html
diff --git a/trac/prefs/templates/prefs.html b/trac/prefs/templates/prefs.html index 58fed66..e061f50 100644
a b 38 38 <div id="tabcontent" py:with="has_forms = list(select('.//form'))"> 39 39 <form id="userprefs" action="" method="post" py:strip="has_forms"> 40 40 ${select("*|text()")} 41 <div py:for="(name, title, child) in child_panels"> 42 <div class="prefs_child"> 43 <h2 id="${name}">${title}</h2> 44 ${child} 45 </div> 41 <div py:for="(name, title, child) in child_panels" 42 id="userprefs_$name" class="prefs_child"> 43 <h2>${title}</h2> 44 ${child} 46 45 </div> 47 46 <div class="buttons" py:if="not has_forms"> 48 47 <input type="hidden" name="action" value="save" />
follow-up: 8 comment:7 by , 10 years ago
Replying to jomae:
}#content.prefs ...
inprefs.css
should be split by line separator.
Oops, that must have slipped in during rebase. Fixed in [13511]. Thanks.
panel
parameter ofIPreferencePanelProvider.get_preference_panels()
is used without changes in id attribute of h2 element inprefs.html
. I think we should prependuserprefs_
to the id like<h2 id="userprefs_$name">
.
Or I think it should be like this. […]
I used <h2 id="${name}">
so e.g in this example (#11870) we can link to the anchor /prefs/notification#watch_component
and the title is highlighted. With your changes that would not work.
Instead of the userprefs_
prefix, would a -section
suffix work? (Similar to TracIni#notification-section)
(There's also <h2 id="subscriptions"> for linking and highlighting /prefs/notification#subscriptions
. Do you think it is also problematic?)
Thanks for reviewing!
comment:8 by , 10 years ago
Replying to psuter:
I used
<h2 id="${name}">
so e.g in this example (#11870) we can link to the anchor/prefs/notification#watch_component
and the title is highlighted. With your changes that would not work.
Okay. I understand use case.
Instead of the
userprefs_
prefix, would a-section
suffix work? (Similar to TracIni#notification-section)(There's also <h2 id="subscriptions"> for linking and highlighting
/prefs/notification#subscriptions
. Do you think it is also problematic?)
I think that -section
suffix would be good as well. I consider that appending prefix or suffix would prevent conflicting with id attribute in other elements. Otherwise, core and plugin developers should be careful about the conflicting. I was not sure that panel
parameter is used for id attribute.
See #11870 for an example where Watch Ticket Components is an optional child of the Notifications panel.