# HG changeset patch # User luisf # Date 1344252803 -3600 # Node ID b52621512b47971558b03ab42a830326f89ed769 # Parent 12f729c9f47d446859c3f9fd0496035e7b0dee96 correctly inserting the autorship fields. diff -r 12f729c9f47d -r b52621512b47 vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.html.erb Mon Aug 06 12:13:28 2012 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.html.erb Mon Aug 06 12:33:23 2012 +0100 @@ -45,6 +45,6 @@ <%= link_to_remove_fields l("remove_author"), f %>

+
+ - -
diff -r 12f729c9f47d -r b52621512b47 vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb Mon Aug 06 12:13:28 2012 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb Mon Aug 06 12:33:23 2012 +0100 @@ -18,13 +18,11 @@

<%= l(:authors) %>

-
- +
<% f.fields_for :authorships do |builder| -%> <%= render "authorship_fields", :f => builder %> <%- end -%> - - <%= link_to_add_author_fields l(:label_add_an_author), f, :authorships, params[:action] %>
+ <%= link_to_add_author_fields l(:label_add_an_author), f, :authorships, params[:action] %>
\ No newline at end of file diff -r 12f729c9f47d -r b52621512b47 vendor/plugins/redmine_bibliography/assets/javascripts/authors.js --- a/vendor/plugins/redmine_bibliography/assets/javascripts/authors.js Mon Aug 06 12:13:28 2012 +0100 +++ b/vendor/plugins/redmine_bibliography/assets/javascripts/authors.js Mon Aug 06 12:33:23 2012 +0100 @@ -6,9 +6,9 @@ function add_author_fields(link, association, content, action) { var new_id = new Date().getTime(); var regexp = new RegExp("new_" + association, "g"); - $(link).insert({ - before: content.replace(regexp, new_id) - }); + + $('authors').insert(content.replace(regexp, new_id)); + if(action != "new"){ toggle_save_author(new_id, $(link)); };