3 |
--------------------------------------------------------------------------------
/app/views/user_mailer/login_token.html.erb:
--------------------------------------------------------------------------------
1 | Click this link to log into EndRun:
2 |
--------------------------------------------------------------------------------
/db/migrate/20140714230725_add_approved_to_links.rb:
--------------------------------------------------------------------------------
1 | class AddApprovedToLinks < ActiveRecord::Migration
2 | def change
3 | add_column :links, :approved, :boolean
4 | add_index :links, :approved
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140728184738_add_slugs_to_posts.rb:
--------------------------------------------------------------------------------
1 | class AddSlugsToPosts < ActiveRecord::Migration
2 | def change
3 | add_column :posts, :slugs, :hstore
4 | add_index :posts, :slugs, using: :gin
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140929154301_add_public_flag_to_tags.rb:
--------------------------------------------------------------------------------
1 | class AddPublicFlagToTags < ActiveRecord::Migration
2 | def change
3 | add_column :tags, :public, :boolean
4 | add_index :tags, :public
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140930195931_add_photo_id_to_links.rb:
--------------------------------------------------------------------------------
1 | class AddPhotoIdToLinks < ActiveRecord::Migration
2 | def change
3 | add_column :links, :photo_id, :integer
4 | add_index :links, :photo_id
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20141112230331_add_signup_source_to_email_signups.rb:
--------------------------------------------------------------------------------
1 | class AddSignupSourceToEmailSignups < ActiveRecord::Migration
2 | def change
3 | add_column :email_signups, :signup_source, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20150224165135_add_freeform_post_header_to_posts.rb:
--------------------------------------------------------------------------------
1 | class AddFreeformPostHeaderToPosts < ActiveRecord::Migration
2 | def change
3 | add_column :posts, :freeform_post_header, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20150609173000_add_facebook_description_to_posts.rb:
--------------------------------------------------------------------------------
1 | class AddFacebookDescriptionToPosts < ActiveRecord::Migration
2 | def change
3 | add_column :posts, :facebook_description, :text
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/amicus.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Amicus controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/documents.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Documents controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
--------------------------------------------------------------------------------
/app/assets/stylesheets/partners.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Partners controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/models/user_post_assignment.rb:
--------------------------------------------------------------------------------
1 | class UserPostAssignment < ActiveRecord::Base
2 | belongs_to :post, touch: true
3 | belongs_to :user, touch: true
4 | validates_presence_of :post
5 | validates_presence_of :user
6 | end
7 |
--------------------------------------------------------------------------------
/app/views/posts/index.html.erb:
--------------------------------------------------------------------------------
1 | <% content_for(:body_classes) { 'post-index-body' } %>
2 |
3 | <% @posts.each do |post| %>
4 | <%= render 'post_full', post: post %>
5 | <% end %>
6 |
--------------------------------------------------------------------------------
/db/migrate/20140816223427_add_sizes_to_photos.rb:
--------------------------------------------------------------------------------
1 | class AddSizesToPhotos < ActiveRecord::Migration
2 | def change
3 | add_column :photos, :sizes, :hstore
4 | add_index :photos, :sizes, using: :gin
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140827184510_change_id_to_string_for_newsletters.rb:
--------------------------------------------------------------------------------
1 | class ChangeIdToStringForNewsletters < ActiveRecord::Migration
2 | def change
3 | change_column :newsletters, :mailchimp_id, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20150224165406_change_freeform_post_header_to_text.rb:
--------------------------------------------------------------------------------
1 | class ChangeFreeformPostHeaderToText < ActiveRecord::Migration
2 | def change
3 | change_column :posts, :freeform_post_header, :text
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20160219184054_rename_featured_image_for_tags.rb:
--------------------------------------------------------------------------------
1 | class RenameFeaturedImageForTags < ActiveRecord::Migration
2 | def change
3 | rename_column :tags, :featured_image_id, :featured_photo_id
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20160310222554_add_mailchimp_data_to_email_signups.rb:
--------------------------------------------------------------------------------
1 | class AddMailchimpDataToEmailSignups < ActiveRecord::Migration
2 | def change
3 | add_column :email_signups, :mailchimp_data, :text
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20160404152647_add_in_stream_to_posts.rb:
--------------------------------------------------------------------------------
1 | class AddInStreamToPosts < ActiveRecord::Migration
2 | def change
3 | add_column :posts, :in_stream, :boolean
4 | add_index :posts, :in_stream
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/spec/views/collections/api_v1_items.html.erb_spec.rb:
--------------------------------------------------------------------------------
1 | require 'rails_helper'
2 |
3 | RSpec.describe "collections/api_v1_items.html.erb", type: :view do
4 | pending "add some examples to (or delete) #{__FILE__}"
5 | end
6 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin/debug.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the debug controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin/photos.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Photos controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin/search.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Search controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin/tags.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Tags controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin/users.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the users controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin_gator.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the admin_gator controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/asset_files.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the AssetFiles controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/pretest.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the pretest controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/sitemap.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Sitemap controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/weedwacker.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the weedwacker controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/yahoo_posts.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the YahooPosts controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/models/static_page.rb:
--------------------------------------------------------------------------------
1 | class StaticPage < ActiveRecord::Base
2 | validates :slug, length: { minimum: 2 }
3 | validates :content, length: { minimum: 2 }
4 |
5 | def to_param
6 | "#{id}-#{slug}"
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/app/views/documents/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@documents) do |document|
2 | json.extract! document, :id, :dc_id, :published, :body, :dc_data, :dc_published_url
3 | json.url document_url(document, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/freeform_stream_promos/edit.html.erb:
--------------------------------------------------------------------------------
1 |
Editing Freeform Stream Promo
2 |
3 | <%= render 'form' %>
4 |
5 | <%= link_to 'Show', @freeform_stream_promo %> |
6 | <%= link_to 'Back', freeform_stream_promos_path %>
7 |
--------------------------------------------------------------------------------
/db/migrate/20140708210125_add_login_token_to_users.rb:
--------------------------------------------------------------------------------
1 | class AddLoginTokenToUsers < ActiveRecord::Migration
2 | def change
3 | add_column :users, :login_token, :string
4 | add_index :users, :login_token
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140812152811_add_post_format_to_posts.rb:
--------------------------------------------------------------------------------
1 | class AddPostFormatToPosts < ActiveRecord::Migration
2 | def change
3 | add_column :posts, :post_format, :string
4 | add_index :posts, :post_format
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140813201832_add_user_id_to_taggings.rb:
--------------------------------------------------------------------------------
1 | class AddUserIdToTaggings < ActiveRecord::Migration
2 | def change
3 | add_column :taggings, :user_id, :integer
4 | add_index :taggings, :user_id
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140930195827_add_via_gator_to_photos.rb:
--------------------------------------------------------------------------------
1 | class AddViaGatorToPhotos < ActiveRecord::Migration
2 | def change
3 | add_column :photos, :via_gator, :boolean
4 | add_index :photos, :via_gator
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20141010201348_add_revised_at_to_posts.rb:
--------------------------------------------------------------------------------
1 | class AddRevisedAtToPosts < ActiveRecord::Migration
2 | def change
3 | add_column :posts, :revised_at, :datetime
4 | add_index :posts, :revised_at
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20150113163509_add_user_id_to_public_search_queries.rb:
--------------------------------------------------------------------------------
1 | class AddUserIdToPublicSearchQueries < ActiveRecord::Migration
2 | def change
3 | add_column :public_search_queries, :user_id, :integer
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20150129163905_add_shorttoken_to_links.rb:
--------------------------------------------------------------------------------
1 | class AddShorttokenToLinks < ActiveRecord::Migration
2 | def change
3 | add_column :links, :short_token, :string
4 | add_index :links, :short_token
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20150515145826_change_byline_column_to_text_on_newsletters.rb:
--------------------------------------------------------------------------------
1 | class ChangeBylineColumnToTextOnNewsletters < ActiveRecord::Migration
2 | def change
3 | change_column :newsletters, :byline, :text
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin/formats.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Formats controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin/public.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Public controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
5 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin/ratings.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Ratings controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin/sessions.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the sessions controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin_api_v1.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the admin_api_v1 controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin_simple.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the admin_simple controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/post_locks.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the PostLocks controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/post_sharables.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the PostSharables controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/project_repo.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the ProjectRepo controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/controllers/landing_page_controller.rb:
--------------------------------------------------------------------------------
1 | class LandingPageController < ApplicationController
2 |
3 | def victim
4 | redirect_to "/2015/12/16/an-unbelievable-story-of-rape#.SxkSdehUz", status: :moved_permanently
5 | end
6 |
7 | end
--------------------------------------------------------------------------------
/app/views/partners/new.html.erb:
--------------------------------------------------------------------------------
1 |
New Partner
2 |
3 | Please be careful not to create duplicate partners.
4 |
5 |
6 |
7 | <%= render 'form' %>
8 |
9 | <%= link_to 'Back', partners_path %>
10 |
--------------------------------------------------------------------------------
/app/workers/index_tag.rb:
--------------------------------------------------------------------------------
1 | class IndexTag
2 | include Sidekiq::Worker
3 | sidekiq_options :retry => false
4 |
5 | def perform(tag_id)
6 | puts "IndexTag id=#{tag_id}"
7 | ES.index_tag(tag_id)
8 | end
9 |
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20140626161124_rename_publish_at_to_published_at_for_posts.rb:
--------------------------------------------------------------------------------
1 | class RenamePublishAtToPublishedAtForPosts < ActiveRecord::Migration
2 | def change
3 | rename_column :posts, :publish_at, :published_at
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20140816215902_add_random_slug_to_photos.rb:
--------------------------------------------------------------------------------
1 | class AddRandomSlugToPhotos < ActiveRecord::Migration
2 | def change
3 | add_column :photos, :random_slug, :string
4 | add_index :photos, :random_slug
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140929154328_add_stream_promo_to_post.rb:
--------------------------------------------------------------------------------
1 | class AddStreamPromoToPost < ActiveRecord::Migration
2 | def change
3 | add_column :posts, :stream_promo, :string
4 | add_index :posts, :stream_promo
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20141124181757_remove_cols_from_posts.rb:
--------------------------------------------------------------------------------
1 | class RemoveColsFromPosts < ActiveRecord::Migration
2 | def change
3 | remove_column :posts, :post_format_id
4 | remove_column :posts, :serialized_draft
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin_analytics.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the AdminAnalytics controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/project_router.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the project_router controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/public_partner.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the public_partner controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/user_features.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the UserFeatures controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/models/post_thread_assignment.rb:
--------------------------------------------------------------------------------
1 | class PostThreadAssignment < ActiveRecord::Base
2 |
3 | belongs_to :post
4 | validates :post, presence: true
5 |
6 | belongs_to :post_thread
7 | validates :post_thread, presence: true
8 |
9 | end
--------------------------------------------------------------------------------
/app/views/featured_blocks/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@featured_blocks) do |featured_block|
2 | json.extract! featured_block, :id, :template, :slots, :published
3 | json.url featured_block_url(featured_block, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/db/migrate/20140929192047_add_public_to_newsletters.rb:
--------------------------------------------------------------------------------
1 | class AddPublicToNewsletters < ActiveRecord::Migration
2 | def change
3 | add_column :newsletters, :public, :boolean
4 | add_index :newsletters, :public
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20141110184742_add_title_deck_to_documents.rb:
--------------------------------------------------------------------------------
1 | class AddTitleDeckToDocuments < ActiveRecord::Migration
2 | def change
3 | add_column :documents, :title, :text
4 | add_column :documents, :deck, :text
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin_google_doc.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the AdminGoogleDoc controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/partner_pageviews.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the PartnerPageviews controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/post_deploy_tokens.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the PostDeployTokens controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/weekly_newsletters.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the weekly_newsletters controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/views/admin_api_v1/preview_gist.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= render "public/posts/#{post_format}" %>
4 |
5 | <% if params.keys.include? 'debug' %>
6 |
<%= YAML.dump @debug %>
7 | <% end %>
--------------------------------------------------------------------------------
/app/views/newsletters/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@newsletters) do |newsletter|
2 | json.extract! newsletter, :id, :name, :email_subject, :mailchimp_id, :blurb, :template
3 | json.url newsletter_url(newsletter, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/weekly_newsletters/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! @weekly_newsletter, :id, :name, :email_subject, :mailchimp_id, :mailchimp_web_id, :byline, :published_at, :public, :archive_url, :opening_graf, :quote_graf, :created_at, :updated_at
2 |
--------------------------------------------------------------------------------
/db/migrate/20140807204017_add_deploy_api_key_to_users.rb:
--------------------------------------------------------------------------------
1 | class AddDeployApiKeyToUsers < ActiveRecord::Migration
2 | def change
3 | add_column :users, :deploy_api_key, :string
4 | add_index :users, :deploy_api_key
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20141001140928_add_published_at_to_letters.rb:
--------------------------------------------------------------------------------
1 | class AddPublishedAtToLetters < ActiveRecord::Migration
2 | def change
3 | add_column :letters, :published_at, :datetime
4 | add_index :letters, :published_at
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20150113161343_add_search_results_to_public_search_queries.rb:
--------------------------------------------------------------------------------
1 | class AddSearchResultsToPublicSearchQueries < ActiveRecord::Migration
2 | def change
3 | add_column :public_search_queries, :search_results, :text
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20160104184134_add_deploy_token_to_graphics.rb:
--------------------------------------------------------------------------------
1 | class AddDeployTokenToGraphics < ActiveRecord::Migration
2 | def change
3 | add_column :graphics, :deploy_token, :text
4 | add_index :graphics, :deploy_token
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20160204200517_add_remote_alive_to_links.rb:
--------------------------------------------------------------------------------
1 | class AddRemoteAliveToLinks < ActiveRecord::Migration
2 | def change
3 | add_column :links, :remote_is_alive, :boolean
4 | add_index :links, :remote_is_alive
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin/email_newsletter.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the EmailNewsletter controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin/user_deploy_api.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the UserDeployAPI controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/freeform_stream_promos.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the FreeformStreamPromos controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 |
6 | Mime::Type.register "application/xls", :xls
--------------------------------------------------------------------------------
/config/initializers/redis.rb:
--------------------------------------------------------------------------------
1 | if $redis.present?
2 | puts "config/initializers/redis.rb: $redis already exists"
3 | else
4 | $redis = ConnectionPool.new(size: 5, timeout: 5) {
5 | Redis.new(url: ENV[ENV['REDIS_PROVIDER']])
6 | }
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20140929154320_add_editors_pick_boolean_to_links.rb:
--------------------------------------------------------------------------------
1 | class AddEditorsPickBooleanToLinks < ActiveRecord::Migration
2 | def change
3 | add_column :links, :editors_pick, :boolean
4 | add_index :links, :editors_pick
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140930201536_add_featured_photo_to_posts.rb:
--------------------------------------------------------------------------------
1 | class AddFeaturedPhotoToPosts < ActiveRecord::Migration
2 | def change
3 | add_column :posts, :featured_photo_id, :integer
4 | add_index :posts, :featured_photo_id
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20151104192738_create_partners.rb:
--------------------------------------------------------------------------------
1 | class CreatePartners < ActiveRecord::Migration
2 | def change
3 | create_table :partners do |t|
4 | t.text :name
5 |
6 | t.timestamps null: false
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/lib/tasks/index_links.rake:
--------------------------------------------------------------------------------
1 | namespace :index_links do
2 | task default: :environment do
3 | start = Time.now.utc.to_f
4 | ESIndexAllLinksWorker.new.perform
5 | puts "ESIndexAllLinksWorker took #{Time.now.utc.to_f - start}"
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/lib/tasks/index_posts.rake:
--------------------------------------------------------------------------------
1 | namespace :index_posts do
2 | task default: :environment do
3 | start = Time.now.utc.to_f
4 | ESIndexAllPostsWorker.new.perform
5 | puts "ESIndexAllPostsWorker took #{Time.now.utc.to_f - start}"
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/public/stream_partials.html.erb:
--------------------------------------------------------------------------------
1 | <% @stream.items.each do |item| %>
2 | <% # some polymorphism is about to happen, get ready: %>
3 | <%= render partial: "public/stream/#{item.class.model_name.singular}", locals: { item: item } %>
4 | <% end %>
--------------------------------------------------------------------------------
/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure sensitive parameters which will be filtered from the log file.
4 | Rails.application.config.filter_parameters += [:password]
5 |
--------------------------------------------------------------------------------
/db/migrate/20140708204328_add_bookmarklet_token_to_users.rb:
--------------------------------------------------------------------------------
1 | class AddBookmarkletTokenToUsers < ActiveRecord::Migration
2 | def change
3 | add_column :users, :bookmarklet_token, :string
4 | add_index :users, :bookmarklet_token
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/views/layouts/_pixel_ping.html.erb:
--------------------------------------------------------------------------------
1 | <% if Rails.env.production? %>
2 |
3 | <% else %>
4 |
5 | <% end %>
--------------------------------------------------------------------------------
/app/views/partners/show.html.erb:
--------------------------------------------------------------------------------
1 |
<%= notice %>
2 |
3 |
4 | Name:
5 | <%= @partner.name %>
6 |
7 |
8 | <%= link_to 'Edit', edit_partner_path(@partner) %> |
9 | <%= link_to 'Back', partners_path %>
10 |
--------------------------------------------------------------------------------
/app/workers/minute_cron_worker.rb:
--------------------------------------------------------------------------------
1 | class MinuteCronWorker
2 | include Sidekiq::Worker
3 | sidekiq_options :retry => false
4 |
5 | def perform
6 | ScanNewPublishedPosts.perform_async
7 | PostLockSweeper.perform_async
8 | end
9 |
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20140929154324_add_published_at_to_newsletters.rb:
--------------------------------------------------------------------------------
1 | class AddPublishedAtToNewsletters < ActiveRecord::Migration
2 | def change
3 | add_column :newsletters, :published_at, :datetime
4 | add_index :newsletters, :published_at
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/lib/tasks/external_service_response.rake:
--------------------------------------------------------------------------------
1 | namespace :external_service_response do
2 | desc "Pull new TopShelf data from Thriller"
3 | task update_facebook_topshelf: :environment do
4 | FacebookRecentPostSharesV1Worker.new.perform
5 | end
6 |
7 | end
8 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/debug.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/links.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/photos.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/posts.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/public.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/search.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/tags.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/users.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/collections.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/partners.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/weedwacker.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/yahoo_posts.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/views/partner_pageviews/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@partner_pageviews) do |partner_pageview|
2 | json.extract! partner_pageview, :id, :post_id, :partner_id, :url, :pageviews
3 | json.url partner_pageview_url(partner_pageview, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/post_deploy_tokens/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@post_deploy_tokens) do |post_deploy_token|
2 | json.extract! post_deploy_token, :id, :post_id, :label, :token, :active
3 | json.url post_deploy_token_url(post_deploy_token, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | begin
3 | load File.expand_path('../spring', __FILE__)
4 | rescue LoadError => e
5 | raise unless e.message.include?('spring')
6 | end
7 | require_relative '../config/boot'
8 | require 'rake'
9 | Rake.application.run
10 |
--------------------------------------------------------------------------------
/db/migrate/20140926173831_add_slug_and_name_to_users.rb:
--------------------------------------------------------------------------------
1 | class AddSlugAndNameToUsers < ActiveRecord::Migration
2 | def change
3 | add_column :users, :slug, :string
4 | add_index :users, :slug
5 | add_column :users, :name, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20141024183444_add_title_and_desc_to_static_pages.rb:
--------------------------------------------------------------------------------
1 | class AddTitleAndDescToStaticPages < ActiveRecord::Migration
2 | def change
3 | add_column :static_pages, :title, :text
4 | add_column :static_pages, :description, :text
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20150702175957_add_mailchimp_id_to_email_signups.rb:
--------------------------------------------------------------------------------
1 | class AddMailchimpIdToEmailSignups < ActiveRecord::Migration
2 | def change
3 | add_column :email_signups, :mailchimp_id, :string
4 | add_index :email_signups, :mailchimp_id
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/formats.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/letters.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/newsletters.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/ratings.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/rattle_can.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/sessions.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/partner_pageviews.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/project_router.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/views/admin/dragons.html.erb:
--------------------------------------------------------------------------------
1 | <%= form_tag update_dragons_path do %>
2 | <% ['javascript', 'style'].each do |block_name| %>
3 | <%= "<#{block_name}>" %>
4 |
5 | <% end %>
6 | <%= submit_tag %>
7 | <% end %>
--------------------------------------------------------------------------------
/app/views/admin/feedback.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/views/featured_blocks/preview.html.erb:
--------------------------------------------------------------------------------
1 | <% @hide_nav = true %>
2 | <% begin %>
3 | <%= render partial: "public/featured_block/#{@featured_block.template}" %>
4 | <% rescue %>
5 |
--------------------------------------------------------------------------------
/db/migrate/20141104185907_add_confirm_token_to_email_signups.rb:
--------------------------------------------------------------------------------
1 | class AddConfirmTokenToEmailSignups < ActiveRecord::Migration
2 | def change
3 | add_column :email_signups, :confirm_token, :string
4 | add_index :email_signups, :confirm_token
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20141117204959_add_names_to_stripe_customers.rb:
--------------------------------------------------------------------------------
1 | class AddNamesToStripeCustomers < ActiveRecord::Migration
2 | def change
3 | add_column :stripe_customers, :first_name, :string
4 | add_column :stripe_customers, :last_name, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/email_newsletter.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/post_threads.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/user_deploy_api.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/freeform_stream_promos.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/post_deploy_tokens.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/weekly_newsletters.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/lib/es_index_all_links_worker.rb:
--------------------------------------------------------------------------------
1 | class ESIndexAllLinksWorker
2 | include Sidekiq::Worker
3 | sidekiq_options :retry => false
4 |
5 | def perform
6 | puts "ESIndexAllLinksWorker rebuilding index"
7 | puts ES.index_all_links
8 | end # perform
9 |
10 | end
--------------------------------------------------------------------------------
/app/models/newsletter_assignment.rb:
--------------------------------------------------------------------------------
1 | class NewsletterAssignment < ActiveRecord::Base
2 | belongs_to :newsletter, touch: true
3 | validates_presence_of :newsletter
4 |
5 | belongs_to :taggable, polymorphic: true, touch: true
6 | validates_presence_of :taggable
7 |
8 | end
--------------------------------------------------------------------------------
/app/views/admin/debug_os_links.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <% @assignments.each do |assignment| %>
3 | <% if assignment.taggable.is_a? Link %>
4 | <%= assignment.taggable.url %>
5 | <%= assignment.taggable.short_token %>
6 |
7 | <% end %>
8 | <% end %>
9 |
--------------------------------------------------------------------------------
/app/views/letters/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@letters) do |letter|
2 | json.extract! letter, :id, :name, :email, :twitter, :street_address, :is_anonymous, :content, :post_id, :status, :stream_promo, :excerpt
3 | json.url letter_url(letter, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/db/migrate/20140930201810_add_fb_and_twitter_headlines_to_posts.rb:
--------------------------------------------------------------------------------
1 | class AddFbAndTwitterHeadlinesToPosts < ActiveRecord::Migration
2 | def change
3 | add_column :posts, :facebook_headline, :text
4 | add_column :posts, :twitter_headline, :text
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20141111191300_add_source_to_user_post_assignments.rb:
--------------------------------------------------------------------------------
1 | class AddSourceToUserPostAssignments < ActiveRecord::Migration
2 | def change
3 | add_column :user_post_assignments, :source, :string
4 | add_index :user_post_assignments, :source
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20150618195818_create_assets.rb:
--------------------------------------------------------------------------------
1 | class CreateAssets < ActiveRecord::Migration
2 | def change
3 | create_table :assets do |t|
4 | t.text :label
5 | t.text :config
6 |
7 | t.timestamps null: false
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require File.expand_path('../config/application', __FILE__)
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/app/base/_buttons.scss:
--------------------------------------------------------------------------------
1 | button,
2 | input[type="submit"] {
3 | @extend %button;
4 | @include appearance(none);
5 | border: none;
6 | cursor: pointer;
7 | user-select: none;
8 | vertical-align: middle;
9 | white-space: nowrap;
10 | }
11 |
--------------------------------------------------------------------------------
/app/lib/post_shareable_maybe.rb:
--------------------------------------------------------------------------------
1 | class PostShareableMaybe
2 | def self.override(shareable, post, col)
3 | if shareable.present? and shareable.respond_to?(col) and shareable.send(col).present?
4 | shareable.send(col)
5 | else
6 | post.send(col)
7 | end
8 | end
9 | end
--------------------------------------------------------------------------------
/app/views/post_threads/show.html.erb:
--------------------------------------------------------------------------------
1 |