Merge pull request #3342 from HDinger/feature/18800-restyle-projects-table

[18800] Restyle and restructure projects table in admin overview
pull/3355/merge
Oliver Günther 9 years ago
commit 35a1c7963d
  1. 5
      app/assets/stylesheets/content/_table.sass
  2. 120
      app/views/admin/projects.html.erb
  3. 4
      features/projects/archive.feature

@ -155,6 +155,9 @@ table.generic-table
text-decoration: none
color: $body-font-color
&.buttons
text-align: right
p
padding: 0 8px
margin: 0
@ -169,7 +172,7 @@ table.generic-table
.generic-table--sort-header-outer
position: absolute
top: 0
padding: 0 8px
padding: 0 6px
line-height: $generic-table--header-height
overflow: hidden
z-index: 1

@ -81,44 +81,86 @@ See doc/COPYRIGHT.rdoc for more details.
</fieldset>
<% end %>
&nbsp;
<div class="autoscroll">
<table class="list">
<thead>
<tr>
<th><%= Project.model_name.human %></th>
<th><%= Project.human_attribute_name(:is_public) %></th>
<th><%= l(:label_required_disk_storage) %></th>
<th><%= Project.human_attribute_name(:created_on) %></th>
<th></th>
</tr>
</thead>
<tbody>
<% project_tree(@projects) do |project, level| %>
<tr class="<%= cycle("odd", "even") %> <%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<td class="name"><span><%= link_to project, settings_project_path(project), :title => project.short_description %></span></td>
<td align="center"><%= checked_image project.is_public? %></td>
<td align="center"><%= render partial: '/storage/required_storage',
locals: { storage: project.required_storage} %></td>
<td align="center"><%= format_date(project.created_on) %></td>
<td class="buttons">
<%= link_to(l(:button_archive),
archive_project_path(project, :status => params[:status]),
:confirm => l(:text_are_you_sure),
:method => :put,
:class => 'icon icon-locked') if project.active? %>
<%= link_to(l(:button_unarchive),
unarchive_project_path(project, :status => params[:status]),
:method => :put,
:class => 'icon icon-unlocked') if !project.active? && (project.parent.nil? || project.parent.active?) %>
<%= link_to(l(:button_copy),
copy_from_project_path(project, :admin),
:class => 'icon icon-copy') %>
<%= link_to(l(:button_delete),
confirm_destroy_project_path(project),
:class => 'icon icon-delete') %>
</td>
<div class="generic-table--container">
<div class="generic-table--results-container">
<table role="grid" class="generic-table">
<colgroup>
<col highlight-col>
<col highlight-col>
<col highlight-col>
<col highlight-col>
<col>
</colgroup>
<thead>
<tr>
<th>
<div class="generic-table--sort-header-outer">
<div class="generic-table--sort-header">
<span>
<%= Project.model_name.human %>
</span>
</div>
</div>
</th>
<th>
<div class="generic-table--sort-header-outer">
<div class="generic-table--sort-header">
<span>
<%= Project.human_attribute_name(:is_public) %>
</span>
</div>
</div>
</th>
<th>
<div class="generic-table--sort-header-outer">
<div class="generic-table--sort-header">
<span>
<%= l(:label_required_disk_storage) %>
</span>
</div>
</div>
</th>
<th>
<div class="generic-table--sort-header-outer">
<div class="generic-table--sort-header">
<span>
<%= Project.human_attribute_name(:created_on) %>
</span>
</div>
</div>
</th>
<th></th>
</tr>
<% end %>
</tbody>
</table>
</thead>
<tbody>
<% project_tree(@projects) do |project, level| %>
<tr class="<%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<td class="name"><span><%= link_to project, settings_project_path(project), :title => project.short_description %></span></td>
<td><%= checked_image project.is_public? %></td>
<td><%= render partial: '/storage/required_storage',
locals: { storage: project.required_storage} %></td>
<td><%= format_date(project.created_on) %></td>
<td class="buttons">
<%= link_to(l(:button_archive),
archive_project_path(project, :status => params[:status]),
:confirm => l(:text_are_you_sure),
:method => :put,
:class => 'icon icon-locked') if project.active? %>
<%= link_to(l(:button_unarchive),
unarchive_project_path(project, :status => params[:status]),
:method => :put,
:class => 'icon icon-unlocked') if !project.active? && (project.parent.nil? || project.parent.active?) %>
<%= link_to(l(:button_copy),
copy_from_project_path(project, :admin),
:class => 'icon icon-copy') %>
<%= link_to(l(:button_delete),
confirm_destroy_project_path(project),
:class => 'icon icon-delete') %>
</td>
</tr>
<% end %>
</tbody>
</table>
<div class="generic-table--header-background"></div>
</div>
</div>

@ -41,7 +41,7 @@ Feature: Navigating to reports page
When I go to the projects admin page
Then I should be on the projects admin page
And I should see "Projects"
And I click on "Archive" within "tr.odd"
And I click on "Archive" within "tbody > tr:nth-of-type(1)"
And I confirm popups
Then I should be on the projects admin page
And I should not see "ParentProject"
@ -52,7 +52,7 @@ Feature: Navigating to reports page
Then I should see "403"
When I go to the projects admin page
When I select "all" from "status"
And I click on "Unarchive" within "tr.odd"
And I click on "Unarchive" within "tbody > tr:nth-of-type(1)"
Then I should be on the projects admin page
And I should see "ParentProject"
When I go to the page of the project called "ParentProject"

Loading…
Cancel
Save