Project

General

Profile

Actions

Feature #7982

open

Folding project list (expand/collapse)

Added by Christian Ziegelt over 13 years ago. Updated over 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Projects
Target version:
-
Start date:
2011-03-24
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

Dear Redmine Team,

I would realy like to possibility to fold (collapse) a projectlist by maybe a +/- button or icon in front of each project.
It would also be fine to have the space between nested levels configurable.

This way one could increase the readability for long project lists very much.

The non-plus-ultra would be, if the setting (state) of collapsed / expanded could be stored on a per user basis (maybe cookies ?)

Thanks very much in advance.


Files

Screenshot.jpg (222 KB) Screenshot.jpg Christian Ziegelt, 2014-10-16 16:32
Screenshot2.jpg (187 KB) Screenshot2.jpg Christian Ziegelt, 2014-10-16 16:32

Related issues

Related to Redmine - Feature #6522: Projects page optional as collapsable treeNew2010-09-28

Actions
Related to Redmine - Feature #2117: Alternative view for "Projects" pageClosed2008-10-31

Actions
Is duplicate of Redmine - Feature #4913: Projects list expanding and contractingClosed2010-02-23

Actions
Has duplicate Redmine - Feature #16939: Hide/Show subprojects in "Projects" sectionClosed

Actions
Actions #1

Updated by Ivan Cenov over 13 years ago

This is like #6522 and #2117

Also, there were some plugin that implemented this function, but I can't remember it.

Actions #2

Updated by Ivan Cenov over 13 years ago

Ivan Cenov wrote:

Also, there were some plugin that implemented this function, but I can't remember it.

P.S. Here it is : http://www.redmine.org/boards/3/topics/4645

Actions #3

Updated by alan blount over 13 years ago

+1 This is something we're needing as well -- it relates to being able to filter/order the list via structure

Actions #4

Updated by Dieter Egert over 12 years ago

The link to above mentioned plugin 'Projects Tree View' is this:
http://www.redmine.org/plugins/projectstreeview or
https://github.com/wojtha/projects_tree_view (older branch)

Actions #5

Updated by Klaus Adler over 12 years ago

+1 This would be a great if it is native in redmine

Actions #7

Updated by Anonymous over 12 years ago

Terence Mill wrote:

Chechout https://github.com/cforce/projects_tree_view/

it is does not work, when there are sublevels it starts behaving erratically folding levels you have not requested to be folded.
under Redmie 2.0.3

Actions #8

Updated by Dmitry Babenko almost 12 years ago

Duplicates #4913.

Actions #9

Updated by Daniel Felix almost 12 years ago

  • Status changed from New to Closed

With any reason, this one has gets an update too instead of just it's duplicat. Please ignore.

Actions #10

Updated by Daniel Felix almost 12 years ago

  • Status changed from Closed to Reopened
Actions #11

Updated by Dima Volotskoy almost 12 years ago

+1

Actions #12

Updated by Frederic P almost 11 years ago

+1 as we have a lot of nested projets.

Actions #13

Updated by Toshi MARUYAMA over 10 years ago

  • Status changed from Reopened to New
Actions #14

Updated by Toshi MARUYAMA over 10 years ago

  • Has duplicate Feature #16939: Hide/Show subprojects in "Projects" section added
Actions #15

Updated by mike B about 10 years ago

+1 This would be a very good feature to have for organizations that have many projects with sub of sub of sub.

Actions #16

Updated by Christian Ziegelt about 10 years ago

A possible Solution:

I finaly gave up the idea with folding correctly. I guess its possible as well - but I am using another way now:

