news and documents views modified

git-svn-id: http://redmine.rubyforge.org/svn/trunk@61 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2006-11-30 22:17:44 +00:00
parent 98d4bdb7df
commit 120e39ba80
5 changed files with 18 additions and 21 deletions

View File

@ -21,9 +21,9 @@
<ul> <ul>
<% for attachment in @attachments %> <% for attachment in @attachments %>
<li> <li>
<% if authorize_for('documents', 'destroy') %> <% if authorize_for('documents', 'destroy_attachment') %>
<div style="float:right;padding:6px;"> <div style="float:right;padding:6px;">
<%= start_form_tag({ :controller => 'documents', :action => 'destroy', :id => @document } ) %> <%= start_form_tag({ :controller => 'documents', :action => 'destroy_attachment', :id => @document, :attachment_id => attachment } ) %>
<%= submit_tag l(:button_delete), :class => 'button-small' %> <%= submit_tag l(:button_delete), :class => 'button-small' %>
<%= end_form_tag %> <%= end_form_tag %>
</div> </div>

View File

@ -2,7 +2,7 @@
<div class="box"> <div class="box">
<p><%= f.text_field :title, :required => true, :size => 60 %></p> <p><%= f.text_field :title, :required => true, :size => 60 %></p>
<p><%= f.text_area :summary, :cols => 60, :rows => 2 %></p> <p><%= f.text_area :summary, :cols => 60, :rows => 2 %></p>
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 10 %></p> <p><%= f.text_area :description, :required => true, :cols => 60, :rows => 15 %></p>
</div> </div>
<% unless $RDM_TEXTILE_DISABLED %> <% unless $RDM_TEXTILE_DISABLED %>

View File

@ -1,21 +1,16 @@
<h2><%= @news.title %></h2> <h2><%= @news.title %></h2>
<p> <p><em><%= @news.summary %><br />
<b><%=l(:field_summary)%></b>: <%= @news.summary %><br /> <%= @news.author.display_name %>, <%= format_time(@news.created_on) %></em></p>
<b><%=l(:field_author)%></b>: <%= @news.author.display_name %><br /> <br />
<b><%=l(:field_created_on)%></b>: <%= format_time(@news.created_on) %>
</p>
<%= textilizable auto_link @news.description %> <%= textilizable auto_link @news.description %>
<% if authorize_for('news', 'edit') %> <div style="float:right;">
<%= start_form_tag ({:controller => 'news', :action => 'edit', :id => @news}, :method => 'get' ) %>
<%= submit_tag l(:button_edit) %>
<%= end_form_tag %>
<% end %>
<% if authorize_for('news', 'destroy') %> <% if authorize_for('news', 'destroy') %>
<%= start_form_tag ({:controller => 'news', :action => 'destroy', :id => @news}) %> <%= start_form_tag ({:controller => 'news', :action => 'destroy', :id => @news}) %>
<%= submit_tag l(:button_delete) %> <%= submit_tag l(:button_delete) %>
<%= end_form_tag %> <%= end_form_tag %>
<% end %> <% end %>
</div>
<%= link_to_if_authorized l(:button_edit), :controller => 'news', :action => 'edit', :id => @news %>

View File

@ -11,7 +11,7 @@
<b><%= link_to d.title, :controller => 'documents', :action => 'show', :id => d %></b> <b><%= link_to d.title, :controller => 'documents', :action => 'show', :id => d %></b>
<br /> <br />
<%= truncate d.description, 250 %><br /> <%= truncate d.description, 250 %><br />
<em><%= format_time(d.created_on) %></em> <em><%= format_time(d.created_on) %></em><br />&nbsp;
</li> </li>
<% end %> <% end %>

View File

@ -2,13 +2,15 @@
<% if @news.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %> <% if @news.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
<ul>
<% for news in @news %> <% for news in @news %>
<p> <li><%= link_to news.title, :controller => 'news', :action => 'show', :id => news %><br />
<b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br />
<% unless news.summary.empty? %><%= news.summary %><br /><% end %> <% unless news.summary.empty? %><%= news.summary %><br /><% end %>
<small>[<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]</small> <em><%= news.author.name %>, <%= format_time(news.created_on) %></em><br />&nbsp;
</p> </li>
<% end %> <% end %>
</ul>
<%= pagination_links_full @news_pages %> <%= pagination_links_full @news_pages %>
<p> <p>