# HG changeset patch
# User luisf
# Date 1316168050 -3600
# Node ID c3e6c51170fa55e1c5bc8f5e223d3c60fc6dbf2d
# Parent 7e887544be061847f949aa9ce30caf42b0018207
Feature #238 - the New Publication now shows all fields correctly.
diff -r 7e887544be06 -r c3e6c51170fa vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb
--- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Thu Sep 15 15:39:07 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Fri Sep 16 11:14:10 2011 +0100
@@ -63,7 +63,7 @@
end
def get_bibtex_required_fields
- all_fields = ["editor", "publisher", "chapter", "pages", "volume", "series", "address", "edition", "year", "note", "institution", "type", "number", "month", "journal", "howpublished", "key", "school"]
+ all_fields = [ "editor", "publisher", "chapter", "pages", "volume", "series", "address", "edition", "year", "type", "note", "number", "journal", "howpublished", "key", "school", "month" ]
fields = Hash.new
fields[ 'article' ] = [ 'journal', 'year', 'volume', 'number', 'pages', 'month', 'note' ]
@@ -78,7 +78,7 @@
fields[ 'misc' ] = [ 'howpublished', 'month', 'year', 'note' ]
fields[ 'phdthesis' ] = [ 'school', 'year', 'address', 'month', 'note' ]
fields[ 'proceedings' ] = [ 'booktitle', 'year', 'editor', 'pages', 'organization', 'publisher', 'address', 'month', 'note' ]
- fields[ 'techreport' ] = [ 'institution', 'year', 'type', 'number', 'address', 'month', 'note' ]
+ fields[ 'techreport' ] = [ 'year', 'type', 'number', 'address', 'month', 'note' ]
fields[ 'unpublished' ] = [ 'note', 'month', 'year' ]
entrytype = BibtexEntryType.find(params[:value]).name
@@ -86,14 +86,11 @@
respond_to do |format|
format.js {
render(:update) {|page|
- all_fields.each do |field|
-
-
-
+ all_fields.each_with_index do |field, idx|
unless fields[entrytype].include? field
- page["publication_bibtex_entry_attributes_#{field}"].up('p').hide()
- else
- page["publication_bibtex_entry_attributes_#{field}"].up('p').show()
+ page["publication_bibtex_entry_attributes_#{field}"].up('p').hide()
+ else
+ page["publication_bibtex_entry_attributes_#{field}"].up('p').show()
end
end
}
diff -r 7e887544be06 -r c3e6c51170fa vendor/plugins/redmine_bibliography/app/views/publications/_bibtex_fields.html.erb
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_bibtex_fields.html.erb Thu Sep 15 15:39:07 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_bibtex_fields.html.erb Fri Sep 16 11:14:10 2011 +0100
@@ -12,6 +12,9 @@
<%= f.text_field :year, :size => 4, :class => 'bibtex' %>
+ <%= f.text_field :month, :size => 4, :class => 'bibtex' %>
+
+
<%= f.text_field :chapter, :size => 15, :class => 'bibtex' %>