Revision 723:d41bf754c0f2 vendor/plugins/redmine_bibliography/app/views/publications

View differences:

vendor/plugins/redmine_bibliography/app/views/publications/_add_project_form.html.erb
1
<% form_remote_for(:publication, 
2
                     :url => {:controller => 'publications', :action => 'add_project', :id => @publication, :project_id => @project}, 
3
                     :method => :post,
4
                     :html => { :id => 'add_project_form' }, 
5
									   :loading => "$('project-add-submit').disable()",
6
									   :complete => "$('project-add-submit').enable()") do |f| %>
7
								<fieldset><legend><%=l(:label_add_project_to_publication)%></legend>
8
	      <p>
9
	        <%= label_tag "project_search", l(:label_project_search) %><%= text_field_tag 'project_search', nil %>
10
	      </p>
11
	     
12
	      <%= observe_field(:project_search,
13
               :frequency => 0.5,
14
               :update => :projects,
15
               :url => { :controller => 'publications', :action => 'autocomplete_for_project', :id => @publication },
16
               :with => 'q')
17
                %>
18

  
19
					<div id="projects">
20
					<% if params[:q] && params[:q].length > 1 %>
21
			  		  <%= projects_check_box_tags 'project[project_ids][]', @projects %>
22
					<% end %>
23
					</div>
24

  
25
        <p><%= submit_tag l(:button_add), :id => 'project-add-submit' %></p>
26
    
27
    
28
      </fieldset>
29
  <% end %>
vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml
1
<%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %>
2

  
3

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

  
7
  <div id="<%= form_tag_id( f.object_name, :search_author ) %>" style=<%= "display:none;" unless params[:action] == "new" %> >
8
      <p>
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>  
19

  
20
      <p style="margin-bottom: -2.5em; padding-bottom; 0"><label><%= l(:identify_author_question) %></label></p>
21
      <p class="author_identify">
22
        <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 ), :onclick => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_yes) %> </label><br />
23
       
24
        <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 ), :onclick => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_correct) %> </label><br />
25
        
26
        <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 ), :onclick => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_no) %> </label><br />
27
      </p>
28
    </div>	
29
  
30
  <div class='author_edit' id="<%= form_tag_id( f.object_name, :edit_author_info ) %>">
31
    <p>
32
      <%= f.text_field :name_on_paper, {:class => ("readonly" unless params[:action] == "new") } %></p>
33
      <p class='description' style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_name_on_paper") %></p>
34
      <p><%= f.text_field :institution, {:class => ("readonly" unless params[:action] == "new") }  %></p>
35
      <p class='description' style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_institution") %></p>
36
      <p><%= f.text_field :email, {:class => ("readonly" unless params[:action] == "new") }  %></p>
37
      <p class='description' style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_email") %></p>
38
    </p>
39
  </div>
40
  
41

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

  
46
  <p>
47

  
48
  <% if params[:action] == 'new' %>
49
   <%= button_to_function l(:label_save_author), {}, { :onclick => "toggle_save_author(#{form_object_id(f.object_name)}); return false;", :id => form_tag_id( f.object_name, :edit_save_button )} %>
50
  <% else %>
51
<%= button_to_function l(:label_edit_author), {}, { :onclick => "toggle_save_author(#{form_object_id(f.object_name)}); return false;", :id => form_tag_id( f.object_name, :edit_save_button )} %>
52

  
53
 <% end %>
54

  
55

  
56
  <%= link_to_remove_fields l("remove_author"), f %>
57
  </p>
58
</div>
59
<br/>
vendor/plugins/redmine_bibliography/app/views/publications/_bibtex_fields.html.erb
1
<p>
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
	%>
10
</p>
11

  
12
<p class="bibtex hol"> 
13
  <%= f.text_field :year, :size => 4 %> 
14
</p>
15
<p class="bibtex hol"> 
16
  <%= f.text_field :month, :size => 4%> 
