update gemfile for heroku

This commit is contained in:
Tyrel Souza 2014-04-29 13:03:46 -04:00
parent 6419de529d
commit 31ff82a5d3
13 changed files with 43 additions and 26 deletions

View File

@ -24,7 +24,7 @@ gem 'jbuilder'
gem 'bootstrap-tagsinput-rails' gem 'bootstrap-tagsinput-rails'
gem 'cocoon', :git => 'git://github.com/nathanvda/cocoon' gem 'cocoon', :git => 'git://github.com/nathanvda/cocoon'
gem 'zeroclipboard-rails' gem 'zeroclipboard-rails'
gem 'unicorn' gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'
group :development do group :development do

View File

@ -1,3 +1,11 @@
GIT
remote: git://github.com/ctran/annotate_models.git
revision: c60fa282d74051e2fb5d41b600f919a39d9edcb4
specs:
annotate (2.6.3)
activerecord (>= 2.3.0)
rake (>= 0.8.7)
GIT GIT
remote: git://github.com/nathanvda/cocoon remote: git://github.com/nathanvda/cocoon
revision: 3735fecd19199e8331f14ef2056b92de3509ad12 revision: 3735fecd19199e8331f14ef2056b92de3509ad12
@ -92,9 +100,11 @@ GEM
thread_safe (~> 0.1) thread_safe (~> 0.1)
warden (~> 1.2.3) warden (~> 1.2.3)
diff-lcs (1.2.5) diff-lcs (1.2.5)
dotenv (0.10.0) dotenv (0.11.1)
dotenv-rails (0.10.0) dotenv-deployment (~> 0.0.2)
dotenv (= 0.10.0) dotenv-deployment (0.0.2)
dotenv-rails (0.11.1)
dotenv (= 0.11.1)
email_validator (1.4.0) email_validator (1.4.0)
activemodel activemodel
erubis (2.7.0) erubis (2.7.0)
@ -128,7 +138,7 @@ GEM
mime-types (1.25.1) mime-types (1.25.1)
mini_portile (0.5.3) mini_portile (0.5.3)
minitest (5.3.3) minitest (5.3.3)
multi_json (1.9.2) multi_json (1.9.3)
nokogiri (1.6.1) nokogiri (1.6.1)
mini_portile (~> 0.5.0) mini_portile (~> 0.5.0)
orm_adapter (0.5.0) orm_adapter (0.5.0)
@ -175,7 +185,7 @@ GEM
rspec-core (~> 2.14.0) rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0) rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0) rspec-mocks (~> 2.14.0)
safe_yaml (1.0.2) safe_yaml (1.0.3)
sass (3.2.19) sass (3.2.19)
sass-rails (4.0.3) sass-rails (4.0.3)
railties (>= 4.0.0, < 5.0) railties (>= 4.0.0, < 5.0)
@ -235,6 +245,7 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
airbrake airbrake
annotate!
awesome_print awesome_print
better_errors better_errors
binding_of_caller binding_of_caller

View File

@ -17,7 +17,7 @@ class CampaignsController < ApplicationController
end end
def edit def edit
if @campaign.processed if @campaign.sent
redirect_to campaign_path(@campaign.listingcode), notice: 'Campaign has been submitted, Cannot edit.' redirect_to campaign_path(@campaign.listingcode), notice: 'Campaign has been submitted, Cannot edit.'
end end
@action = campaign_path(@campaign.listingcode) @action = campaign_path(@campaign.listingcode)
@ -39,6 +39,9 @@ class CampaignsController < ApplicationController
def update def update
if @campaign.update(campaign_params) if @campaign.update(campaign_params)
if params[:send]
@campaign.update({sent: true})
end
redirect_to campaign_path(@campaign.listingcode), notice: 'Campaign was successfully updated.' redirect_to campaign_path(@campaign.listingcode), notice: 'Campaign was successfully updated.'
else else
show_errors('edit') show_errors('edit')

View File

@ -4,7 +4,7 @@ class VideolistingsController < ApplicationController
def publish def publish
if @videolisting.published? if @videolisting.published?
@message = "Campaign Already Published." @message = "Campaign Already Published."
elsif @videolisting.campaign.processed? elsif @videolisting.campaign.sent?
@videolisting.published = true @videolisting.published = true
@videolisting.save @videolisting.save

View File

@ -24,7 +24,7 @@ class Campaign < ActiveRecord::Base
end end
def send_to_better_video def send_to_better_video
if self.processed_changed? && self.processed == true if self.sent_changed? && self.sent? == true
#TODO Make API Calls #TODO Make API Calls
end end
end end

View File

@ -94,6 +94,7 @@
</div> </div>
<div class="actions"> <div class="actions">
<%= frm.submit %> <%= frm.submit "Save For Later", :name => "save" %>
<%= frm.submit "Publish", :name => "send", data: { confirm: 'Once you send to BetterVideo, you cannot edit again. Are you sure?' } %>
</div> </div>
<% end %> <% end %>

