contextual links redesign

git-svn-id: http://redmine.rubyforge.org/svn/trunk@93 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2006-12-16 12:15:31 +00:00
parent e5562afcd3
commit 236c735d08
21 changed files with 104 additions and 121 deletions

View File

@ -1,3 +1,7 @@
<div class="contextual">
<%= link_to l(:label_project_new), {:controller => 'projects', :action => 'add'}, :class => 'pic picAdd' %>
</div>
<h2><%=l(:label_project_plural)%></h2> <h2><%=l(:label_project_plural)%></h2>
<table class="listTableContent"> <table class="listTableContent">
@ -26,5 +30,3 @@
<p><%= pagination_links_full @project_pages %> <p><%= pagination_links_full @project_pages %>
[ <%= @project_pages.current.first_item %> - <%= @project_pages.current.last_item %> / <%= @project_count %> ]</p> [ <%= @project_pages.current.first_item %> - <%= @project_pages.current.last_item %> / <%= @project_count %> ]</p>
<p><%= link_to ('&#187; ' + l(:label_project_new)), :controller => 'projects', :action => 'add' %></p>

View File

@ -1,3 +1,7 @@
<div class="contextual">
<%= link_to l(:label_auth_source_new), {:action => 'new'}, :class => 'pic picAdd' %>
</div>
<h2><%=l(:label_auth_source_plural)%></h2> <h2><%=l(:label_auth_source_plural)%></h2>
<table class="listTableContent"> <table class="listTableContent">
@ -25,6 +29,3 @@
</table> </table>
<%= pagination_links_full @auth_source_pages %> <%= pagination_links_full @auth_source_pages %>
<br />
<%= link_to '&#187; ' + l(:label_auth_source_new), :action => 'new' %>

View File

@ -1,34 +1,22 @@
<div class="contextual">
<%= link_to_if_authorized l(:button_edit), {:controller => 'documents', :action => 'edit', :id => @document}, :class => 'pic picEdit' %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'documents', :action => 'destroy', :id => @document}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
</div>
<h2><%= @document.title %></h2> <h2><%= @document.title %></h2>
<p><em><%= @document.category.name %><br /> <p><em><%= @document.category.name %><br />
<%= format_date @document.created_on %></em></p> <%= format_date @document.created_on %></em></p>
<%= textilizable @document.description %> <%= textilizable @document.description %>
<table width="100%">
<tr><td><%= link_to_if_authorized l(:button_edit), :controller => 'documents', :action => 'edit', :id => @document %></td>
<td align="right">
<% if authorize_for('documents', 'destroy') %>
<%= start_form_tag({ :controller => 'documents', :action => 'destroy', :id => @document } ) %>
<%= submit_tag l(:button_delete) %>
<%= end_form_tag %>
<% end %>
</td></tr>
</table>
<br /> <br />
<h3><%= l(:label_attachment_plural) %></h3> <h3><%= l(:label_attachment_plural) %></h3>
<ul> <ul>
<% for attachment in @attachments %> <% for attachment in @attachments %>
<li> <li>
<% if authorize_for('documents', 'destroy_attachment') %> <div class="contextual">
<div style="float:right;padding:6px;"> <%= link_to_if_authorized l(:button_delete), {:controller => 'documents', :action => 'destroy_attachment', :id => @document, :attachment_id => attachment}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
<%= start_form_tag({ :controller => 'documents', :action => 'destroy_attachment', :id => @document, :attachment_id => attachment } ) %> </div>
<%= submit_tag l(:button_delete), :class => 'button-small' %>
<%= end_form_tag %>
</div>
<% end %>
<%= link_to attachment.filename, :action => 'download', :id => @document, :attachment_id => attachment %> <%= link_to attachment.filename, :action => 'download', :id => @document, :attachment_id => attachment %>
(<%= human_size attachment.filesize %>)<br /> (<%= human_size attachment.filesize %>)<br />
<em><%= attachment.author.display_name %>, <%= format_date(attachment.created_on) %></em><br /> <em><%= attachment.author.display_name %>, <%= format_date(attachment.created_on) %></em><br />

View File

@ -1,3 +1,7 @@
<div class="contextual">
<%= link_to l(:label_issue_status_new), {:action => 'new'}, :class => 'pic picAdd' %>
</div>
<h2><%=l(:label_issue_status_plural)%></h2> <h2><%=l(:label_issue_status_plural)%></h2>
<table class="listTableContent"> <table class="listTableContent">
@ -23,6 +27,3 @@
</table> </table>
<%= pagination_links_full @issue_status_pages %> <%= pagination_links_full @issue_status_pages %>
<br />
<%= link_to '&#187; ' + l(:label_issue_status_new), :action => 'new' %>