17
</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 %>  
32
</p>
33
<p class="bibtex hol"> 
34
 <%= f.text_field :address %>
35
</p>
36
<p class="bibtex hol"> 
37
 <%= f.text_field :annote %>
38
</p>
39
<p class="bibtex hol"> 
40
 <%= f.text_field :crossref %>
41
</p>
42
<p class="bibtex hol"> 
43
 <%= f.text_field :edition %>
44
</p>
45
<p class="bibtex hol"> 
46
 <%= f.text_field :eprint %>
47
</p>
48
<p class="bibtex hol"> 
49
 <%= f.text_field :howpublished %>
50
</p>
51
<p class="bibtex hol"> 
52
 <%= f.text_field :journal %>
53
</p>
54
<p class="bibtex hol"> 
55
 <%= f.text_field :key %>
56
</p>
57
<p class="bibtex hol"> 
58
 <%= f.text_field :note %>
59
</p>
60
<p class="bibtex hol"> 
61
 <%= f.text_field :number %>
62
</p>
63
<p class="bibtex hol"> 
64
 <%= f.text_field :organization %>
65
</p>
66
<p class="bibtex hol"> 
67
 <%= f.text_field :school %>
68
</p>
69
<p class="bibtex hol"> 
70
 <%= f.text_field :series %>
71
</p>
72
<p class="bibtex hol"> 
73
 <%= f.text_field :type %>
74
</p>
75
<p class="bibtex hol"> 
76
 <%= f.text_field :url %>
77
</p>
78
<p class="bibtex hol"> 
79
 <%= f.text_field :volume %>
80
</p>
vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb
1
<%= f.error_messages %>  
2

  
3
<h3><%= f.text_field :title, :required => true, :size => 70 %></h3>
4

  
5
<div class="splitcontentleft">      
6
  <h3><%= l(:label_publication_other_details) %></h3>
7
  <div class="box tabular">
8
    <% f.fields_for :bibtex_entry do |builder| -%>
9
      <%= render :partial => 'bibtex_fields', :locals => { :f => builder}  %>
10
    <%- end -%>
11

  
12
    <p>
13
      <%= f.text_field :external_url, :size => 70 %>
14
      <br />
15
      <em><%= l(:text_external_url) %></em>
16
    </p>
17

  
18
  </div>
19
</div>
20

  
21
<div class="splitcontentright">
22
  <h3><%= l(:authors) %></h3>    
23
  <div class="box tabular">
24
    <% f.fields_for :authorships do |builder| -%>
25
      <%= render "authorship_fields", :f => builder %>
26
    <%- end -%>
27
    <%= link_to_add_fields l(:label_add_an_author), f, :authorships %>
28
  </div>
29
</div>
30

  
31

  
vendor/plugins/redmine_bibliography/app/views/publications/_identify_author_form.html.erb
1
<legend><%= "Identify Authors in the system…" %></legend>
2

  
3
<%= link_to_remote "It's me!", 
4
   { :url => { :controller => 'publications', 
5
     :action => 'add_me_as_author',
6
     :project_id => @project }, :method => 'post'}, 
7
   { :class => 'icon icon-add', :id => "add_me_as_author" } %>
8

  
9
<p>
10
  <%= label_tag "author_search", l(:label_project_search) %><%= text_field_tag 'author_search', nil %>
11
</p>
12
	     
13
<%= observe_field( form_tag_id(f.object_name, :name),
14
     :frequency => 0.5,
15
     :update => :identify_author,
16
     :url => { :controller => 'publications', :action => 'autocomplete_for_author' },
17
     :with => 'q')
18
%>
19

  
20
<div id="identify_author">
21
  <% if params[:q] && params[:q].length > 1 %>
22
    <%= select_author_links 'author[author_ids][]', @authors %>
23
  <% end %>
