Add helpers for convering simple_form collection to a hash and getting it back. clean up styling for show
This commit is contained in:
parent
6e76c4d480
commit
466141adad
@ -46,3 +46,14 @@ textarea {
|
|||||||
select {
|
select {
|
||||||
width:100%;
|
width:100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.campaign-item, .videolisting-item {
|
||||||
|
display:block;
|
||||||
|
strong {
|
||||||
|
display:block;
|
||||||
|
}
|
||||||
|
span {
|
||||||
|
padding-left: 2em;
|
||||||
|
}
|
||||||
|
}
|
@ -1,21 +1,32 @@
|
|||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
def producttypeid_list
|
def producttypeid_list(options={})
|
||||||
producttypeids = []
|
producttypeids = []
|
||||||
producttypeids << ["720 - Basic Montage", 720]
|
producttypeids << ["720 - Basic Montage", 720]
|
||||||
producttypeids << ["721 - Advanced Montage", 721]
|
producttypeids << ["721 - Advanced Montage", 721]
|
||||||
producttypeids << ["722 - Basic Video Shoot", 722]
|
producttypeids << ["722 - Basic Video Shoot", 722]
|
||||||
producttypeids << ["723 - Repurposed", 723]
|
producttypeids << ["723 - Repurposed", 723]
|
||||||
producttypeids << ["724 - Repurposed Edit", 724]
|
producttypeids << ["724 - Repurposed Edit", 724]
|
||||||
|
|
||||||
|
if options.empty?
|
||||||
|
return producttypeids
|
||||||
|
else
|
||||||
|
convert_to_hash(producttypeids)[options[:item]]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def voiceoverselection_list
|
def voiceoverselection_list(options={})
|
||||||
voiceoverselections = []
|
voiceoverselections = []
|
||||||
voiceoverselections << ["1 - Male", 1]
|
voiceoverselections << ["1 - Male", 1]
|
||||||
voiceoverselections << ["2 - Female", 2]
|
voiceoverselections << ["2 - Female", 2]
|
||||||
voiceoverselections << ["3 - No Preference", 3]
|
voiceoverselections << ["3 - No Preference", 3]
|
||||||
|
if options.empty?
|
||||||
|
return voiceoverselections
|
||||||
|
else
|
||||||
|
convert_to_hash(voiceoverselections)[options[:item]]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def musicselection_list
|
def musicselection_list(options={})
|
||||||
musicselections = []
|
musicselections = []
|
||||||
musicselections << ["0 - No Preference", 0]
|
musicselections << ["0 - No Preference", 0]
|
||||||
musicselections << ["1 - Easy", 1]
|
musicselections << ["1 - Easy", 1]
|
||||||
@ -24,5 +35,77 @@ module ApplicationHelper
|
|||||||
musicselections << ["4 - New Age", 4]
|
musicselections << ["4 - New Age", 4]
|
||||||
musicselections << ["5 - Positive", 5]
|
musicselections << ["5 - Positive", 5]
|
||||||
musicselections << ["6 - Rock", 6]
|
musicselections << ["6 - Rock", 6]
|
||||||
|
if options.empty?
|
||||||
|
return musicselections
|
||||||
|
else
|
||||||
|
convert_to_hash(musicselections)[options[:item]]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def us_states
|
||||||
|
[
|
||||||
|
['Alabama', 'AL'],
|
||||||
|
['Alaska', 'AK'],
|
||||||
|
['Arizona', 'AZ'],
|
||||||
|
['Arkansas', 'AR'],
|
||||||
|
['California', 'CA'],
|
||||||
|
['Colorado', 'CO'],
|
||||||
|
['Connecticut', 'CT'],
|
||||||
|
['Delaware', 'DE'],
|
||||||
|
['District of Columbia', 'DC'],
|
||||||
|
['Florida', 'FL'],
|
||||||
|
['Georgia', 'GA'],
|
||||||
|
['Hawaii', 'HI'],
|
||||||
|
['Idaho', 'ID'],
|
||||||
|
['Illinois', 'IL'],
|
||||||
|
['Indiana', 'IN'],
|
||||||
|
['Iowa', 'IA'],
|
||||||
|
['Kansas', 'KS'],
|
||||||
|
['Kentucky', 'KY'],
|
||||||
|
['Louisiana', 'LA'],
|
||||||
|
['Maine', 'ME'],
|
||||||
|
['Maryland', 'MD'],
|
||||||
|
['Massachusetts', 'MA'],
|
||||||
|
['Michigan', 'MI'],
|
||||||
|
['Minnesota', 'MN'],
|
||||||
|
['Mississippi', 'MS'],
|
||||||
|
['Missouri', 'MO'],
|
||||||
|
['Montana', 'MT'],
|
||||||
|
['Nebraska', 'NE'],
|
||||||
|
['Nevada', 'NV'],
|
||||||
|
['New Hampshire', 'NH'],
|
||||||
|
['New Jersey', 'NJ'],
|
||||||
|
['New Mexico', 'NM'],
|
||||||
|
['New York', 'NY'],
|
||||||
|
['North Carolina', 'NC'],
|
||||||
|
['North Dakota', 'ND'],
|
||||||
|
['Ohio', 'OH'],
|
||||||
|
['Oklahoma', 'OK'],
|
||||||
|
['Oregon', 'OR'],
|
||||||
|
['Pennsylvania', 'PA'],
|
||||||
|
['Puerto Rico', 'PR'],
|
||||||
|
['Rhode Island', 'RI'],
|
||||||
|
['South Carolina', 'SC'],
|
||||||
|
['South Dakota', 'SD'],
|
||||||
|
['Tennessee', 'TN'],
|
||||||
|
['Texas', 'TX'],
|
||||||
|
['Utah', 'UT'],
|
||||||
|
['Vermont', 'VT'],
|
||||||
|
['Virginia', 'VA'],
|
||||||
|
['Washington', 'WA'],
|
||||||
|
['West Virginia', 'WV'],
|
||||||
|
['Wisconsin', 'WI'],
|
||||||
|
['Wyoming', 'WY']
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
private
|
||||||
|
def convert_to_hash(list)
|
||||||
|
list.map!{|x| x= x[1],x[0]}
|
||||||
|
return Hash[*list.flatten]
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
@ -26,7 +26,9 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-1"></div>
|
<div class="col-md-1"></div>
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
|
<%= frm.input :advertisername,
|
||||||
|
label: 'Advertiser Name',
|
||||||
|
hint: "The name of the company." %>
|
||||||
<%= frm.input :clientid,
|
<%= frm.input :clientid,
|
||||||
label: 'Client ID',
|
label: 'Client ID',
|
||||||
hint: 'An identifier provided by BetterVideo.' %>
|
hint: 'An identifier provided by BetterVideo.' %>
|
||||||
@ -36,9 +38,7 @@
|
|||||||
<%= frm.input :websiteurl,
|
<%= frm.input :websiteurl,
|
||||||
label: 'Website URL',
|
label: 'Website URL',
|
||||||
hint: "Used for script research and may be used in the video if they are including websites in the video graphics." %>
|
hint: "Used for script research and may be used in the video if they are including websites in the video graphics." %>
|
||||||
<%= frm.input :advertisername,
|
|
||||||
label: 'Advertiser Name',
|
|
||||||
hint: "The name of the company." %>
|
|
||||||
<%= frm.input :vpa,
|
<%= frm.input :vpa,
|
||||||
label: 'Client Service Rep',
|
label: 'Client Service Rep',
|
||||||
hint: "This is the full name of the client services representative, as entered in the BetteVideo system associated with this order. This feature is designed for sales reps that are well known to the system. This feature is typically used for automated communication." %>
|
hint: "This is the full name of the client services representative, as entered in the BetteVideo system associated with this order. This feature is designed for sales reps that are well known to the system. This feature is typically used for automated communication." %>
|
||||||
@ -61,7 +61,8 @@
|
|||||||
<%= frm.input :city,
|
<%= frm.input :city,
|
||||||
label: 'City' %>
|
label: 'City' %>
|
||||||
<%= frm.input :state,
|
<%= frm.input :state,
|
||||||
label: 'State' %>
|
label: 'State',
|
||||||
|
collection: us_states%>
|
||||||
<%= frm.input :zip,
|
<%= frm.input :zip,
|
||||||
label: 'ZIP' %>
|
label: 'ZIP' %>
|
||||||
|
|
||||||
@ -80,6 +81,7 @@
|
|||||||
placeholder: "ex: red, white, blue" %>
|
placeholder: "ex: red, white, blue" %>
|
||||||
<%= frm.input :description,
|
<%= frm.input :description,
|
||||||
label: 'Description',
|
label: 'Description',
|
||||||
|
as: 'text',
|
||||||
hint: "Used for script research." %>
|
hint: "Used for script research." %>
|
||||||
<%= frm.input :facebookurl,
|
<%= frm.input :facebookurl,
|
||||||
label: 'Facebook URL',
|
label: 'Facebook URL',
|
||||||
|
@ -1,38 +1,38 @@
|
|||||||
<li>
|
<li>
|
||||||
<p>
|
<span class="videolisting-item">
|
||||||
<strong>videocode</strong>
|
<strong>videocode</strong>
|
||||||
<%= videolisting.videocode %>
|
<span><%= videolisting.videocode %></span>
|
||||||
</p>
|
</span>
|
||||||
<p>
|
<span class="videolisting-item">
|
||||||
<strong>producttypeid</strong>
|
<strong>producttypeid</strong>
|
||||||
<%= videolisting.producttypeid %>
|
<span><%= producttypeid_list item:videolisting.producttypeid %></span>
|
||||||
</p>
|
</span>
|
||||||
<p>
|
<span class="videolisting-item">
|
||||||
<strong>voiceoverselection</strong>
|
<strong>voiceoverselection</strong>
|
||||||
<%= videolisting.voiceoverselection %>
|
<span><%= voiceoverselection_list item:videolisting.voiceoverselection %></span>
|
||||||
</p>
|
</span>
|
||||||
<p>
|
<span class="videolisting-item">
|
||||||
<strong>musicselection</strong>
|
<strong>musicselection</strong>
|
||||||
<%= videolisting.musicselection %>
|
<span><%= musicselection_list item:videolisting.musicselection %></span>
|
||||||
</p>
|
</span>
|
||||||
<p>
|
<span class="videolisting-item">
|
||||||
<strong>clientprovidedscript</strong>
|
<strong>clientprovidedscript</strong>
|
||||||
<%= videolisting.clientprovidedscript %>
|
<span><%= videolisting.clientprovidedscript %></span>
|
||||||
</p>
|
</span>
|
||||||
<p>
|
<span class="videolisting-item">
|
||||||
<strong>keywords</strong>
|
<strong>keywords</strong>
|
||||||
<%= videolisting.keywords %>
|
<span><%= videolisting.keywords %></span>
|
||||||
</p>
|
</span>
|
||||||
<p>
|
<span class="videolisting-item">
|
||||||
<strong>focus</strong>
|
<strong>focus</strong>
|
||||||
<%= videolisting.focus %>
|
<span><%= videolisting.focus %></span>
|
||||||
</p>
|
</span>
|
||||||
<p>
|
<span class="videolisting-item">
|
||||||
<strong>notes</strong>
|
<strong>notes</strong>
|
||||||
<%= videolisting.notes %>
|
<span><%= videolisting.notes %></span>
|
||||||
</p>
|
</span>
|
||||||
<p>
|
<span class="videolisting-item">
|
||||||
<strong>asseturls</strong>
|
<strong>asseturls</strong>
|
||||||
<%= videolisting.asseturls %>
|
<span><%= videolisting.asseturls %></span>
|
||||||
</p>
|
</span>
|
||||||
</li>
|
</li>
|
@ -1,6 +1,6 @@
|
|||||||
<%= link_to 'Show', @campaign %> |
|
<%= link_to 'Show', campaign_path(@campaign.listingcode) %> |
|
||||||
<%= link_to 'Back', campaigns_path %>
|
<%= link_to 'Back', campaigns_path %>
|
||||||
|
|
||||||
<h1>Editing campaign</h1>
|
<h1>Editing <%= @campaign.advertisername %></h1>
|
||||||
|
|
||||||
<%= render 'form' %>
|
<%= render 'form' %>
|
@ -12,47 +12,77 @@
|
|||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="col-md-2"></div>
|
<div class="col-md-2"></div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<strong>Clientid:</strong>
|
<span class="campaign-item">
|
||||||
<%= @campaign.clientid %>
|
<strong>Clientid</strong>
|
||||||
|
<span><%= @campaign.clientid %></span>
|
||||||
|
</span>
|
||||||
|
|
||||||
<strong>Listingcode:</strong>
|
<span class="campaign-item">
|
||||||
<%= @campaign.listingcode %>
|
<strong>Listingcode</strong>
|
||||||
|
<span><%= @campaign.listingcode %></span>
|
||||||
|
</span>
|
||||||
|
|
||||||
<strong>Billingcode:</strong>
|
<span class="campaign-item">
|
||||||
<%= @campaign.billingcode %>
|
<strong>Billingcode</strong>
|
||||||
|
<span><%= @campaign.billingcode %></span>
|
||||||
|
</span>
|
||||||
|
|
||||||
<strong>Address1:</strong>
|
<span class="campaign-item">
|
||||||
<%= @campaign.address %>
|
<strong>Address1</strong>
|
||||||
|
<span><%= @campaign.address %></span>
|
||||||
|
</span>
|
||||||
|
|
||||||
<strong>City:</strong>
|
<span class="campaign-item">
|
||||||
<%= @campaign.city %>
|
<strong>City</strong>
|
||||||
|
<span><%= @campaign.city %></span>
|
||||||
|
</span>
|
||||||
|
|
||||||
<strong>State:</strong>
|
<span class="campaign-item">
|
||||||
<%= @campaign.state %>
|
<strong>State</strong>
|
||||||
|
<span><%= @campaign.state %></span>
|
||||||
|
</span>
|
||||||
|
|
||||||
<strong>Zip:</strong>
|
<span class="campaign-item">
|
||||||
<%= @campaign.zip %>
|
<strong>Zip</strong>
|
||||||
|
<span><%= @campaign.zip %></span>
|
||||||
|
</span>
|
||||||
|
|
||||||
<strong>Email Address:</strong>
|
<span class="campaign-item">
|
||||||
<%= @campaign.emailaddress %>
|
<strong>Email Address</strong>
|
||||||
|
<span><%= @campaign.emailaddress %></span>
|
||||||
|
</span>
|
||||||
|
|
||||||
<strong>Customer First Name:</strong>
|
<span class="campaign-item">
|
||||||
<%= @campaign.customerfirstname %>
|
<strong>Customer First Name</strong>
|
||||||
|
<span><%= @campaign.customerfirstname %></span>
|
||||||
|
</span>
|
||||||
|
|
||||||
<strong>Customer Last Name:</strong>
|
<span class="campaign-item">
|
||||||
<%= @campaign.customerlastname %>
|
<strong>Customer Last Name</strong>
|
||||||
|
<span><%= @campaign.customerlastname %></span>
|
||||||
|
</span>
|
||||||
|
|
||||||
<strong>Businessphone:</strong>
|
<span class="campaign-item">
|
||||||
<%= @campaign.businessphone %>
|
<strong>Businessphone</strong>
|
||||||
|
<span><%= @campaign.businessphone %></span>
|
||||||
|
</span>
|
||||||
|
|
||||||
<strong>Description:</strong>
|
|
||||||
<%= @campaign.description %>
|
|
||||||
|
|
||||||
<strong>Contactphone:</strong>
|
<span class="campaign-item">
|
||||||
<%= @campaign.contactphone %>
|
<strong>Description</strong>
|
||||||
|
<span><%= @campaign.description %></span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span class="campaign-item">
|
||||||
|
<strong>Contactphone</strong>
|
||||||
|
<span><%= @campaign.contactphone %></span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span class="campaign-item">
|
||||||
|
<strong>Websiteurl</strong>
|
||||||
|
<span><%= @campaign.websiteurl %></span>
|
||||||
|
</span>
|
||||||
|
|
||||||
<strong>Websiteurl:</strong>
|
|
||||||
<%= @campaign.websiteurl %>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<ul>
|
<ul>
|
||||||
|
Loading…
Reference in New Issue
Block a user