I installed the plugin "Favourite projects" [[http://www.redmine.org/plugins/redmine_favourite_projects]]
This way I select just the projects I am currently working on, or need to see constantly.

Then I changed the plugins views a little bit:
./plugins/redmine_favorite_projects/app/views/projects/

index.html.erb:
Just added a few lines as java script in the beginning of the file - as a click handler for hiding not favorite projects

<script>
$(function()
{
    $('ul.side-nav a').click(function()
    {
       $('tr.project').hide();
       $('tr.' + $(this).attr('class')).show();       
    });

    $('ul.side-nav2 a').click(function()
    {
       $('th.description').hide();
       $('td.description').hide();
    });

});
</script>

.
.
.
<!-- inside the "Filter" dropdown are a few more links now ... -->
<div class="filters">   

    <fieldset id="filters" class="collapsible <%= 'collapsed' if no_filters %>">
      <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
      <div style="<%= 'display: none;' if no_filters %>">  
        <p>  
          <span class="filter-condition">        
            <label for="closed"><%= check_box_tag 'closed', 1, params[:closed] %> <%= l(:label_show_closed_projects) %></label>
            <ul class="side-nav">
                <li><a class="project" href="#">Show all</a></li>
                <li><a class="FAV_ON" href="#">Show only favorite</a></li>
            </ul>            
            <ul class="side-nav2">
                <li><a class="hide_description" href="#">Show only project</a></li>
            </ul>            
          </span>

        </p>    

      </div>
    </fieldset> 

    <p class="buttons hide-when-print">
        <%= link_to l(:button_apply), "#", :onclick=>"$('#query_form').submit()", :class => 'icon icon-checked' %>
        <%= link_to l(:button_clear), { :set_filter => 1, :project_id => @project }, :class => 'icon icon-reload'  %>
    </p>   
</div>

_list.html.erb:
Changed a few lines, to have classes for the html tags to hide them

<table class="list">
  <thead>
    <tr>
        <th style="width:25px"></th>  
        <th><%=l(:label_project)%></th>

            <!--added class=... -->
                <th class="description"><%=l(:field_description)%></th>
        <!-- <th><%=l(:field_go_to)%></th> -->
        <!-- <th><%=l(:field_created_on)%></th> -->
    </tr>
  </thead>

Added a value "favorite=..." and a function "favorite_status()"

<% project_tree(@projects) do |project, level| %>
<tr class="<%= cycle("odd", "even") %> <%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %> <%= favorite_mark(project, User.current) %>" favorite="<%= favorite_status(project, User.current)%>">
        <td><%= favorite_tag(project, User.current) %></td>  

I also changed the helper file - I added the neccessary functions to mark what is favorite
./plugins/redmine_favorite_projects/app/views/projects/favorite_projects_helper.rb :

  def favorite_mark(object, user, options={})
    return '' unless user && user.logged? && user.member_of?(object)
    favorite = FavoriteProject.favorite?(object.id, user.id)
    favorite ? 'FAV_ON' : 'FAV_OFF'
  end

  def favorite_status(object, user, options={})
    return '' unless user && user.logged? && user.member_of?(object)
    favorite = FavoriteProject.favorite?(object.id, user.id)
    favorite ? 'ON' : 'OFF'
  end

I guess - this could be done much nicer - but it fits my needs.

In combination with Firefox and the "All-In-One sidebar" addon, I use the Multipanel feature from this addon to see my projectlist all the time.
Just navigate to your project list - open the sidebar with multipanel view and click on the double arrow icon left from the sidebars close symbol.

Now your projectlist is on the left side. If you click on your project the overview page will be opened on the right (main) panel.
I also changed my standard destination for projects to "issues" instead of the overview page.

Please see at the screenshots attached to get an idea.
If any questions remain, pease feel free to contact me.

Best
Christian

Actions #18

Updated by Nicolas Delanou over 9 years ago

Is there any solution for the 3.0.+ yet ?

Actions #19

Updated by Sebastien Thibaud almost 8 years ago

Dears All,

Here the solution I apply to meet my need.
No need to modify any ruby file nor to deploy plugin.
It is rendered directly by browser.

edit application.css of your theme (/redmine/public/themes/mytheme/stylesheets/application.css) then add :

span.expcolroot, span.expcolchild{
  font-size: 8px;
  line-height:8px;
  font-weight : bold;
  cursor: pointer;
  padding:1px;
  width: 8px;
  height: 8px;
  border:1px solid #999;
  display: inline-block;
  margin-right: 3px;
  text-align: center;
  background-color:#ddd;
  color: #999;
  border-radius:2px;
}

span.expcolroot:hover, span.expcolchild:hover{
  background-color:#999;
  color:#fff;
}

edit main application.js (eg:/redmine/public/javascripts/application.js), then add :

function addProjectsListCollapse(){
  $( "div#projects-index div.root" ).prepend( "<span class='expcolroot'>-</span>" );
  $( "div#projects-index div.child" ).prepend( "<span class='expcolchild'>-</span>" );
  $( "span.expcolroot, span.expcolchild").click(function(){
    $header = $(this);
    $content1 = $header.parent().next("ul");
    $content2 = $header.parent().children(".description");
    if ($content1.length) {
      $content1.slideToggle(150, function () {
        if ($content1.is(":hidden")){
          $header.html("+");
        } else {
          $header.html("-");
        }
      });
    }
    if ($content2.length) {
      $content2.slideToggle(150, function () {
        if ($content2.is(":hidden")){
          $header.html("+");
        } else {
          $header.html("-");
        }
      });
    }
  });
}

$(document).ready(addProjectsListCollapse);

These short modifications will add a plus/minus sign on left of project title ([+]/[-])
It can show/hide project's discription and sub-projects list if present

Actions #20

Updated by Anton Sergeev almost 8 years ago

Here is Sub project collapse plugin based on Sebastien Thibaud comment.

Actions #21

Updated by Tom Lithgow over 7 years ago

Hello All,

We could very much do with the collapse Projects feature also as we have many projects that also include sub projects.

Anton Sergeev, you solution looks neat but we have tried this and while the plugin shows up the Projects page has not changed to reflect the collapse arrows. Do we need the Favourite Projects Plugin as mentioned in Sebastien's solution?

Thank you for the help.

Actions

Also available in: Atom PDF