Revision 951:010291c90b0b

View differences:

vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb
43 43
            bibtex_entry_no = BibtexEntryType.find_by_name(bib[0].type.to_s).id
44 44
            page["publication_title"].value = bib[0][:title]
45 45
            page["publication_bibtex_entry_attributes_entry_type"].value = bibtex_entry_no
46

  
46
            
47 47
            BibtexEntryType.fields(bibtex_entry_no).each do |field|
48 48
              page["publication_bibtex_entry_attributes_#{field}"].value = bib[0][field]
49 49
            end
50

  
51
            # for each author simulates a click and fills the author info                        
52
            bib[0].authors.each do |author|            
53
              page["add_another_author"].click
54
#              page.alert(bib[0].authors.length)
55
#              page.alert(page["authors"].first.id)
56
            
57
            end
58
            
59

  
60

  
50 61
          }
51 62
        }
52 63
      end
vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.html.erb
1 1
<%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %>
2 2

  
3

  
4
<div id="authors" class="fields">
5
<!--  <h4><%= l("label_author_1") %></h4> -->
6

  
3
<fieldset>
7 4
  <div id="<%= form_tag_id( f.object_name, :search_author ) %>" style=<%= "display:none;" unless params[:action] == "new" %> >
8 5
      <p>
9 6
        <%= f.text_field :search_name, :size => 25 %>
......
42 39
  <div class="box" id="<%= form_tag_id( f.object_name, :show_author_info ) %>" style="display: none">
43 40
	
44 41
  </div>
45

  
46 42
  <p>
47 43

  
48 44
  <%- if params[:action] == 'new' -%>
......
54 50

  
55 51
  <%= link_to_remove_fields l("remove_author"), f %>
56 52
  </p>
57
</div>
58
<br/>
53
</fieldset>
54
<br />
55

  
56

  
57

  
vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb
17 17

  
18 18
<h3><%= l(:authors) %></h3>    
19 19
<div class="box tabular">
20
  <% f.fields_for :authorships do |builder| -%>
21
    <%= render "authorship_fields", :f => builder %>
22
  <%- end -%>
20
  <div id="authors" class="fields">
21
    <% f.fields_for :authorships do |builder| -%>
22
      <%= render "authorship_fields", :f => builder %>
23
      <%- end -%>
24
  </div>
23 25
  <%= link_to_add_author_fields l(:label_add_an_author), f, :authorships, params[:action] %>
24 26
</div>

Also available in: Unified diff