Revision 787:a36cce722860 vendor/plugins
| vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb | ||
|---|---|---|
| 12 | 12 |
def projects_check_box_tags(name, projects) |
| 13 | 13 |
s = '' |
| 14 | 14 |
projects.sort.each do |project| |
| 15 |
s << "<label>#{ check_box_tag name, project.id, false } #{link_to_project project}</label>\n"
|
|
| 15 |
if User.current.allowed_to?(:edit_publication, project) |
|
| 16 |
s << "<label>#{ check_box_tag name, project.id, false } #{link_to_project project}</label>\n"
|
|
| 17 |
s << '<br />' |
|
| 18 |
end |
|
| 16 | 19 |
end |
| 20 |
|
|
| 17 | 21 |
s |
| 18 | 22 |
end |
| 19 | 23 |
|
| ... | ... | |
| 43 | 47 |
f.hidden_field(:_destroy) + link_to_function(name, "remove_fields(this)", :class => 'icon icon-del') |
| 44 | 48 |
end |
| 45 | 49 |
|
| 46 |
def link_to_add_fields(name, f, association)
|
|
| 50 |
def link_to_add_author_fields(name, f, association, action)
|
|
| 47 | 51 |
new_object = f.object.class.reflect_on_association(association).klass.new |
| 48 | 52 |
fields = f.fields_for(association, new_object, :child_index => "new_#{association}") do |builder|
|
| 49 | 53 |
render(association.to_s.singularize + "_fields", :f => builder) |
| 50 | 54 |
end |
| 51 |
link_to_function(name, h("add_fields(this, '#{association}', '#{escape_javascript(fields)}')"), { :class => 'icon icon-add', :id => "add_another_author" })
|
|
| 55 |
link_to_function(name, h("add_author_fields(this, '#{association}', '#{escape_javascript(fields)}', '#{action}')"), { :class => 'icon icon-add', :id => "add_another_author" })
|
|
| 52 | 56 |
end |
| 53 | 57 |
|
| 54 | 58 |
def sanitized_object_name(object_name) |
| vendor/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb | ||
|---|---|---|
| 7 | 7 |
<dl> |
| 8 | 8 |
<% @project.publications.each do |publication| %> |
| 9 | 9 |
<dt> |
| 10 |
<%= link_to publication.title, :controller => 'publications', :action => 'show', :id => publication, :project_id => @project %> |
|
| 11 |
</dt> |
|
| 12 |
<dd> |
|
| 13 | 10 |
<span class="authors"> |
| 14 |
<%= publication.authorships.map { |a| h a.name_on_paper }.join(', ') %>
|
|
| 11 |
<%= publication.authorships.map { |a| h a.name_on_paper }.join(', ') %><% if !publication.authorships.empty? %>.<% end %>
|
|
| 15 | 12 |
</span> |
| 13 |
<span class="title"><%= link_to publication.title, :controller => 'publications', :action => 'show', :id => publication, :project_id => @project %></span> |
|
| 16 | 14 |
<% if publication.bibtex_entry.year.to_s != "" %> |
| 17 | 15 |
<span class="year"> |
| 18 |
<%= publication.bibtex_entry.year %>
|
|
| 16 |
(<%= publication.bibtex_entry.year %>)
|
|
| 19 | 17 |
</span> |
| 20 | 18 |
<% end %> |
| 21 |
</dd> |
|
| 19 |
</dt><dd></dd>
|
|
| 22 | 20 |
<% end -%> |
| 23 | 21 |
</dl> |
| 24 | 22 |
</div> |
| vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.rhtml | ||
|---|---|---|
| 19 | 19 |
|
| 20 | 20 |
<p style="margin-bottom: -2.5em; padding-bottom; 0"><label><%= l(:identify_author_question) %></label></p> |
| 21 | 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 />
|
|
| 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 ), :onchange => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_yes) %> </label><br />
|
|
| 23 | 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 />
|
|
| 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 ), :onchange => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_correct) %> </label><br />
|
|
| 25 | 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 />
|
|
| 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 ), :onchange => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_no) %> </label><br />
|
|
| 27 | 27 |
</p> |
| 28 | 28 |
</div> |
| 29 | 29 |
|
| ... | ... | |
| 45 | 45 |
|
| 46 | 46 |
<p> |
| 47 | 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 %> |
|
| 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 |
<%- end -%> |
|
| 54 | 53 |
|
| 55 | 54 |
|
| 56 | 55 |
<%= link_to_remove_fields l("remove_author"), f %>
|
| vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb | ||
|---|---|---|
| 24 | 24 |
<% f.fields_for :authorships do |builder| -%> |
| 25 | 25 |
<%= render "authorship_fields", :f => builder %> |
| 26 | 26 |
<%- end -%> |
| 27 |
<%= link_to_add_fields l(:label_add_an_author), f, :authorships %>
|
|
| 27 |
<%= link_to_add_author_fields l(:label_add_an_author), f, :authorships, params[:action] %>
|
|
| 28 | 28 |
</div> |
| 29 | 29 |
</div> |
| 30 | 30 |
|
| vendor/plugins/redmine_bibliography/app/views/users/show.rhtml | ||
|---|---|---|
| 51 | 51 |
|
| 52 | 52 |
<% @publications.each do |publication|%> |
| 53 | 53 |
<dt> |
| 54 |
<%= link_to publication.title, :controller => 'publications', :action => 'show', :id => publication %> |
|
| 55 |
</dt> |
|
| 56 |
|
|
| 57 |
<dd> |
|
| 58 | 54 |
<span class="authors"> |
| 59 |
<%= publication.authorships.map { |a| h a.name_on_paper }.join(', ') %>
|
|
| 55 |
<%= publication.authorships.map { |a| h a.name_on_paper }.join(', ') %><% if !publication.authorships.empty? %>.<% end %>
|
|
| 60 | 56 |
</span> |
| 57 |
<span class="title"><%= link_to publication.title, :controller => 'publications', :action => 'show', :id => publication %></span> |
|
| 61 | 58 |
<% if publication.bibtex_entry.year.to_s != "" %> |
| 62 | 59 |
<span class="year"> |
| 63 |
<%= publication.bibtex_entry.year %>
|
|
| 60 |
(<%= publication.bibtex_entry.year %>)
|
|
| 64 | 61 |
</span> |
| 65 | 62 |
<% end %> |
| 63 |
</dt> |
|
| 64 |
<dd> |
|
| 66 | 65 |
</dd> |
| 67 | 66 |
<% end %> |
| 68 | 67 |
</div> |
| vendor/plugins/redmine_bibliography/assets/javascripts/authors.js | ||
|---|---|---|
| 3 | 3 |
$(link).up(".fields").hide();
|
| 4 | 4 |
} |
| 5 | 5 |
|
| 6 |
function add_fields(link, association, content) {
|
|
| 7 |
var new_id = new Date().getTime(); |
|
| 8 |
var regexp = new RegExp("new_" + association, "g")
|
|
| 9 |
$(link).insert({
|
|
| 10 |
before: content.replace(regexp, new_id) |
|
| 11 |
}); |
|
| 6 |
function add_author_fields(link, association, content, action) {
|
|
| 7 |
var new_id = new Date().getTime(); |
|
| 8 |
var regexp = new RegExp("new_" + association, "g");
|
|
| 9 |
$(link).insert({
|
|
| 10 |
before: content.replace(regexp, new_id) |
|
| 11 |
}); |
|
| 12 |
if(action != "new"){
|
|
| 13 |
toggle_save_author(new_id, $(link)); |
|
| 14 |
}; |
|
| 12 | 15 |
} |
| 13 | 16 |
|
| 14 | 17 |
function identify_author_status(status, object_id) {
|
| vendor/plugins/redmine_bibliography/assets/stylesheets/bibliography.css | ||
|---|---|---|
| 39 | 39 |
div#bibliography dd { margin-bottom: 1em; padding-left: 18px; font-size: 0.9em; }
|
| 40 | 40 |
div#bibliography .box dd { margin-bottom: 0.6em; padding-left: 0; }
|
| 41 | 41 |
div#bibliography dd .authors { font-style: italic; }
|
| 42 |
div#bibliography dt .title { font-style: italic; }
|
|
| 42 | 43 |
div#bibliography dd span.authors { color: #808080; }
|
| 43 | 44 |
div#bibliography dd span.year { padding-left: 0.6em; }
|
| 44 | 45 |
|
| vendor/plugins/redmine_tags/app/views/projects/_filter_search_tags.html.erb | ||
|---|---|---|
| 2 | 2 |
<% fields_for @project, :builder => TabularFormBuilder do |f| -%> |
| 3 | 3 |
<div> |
| 4 | 4 |
<p id="project_tags"> |
| 5 |
<%= f.text_field :tag_list, :label => :tags, :size => 60, :class => 'hol' %>
|
|
| 5 |
<%= f.text_field :tag_list, :label => :label_tags_search, :size => 60, :class => 'hol' %>
|
|
| 6 | 6 |
</p> |
| 7 | 7 |
<div id="project_tag_candidates" class="autocomplete"></div> |
| 8 | 8 |
<%= javascript_include_tag 'tags_input', :plugin => 'redmine_tags' %> |
| vendor/plugins/redmine_tags/app/views/projects/index.rhtml | ||
|---|---|---|
| 17 | 17 |
<% end %> |
| 18 | 18 |
|
| 19 | 19 |
<div style="clear:both;"></div> |
| 20 |
<h2> |
|
| 21 |
<%= l("label_project_all") %>
|
|
| 22 |
</h2> |
|
| 23 |
|
|
| 24 |
<div style="clear:both;"></div> |
|
| 20 | 25 |
<% form_remote_tag(:controller => :projects, :action => :index, :method => :get, :html => {:id => :project_filtering_form}) do %>
|
| 21 | 26 |
|
| 22 | 27 |
<% if @filter_status=="true" %> |
| ... | ... | |
| 44 | 49 |
</fieldset> |
| 45 | 50 |
<% end %> |
| 46 | 51 |
|
| 47 |
<div style="clear:both;"></div> |
|
| 48 |
<h2> |
|
| 49 |
<%= l("label_project_all") %>
|
|
| 50 |
</h2> |
|
| 51 |
|
|
| 52 | 52 |
<div id="projects"> |
| 53 | 53 |
<%= render :partial => 'filtered_projects' %> |
| 54 | 54 |
</div> |
| vendor/plugins/redmine_tags/assets/stylesheets/redmine_tags.css | ||
|---|---|---|
| 33 | 33 |
div.tags .tag-nube-8 { font-size: 1.5em; }
|
| 34 | 34 |
|
| 35 | 35 |
.tag-count { font-size: .75em; margin-left: .5em; }
|
| 36 |
|
|
| 37 |
#project_tags label { padding-right: .5em; }
|
|
| vendor/plugins/redmine_tags/config/locales/en.yml | ||
|---|---|---|
| 23 | 23 |
tags: Tags |
| 24 | 24 |
field_tags: Tags |
| 25 | 25 |
field_tag_list: Tags |
| 26 |
label_tags_search: "Tags: " |
|
| 26 | 27 |
setting_issue_tags: Issues Tags |
| 27 | 28 |
issues_sidebar: Display tags on sidebar as |
| 28 | 29 |
issues_show_count: Display amount of issues |
Also available in: Unified diff