ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Make the query list in the sidebar a ul (Bug #306)


Added by Felix Schäfer at 2011-03-25 04:40 pm. Updated at 2011-12-17 11:19 am.


Status:Declined Start date:2011-03-25
Priority:Normal Due date:
Assignee:Felix Schäfer % Done:

0%

Category:User interface
Target version:-
Remote issue URL: Affected version:

Description

The query list in the sidebar of the issue views currently is a bunch of links with <br/> in between, anyone against changing that to an unordered list styled to have no bullets?


History

Updated by Felix Schäfer at 2011-03-25 04:41 pm

Oh, the current code is at source:/app/views/issues/_sidebar.rhtml#L17.

Updated by Felix Schäfer at 2011-03-25 06:54 pm

I realized this can't go into the 1.x line because it breaks how you'd need to use the view hooks in the issue sidebar. The proposed patch could be something like (I've inspected all sidebars to make sure the #sidebar ul css rule wouldn't disturb anything else…):

 1diff --git a/app/views/issues/_sidebar.rhtml b/app/views/issues/_sidebar.rhtml
 2index db85f97..946e556 100644
 3--- a/app/views/issues/_sidebar.rhtml
 4+++ b/app/views/issues/_sidebar.rhtml
 5@@ -1,23 +1,25 @@
 6 <h3><%= l(:label_issue_plural) %></h3>
 7-<%= link_to l(:label_issue_view_all), { :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1 } %><br />
 8+<ul>
 9+<li><%= link_to l(:label_issue_view_all), { :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1 } %></li>
10 <% if @project %>
11-<%= link_to l(:field_summary), :controller => 'reports', :action => 'issue_report', :id => @project %><br />
12+<li><%= link_to l(:field_summary), :controller => 'reports', :action => 'issue_report', :id => @project %></li>
13 <% end %>
14 <%= call_hook(:view_issues_sidebar_issues_bottom) %>
15-
16 <% if User.current.allowed_to?(:view_calendar, @project, :global => true) %>
17-       <%= link_to(l(:label_calendar), :controller => 'calendars', :action => 'show', :project_id => @project) %><br />
18+<li><%= link_to(l(:label_calendar), :controller => 'calendars', :action => 'show', :project_id => @project) %></li>
19 <% end %>
20 <% if User.current.allowed_to?(:view_gantt, @project, :global => true) %>
21-       <%= link_to(l(:label_gantt), :controller => 'gantts', :action => 'show', :project_id => @project) %><br />
22+<li><%= link_to(l(:label_gantt), :controller => 'gantts', :action => 'show', :project_id => @project) %></li>
23 <% end %>
24 <%= call_hook(:view_issues_sidebar_planning_bottom) %>
25+<ul>
26
27 <% unless sidebar_queries.empty? -%>
28 <h3><%= l(:label_query_plural) %></h3>
29-
30+<ul>
31 <% sidebar_queries.each do |query| -%>
32-<%= link_to(h(query.name), :controller => 'issues', :action => 'index', :project_id => @project, :query_id => query) %><br />
33+<li><%= link_to(h(query.name), :controller => 'issues', :action => 'index', :project_id => @project, :query_id => query) %></li>
34 <% end -%>
35+</ul>
36 <%= call_hook(:view_issues_sidebar_queries_bottom) %>
37 <% end -%>
38diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
39index 7e5847b..f60f9d2 100644
40--- a/public/stylesheets/application.css
41+++ b/public/stylesheets/application.css
42@@ -75,6 +75,7 @@ h4, .wiki h3 {font-size: 13px;padding: 2px 10px 1px 0px;margin-bottom: 5px; bord
43 #sidebar hr{ width: 100%; margin: 0 auto; height: 1px; background: #ccc; border: 0; }
44 * html #sidebar hr{ width: 95%; position: relative; left: -6px; color: #ccc; }
45 #sidebar .contextual { margin-right: 1em; }
46+#sidebar ul {list-style-type: none; padding: 0; margin: 0;}
47
48 #content { width: 75%; background-color: #fff; margin: 0px; border-right: 1px solid #ddd; padding: 6px 10px 10px 10px; z-index: 10; }
49 * html #content{ width: 75%; padding-left: 0; margin-top: 0px; padding: 6px 10px 10px 10px;}

This just doesn't look "nice" to me though. I propose switching those lists (and essentially every more or less dynamic sidebar list/menu) to RedmineMenus, that way the elements could be declared in the models/controllers they rely on (the calendar and gantt links for example) and it would be easier to extend them from plugins than with the ViewHooks. I also suspect (haven't tested it though) RedmineMenu to be a little more performant than the ViewHooks in this instance. Comments?

  • Target version changed from 1.3.0 to 2.0.0

Updated by Eric Davis at 2011-03-28 09:58 pm

Felix Schäfer:

The code looks good but you are correct, anything using the hooks will need to be changed.

This just doesn't look "nice" to me though. I propose switching those lists (and essentially every more or less dynamic sidebar list/menu) to RedmineMenus, that way the elements could be declared in the models/controllers they rely on (the calendar and gantt links for example) and it would be easier to extend them from plugins than with the ViewHooks.

-1 for using RedmineMenus for this. The menus come with a lot of other code that wouldn't be used.

If there was a simpler ChiliProjectList or something that was an application-wide array, that would be better. Kinda like how the SCMs are registered but we'd need a key for where the List belongs too (e.g. :view_issues_sidebar => [...], :view_wiki_sidebar => [...], :view_footer => [...])

I also suspect (haven't tested it though) RedmineMenu to be a little more performant than the ViewHooks in this instance. Comments?

I dunno, that would need testing. Menu adds some mid sized objects with every request. ViewHooks has classes. The Menu would be easier to understand though...

Updated by Eric Davis at 2011-05-29 06:18 pm

Pushing it out of 2.0.0, at least for the RC. We could add it post-RC or in a minor release.

  • Target version deleted (2.0.0)

Updated by Eric Davis at 2011-12-16 08:28 pm

Felix:

I think the saved queries should be submenu items (part of #559). If they are, then I don't think we'd need this change anymore. What do you think?

Updated by Felix Schäfer at 2011-12-17 11:19 am

Submenu sounds great :-)

  • Status changed from Open to Declined

Also available in: Atom PDF