View File

@ -1,11 +1,9 @@
<h2><%= @issue.tracker.name %> #<%= @issue.id %> - <%= @issue.subject %></h2> <div class="contextual">
<div class="topright"> <%= l(:label_export_to) %><%= link_to 'PDF', {:action => 'export_pdf', :id => @issue}, :class => 'pic picPdf' %>
<small>
<%= l(:label_export_to) %>&nbsp;
<%= link_to 'PDF', :action => 'export_pdf', :id => @issue %>
</small>
</div> </div>
<h2><%= @issue.tracker.name %> #<%= @issue.id %> - <%= @issue.subject %></h2>
<div class="box"> <div class="box">
<table width="100%"> <table width="100%">
<tr> <tr>
@ -46,13 +44,12 @@ end %>
<b><%=l(:field_description)%> :</b><br /><br /> <b><%=l(:field_description)%> :</b><br /><br />
<%= textilizable @issue.description %> <%= textilizable @issue.description %>
<br /> <br />
<div style="float:left;">
<% if authorize_for('issues', 'edit') %> <div class="contextual">
<%= start_form_tag ({:controller => 'issues', :action => 'edit', :id => @issue}, :method => "get" ) %> <%= link_to_if_authorized l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue}, :class => 'pic picEdit' %>
<%= submit_tag l(:button_edit) %> <%= link_to_if_authorized l(:button_move), {:controller => 'projects', :action => 'move_issues', :id => @project, "issue_ids[]" => @issue.id }, :class => 'pic picMove' %>
<%= end_form_tag %> <%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
&nbsp;&nbsp; </div>
<% end %>
<% if authorize_for('issues', 'change_status') and @status_options and !@status_options.empty? %> <% if authorize_for('issues', 'change_status') and @status_options and !@status_options.empty? %>
<%= start_form_tag ({:controller => 'issues', :action => 'change_status', :id => @issue}) %> <%= start_form_tag ({:controller => 'issues', :action => 'change_status', :id => @issue}) %>
@ -62,26 +59,8 @@ end %>
</select> </select>
<%= submit_tag l(:button_change) %> <%= submit_tag l(:button_change) %>
<%= end_form_tag %> <%= end_form_tag %>
&nbsp;&nbsp;
<% end %> <% end %>
<% if authorize_for('projects', 'move_issues') %>
<%= start_form_tag ({:controller => 'projects', :action => 'move_issues', :id => @project} ) %>
<%= hidden_field_tag "issue_ids[]", @issue.id %>
<%= submit_tag l(:button_move) %>
<%= end_form_tag %>
&nbsp;&nbsp;
<% end %>
</div>
<div style="float:right;">
<% if authorize_for('issues', 'destroy') %>
<%= start_form_tag ({:controller => 'issues', :action => 'destroy', :id => @issue} ) %>
<%= submit_tag l(:button_delete) %>
<%= end_form_tag %>
&nbsp;&nbsp;
<% end %>
</div>
<div class="clear"></div>
</div> </div>
<div id="history" class="box"> <div id="history" class="box">

View File

@ -1,29 +1,25 @@
<div class="contextual">
<%= link_to_if_authorized l(:button_edit), {:controller => 'news', :action => 'edit', :id => @news}, :class => 'pic picEdit' %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy', :id => @news}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
</div>
<h2><%= @news.title %></h2> <h2><%= @news.title %></h2>
<p><em><%= @news.summary %><br /> <p><em><%= @news.summary %><br />
<%= @news.author.display_name %>, <%= format_time(@news.created_on) %></em></p> <%= @news.author.display_name %>, <%= format_time(@news.created_on) %></em></p>
<br /> <br />
<%= textilizable auto_link @news.description %> <%= textilizable auto_link @news.description %>
<br />
<div style="float:right;">
<% if authorize_for('news', 'destroy') %>
<%= start_form_tag ({:controller => 'news', :action => 'destroy', :id => @news}) %>
<%= submit_tag l(:button_delete) %>
<%= end_form_tag %>
<% end %>
</div>
<p><%= link_to_if_authorized l(:button_edit), :controller => 'news', :action => 'edit', :id => @news %></p>
<div id="comments" style="margin-bottom:16px;"> <div id="comments" style="margin-bottom:16px;">
<h3><%= l(:label_comment_plural) %></h3> <h3><%= l(:label_comment_plural) %></h3>
<% @news.comments.each do |comment| %> <% @news.comments.each do |comment| %>
<% next if comment.new_record? %> <% next if comment.new_record? %>
<h4><%= format_time(comment.created_on) %> - <%= comment.author.name %></h4> <h4><%= format_time(comment.created_on) %> - <%= comment.author.name %></h4>
<div style="float:right;"> <div class="contextual">
<small><%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy_comment', :id => @news, :comment_id => comment}, :confirm => l(:text_are_you_sure), :post => true %></small> <%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy_comment', :id => @news, :comment_id => comment}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
</div> </div>
<%= simple_format(auto_link(h comment.comment))%> <%= simple_format(auto_link(h comment.comment))%>
<% end if @news.comments_count > 0 %> <% end if @news.comments_count > 0 %>
</div> </div>