24
</div>
25

  
vendor/plugins/redmine_bibliography/app/views/publications/_list_projects.html.erb
1
<%= render_projects_list(@publication, true) %>
vendor/plugins/redmine_bibliography/app/views/publications/_new_bibtex_step.html.erb
1
<h3>New Bibtex</h3>
2

  
3
<h4>Paste your Bibtex entries here</h4>
4
<p>
5
  <%=label_tag :bibtex_entry %>
6
  <%=text_area_tag :bibtex_entry%>  
7
</p>
8

  
9

  
vendor/plugins/redmine_bibliography/app/views/publications/_review_bibtex_step.html.erb
1
<h2>Review new entries</h2>
2

  
vendor/plugins/redmine_bibliography/app/views/publications/add_project.rjs
1
page.replace_html :list_projects, :partial => 'list_projects'
2
page[:add_project_form].reset
3

  
vendor/plugins/redmine_bibliography/app/views/publications/autocomplete_for_author.rhtml
1
<% if params[:q] && params[:q].length > 1 %>
2
	<%= choose_author_link @object_name, @results %>
3
<% end %>
4

  
vendor/plugins/redmine_bibliography/app/views/publications/autocomplete_for_project.rhtml
1
<% if params[:q] && params[:q].length > 1 %>
2
	<%= projects_check_box_tags 'publication[project_ids][]', @projects %>
3
<% end %>
vendor/plugins/redmine_bibliography/app/views/publications/create.html.erb
1
<h2>Publications#create</h2>
vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb
1
<% content_for :header_tags do %>
2
    <%= javascript_include_tag 'authors', :plugin => 'redmine_bibliography' %>
3
    <%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %>  
4
    <%= javascript_tag 'Event.observe(window, "load", function(e){show_required_bibtex_fields(' + @bibtype_fields.to_json + ')});' %>
5
<% end %>
6

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

  
9
<% form_for @publication, :url => { :project_id  => @project, :action => :update }, :builder => TabularFormBuilder do |f| -%>
10
  <%= render :partial => 'form', :locals => { :f => f }  %>
11

  
12
  <div style="clear:both"></div>
13
  <%= f.submit %>
14
<% end %>
15
<p>
16
  <%= link_to l(:label_publication_show), { :controller => "publications", :action => "show", :id => @publication, :project_id => @project_id } %> |
17
  <%= link_to l(:label_publication_index), { :controller => "publications", :action => "index", :project_id => @project } %>
18
</p>
vendor/plugins/redmine_bibliography/app/views/publications/import.html.erb
1
<h1>New Publication</h1>
2

  
3
<% form_for @publication, :url => { :action => "create" } do |f| %>
4
  <% f.error_messages %>
5

  
6
  <%= render :partial  => "#{@publication.current_step}_bibtex_step", :locals => { :f => f }  %>
7

  
8
  <p><%= f.submit "Submit" %></p>
9
  <p><%= f.submit "Back", :name => "back_button" unless @publication.first_step? %></p>
10
  
11
<% end %>
12

  
vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb
1
<div class="contextual">
2
  <% if User.current.allowed_to?(:add_publication, @project) %>			
3
	  <%= link_to l(:label_publication_new), {:controller => 'publications', :action => 'new', :project_id => @project}, :class => 'icon icon-add' %>
4
	<% end %>
5
</div>
6

  
7
  <% if @project %>
8
    <h3><%= l(:label_all_publications_for_project, :project => @project.name) %></h3>
9
  <% else %>
10
    <h3><%= l(:label_all_publications) %></h3>
11
  <% end %>
12

  
13
  <div class="autoscroll">
14
  <table class="list publications">
15
    <thead><tr>
16
      <th><%= l(:title) %></th> 
17
      <th><%= l(:authors) %></th> 
18
      <th><%= l(:year) %></th>
19
      <th><%= l(:associated_projects) %></th>
20
    </tr></thead>
21

  
22
    <%- @publications.each do |publication| -%>        
23
      <%- if publication.projects.visible.length > 0 -%>
24
        <tr class="<%= cycle('odd', 'even') %>">