View File

@ -7,7 +7,7 @@
<tr> <tr>
<th>Listing Code (Form Hash)</th> <th>Listing Code (Form Hash)</th>
<th>Advertiser</th> <th>Advertiser</th>
<th>Processed?</th> <th>Sent?</th>
<th>Percent of Videos Completed</th> <th>Percent of Videos Completed</th>
<th>Address</th> <th>Address</th>
<th>City</th> <th>City</th>
@ -22,13 +22,13 @@
<tr> <tr>
<td><%= link_to campaign.listingcode, campaign_path(campaign.listingcode) %></td> <td><%= link_to campaign.listingcode, campaign_path(campaign.listingcode) %></td>
<td><%= campaign.advertisername %></td> <td><%= campaign.advertisername %></td>
<td><i class="glyphicon glyphicon-<% if campaign.processed? %>ok<% else %>remove<% end %>"></i> </td> <td><i class="glyphicon glyphicon-<% if campaign.sent? %>ok<% else %>remove<% end %>"></i> </td>
<td><%= number_to_percentage(campaign.video_completion_percent, precision: 0) %></td> <td><%= number_to_percentage(campaign.video_completion_percent, precision: 0) %></td>
<td><%= campaign.address %></td> <td><%= campaign.address %></td>
<td><%= campaign.city %></td> <td><%= campaign.city %></td>
<td><%= campaign.state %></td> <td><%= campaign.state %></td>
<td><%= campaign.zip %></td> <td><%= campaign.zip %></td>
<td><%= link_to 'Edit', edit_campaign_path(campaign.listingcode) %></td> <td><%= link_to 'Edit', edit_campaign_path(campaign.listingcode) unless campaign.sent %></td>
<td><%= link_to 'Destroy', campaign_path(campaign.listingcode), method: :delete, data: { confirm: 'Are you sure?' } %></td> <td><%= link_to 'Destroy', campaign_path(campaign.listingcode), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr> </tr>
<% end %> <% end %>

View File

@ -11,12 +11,12 @@
</div> </div>
<div class="navbar-collapse collapse"> <div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<% if user_signed_in? %> <% if user_signed_in? %>
<li><%= link_to "Profile", edit_user_registration_path %></li> <li><%= link_to "Profile", edit_user_registration_path %></li>
<li><%= link_to "Logout", destroy_user_session_path, :method => :delete %></li> <li><%= link_to "Logout", destroy_user_session_path, :method => :delete %></li>
<% else %> <% else %>
<li><%= link_to "Sign in", new_user_session_path %></li> <li><%= link_to "Sign in", new_user_session_path %></li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -17,9 +17,7 @@
<button class='clip_button' data-clipboard-target='videocode' data-clipboard-text='<%= @videolisting.videocode %>' id='clip_button' title='Click me to copy to clipboard.'> <button class='clip_button' data-clipboard-target='videocode' data-clipboard-text='<%= @videolisting.videocode %>' id='clip_button' title='Click me to copy to clipboard.'>
<b>Copy To Clipboard...</b> <b>Copy To Clipboard...</b>
</button> </button>
<hr> <hr>
<h3>Preview Image</h3> <h3>Preview Image</h3>
<%= image_tag(@videolisting.get_preview_url) %> <%= image_tag(@videolisting.get_preview_url) %>

View File

@ -0,0 +1,5 @@
class RemovePublishedFromCampaign < ActiveRecord::Migration
def change
remove_column :campaigns, :processed
end
end

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20140425201114) do ActiveRecord::Schema.define(version: 20140429154347) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@ -51,7 +51,6 @@ ActiveRecord::Schema.define(version: 20140425201114) do
t.string "websiteurl" t.string "websiteurl"
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.boolean "processed"
t.boolean "sent", default: false t.boolean "sent", default: false
t.string "awards" t.string "awards"
t.string "background" t.string "background"

View File

@ -79,9 +79,9 @@ describe CampaignsController do
#line 63 camp_controller #line 63 camp_controller
end end
it "doesn't allow edits on an already published campaign" do it "doesn't allow edits on an already sent campaign" do
camp = FactoryGirl.create(:campaign) camp = FactoryGirl.create(:campaign)
camp.processed = true camp.sent = true
camp.save camp.save
get :edit, listingcode: camp.listingcode get :edit, listingcode: camp.listingcode
expect(response.status).to eq 302 expect(response.status).to eq 302

View File

@ -25,7 +25,7 @@ FactoryGirl.define do
vpa "John Smith" vpa "John Smith"
websiteurl "bobsbbq.com" websiteurl "bobsbbq.com"
zip "90200" zip "90200"
processed false sent false
after(:build) do |campaign, evaluator| after(:build) do |campaign, evaluator|
video = FactoryGirl.create(:videolisting) video = FactoryGirl.create(:videolisting)
campaign.videolistings << video campaign.videolistings << video