Revision 1274:5ea1a213c7a5 plugins/redmine_bibliography/app/views/publications

View differences:

plugins/redmine_bibliography/app/views/publications/_authorship_fields.html.erb
7 7
  <div id="<%= form_tag_id( f.object_name, :search_author ) %>" style=<%= "display:none;" unless params[:action] == "new" %> >
8 8
      <p>
9 9
        <%= f.text_field :search_name, :size => 25 %>
10
        <%= observe_field( form_tag_id(f.object_name, :search_name), :frequency => 0.5, :update => form_tag_id( f.object_name, :search_results), :url => { :controller => 'publications', :action => 'autocomplete_for_author', :object_name => form_object_id(f.object_name)  },  :with => 'q' ) %>
11
      </p>
12
      <%# link_to_function l(:label_author_is_me), "update_author_info(this," + User.current.get_author_info.to_json + ")", :id => "add_me_as_author" %>
13

  
14
      <p>   
15
      <%= f.select :search_results, options_for_select(@author_options), {}, {:size => 5, 
16
        :onChange => remote_function( :url => { :controller => :publications, :action => :get_user_info, :object_id => form_object_id(f.object_name) }, :with => "'value=' + 
17
        value" )} %>
18
	</p>  
10
      <p>
11
        <%= f.select :search_results, options_for_select(@author_options) %>
12
	    </p>
19 13

  
20 14
      <p style="margin-bottom: -2.5em; padding-bottom; 0"><label><%= l(:identify_author_question) %></label></p>
21 15
      <p class="author_identify">
22 16
        <label class='inline'><%= radio_button_tag(:identify_author, "yes", false, :name => form_tag_name(f.object_name,:identify_author ), :id => form_tag_id( f.object_name, :identify_author_yes ), :onchange => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_yes) %> </label><br />
23
       
17

  
24 18
        <label class='inline'><%= radio_button_tag(:identify_author, "correct", false, :name => form_tag_name(f.object_name,:identify_author ), :id => form_tag_id( f.object_name, :identify_author_corrections ), :onchange => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_correct) %> </label><br />
25
        
19

  
26 20
        <label class='inline'><%= radio_button_tag(:identify_author, "no", true, :name => form_tag_name(f.object_name,:identify_author ), :id => form_tag_id( f.object_name, :identify_author_no ), :onchange => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_no) %> </label><br />
27 21
      </p>
28
    </div>	
29
  
22
    </div>
23

  
30 24
  <div class='author_edit' id="<%= form_tag_id( f.object_name, :edit_author_info ) %>">
31 25
    <p>
32 26
      <%= f.text_field :name_on_paper, {:class => ("readonly" unless params[:action] == "new") } %></p>
......
37 31
      <p class='description' style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_email") %></p>
38 32
    </p>
39 33
  </div>
40
  
34

  
41 35

  
42 36
  <div class="box" id="<%= form_tag_id( f.object_name, :show_author_info ) %>" style="display: none">
43
	
37

  
44 38
  </div>
45 39

  
46 40
  <p>
plugins/redmine_bibliography/app/views/publications/_bibtex_fields.html.erb
1 1
<p>
2 2
  <label for="bibtex_entry_type"><%=l("field_entry_type")%> <span class="required">*</span></label>
3
	<%= f.collection_select :entry_type, 
4
	        BibtexEntryType.find(:all).reject { |x| x.redundant? }, 
5
	        :id, 
6
	        :label,  
7
	        { :selected => @selected_bibtex_entry_type_id, :prompt => true },	           
8
	        :onChange => remote_function( :url => { :controller => :publications, :action => :get_bibtex_required_fields}, :with => "'value=' + value" )	              
9
	%>
3
	<%= f.collection_select :entry_type,
4
	        BibtexEntryType.find(:all).reject { |x| x.redundant? },
5
	        :id,
6
	        :label,
7
	        { :selected => @selected_bibtex_entry_type_id, :prompt => true } %>
10 8
</p>
11 9

  
12
<p class="bibtex hol"> 
13
  <%= f.text_field :year, :size => 4 %> 
10
<p class="bibtex hol">
11
  <%= f.text_field :year, :size => 4 %>
14 12
</p>
15
<p class="bibtex hol"> 
16
  <%= f.text_field :month, :size => 4%> 
13
<p class="bibtex hol">
14
  <%= f.text_field :month, :size => 4%>
17 15
</p>
18
<p class="bibtex hol">  
19
  <%= f.text_field :chapter, :size => 15%>  
20
</p>  
21
<p class="bibtex hol"> 
22
  <%= f.text_field :editor, :size => 33  %>  
23
</p>  
24
<p class="bibtex hol"> 
25
  <%= f.text_field :booktitle, :size => 33  %>  
26
</p>  
27
<p class="bibtex hol"> 
28
  <%= f.text_field :publisher,:size => 33  %>  
29
</p>  
30
<p class="bibtex hol"> 
31
  <%= f.text_field :pages, :size => 12 %>  
16
<p class="bibtex hol">
17
  <%= f.text_field :chapter, :size => 15%>
32 18
</p>
33
<p class="bibtex hol"> 
19
<p class="bibtex hol">
20
  <%= f.text_field :editor, :size => 33  %>
21
</p>
22
<p class="bibtex hol">
23
  <%= f.text_field :booktitle, :size => 33  %>
24
</p>
25
<p class="bibtex hol">
26
  <%= f.text_field :publisher,:size => 33  %>
27
</p>
28
<p class="bibtex hol">
29
  <%= f.text_field :pages, :size => 12 %>
30
</p>
31
<p class="bibtex hol">
34 32
 <%= f.text_field :address %>
35 33
</p>
36
<p class="bibtex hol"> 
34
<p class="bibtex hol">
37 35
 <%= f.text_field :annote %>
38 36
</p>
39
<p class="bibtex hol"> 
37
<p class="bibtex hol">
40 38
 <%= f.text_field :crossref %>
41 39
</p>
42
<p class="bibtex hol"> 
40
<p class="bibtex hol">
43 41
 <%= f.text_field :edition %>
44 42
</p>
45
<p class="bibtex hol"> 
43
<p class="bibtex hol">
46 44
 <%= f.text_field :eprint %>
47 45
</p>
48
<p class="bibtex hol"> 
46
<p class="bibtex hol">
49 47
 <%= f.text_field :howpublished %>
50 48
</p>
51
<p class="bibtex hol"> 
49
<p class="bibtex hol">
52 50
 <%= f.text_field :journal %>
53 51
</p>
54
<p class="bibtex hol"> 
52
<p class="bibtex hol">
55 53
 <%= f.text_field :key %>
56 54
</p>
57
<p class="bibtex hol"> 
55
<p class="bibtex hol">
58 56
 <%= f.text_field :note %>
59 57
</p>
60
<p class="bibtex hol"> 
58
<p class="bibtex hol">
61 59
 <%= f.text_field :number %>
62 60
</p>
63
<p class="bibtex hol"> 
61
<p class="bibtex hol">
64 62
 <%= f.text_field :organization %>
65 63
</p>
66
<p class="bibtex hol"> 
64
<p class="bibtex hol">
67 65
 <%= f.text_field :school %>
68 66
</p>
69
<p class="bibtex hol"> 
67
<p class="bibtex hol">
70 68
 <%= f.text_field :series %>
71 69
</p>
72
<p class="bibtex hol"> 
70
<p class="bibtex hol">
73 71
 <%= f.text_field :type %>
74 72
</p>
75
<p class="bibtex hol"> 
73
<p class="bibtex hol">
76 74
 <%= f.text_field :url %>
77 75
</p>
78
<p class="bibtex hol"> 
76
<p class="bibtex hol">
79 77
 <%= f.text_field :volume %>
80 78
</p>
plugins/redmine_bibliography/app/views/publications/_form.html.erb
5 5
<div class="splitcontentleft">
6 6
  <h3><%= l(:label_publication_other_details) %></h3>
7 7
  <div class="box tabular">
8
    <% f.fields_for :bibtex_entry do |builder| -%>
8
    <%= f.fields_for :bibtex_entry do |builder| -%>
9 9
      <%= render :partial => 'bibtex_fields', :locals => { :f => builder}  %>
10 10
    <%- end -%>
11 11

  
......
26 26
<div class="splitcontentright">
27 27
  <h3><%= l(:authors) %></h3>
28 28
  <div class="box tabular">
29
    <% f.fields_for :authorships do |builder| -%>
29
    <%= f.fields_for :authorships do |builder| -%>
30 30
      <%= render "authorship_fields", :f => builder %>
31 31
    <%- end -%>
32 32
    <%= link_to_add_author_fields l(:label_add_an_author), f, :authorships, params[:action] %>
plugins/redmine_bibliography/app/views/publications/new.html.erb
1 1
<% content_for :header_tags do %>
2 2
    <%= javascript_include_tag 'authors', :plugin => 'redmine_bibliography' %>
3
    <%= javascript_include_tag 'bibliography', :plugin => 'redmine_bibliography' %>
3 4
    <%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %>
4 5
<% end %>
5 6

  
6 7
<h2><%=l(:label_publication_new)%></h2>
7 8

  
8
<% labelled_form_for @publication, :url => { :project_id  => @project, :action => :create } do |f| -%>
9
  <%= render :partial => 'form', :locals => { :f => f }  %>
10
  <div style="clear:both"></div>
11
  <%= f.submit %>
9
<%= labelled_form_for @publication, :url => { :project_id  => @project, :action => :create } do |f| -%>
10
    <%= render :partial => 'form', :locals => { :f => f }  %>
11
    <div style="clear:both"></div>
12
    <%= f.submit %>
12 13
<% end %>
plugins/redmine_bibliography/app/views/publications/show_bibtex_fields.js.erb
1
fields = <%= @fields.to_json.html_safe -%>;
2

  
3
$.each($(".bibtex"), function( key, value ) {
4
    $this = $(this);
5

  
6
    input_id = $this.children('input').attr('id');
7
    name = input_id.split('_')[4];
8

  
9
    if ($.inArray(name, fields)){
10
        $this.show();
11
    }
12
});

Also available in: Unified diff