comparison vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb @ 720:5eb7efd59ed7 cannam

Merge
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Mon, 17 Oct 2011 16:58:48 +0100
parents 2b665b7e67f4
children a0c9cc95bcf3
comparison
equal deleted inserted replaced
719:3f7bea56f35b 720:5eb7efd59ed7
62 end 62 end
63 end 63 end
64 64
65 def get_bibtex_required_fields 65 def get_bibtex_required_fields
66 66
67 fields = BibtexEntryType.fields(params[:value]) 67 unless params[:value].empty?
68 all_fields = BibtexEntryType.all_fields 68 fields = BibtexEntryType.fields(params[:value])
69 end
69 70
70 respond_to do |format| 71 respond_to do |format|
71 format.js { 72 format.js {
72 render(:update) {|page| 73 render(:update) {|page|
73 all_fields.each_with_index do |field, idx| 74 if params[:value].empty?
74 unless fields.include? field 75 page << "hideOnLoad();"
75 page["publication_bibtex_entry_attributes_#{field}"].up('p').hide() 76 else
76 else 77 page << "show_required_bibtex_fields(#{fields.to_json()});"
77 page["publication_bibtex_entry_attributes_#{field}"].up('p').show()
78 end
79 end 78 end
80 } 79 }
81 } 80 }
81
82 end 82 end
83 end 83 end
84 84
85 def add_author 85 def add_author
86 if (request.xhr?) 86 if (request.xhr?)