Revision 1407:00a51e442fe9 plugins/redmine_bibliography

View differences:

plugins/redmine_bibliography/app/helpers/publications_helper.rb
123 123
    s
124 124
  end
125 125
end
126

  
127

  
128
def render_authorship_link(link_class, link_id)
129

  
130
  # Renders a link for an author used when adding authors for a publication
131
  # link_class can be either User or Author
132
  # link_id will be the id of the Author/User we wish to link
133

  
134
  s= ""
135

  
136
  if link_class == "Author"
137
    s << link_to_author(Author.find(link_id), {}, :class => 'author_link')
138
  else
139
    s << link_to_user(User.find(link_id), :class => 'publication_project')
140
  end
141

  
142
  confirm_msg = "Are you sure you want to remove the link between this publication's author and this code.soundsoftware.ac.uk site user?"
143

  
144
  ## s << link_to(l(:button_delete), { :url => { :controller => 'publications', :action => 'remove_project', :id => publication, :remove_project_id => proj,  :project_id => @project }, :method => :post, :confirm => confirm_msg }, :class => 'icon icon-del', :remote => :true)
145

  
146
  s.html_safe
147
end
148

  
plugins/redmine_bibliography/app/views/publications/_authorship_fields.html.erb
6 6
    <p><%= f.text_field :email -%></p>
7 7

  
8 8
    <p class="author_associated search_author_tie">
9
      <%= f.check_box :search_author_tie -%>
10
      <span class="author_associated_name"></span>
9
      <%= f.check_box :search_author_tie, :label => '' -%>
10
      <span>Not associated with any SoundSoftware site user.</span>
11 11
    </p>
12 12

  
13 13
    <%= f.hidden_field :search_author_class -%>
plugins/redmine_bibliography/app/views/publications/autocomplete_for_author.html.erb
6 6
    'search_author_id' => result.id,
7 7
    'name' => result.name,
8 8
    'institution' => result.institution,
9
    'email' => result.mail
9
    'email' => result.mail,
10
    'authorship_link' => " Keep associated with #{render_authorship_link(result.class.name, result.id)}"
10 11
    }
11 12
}.to_json %>
plugins/redmine_bibliography/assets/javascripts/authors.js
26 26

  
27 27
            $this.closest('div').find("input[id$='search_author_class']").val(ui.item.search_author_class);
28 28
            $this.closest('div').find("input[id$='search_author_id']").val(ui.item.search_author_id);
29

  
29 30
            $this.closest('div').find("input[id$='search_author_tie']").attr('checked', 'checked');
31
            $this.closest('div').find("input[id$='search_author_tie']").next('span').replaceWith(ui.item.authorship_link);
30 32

  
31 33
            // triggers the save button
32 34
            $this.closest('div').next('div').find('.author_save_btn').click();
plugins/redmine_bibliography/assets/javascripts/bibliography.js
8 8
	$author_info.find('p :input').attr("readonly", true);
9 9
    $author_info.find('p :input').addClass('readonly');
10 10

  
11
    // Always hides on save
12
    $this.closest('div').prev().find('p.search_author_tie').hide();
13

  
11 14
    $this.siblings('.author_edit_btn').show();
12 15
    $this.hide();
13 16

  
......
22 25
    $author_info.find('p :input').attr("readonly", false);
23 26
    $author_info.find('p :input').removeClass('readonly');
24 27

  
28
    // Always shows on edit
29
    $this.closest('div').prev().find('p.search_author_tie').show();
30

  
25 31
    $this.siblings('.author_save_btn').show();
26 32
    $this.hide();
27 33

  
plugins/redmine_bibliography/assets/stylesheets/bibliography.css
66 66
  background-image: url(../../../images/loading.gif);
67 67
}
68 68

  
69
.authorship_tie {
69
.search_author_tie {
70 70
  display: none;
71 71
  float: left;
72 72
}

Also available in: Unified diff