Revision 429:27930c9b424d vendor

View differences:

vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb
54 54

  
55 55
  def edit
56 56
    @publication = Publication.find(params[:id])
57

  
58

  
57
    
59 58
  end
60 59

  
61 60
  def update
62

  
63
    logger.error "AAAA update"
64

  
61
    @publication = Publication.find(params[:id])
62
    if @publication.update_attributes(params[:publication])
63
      flash[:notice] = "Successfully updated Publication."
64
      redirect_to @publication
65
    else
66
      render :action => 'edit'
67
    end
65 68
  end
66 69

  
67 70
  def show
vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb
1 1
<h2>Publications#edit</h2>
2 2

  
3
<% form_for @publication, :url => {:action => :edit} do |f| -%>
4
  <%= f.error_messages %>
5
  <p>
6
    <%= f.label :title, l(:title) %>  <%= f.text_field :title %>  
7
  </p>
8
  
3
<%= render :partial => 'edit' %>
9 4

  
10
  <h3><%= l(:authors) -%></h3>
11
  
12
  <% f.fields_for :authors do |author| %>
13
    <p>
14
      <%= author.label :name, l("name") %> <%= author.text_field :name %>            
15
    </p>
16
    
17
  <% end %>
18
  
19
  
20
  <% f.fields_for @publication.bibtex_entry do |b| -%>
21
    <p> 
22
      <%= b.label :year, l(:year) %>  <%= b.text_field :year %>  
23
    </p>
24
    <p> 
25
      <%= b.label :chapter, l(:chapter) %>  <%= b.text_field :chapter %>  
26
    </p>
27
    <p>  
28
      <%= b.label :editor, l(:editor) %>  <%= b.text_field :editor %>  
29
    </p>
30
    <p> 
31
      <%= b.label :booktitle, l(:booktitle) %>  <%= b.text_field :booktitle %>  
32
    </p>
33
    <p> 
34
      <%= b.label :publisher, l(:publisher) %>  <%= b.text_field :publisher %>  
35
    </p>
36
    <p> 
37
      <%= b.label :pages, l(:pages) %>  <%= b.text_field :pages %>  
38
    </p>
39
  <% end -%>
40 5

  
6
<p>
7
  <%= link_to :show %></p>
41 8

  
42 9

  
43
  <%= f.submit "Submit" %>
44

  
45

  
46

  
47

  
48

  
49
<% end -%>

Also available in: Unified diff