Initial Commit

This commit is contained in:
Tyrel Souza 2014-04-07 14:41:34 -04:00
commit 2d56a97674
95 changed files with 1875 additions and 0 deletions

13
.gitignore vendored Normal file
View File

@ -0,0 +1,13 @@
!.keep
*.DS_Store
*.swo
*.swp
/.bundle
/.env
/.foreman
/coverage/*
/db/*.sqlite3
/log/*
/public/system
/tags
/tmp/*

1
.rspec Normal file
View File

@ -0,0 +1 @@
--color

1
.ruby-version Normal file
View File

@ -0,0 +1 @@
2.1.0

3
.sample.env Normal file
View File

@ -0,0 +1,3 @@
# http://ddollar.github.com/foreman/
RACK_ENV=development
SECRET_KEY_BASE=development_secret

13
.travis.yml Normal file
View File

@ -0,0 +1,13 @@
before_script:
- cp .sample.env .env
branches:
only:
- master
cache: bundler
language: ruby
notifications:
campfire:
on_success: change
on_failure: always
template: '%{repository_name} build #%{build_number} on %{branch} by %{author} finished: %{message}: %{build_url}'
rvm: ruby-2.1.0

50
Gemfile Normal file
View File

@ -0,0 +1,50 @@
source 'https://rubygems.org'
ruby '2.1.0'
gem 'airbrake'
gem 'bourbon'
gem 'coffee-rails'
gem 'delayed_job_active_record', '>= 4.0.0'
gem 'email_validator'
gem 'flutie'
gem 'high_voltage'
gem 'jquery-rails'
gem 'neat'
gem 'pg'
gem 'rack-timeout'
gem 'rails', '>= 4.0.3'
gem 'recipient_interceptor'
gem 'sass-rails'
gem 'simple_form'
gem 'title'
gem 'uglifier'
gem 'unicorn'
group :development do
gem 'foreman'
gem 'spring'
gem 'spring-commands-rspec'
end
group :development, :test do
gem 'awesome_print'
gem 'dotenv-rails'
gem 'factory_girl_rails'
gem 'pry-rails'
gem 'rspec-rails', '>= 2.14'
end
group :test do
gem 'capybara-webkit', '>= 1.0.0'
gem 'database_cleaner'
gem 'launchy'
gem 'shoulda-matchers'
gem 'simplecov', require: false
gem 'timecop'
gem 'webmock'
end
group :staging, :production do
gem 'newrelic_rpm', '>= 3.7.3'
end

236
Gemfile.lock Normal file
View File

@ -0,0 +1,236 @@
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.0.4)
actionpack (= 4.0.4)
mail (~> 2.5.4)
actionpack (4.0.4)
activesupport (= 4.0.4)
builder (~> 3.1.0)
erubis (~> 2.7.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.4)
activesupport (= 4.0.4)
builder (~> 3.1.0)
activerecord (4.0.4)
activemodel (= 4.0.4)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.4)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.4)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
addressable (2.3.6)
airbrake (3.1.16)
builder
multi_json
arel (4.0.2)
awesome_print (1.2.0)
bourbon (3.1.8)
sass (>= 3.2.0)
thor
builder (3.1.4)
capybara (2.1.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
capybara-webkit (1.1.1)
capybara (>= 2.0.2, < 2.2.0)
json
coderay (1.1.0)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.7.0)
crack (0.4.2)
safe_yaml (~> 1.0.0)
database_cleaner (1.2.0)
delayed_job (4.0.0)
activesupport (>= 3.0, < 4.1)
delayed_job_active_record (4.0.0)
activerecord (>= 3.0, < 4.1)
delayed_job (>= 3.0, < 4.1)
diff-lcs (1.2.5)
docile (1.1.3)
dotenv (0.10.0)
dotenv-rails (0.10.0)
dotenv (= 0.10.0)
email_validator (1.4.0)
activemodel
erubis (2.7.0)
execjs (2.0.2)
factory_girl (4.4.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.4.1)
factory_girl (~> 4.4.0)
railties (>= 3.0.0)
flutie (2.0.0)
foreman (0.63.0)
dotenv (>= 0.7)
thor (>= 0.13.6)
high_voltage (2.1.0)
hike (1.2.3)
i18n (0.6.9)
jquery-rails (3.1.0)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.1)
kgio (2.9.2)
launchy (2.4.2)
addressable (~> 2.3)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
method_source (0.8.2)
mime-types (1.25.1)
mini_portile (0.5.3)
minitest (4.7.5)
multi_json (1.9.2)
neat (1.6.0)
bourbon (>= 3.1)
sass (>= 3.3)
newrelic_rpm (3.7.3.204)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
pg (0.17.1)
polyglot (0.3.4)
pry (0.9.12.6)
coderay (~> 1.0)
method_source (~> 0.8)
slop (~> 3.4)
pry-rails (0.3.2)
pry (>= 0.9.10)
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
rack-timeout (0.0.4)
rails (4.0.4)
actionmailer (= 4.0.4)
actionpack (= 4.0.4)
activerecord (= 4.0.4)
activesupport (= 4.0.4)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.4)
sprockets-rails (~> 2.0.0)
railties (4.0.4)
actionpack (= 4.0.4)
activesupport (= 4.0.4)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.13.0)
rake (10.2.2)
recipient_interceptor (0.1.2)
mail
rspec-core (2.14.8)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.6)
rspec-rails (2.14.2)
actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
safe_yaml (1.0.2)
sass (3.3.4)
sass-rails (4.0.1)
railties (>= 4.0.0, < 5.0)
sass (>= 3.1.10)
sprockets-rails (~> 2.0.0)
shoulda-matchers (2.5.0)
activesupport (>= 3.0.0)
simple_form (3.0.1)
actionpack (>= 4.0.0, < 4.1)
activemodel (>= 4.0.0, < 4.1)
simplecov (0.8.2)
docile (~> 1.1.0)
multi_json
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
slop (3.5.0)
spring (1.1.2)
spring-commands-rspec (1.0.1)
spring (>= 0.9.1)
sprockets (2.12.0)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.0.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
thor (0.19.1)
thread_safe (0.3.3)
tilt (1.4.1)
timecop (0.7.1)
title (0.0.4)
i18n
rails (>= 3.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.39)
uglifier (2.5.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
unicorn (4.8.2)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
webmock (1.17.4)
addressable (>= 2.2.7)
crack (>= 0.3.2)
xpath (2.0.0)
nokogiri (~> 1.3)
PLATFORMS
ruby
DEPENDENCIES
airbrake
awesome_print
bourbon
capybara-webkit (>= 1.0.0)
coffee-rails
database_cleaner
delayed_job_active_record (>= 4.0.0)
dotenv-rails
email_validator
factory_girl_rails
flutie
foreman
high_voltage
jquery-rails
launchy
neat
newrelic_rpm (>= 3.7.3)
pg
pry-rails
rack-timeout
rails (>= 4.0.3)
recipient_interceptor
rspec-rails (>= 2.14)
sass-rails
shoulda-matchers
simple_form
simplecov
spring
spring-commands-rspec
timecop
title
uglifier
unicorn
webmock

2
Procfile Normal file
View File

@ -0,0 +1,2 @@
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
worker: bundle exec rake jobs:work

25
README.md Normal file
View File

@ -0,0 +1,25 @@
Vidpush
=======
Getting Started
---------------
This repository comes equipped with a self-setup script:
% ./bin/setup
After setting up, you can run the application using [foreman]:
% foreman start
[foreman]: http://ddollar.github.io/foreman/
Guidelines
----------
Use the following guides for getting things done, programming well, and
programming in style.
* [Protocol](http://github.com/thoughtbot/guides/blob/master/protocol)
* [Best Practices](http://github.com/thoughtbot/guides/blob/master/best-practices)
* [Style](http://github.com/thoughtbot/guides/blob/master/style)

23
Rakefile Normal file
View File

@ -0,0 +1,23 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
Vidpush::Application.load_tasks
if defined?(RSpec)
task(:spec).clear
desc 'Run all specs'
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = '--tag ~factory'
end
desc 'Run factory specs.'
RSpec::Core::RakeTask.new(:factory_specs) do |t|
t.pattern = './spec/models/factories_spec.rb'
end
task spec: :factory_specs
end
task(:default).clear
task :default => [:spec]

0
app/assets/images/.keep Normal file
View File

View File

@ -0,0 +1,15 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require_tree .

View File

@ -0,0 +1,8 @@
@charset 'utf-8';
///////////////////////////////////////////////////////////////////////////////
@import 'bourbon';
@import 'neat';
///////////////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,5 @@
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end

View File

@ -0,0 +1,58 @@
class CampaignsController < ApplicationController
before_action :set_campaign, only: [:show, :edit, :update, :destroy]
# GET /campaigns
def index
@campaigns = Campaign.all
end
# GET /campaigns/1
def show
end
# GET /campaigns/new
def new
@campaign = Campaign.new
end
# GET /campaigns/1/edit
def edit
end
# POST /campaigns
def create
@campaign = Campaign.new(campaign_params)
if @campaign.save
redirect_to @campaign, notice: 'Campaign was successfully created.'
else
render action: 'new'
end
end
# PATCH/PUT /campaigns/1
def update
if @campaign.update(campaign_params)
redirect_to @campaign, notice: 'Campaign was successfully updated.'
else
render action: 'edit'
end
end
# DELETE /campaigns/1
def destroy
@campaign.destroy
redirect_to campaigns_url, notice: 'Campaign was successfully destroyed.'
end
private
# Use callbacks to share common setup or constraints between actions.
def set_campaign
@campaign = Campaign.find(params[:id])
end
# Only allow a trusted parameter "white list" through.
def campaign_params
params.require(:campaign).permit(:clientid, :listingcode, :billingcode, :advertisername, :address1, :address2, :city, :state, :zip, :emailaddress, :customerfirstname, :customerlastname, :salesrep, :salesrepemail, :businessphone, :contactphone, :websiteurl)
end
end

View File

View File

@ -0,0 +1,58 @@
class VideolistingsController < ApplicationController
before_action :set_videolisting, only: [:show, :edit, :update, :destroy]
# GET /videolistings
def index
@videolistings = Videolisting.all
end
# GET /videolistings/1
def show
end
# GET /videolistings/new
def new
@videolisting = Videolisting.new
end
# GET /videolistings/1/edit
def edit
end
# POST /videolistings
def create
@videolisting = Videolisting.new(videolisting_params)
if @videolisting.save
redirect_to @videolisting, notice: 'Videolisting was successfully created.'
else
render action: 'new'
end
end
# PATCH/PUT /videolistings/1
def update
if @videolisting.update(videolisting_params)
redirect_to @videolisting, notice: 'Videolisting was successfully updated.'
else
render action: 'edit'
end
end
# DELETE /videolistings/1
def destroy
@videolisting.destroy
redirect_to videolistings_url, notice: 'Videolisting was successfully destroyed.'
end
private
# Use callbacks to share common setup or constraints between actions.
def set_videolisting
@videolisting = Videolisting.find(params[:id])
end
# Only allow a trusted parameter "white list" through.
def videolisting_params
params.require(:videolisting).permit(:videocode, :producttypeid, :remoteassetsarchive, :voiceoverselection, :musicselection, :clientprovidedscript, :keywords, :focus, :notes, :asseturls)
end
end

View File

@ -0,0 +1,2 @@
module ApplicationHelper
end

0
app/mailers/.keep Normal file
View File

0
app/models/.keep Normal file
View File

4
app/models/campaign.rb Normal file
View File

@ -0,0 +1,4 @@
class Campaign < ActiveRecord::Base
has_many :videolistings
accepts_nested_attributes_for :videolistings
end

View File

View File

@ -0,0 +1,3 @@
class Videolisting < ActiveRecord::Base
belongs_to :campaign
end

View File

@ -0,0 +1,5 @@
<div id="flash">
<% flash.each do |key, value| -%>
<div id="flash_<%= key %>"><%= value %></div>
<% end -%>
</div>

View File

@ -0,0 +1,10 @@
<%= javascript_include_tag :application %>
<%= yield :javascript %>
<% if Rails.env.test? %>
<%= javascript_tag do %>
$.fx.off = true;
$.ajaxSetup({ async: false });
<% end %>
<% end %>

View File

@ -0,0 +1,85 @@
<%= form_for(@campaign) do |f| %>
<% if @campaign.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@campaign.errors.count, "error") %> prohibited this campaign from being saved:</h2>
<ul>
<% @campaign.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :clientid %><br>
<%= f.text_field :clientid %>
</div>
<div class="field">
<%= f.label :listingcode %><br>
<%= f.text_field :listingcode %>
</div>
<div class="field">
<%= f.label :billingcode %><br>
<%= f.text_field :billingcode %>
</div>
<div class="field">
<%= f.label :advertisername %><br>
<%= f.text_field :advertisername %>
</div>
<div class="field">
<%= f.label :address1 %><br>
<%= f.text_field :address1 %>
</div>
<div class="field">
<%= f.label :address2 %><br>
<%= f.text_field :address2 %>
</div>
<div class="field">
<%= f.label :city %><br>
<%= f.text_field :city %>
</div>
<div class="field">
<%= f.label :state %><br>
<%= f.text_field :state %>
</div>
<div class="field">
<%= f.label :zip %><br>
<%= f.text_field :zip %>
</div>
<div class="field">
<%= f.label :emailaddress %><br>
<%= f.text_field :emailaddress %>
</div>
<div class="field">
<%= f.label :customerfirstname %><br>
<%= f.text_field :customerfirstname %>
</div>
<div class="field">
<%= f.label :customerlastname %><br>
<%= f.text_field :customerlastname %>
</div>
<div class="field">
<%= f.label :salesrep %><br>
<%= f.text_field :salesrep %>
</div>
<div class="field">
<%= f.label :salesrepemail %><br>
<%= f.text_field :salesrepemail %>
</div>
<div class="field">
<%= f.label :businessphone %><br>
<%= f.text_field :businessphone %>
</div>
<div class="field">
<%= f.label :contactphone %><br>
<%= f.text_field :contactphone %>
</div>
<div class="field">
<%= f.label :websiteurl %><br>
<%= f.text_field :websiteurl %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>

View File

@ -0,0 +1,6 @@
<h1>Editing campaign</h1>
<%= render 'form' %>
<%= link_to 'Show', @campaign %> |
<%= link_to 'Back', campaigns_path %>

View File

@ -0,0 +1,59 @@
<h1>Listing campaigns</h1>
<table>
<thead>
<tr>
<th>Clientid</th>
<th>Listingcode</th>
<th>Billingcode</th>
<th>Advertisername</th>
<th>Address1</th>
<th>Address2</th>
<th>City</th>
<th>State</th>
<th>Zip</th>
<th>Emailaddress</th>
<th>Customerfirstname</th>
<th>Customerlastname</th>
<th>Salesrep</th>
<th>Salesrepemail</th>
<th>Businessphone</th>
<th>Contactphone</th>
<th>Websiteurl</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% @campaigns.each do |campaign| %>
<tr>
<td><%= campaign.clientid %></td>
<td><%= campaign.listingcode %></td>
<td><%= campaign.billingcode %></td>
<td><%= campaign.advertisername %></td>
<td><%= campaign.address1 %></td>
<td><%= campaign.address2 %></td>
<td><%= campaign.city %></td>
<td><%= campaign.state %></td>
<td><%= campaign.zip %></td>
<td><%= campaign.emailaddress %></td>
<td><%= campaign.customerfirstname %></td>
<td><%= campaign.customerlastname %></td>
<td><%= campaign.salesrep %></td>
<td><%= campaign.salesrepemail %></td>
<td><%= campaign.businessphone %></td>
<td><%= campaign.contactphone %></td>
<td><%= campaign.websiteurl %></td>
<td><%= link_to 'Show', campaign %></td>
<td><%= link_to 'Edit', edit_campaign_path(campaign) %></td>
<td><%= link_to 'Destroy', campaign, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Campaign', new_campaign_path %>

View File

@ -0,0 +1,5 @@
<h1>New campaign</h1>
<%= render 'form' %>
<%= link_to 'Back', campaigns_path %>

View File

@ -0,0 +1,89 @@
<p id="notice"><%= notice %></p>
<p>
<strong>Clientid:</strong>
<%= @campaign.clientid %>
</p>
<p>
<strong>Listingcode:</strong>
<%= @campaign.listingcode %>
</p>
<p>
<strong>Billingcode:</strong>
<%= @campaign.billingcode %>
</p>
<p>
<strong>Advertisername:</strong>
<%= @campaign.advertisername %>
</p>
<p>
<strong>Address1:</strong>
<%= @campaign.address1 %>
</p>
<p>
<strong>Address2:</strong>
<%= @campaign.address2 %>
</p>
<p>
<strong>City:</strong>
<%= @campaign.city %>
</p>
<p>
<strong>State:</strong>
<%= @campaign.state %>
</p>
<p>
<strong>Zip:</strong>
<%= @campaign.zip %>
</p>
<p>
<strong>Emailaddress:</strong>
<%= @campaign.emailaddress %>
</p>
<p>
<strong>Customerfirstname:</strong>
<%= @campaign.customerfirstname %>
</p>
<p>
<strong>Customerlastname:</strong>
<%= @campaign.customerlastname %>
</p>
<p>
<strong>Salesrep:</strong>
<%= @campaign.salesrep %>
</p>
<p>
<strong>Salesrepemail:</strong>
<%= @campaign.salesrepemail %>
</p>
<p>
<strong>Businessphone:</strong>
<%= @campaign.businessphone %>
</p>
<p>
<strong>Contactphone:</strong>
<%= @campaign.contactphone %>
</p>
<p>
<strong>Websiteurl:</strong>
<%= @campaign.websiteurl %>
</p>
<%= link_to 'Edit', edit_campaign_path(@campaign) %> |
<%= link_to 'Back', campaigns_path %>

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="ROBOTS" content="NOODP" />
<title><%= title %></title>
<%= stylesheet_link_tag :application, :media => 'all' %>
<%= csrf_meta_tags %>
</head>
<body class="<%= body_class %>">
<%= render 'flashes' -%>
<%= yield %>
<%= render 'javascript' %>
</body>
</html>

0
app/views/pages/.keep Normal file
View File

View File

@ -0,0 +1,57 @@
<%= form_for(@videolisting) do |f| %>
<% if @videolisting.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@videolisting.errors.count, "error") %> prohibited this videolisting from being saved:</h2>
<ul>
<% @videolisting.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :videocode %><br>
<%= f.text_field :videocode %>
</div>
<div class="field">
<%= f.label :producttypeid %><br>
<%= f.text_field :producttypeid %>
</div>
<div class="field">
<%= f.label :remoteassetsarchive %><br>
<%= f.text_field :remoteassetsarchive %>
</div>
<div class="field">
<%= f.label :voiceoverselection %><br>
<%= f.text_field :voiceoverselection %>
</div>
<div class="field">
<%= f.label :musicselection %><br>
<%= f.text_field :musicselection %>
</div>
<div class="field">
<%= f.label :clientprovidedscript %><br>
<%= f.text_field :clientprovidedscript %>
</div>
<div class="field">
<%= f.label :keywords %><br>
<%= f.text_field :keywords %>
</div>
<div class="field">
<%= f.label :focus %><br>
<%= f.text_field :focus %>
</div>
<div class="field">
<%= f.label :notes %><br>
<%= f.text_field :notes %>
</div>
<div class="field">
<%= f.label :asseturls %><br>
<%= f.text_field :asseturls %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>

View File

@ -0,0 +1,6 @@
<h1>Editing videolisting</h1>
<%= render 'form' %>
<%= link_to 'Show', @videolisting %> |
<%= link_to 'Back', videolistings_path %>

View File

@ -0,0 +1,45 @@
<h1>Listing videolistings</h1>
<table>
<thead>
<tr>
<th>Videocode</th>
<th>Producttypeid</th>
<th>Remoteassetsarchive</th>
<th>Voiceoverselection</th>
<th>Musicselection</th>
<th>Clientprovidedscript</th>
<th>Keywords</th>
<th>Focus</th>
<th>Notes</th>
<th>Asseturls</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% @videolistings.each do |videolisting| %>
<tr>
<td><%= videolisting.videocode %></td>
<td><%= videolisting.producttypeid %></td>
<td><%= videolisting.remoteassetsarchive %></td>
<td><%= videolisting.voiceoverselection %></td>
<td><%= videolisting.musicselection %></td>
<td><%= videolisting.clientprovidedscript %></td>
<td><%= videolisting.keywords %></td>
<td><%= videolisting.focus %></td>
<td><%= videolisting.notes %></td>
<td><%= videolisting.asseturls %></td>
<td><%= link_to 'Show', videolisting %></td>
<td><%= link_to 'Edit', edit_videolisting_path(videolisting) %></td>
<td><%= link_to 'Destroy', videolisting, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Videolisting', new_videolisting_path %>

View File

@ -0,0 +1,5 @@
<h1>New videolisting</h1>
<%= render 'form' %>
<%= link_to 'Back', videolistings_path %>

View File

@ -0,0 +1,54 @@
<p id="notice"><%= notice %></p>
<p>
<strong>Videocode:</strong>
<%= @videolisting.videocode %>
</p>
<p>
<strong>Producttypeid:</strong>
<%= @videolisting.producttypeid %>
</p>
<p>
<strong>Remoteassetsarchive:</strong>
<%= @videolisting.remoteassetsarchive %>
</p>
<p>
<strong>Voiceoverselection:</strong>
<%= @videolisting.voiceoverselection %>
</p>
<p>
<strong>Musicselection:</strong>
<%= @videolisting.musicselection %>
</p>
<p>
<strong>Clientprovidedscript:</strong>
<%= @videolisting.clientprovidedscript %>
</p>
<p>
<strong>Keywords:</strong>
<%= @videolisting.keywords %>
</p>
<p>
<strong>Focus:</strong>
<%= @videolisting.focus %>
</p>
<p>
<strong>Notes:</strong>
<%= @videolisting.notes %>
</p>
<p>
<strong>Asseturls:</strong>
<%= @videolisting.asseturls %>
</p>
<%= link_to 'Edit', edit_videolisting_path(@videolisting) %> |
<%= link_to 'Back', videolistings_path %>

3
bin/bundle Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle')

5
bin/delayed_job Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env ruby
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
require 'delayed/command'
Delayed::Command.new(ARGV).daemonize

4
bin/rails Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'

4
bin/rake Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env ruby
require_relative '../config/boot'
require 'rake'
Rake.application.run

32
bin/setup Executable file
View File

@ -0,0 +1,32 @@
#!/usr/bin/env sh
# Set up Rails app. Run this script immediately after cloning the codebase.
# https://github.com/thoughtbot/guides/tree/master/protocol
# Exit if any subcommand fails
set -e
# Set up Ruby dependencies via Bundler
bundle install
# Set up database and add any development seed data
bundle exec rake dev:prime
# Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv
mkdir -p .git/safe
# Set up configurable environment variables
if [ ! -f .env ]; then
cp .sample.env .env
fi
# Pick a port for Foreman
echo "port: 7000" > .foreman
# Set up DNS via Pow
if [ -d ~/.pow ]
then
echo 7000 > ~/.pow/`basename $PWD`
else
echo "Pow not set up but the team uses it for this project. Setup: http://goo.gl/RaDPO"
fi

4
config.ru Normal file
View File

@ -0,0 +1,4 @@
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run Rails.application

42
config/application.rb Normal file
View File

@ -0,0 +1,42 @@
require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
module Vidpush
class Application < Rails::Application
config.i18n.enforce_available_locales = true
config.active_record.default_timezone = :utc
config.generators do |generate|
generate.helper false
generate.javascript_engine false
generate.request_specs false
generate.routing_specs false
generate.stylesheets false
generate.test_framework :rspec
generate.view_specs false
end
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
end
end

4
config/boot.rb Normal file
View File

@ -0,0 +1,4 @@
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])

11
config/database.yml Normal file
View File

@ -0,0 +1,11 @@
development: &default
adapter: postgresql
database: vidpush_development
encoding: utf8
min_messages: warning
pool: 2
timeout: 5000
test:
<<: *default
database: vidpush_test

5
config/environment.rb Normal file
View File

@ -0,0 +1,5 @@
# Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Vidpush::Application.initialize!

View File

@ -0,0 +1,35 @@
Vidpush::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = true
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
# Raise an ActionController::UnpermittedParameters exception when
# a parameter is not explcitly permitted but is passed anyway.
config.action_controller.action_on_unpermitted_parameters = :raise
config.action_mailer.default_url_options = { host: 'vidpush.local' }
end

View File

@ -0,0 +1,89 @@
require Rails.root.join('config/initializers/smtp')
Vidpush::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both thread web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
# config.action_dispatch.rack_cache = true
# Disable Rails's static asset server (Apache or nginx will already do this).
config.serve_static_assets = false
# Enable deflate / gzip compression of controller-generated responses
config.middleware.use Rack::Deflater
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Generate digests for assets URLs.
config.assets.digest = true
# Version of your assets, change this if you want to expire all your assets.
config.assets.version = '1.0'
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# Set to :debug to see everything in the log.
config.log_level = :info
# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# config.assets.precompile += %w( search.js )
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = SMTP_SETTINGS
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Disable automatic flushing of the log to improve performance.
# config.autoflush_log = false
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
config.action_mailer.default_url_options = { host: 'vidpush.com' }
end

View File

@ -0,0 +1,9 @@
require_relative 'production'
Mail.register_interceptor RecipientInterceptor.new(ENV['EMAIL_RECIPIENTS'])
Vidpush::Application.configure do
# ...
config.action_mailer.default_url_options = { host: 'staging.vidpush.com' }
end

View File

@ -0,0 +1,38 @@
Vidpush::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = false
# Configure static asset server for tests with Cache-Control for performance.
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
config.action_mailer.default_url_options = { host: 'www.example.com' }
end

View File

@ -0,0 +1,7 @@
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
# Rails.backtrace_cleaner.remove_silencers!

View File

@ -0,0 +1,3 @@
# Protect against injection attacks
# http://www.kb.cert.org/vuls/id/380039
ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::XML)

View File

@ -0,0 +1,28 @@
require 'net/http'
require 'net/smtp'
# Example:
# begin
# some http call
# rescue *HTTP_ERRORS => error
# notify_hoptoad error
# end
HTTP_ERRORS = [Timeout::Error,
Errno::EINVAL,
Errno::ECONNRESET,
EOFError,
Net::HTTPBadResponse,
Net::HTTPHeaderSyntaxError,
Net::ProtocolError]
SMTP_SERVER_ERRORS = [TimeoutError,
IOError,
Net::SMTPUnknownError,
Net::SMTPServerBusy,
Net::SMTPAuthenticationError]
SMTP_CLIENT_ERRORS = [Net::SMTPFatalError,
Net::SMTPSyntaxError]
SMTP_ERRORS = SMTP_SERVER_ERRORS + SMTP_CLIENT_ERRORS

View File

@ -0,0 +1,4 @@
# Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password]

View File

@ -0,0 +1,16 @@
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end
# These inflection rules are supported but not enabled by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.acronym 'RESTful'
# end

View File

@ -0,0 +1,5 @@
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone

View File

@ -0,0 +1 @@
Rack::Timeout.timeout = (ENV['TIMEOUT_IN_SECONDS'] || 5).to_i

View File

@ -0,0 +1,10 @@
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
# You can use `rake secret` to generate a secure secret key.
# Make sure your secret_key_base is kept private
# if you're sharing your code publicly.
Vidpush::Application.config.secret_key_base = ENV['SECRET_KEY_BASE']

View File

@ -0,0 +1,3 @@
# Be sure to restart your server when you modify this file.
Vidpush::Application.config.session_store :cookie_store, key: '_vidpush_session'

View File

@ -0,0 +1,10 @@
if Rails.env.staging? || Rails.env.production?
SMTP_SETTINGS = {
address: ENV.fetch('SMTP_ADDRESS'), # example: 'smtp.sendgrid.net'
authentication: :plain,
domain: ENV.fetch('SMTP_DOMAIN'), # example: 'this-app.com'
password: ENV.fetch('SMTP_PASSWORD'),
port: '587',
user_name: ENV.fetch('SMTP_USERNAME')
}
end

View File

@ -0,0 +1,14 @@
# Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
end
# To enable root element in JSON for ActiveRecord objects.
# ActiveSupport.on_load(:active_record) do
# self.include_root_in_json = true
# end

11
config/locales/en.yml Normal file
View File

@ -0,0 +1,11 @@
en:
date:
formats:
default: '%m/%d/%Y'
with_weekday: '%a %m/%d/%y'
time:
formats:
default: '%a, %b %-d, %Y at %r'
date: '%b %-d, %Y'
short: '%B %d'

6
config/routes.rb Normal file
View File

@ -0,0 +1,6 @@