summaryrefslogtreecommitdiffstats
path: root/redmine/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2006-10-08 10:42:50 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2006-10-08 10:42:50 +0000
commitdc26a9cd39be4867dfc822cd4da019e478ff1a5f (patch)
treef9084624c3c16bbf91066931f861ff245fa53c2d /redmine/app
parent5f185b6c0532595e4a165600db9f99c5475289bb (diff)
downloadredmine-dc26a9cd39be4867dfc822cd4da019e478ff1a5f.tar.gz
redmine-dc26a9cd39be4867dfc822cd4da019e478ff1a5f.zip
association loading in documents/show
git-svn-id: http://redmine.rubyforge.org/svn/trunk@24 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'redmine/app')
-rw-r--r--redmine/app/controllers/documents_controller.rb20
-rw-r--r--redmine/app/views/documents/show.rhtml8
2 files changed, 14 insertions, 14 deletions
diff --git a/redmine/app/controllers/documents_controller.rb b/redmine/app/controllers/documents_controller.rb
index e8c8e2d03..f2693577e 100644
--- a/redmine/app/controllers/documents_controller.rb
+++ b/redmine/app/controllers/documents_controller.rb
@@ -16,10 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class DocumentsController < ApplicationController
- layout 'base'
- before_filter :find_project, :authorize
-
- def show
+ layout 'base'
+ before_filter :find_project, :authorize
+
+ def show
+ @attachments = @document.attachments.find(:all, :order => "created_on DESC")
end
def edit
@@ -48,18 +49,17 @@ class DocumentsController < ApplicationController
@attachment.author_id = self.logged_in_user.id if self.logged_in_user
@attachment.save
end
- render :action => 'show'
+ redirect_to :action => 'show', :id => @document
end
def destroy_attachment
@document.attachments.find(params[:attachment_id]).destroy
- render :action => 'show'
+ redirect_to :action => 'show', :id => @document
end
private
- def find_project
+ def find_project
@document = Document.find(params[:id])
- @project = @document.project
- end
-
+ @project = @document.project
+ end
end
diff --git a/redmine/app/views/documents/show.rhtml b/redmine/app/views/documents/show.rhtml
index 136621331..89693de89 100644
--- a/redmine/app/views/documents/show.rhtml
+++ b/redmine/app/views/documents/show.rhtml
@@ -18,11 +18,11 @@
<br /><br />
-<table border="0" cellspacing="1" cellpadding="2" width="100%">
-<% for attachment in @document.attachments %>
- <tr style="background-color:#CEE1ED">
+<table class="listTableContent">
+<% for attachment in @attachments %>
+ <tr class="<%= cycle("odd", "even") %>">
+ <td><%= format_date(attachment.created_on) %></td>
<td><%= link_to attachment.filename, :action => 'download', :id => @document, :attachment_id => attachment %></td>
- <td align="center"><%= format_date(attachment.created_on) %></td>
<td align="center"><%= attachment.author.display_name %></td>
<td><%= human_size(attachment.filesize) %><br /><%= lwr(:label_download, attachment.downloads) %></td>