View File

@ -1,10 +1,10 @@
<h2><%= l(:label_gantt) %></h2> <div class="contextual">
<div class="topright"> <%= l(:label_export_to) %>
<small> <%= link_to 'PDF', {:zoom => @zoom, :year => @year_from, :month => @month_from, :months => @months, :output => 'pdf'}, :class => 'pic picPdf' %>
<%= l(:label_export_to) %>&nbsp;&nbsp;<%= link_to 'PDF', :zoom => @zoom, :year => @year_from, :month => @month_from, :months => @months, :output => 'pdf' %>
</small>
</div> </div>
<h2><%= l(:label_gantt) %></h2>
<table width="100%"> <table width="100%">
<tr> <tr>
<td align="left"> <td align="left">

View File

@ -1,3 +1,7 @@
<div class="contextual">
<%= link_to_if_authorized l(:label_document_new), {:controller => 'projects', :action => 'add_document', :id => @project}, :class => 'pic picAdd' %>
</div>
<h2><%=l(:label_document_plural)%></h2> <h2><%=l(:label_document_plural)%></h2>
<% if @documents.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %> <% if @documents.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
@ -17,7 +21,3 @@
<% end %> <% end %>
</ul> </ul>
<% end %> <% end %>
<p>
<%= link_to_if_authorized '&#187; ' + l(:label_document_new), :controller => 'projects', :action => 'add_document', :id => @project %>
</p>

View File

@ -1,3 +1,7 @@
<div class="contextual">
<%= link_to_if_authorized l(:label_attachment_new), {:controller => 'projects', :action => 'add_file', :id => @project}, :class => 'pic picAdd' %>
</div>
<h2><%=l(:label_attachment_plural)%></h2> <h2><%=l(:label_attachment_plural)%></h2>
<% delete_allowed = authorize_for('versions', 'destroy_file') %> <% delete_allowed = authorize_for('versions', 'destroy_file') %>
@ -26,9 +30,9 @@
<td align="center"><small><%= file.digest %></small></td> <td align="center"><small><%= file.digest %></small></td>
<% if delete_allowed %> <% if delete_allowed %>
<td align="center"> <td align="center">
<%= start_form_tag :controller => 'versions', :action => 'destroy_file', :id => version, :attachment_id => file %> <div class="contextual">
<%= submit_tag l(:button_delete), :class => "button-small" %> <%= link_to_if_authorized l(:button_delete), {:controller => 'versions', :action => 'destroy_file', :id => version, :attachment_id => file}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
<%= end_form_tag %> </div>
</td> </td>
<% end %> <% end %>
</tr> </tr>
@ -37,10 +41,3 @@
<% end %> <% end %>
<% end %> <% end %>
</table> </table>
<br />
<p>
<%= link_to_if_authorized '&#187; ' + l(:label_attachment_new), :controller => 'projects', :action => 'add_file', :id => @project %>
</p>

View File

@ -1,12 +1,11 @@
<h2><%=l(:label_issue_plural)%></h2> <div class="contextual">
<div class="topright"> <%= l(:label_export_to) %>
<small> <%= link_to 'CSV', {:action => 'export_issues_csv', :id => @project}, :class => 'pic picCsv' %>,
<%= l(:label_export_to) %>&nbsp; <%= link_to 'PDF', {:action => 'export_issues_pdf', :id => @project}, :class => 'pic picPdf' %>
<%= link_to 'CSV', :action => 'export_issues_csv', :id => @project %>,
<%= link_to 'PDF', :action => 'export_issues_pdf', :id => @project %>
</small>
</div> </div>
<h2><%=l(:label_issue_plural)%></h2>
<%= start_form_tag :action => 'list_issues' %> <%= start_form_tag :action => 'list_issues' %>
<table cellpadding=2> <table cellpadding=2>
<tr> <tr>

View File

