From 3a9ec8cf6d9a75ed1544b77464494b1435bb2dfd Mon Sep 17 00:00:00 2001 From: Taylor Griffin Date: Fri, 27 Feb 2015 07:39:07 +1100 Subject: [PATCH] include crop approval status in sci and alt names --- app/views/alternate_names/show.html.haml | 2 ++ app/views/crops/_approval_status_message.html.haml | 11 +++++++++++ app/views/crops/show.html.haml | 12 +----------- app/views/scientific_names/show.html.haml | 2 ++ 4 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 app/views/crops/_approval_status_message.html.haml diff --git a/app/views/alternate_names/show.html.haml b/app/views/alternate_names/show.html.haml index 67dfc9a37..06012457b 100644 --- a/app/views/alternate_names/show.html.haml +++ b/app/views/alternate_names/show.html.haml @@ -1,5 +1,7 @@ %p#notice= notice += render :partial => 'crops/approval_status_message', :locals => { :crop => @alternate_name.crop } + %p %b Alternate name: = @alternate_name.name diff --git a/app/views/crops/_approval_status_message.html.haml b/app/views/crops/_approval_status_message.html.haml new file mode 100644 index 000000000..fffb822f4 --- /dev/null +++ b/app/views/crops/_approval_status_message.html.haml @@ -0,0 +1,11 @@ +- if crop.pending? + .alert.alert-danger + %b This crop is currently pending approval. + %p This crop was requested by #{crop.requester} #{time_ago_in_words(crop.created_at)} ago. + - unless crop.request_notes.blank? + %p + Request notes: #{crop.request_notes} + +- if crop.rejected? + .alert.alert-danger + %b This crop was rejected for the following reason: #{crop.reason_for_rejection == "other" ? crop.rejection_notes : crop.reason_for_rejection}. \ No newline at end of file diff --git a/app/views/crops/show.html.haml b/app/views/crops/show.html.haml index bda1804d2..57efa60a5 100644 --- a/app/views/crops/show.html.haml +++ b/app/views/crops/show.html.haml @@ -1,17 +1,7 @@ - content_for :title, @crop.name - content_for :subtitle, @crop.default_scientific_name -- if @crop.pending? - .alert.alert-danger - %b This crop is currently pending approval. - %p This crop was requested by #{@crop.requester} #{time_ago_in_words(@crop.created_at)} ago. - - unless @crop.request_notes.blank? - %p - Request notes: #{@crop.request_notes} - -- if @crop.rejected? - .alert.alert-danger - %b This crop was rejected for the following reason: #{@crop.reason_for_rejection == "other" ? @crop.rejection_notes : @crop.reason_for_rejection}. += render :partial => 'approval_status_message', :locals => { :crop => @crop } - if @crop.approved? - content_for :buttonbar do diff --git a/app/views/scientific_names/show.html.haml b/app/views/scientific_names/show.html.haml index a3efe2d6f..1c0a76357 100644 --- a/app/views/scientific_names/show.html.haml +++ b/app/views/scientific_names/show.html.haml @@ -1,5 +1,7 @@ %p#notice= notice += render :partial => 'crops/approval_status_message', :locals => { :crop => @scientific_name.crop } + %p %b Scientific name: = @scientific_name.scientific_name