Revision 457:8aa775cb7c0a vendor/plugins/redmine_bibliography/app

View differences:

vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb
1 1
# vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb
2 2

  
3 3
class PublicationsController < ApplicationController
4
  # TODO: should be removed on production version?
5 4
  unloadable
6

  
5
  
6
  before_filter :find_project, :authorize, :only => [:index, :new]
7
  
7 8
  def new
8 9
    @publication = Publication.new      
9 10
    
......
32 33
  end
33 34

  
34 35
  def index
35
    @project = Project.find(params[:project_id])
36 36
    @publications = Publication.find(:all)
37 37
  end
38 38

  
......
175 175
  def review_new_entries
176 176

  
177 177
  end
178
  
179
  
180
  private
181
   
182
  def find_project
183
   # @project variable must be set before calling the authorize filter
184
   @project = Project.find(params[:project_id])
185
  end
178 186

  
179 187

  
180 188
end
vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb
1
<h2>Publications#index</h2>
1
<div class="contextual">
2
	<% if User.current.allowed_to?(:add_publication, @project) %>
3
		<%= link_to l(:label_publication_new), {:controller => 'publications', :action => 'new', :parent_id => @project}, :class => 'icon icon-add' %>
4
	<% end %>
5
</div>
2 6

  
7
<div class="splitcontentleft">
8
  <h3>Publications#index</h3>
3 9

  
4
<table>
5
  <tr>
6
    <th>Number</th>
7
    <th>Title</th> 
8
  </tr>
9 10

  
10
<% @publications.each do |publication| %>
11
	<tr>
12
	  <td><%= publication.id %></td>
13
	  <td><%= publication.title %></td>
14
	 	</tr>
15
	
16
<% end %>
11
  <table>
12
    <tr>
13
      <th>Number</th>
14
      <th>Title</th> 
15
    </tr>
16

  
17
    <% @publications.each do |publication| %>
18
	    <tr>
19
	      <td><%= publication.id %></td>
20
	      <td><%= publication.title %></td>
21
	 	  </tr>
22
    <% end %>    
23
  </table>
24

  
25
</div>
26

  
27
<div class="splitcontentright">
28
  placeholder div
29
</div>
30

  
31

  
32
<% content_for :sidebar do %>
33
  Sidebar
34
<% end %>
35
  

Also available in: Unified diff