@ -1,3 +1,7 @@
<div class="contextual">
<%= link_to_if_authorized l(:label_news_new), {:controller => 'projects', :action => 'add_news', :id => @project}, :class => 'pic picAdd' %>
</div>
<h2><%=l(:label_news_plural)%></h2> <h2><%=l(:label_news_plural)%></h2>
<% if @news.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %> <% if @news.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
@ -14,6 +18,3 @@
<%= pagination_links_full @news_pages %> <%= pagination_links_full @news_pages %>
<p>
<%= link_to_if_authorized '&#187; ' + l(:label_news_new), :controller => 'projects', :action => 'add_news', :id => @project %>
</p>

View File

@ -1,3 +1,7 @@
<div class="contextual">
<%= link_to l(:label_role_new), {:action => 'new'}, :class => 'pic picAdd' %>
</div>
<h2><%=l(:label_role_plural)%></h2> <h2><%=l(:label_role_plural)%></h2>
<table class="listTableContent"> <table class="listTableContent">
@ -16,6 +20,3 @@
</table> </table>
<%= pagination_links_full @role_pages %> <%= pagination_links_full @role_pages %>
<br />
<%= link_to '&#187; ' + l(:label_role_new), :action => 'new' %>

View File

@ -1,3 +1,7 @@
<div class="contextual">
<%= link_to l(:label_tracker_new), {:action => 'new'}, :class => 'pic picAdd' %>
</div>
<h2><%=l(:label_tracker_plural)%></h2> <h2><%=l(:label_tracker_plural)%></h2>
<table class="listTableContent"> <table class="listTableContent">
@ -17,6 +21,3 @@
</table> </table>
<%= pagination_links_full @tracker_pages %> <%= pagination_links_full @tracker_pages %>
<br />
<%= link_to '&#187; ' + l(:label_tracker_new), :action => 'new' %>

View File

@ -1,3 +1,7 @@
<div class="contextual">
<%= link_to l(:label_user_new), {:action => 'add'}, :class => 'pic picAdd' %>
</div>
<h2><%=l(:label_user_plural)%></h2> <h2><%=l(:label_user_plural)%></h2>
<table class="listTableContent"> <table class="listTableContent">
@ -40,7 +44,3 @@
<p><%= pagination_links_full @user_pages %> <p><%= pagination_links_full @user_pages %>
[ <%= @user_pages.current.first_item %> - <%= @user_pages.current.last_item %> / <%= @user_count %> ] [ <%= @user_pages.current.first_item %> - <%= @user_pages.current.last_item %> / <%= @user_count %> ]
</p> </p>
<p>
<%= link_to '&#187; ' + l(:label_user_new), :action => 'add' %>
</p>

View File

@ -7,6 +7,7 @@ http://redmine.org/
== xx/xx/2006 v0.x.x == xx/xx/2006 v0.x.x
* comments can now be added on news
* "my page" is now customizable * "my page" is now customizable
* improved issues change history * improved issues change history
* new functionality: move an issue to another project or tracker * new functionality: move an issue to another project or tracker

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

After

Width:  |  Height:  |  Size: 289 B

BIN
public/images/csv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 955 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 397 B

BIN
public/images/move.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

BIN
public/images/pdf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

View File

@ -128,6 +128,14 @@ background-color: #80b0da;
.picLogout { background: url(../images/logout.png) no-repeat 4px 50%; } .picLogout { background: url(../images/logout.png) no-repeat 4px 50%; }
.picHelp { background: url(../images/help.png) no-repeat 4px 50%; } .picHelp { background: url(../images/help.png) no-repeat 4px 50%; }
.picEdit { background: url(../images/edit_small.png) no-repeat 4px 50%; }
.picDelete { background: url(../images/delete.png) no-repeat 4px 50%; }
.picAdd { background: url(../images/add.png) no-repeat 4px 50%; }
.picMove { background: url(../images/move.png) no-repeat 4px 50%; }
.picPdf { background: url(../images/pdf.png) no-repeat 4px 50%;}
.picCsv { background: url(../images/csv.png) no-repeat 4px 50%;}
.pic { padding-left: 18px; margin-left: 3px; }
/**************** Content styles ****************/ /**************** Content styles ****************/
html>body #content { html>body #content {
@ -247,7 +255,7 @@ legend {
table.listTableContent { table.listTableContent {
border:1px solid #578bb8; border:1px solid #578bb8;
width:99%; width:100%;
border-collapse: collapse; border-collapse: collapse;
} }
@ -458,6 +466,14 @@ img.calendar-trigger {
margin-left: 34px; margin-left: 34px;
} }
/***** Contextual links div *****/
.contextual {
float: right;
font-size: 0.8em;
}
/***** CSS FORM ******/ /***** CSS FORM ******/
.tabular p{ .tabular p{
margin: 0; margin: 0;