@@ -10,6 +10,20 | |||||
10 | <%= text_field 'document', 'title', :size => 60 %></p> |
|
10 | <%= text_field 'document', 'title', :size => 60 %></p> | |
11 |
|
11 | |||
12 | <p><label for="document_description"><%=l(:field_description)%></label> |
|
12 | <p><label for="document_description"><%=l(:field_description)%></label> | |
13 | <%= text_area 'document', 'description', :cols => 60, :rows => 5 %></p> |
|
13 | <%= text_area 'document', 'description', :cols => 60, :rows => 15 %></p> | |
14 | <!--[eoform:document]--> |
|
14 | <!--[eoform:document]--> | |
15 | </div> No newline at end of file |
|
15 | </div> | |
|
16 | ||||
|
17 | <% unless $RDM_TEXTILE_DISABLED %> | |||
|
18 | <%= javascript_include_tag 'jstoolbar' %> | |||
|
19 | <script type="text/javascript"> | |||
|
20 | //<![CDATA[ | |||
|
21 | if (document.getElementById) { | |||
|
22 | if (document.getElementById('document_description')) { | |||
|
23 | var commentTb = new jsToolBar(document.getElementById('document_description')); | |||
|
24 | commentTb.draw(); | |||
|
25 | } | |||
|
26 | } | |||
|
27 | //]]> | |||
|
28 | </script> | |||
|
29 | <% end %> No newline at end of file |
@@ -1,47 +1,48 | |||||
1 | <h2><%= @document.title %></h2> |
|
1 | <h2><%= @document.title %></h2> | |
2 |
|
2 | |||
3 | <strong><%=l(:field_description)%>:</strong> <%= @document.description %><br /> |
|
3 | <p><em><%= @document.category.name %><br /> | |
4 | <strong><%=l(:field_category)%>:</strong> <%= @document.category.name %><br /> |
|
4 | <%= format_date @document.created_on %></em></p> | |
5 | <br /> |
|
5 | <%= textilizable @document.description %> | |
6 |
|
6 | |||
7 | <% if authorize_for('documents', 'edit') %> |
|
|||
8 | <%= start_form_tag({ :controller => 'documents', :action => 'edit', :id => @document }, :method => 'get' ) %> |
|
|||
9 | <%= submit_tag l(:button_edit) %> |
|
|||
10 | <%= end_form_tag %> |
|
|||
11 | <% end %> |
|
|||
12 |
|
7 | |||
|
8 | <table width="100%"> | |||
|
9 | <tr><td><%= link_to_if_authorized l(:button_edit), :controller => 'documents', :action => 'edit', :id => @document %></td> | |||
|
10 | <td align="right"> | |||
13 | <% if authorize_for('documents', 'destroy') %> |
|
11 | <% if authorize_for('documents', 'destroy') %> | |
14 | <%= start_form_tag({ :controller => 'documents', :action => 'destroy', :id => @document } ) %> |
|
12 | <%= start_form_tag({ :controller => 'documents', :action => 'destroy', :id => @document } ) %> | |
15 | <%= submit_tag l(:button_delete) %> |
|
13 | <%= submit_tag l(:button_delete) %> | |
16 |
<%= end_form_tag %> |
|
14 | <%= end_form_tag %> | |
17 | <% end %> |
|
15 | <% end %> | |
|
16 | </td></tr> | |||
|
17 | </table> | |||
|
18 | <br /> | |||
18 |
|
19 | |||
19 | <br /><br /> |
|
20 | <h3><%= l(:label_attachment_plural) %></h3> | |
20 |
|
21 | <ul> | ||
21 | <table class="reportTableContent"> |
|
|||
22 | <% for attachment in @attachments %> |
|
22 | <% for attachment in @attachments %> | |
23 | <tr class="<%= cycle("odd", "even") %>"> |
|
23 | <li> | |
24 | <td><%= format_date(attachment.created_on) %></td> |
|
24 | <% if authorize_for('documents', 'destroy') %> | |
25 | <td><%= link_to attachment.filename, :action => 'download', :id => @document, :attachment_id => attachment %></td> |
|
25 | <div style="float:right;padding:6px;"> | |
26 | <td align="center"><%= attachment.author.display_name %></td> |
|
26 | <%= start_form_tag({ :controller => 'documents', :action => 'destroy', :id => @document } ) %> | |
27 | <td><%= human_size(attachment.filesize) %><br /><%= lwr(:label_download, attachment.downloads) %></td> |
|
27 | <%= submit_tag l(:button_delete), :class => 'button-small' %> | |
28 |
|
28 | <%= end_form_tag %> | ||
29 | <% if authorize_for('documents', 'destroy_attachment') %> |
|
29 | </div> | |
30 | <td align="center"> |
|
30 | <% end %> | |
31 | <%= start_form_tag :action => 'destroy_attachment', :id => @document, :attachment_id => attachment %> |
|
31 | ||
32 | <%= submit_tag l(:button_delete), :class => "button-small" %> |
|
32 | <%= link_to attachment.filename, :action => 'download', :id => @document, :attachment_id => attachment %> | |
33 | <%= end_form_tag %> |
|
33 | (<%= human_size attachment.filesize %>)<br /> | |
34 | </tr> |
|
34 | <em><%= attachment.author.display_name %>, <%= format_date(attachment.created_on) %></em><br /> | |
35 | <% end %> |
|
35 | <%= lwr(:label_download, attachment.downloads) %> | |
36 |
|
36 | </li> | ||
37 | <% end %> |
|
37 | <% end %> | |
38 |
</ |
|
38 | </ul> | |
39 | <br /> |
|
39 | <br /> | |
40 |
|
40 | |||
|
41 | ||||
41 | <% if authorize_for('documents', 'add_attachment') %> |
|
42 | <% if authorize_for('documents', 'add_attachment') %> | |
42 | <%= start_form_tag ({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true) %> |
|
43 | <%= start_form_tag ({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true) %> | |
43 | <%=l(:label_attachment_new)%><br /><%= file_field 'attachment', 'file' %> |
|
44 | <label><%=l(:label_attachment_new)%></label> | |
|
45 | <%= file_field 'attachment', 'file' %> | |||
44 | <%= submit_tag l(:button_add) %> |
|
46 | <%= submit_tag l(:button_add) %> | |
45 | <%= end_form_tag %> |
|
47 | <%= end_form_tag %> | |
46 | <% end %> |
|
48 | <% end %> | |
47 |
|
@@ -10,8 +10,8 | |||||
10 | <li> |
|
10 | <li> | |
11 | <b><%= link_to d.title, :controller => 'documents', :action => 'show', :id => d %></b> |
|
11 | <b><%= link_to d.title, :controller => 'documents', :action => 'show', :id => d %></b> | |
12 | <br /> |
|
12 | <br /> | |
13 |
<%= |
|
13 | <%= truncate d.description, 250 %><br /> | |
14 |
<%= format_time(d.created_on) %> |
|
14 | <em><%= format_time(d.created_on) %></em> | |
15 | </li> |
|
15 | </li> | |
16 |
|
16 | |||
17 | <% end %> |
|
17 | <% end %> |
General Comments 0
You need to be logged in to leave comments.
Login now