From bf04986e255a3ac147532e7e2bec66395c6750c9 Mon Sep 17 00:00:00 2001 From: Jonathan Kolyer Date: Thu, 6 Feb 2014 13:07:32 -0600 Subject: [PATCH 1/2] VRFS-1033 changed column names from {short,long}_text to Who/Quote --- admin/app/admin/promo_buzz.rb | 8 ++++---- admin/app/views/admin/buzzs/_form.html.erb | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/admin/app/admin/promo_buzz.rb b/admin/app/admin/promo_buzz.rb index 62e0ca098..5c841545b 100644 --- a/admin/app/admin/promo_buzz.rb +++ b/admin/app/admin/promo_buzz.rb @@ -10,11 +10,11 @@ ActiveAdmin.register JamRuby::PromoBuzz, :as => 'Buzz' do form :partial => 'form' index do - column 'Short Text' do |pp| pp.text_short end + column 'Who?' do |pp| pp.text_short end column 'Image' do |pp| image_tag(pp.image_url, :size => '50x50') end - column 'Long Text' do |pp| pp.text_long[0..256] end + column 'Quote' do |pp| pp.text_long[0..256] end column 'State' do |pp| pp.aasm_state end column 'Position' do |pp| pp.position end column 'Updated' do |pp| pp.updated_at end @@ -23,8 +23,8 @@ ActiveAdmin.register JamRuby::PromoBuzz, :as => 'Buzz' do show do attributes_table do - row :text_short - row :text_long + row 'Who?' do |obj| obj.text_short end + row 'Quote' do |obj| obj.text_long end row :image do |obj| image_tag(obj.image_url, :size => '50x50') end diff --git a/admin/app/views/admin/buzzs/_form.html.erb b/admin/app/views/admin/buzzs/_form.html.erb index 96d6b7b83..9af84e2da 100644 --- a/admin/app/views/admin/buzzs/_form.html.erb +++ b/admin/app/views/admin/buzzs/_form.html.erb @@ -1,13 +1,13 @@ <% unless @promo.image_name.present? %> <%= direct_upload_form_for @uploader do |f| %>

<%= f.file_field :image %>

-

<%= f.submit "Upload Image" %>

+

<%= f.submit "Upload Image", :id => :submit_buzz_img %>

<% end %> <% end %> <%= semantic_form_for([:admin, @promo], :html => {:multipart => true}, :url => @promo.new_record? ? admin_buzzs_path : "/admin/buzzs/#{@promo.id}") do |f| %> <%= f.inputs do %> - <%= f.input(:text_short, :label => "Short Text", :input_html => {:maxlength => 512}) %> - <%= f.input(:text_long, :label => "Long Text", :input_html => {:rows => 3, :maxlength => 4096}) %> + <%= f.input(:text_short, :label => "Who?", :input_html => {:maxlength => 512}) %> + <%= f.input(:text_long, :label => "Quote", :input_html => {:rows => 3, :maxlength => 4096}) %> <%= f.input(:position, :label => "Position", :input_html => {:maxlength => 4}) %> <%= f.input(:aasm_state, :as => :select, :collection => Promotional::STATES, :label => 'Status') %> Image File: <%= @promo.image_name %> From 966075c885d00d7f589af3b826273a69809be4ad Mon Sep 17 00:00:00 2001 From: Jonathan Kolyer Date: Fri, 7 Feb 2014 20:26:17 -0600 Subject: [PATCH 2/2] VRFS-1034 fixed image uploading for buzz; added UI text instructing user to upload image before editing text --- admin/app/views/admin/buzzs/_form.html.erb | 1 + ruby/lib/jam_ruby/models/promotional.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/admin/app/views/admin/buzzs/_form.html.erb b/admin/app/views/admin/buzzs/_form.html.erb index 9af84e2da..ba1cf0ec6 100644 --- a/admin/app/views/admin/buzzs/_form.html.erb +++ b/admin/app/views/admin/buzzs/_form.html.erb @@ -1,4 +1,5 @@ <% unless @promo.image_name.present? %> +

Upload Image First

<%= direct_upload_form_for @uploader do |f| %>

<%= f.file_field :image %>

<%= f.submit "Upload Image", :id => :submit_buzz_img %>

diff --git a/ruby/lib/jam_ruby/models/promotional.rb b/ruby/lib/jam_ruby/models/promotional.rb index 56d5f4487..d560f46b4 100644 --- a/ruby/lib/jam_ruby/models/promotional.rb +++ b/ruby/lib/jam_ruby/models/promotional.rb @@ -55,6 +55,7 @@ class JamRuby::PromoBuzz < JamRuby::Promotional self.text_long = params[:text_long] self.position = params[:position] self.aasm_state = params[:aasm_state] + self.key = params[:key] self end