25
          <td class="firstcol title" align="top"><%= link_to publication.title, :controller => "publications", :action => "show", :id => publication, :project_id => @project %></td>
26
          <td class="authors" align="top">
27
            <%= render_authorships_list(publication) %>
28
          <td class="year"><%= publication.bibtex_entry.year %></td>
29
          <td class="projects">
30
              <%= render_projects_list(publication, false) %>
31
          </td>
32
        </tr>
33
      <%- end -%>
34
    <%- end -%>
35
  </table>
36
  </div>
37

  
38
<% content_for :sidebar do %>
39
<% end %>
40
  
vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb
1
<% content_for :header_tags do %>
2
    <%= javascript_include_tag 'authors', :plugin => 'redmine_bibliography' %>
3
    <%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %>
4
<% end %>
5

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

  
8
<% form_for @publication, :url => { :project_id  => @project, :action => :create }, :builder => TabularFormBuilder do |f| -%>
9
  <%= render :partial => 'form', :locals => { :f => f }  %>
10
  <div style="clear:both"></div>
11
  <%= f.submit %>
12
<% end %>
vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb
1
<%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %>
2

  
3
<h2><%=l(:label_publication_show)%></h2>
4

  
5
<div class="box">
6
<h3>
7
  <%= h @publication.title %>
8
</h3>
9

  
10
<h4><%= l(:authors) %></h4>
11
<ul id="authorships">
12
  <% for authorship in @publication.authorships.find(:all, :order => :auth_order) %>
13
    <% content_tag_for :li, authorship do %>
14
      <%- if User.current.allowed_to?(:edit_publication, @project) && @publication.authorships.length > 1 -%>    
15
        <span class="handle">[drag to reorder]</span>
16
      <%- end -%>
17
      <%= link_to_authorship authorship %> <em><%= h authorship.institution %></em> <br />
18
    <%- end -%>
19
  <%- end -%>
20
</ul>
21
<%- if User.current.allowed_to?(:edit_publication, @project) && @publication.authorships.length > 1 -%>
22
  <%= sortable_element("authorships", :url => { :controller => :publications, :action => :sort_author_order }, :handle => "handle") %>
23
<%- end -%>
24

  
25
<%- if @publication.bibtex_entry != nil -%>
26
  <%= show_bibtex_fields(@publication.bibtex_entry) %>
27
<%- end -%>
28

  
29

  
30
<% unless @publication.external_url.blank? %>
31
  <h4>
32
    <%= l(:field_external_url) %>
33
  </h4>
34
  <p>
35
    <%= link_to h(@publication.external_url), @publication.external_url, {:target => "_blank"} %>
36
  </p>
37
<% end %>
38

  
39
<br / >
40
  <% if User.current.allowed_to?(:add_publication, @project) %>	
41
    <%= link_to l(:label_publication_edit), { :controller => "publications", :action => "edit", :id => @publication, :project_id => @project } %> |
42
    <%= link_to "Delete", {:controller => 'publications', :action => 'destroy', :id => @publication, :project_id => @project },
43
                                                     :confirm => l(:text_are_you_sure), :method => :delete, :title => l(:button_delete) %> |
44
  <% end %>
45
  <%= link_to l(:view_all_publications), {:controller => 'publications', :action => 'index', :project_id => @project } %>
46
</div>
47

  
48
<% projects = Project.active.find(:all, :limit => 100, :order => 'name ASC') - @publication.projects %>
49

  
50
<% content_for :sidebar do %>
51
  <h3><%=l(:label_publication_project_index)%></h3>
52

  
53
  <p id="list_projects">
54
    <%= render :partial => 'list_projects' %>
55
  </p>
56
  
57
  <%- if User.current.allowed_to?(:edit_publication, @project) -%>
58
    <%= render :partial => 'add_project_form' %>    
59
  <%- end -%>
60
<% end %>
vendor/plugins/redmine_bibliography/app/views/publications/update.html.erb
1
<h2>Publications#update</h2>

Also available in: Unified diff