changeset 653:0c5674b65db0 feature_36

Gross hack to "fix" #268 (unhelpful text "bibtex_entry.entry_type can't be blank")
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 09 Sep 2011 14:34:48 +0100
parents 525f48af3f54
children 1ee95265342f
files vendor/plugins/redmine_bibliography/app/models/publication.rb vendor/plugins/redmine_bibliography/config/locales/en.yml
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/app/models/publication.rb	Fri Sep 09 12:24:45 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/models/publication.rb	Fri Sep 09 14:34:48 2011 +0100
@@ -18,7 +18,18 @@
   
   before_save :set_initial_author_order
   after_save :notify_authors
-  
+
+  # Ensure error message uses proper text instead of
+  # bibtex_entry.entry_type (#268).  There has to be a better way to
+  # do this!
+  def self.human_attribute_name(k)
+    if k == 'bibtex_entry.entry_type'
+      l(:field_entry_type)
+    else
+      super
+    end
+  end
+
   # Returns the mail adresses of users that should be notified
   def notify_authors
     
--- a/vendor/plugins/redmine_bibliography/config/locales/en.yml	Fri Sep 09 12:24:45 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/config/locales/en.yml	Fri Sep 09 14:34:48 2011 +0100
@@ -34,7 +34,6 @@
   field_identify_author_yes: "Yes"
   field_identify_author_correct: "Corrections"
   field_identify_author_no: "No"
-  entry_type: "Bibtex Entry Type"
   
   label_author_is_me: "(I am this author)"
   label_add_me_as_author: "Add me as an author"