change defaults

This commit is contained in:
Tyrel Souza 2014-04-24 12:51:50 -04:00
parent 65c10c4909
commit 339a262e06
8 changed files with 11 additions and 20 deletions

View File

@ -9,6 +9,13 @@ class Campaign < ActiveRecord::Base
validates :description, presence: true validates :description, presence: true
validates :productsandservices, presence: true validates :productsandservices, presence: true
def init
self.clientid = 720
end
after_create :send_to_better_video after_create :send_to_better_video
def send_to_better_video def send_to_better_video
#TODO Make API Calls #TODO Make API Calls

View File

@ -1,10 +1,13 @@
class Videolisting < ActiveRecord::Base class Videolisting < ActiveRecord::Base
belongs_to :campaign belongs_to :campaign
validates :videocode, presence: true, uniqueness: true validates :videocode, presence: true, uniqueness: true
validates :producttypeid, presence: true
validates :voiceoverselection, presence: true validates :voiceoverselection, presence: true
validates :musicselection, presence: true validates :musicselection, presence: true
def init
self.producttypeid = 721
end
def asseturls_array def asseturls_array
self.asseturls.split(',').collect { |url| { asseturl: url.strip } } self.asseturls.split(',').collect { |url| { asseturl: url.strip } }

View File

@ -26,9 +26,6 @@
<%= frm.input :listingcode, <%= frm.input :listingcode,
label: 'Listing Code', label: 'Listing Code',
hint: "This should be the same as Intake Form's Form Hash." %> hint: "This should be the same as Intake Form's Form Hash." %>
<%= frm.input :clientid,
label: 'Client ID',
hint: 'An identifier provided by BetterVideo.' %>
<%= frm.input :description, <%= frm.input :description,
label: 'Description', label: 'Description',
as: 'text', as: 'text',

View File

@ -3,10 +3,6 @@
<strong>Video Code</strong> <strong>Video Code</strong>
<span><%= videolisting.videocode %></span> <span><%= videolisting.videocode %></span>
</span> </span>
<span class="videolisting-item">
<strong>Video Type</strong>
<span><%= producttypeid_list item:videolisting.producttypeid %></span>
</span>
<span class="videolisting-item"> <span class="videolisting-item">
<strong>Voiceover Selection</strong> <strong>Voiceover Selection</strong>
<span><%= voiceoverselection_list item:videolisting.voiceoverselection %></span> <span><%= voiceoverselection_list item:videolisting.voiceoverselection %></span>

View File

@ -1,7 +1,5 @@
json.assets videolisting.asseturls_array if videolisting.asseturls_array json.assets videolisting.asseturls_array if videolisting.asseturls_array
json.clientprovidedscript videolisting.clientprovidedscript if videolisting.clientprovidedscript json.clientprovidedscript videolisting.clientprovidedscript if videolisting.clientprovidedscript
json.focus videolisting.focus if videolisting.focus
json.keywords videolisting.keywords if videolisting.keywords
json.musicselection videolisting.musicselection if videolisting.musicselection json.musicselection videolisting.musicselection if videolisting.musicselection
json.notes videolisting.notes if videolisting.notes json.notes videolisting.notes if videolisting.notes
json.producttypeid videolisting.producttypeid if videolisting.producttypeid json.producttypeid videolisting.producttypeid if videolisting.producttypeid

View File

@ -2,10 +2,6 @@
<%= f.input :videocode, <%= f.input :videocode,
label: 'Video Code', label: 'Video Code',
hint: "Unique identifier for every video." %> hint: "Unique identifier for every video." %>
<%= f.input :producttypeid,
label: "Product Type",
collection: producttypeid_list,
hint: "What type of content to create for this video. The types available are dependant on the pre-defined list of products." %>
<%= f.input :voiceoverselection, <%= f.input :voiceoverselection,
label: 'Voiceover Selection', label: 'Voiceover Selection',
collection: voiceoverselection_list, collection: voiceoverselection_list,

View File

@ -4,7 +4,6 @@
<tr> <tr>
<th>Listing Code(Form Hash)</th> <th>Listing Code(Form Hash)</th>
<th>Processed?</th> <th>Processed?</th>
<th>Client ID</th>
<th>Billing Code</th> <th>Billing Code</th>
<th>Address</th> <th>Address</th>
<th>City</th> <th>City</th>
@ -20,7 +19,6 @@
<tr> <tr>
<td><%= link_to campaign.listingcode, campaign_path(campaign.listingcode) %></td> <td><%= link_to campaign.listingcode, campaign_path(campaign.listingcode) %></td>
<td><i class="glyphicon glyphicon-<% if campaign.processed? %>ok<% else %>remove<% end %>"></i> </td> <td><i class="glyphicon glyphicon-<% if campaign.processed? %>ok<% else %>remove<% end %>"></i> </td>
<td><%= campaign.clientid %></td>
<td><%= campaign.billingcode %></td> <td><%= campaign.billingcode %></td>
<td><%= campaign.address %></td> <td><%= campaign.address %></td>
<td><%= campaign.city %></td> <td><%= campaign.city %></td>

View File

@ -14,10 +14,6 @@
<strong>Listing Code</strong> <strong>Listing Code</strong>
<span><%= @campaign.listingcode %></span> <span><%= @campaign.listingcode %></span>
</span> </span>
<span class="campaign-item">
<strong>Client Id</strong>
<span><%= @campaign.clientid %></span>
</span>
<span class="campaign-item"> <span class="campaign-item">
<strong>Description</strong> <strong>Description</strong>
<span><%= @campaign.description %></span> <span><%= @campaign.description %></span>