toggle whether a donation campaign is advertised
This commit is contained in:
parent
a11140f9e1
commit
0e6f823154
6 changed files with 21 additions and 9 deletions
|
@ -20,6 +20,12 @@ module ApplicationHelper
|
|||
end
|
||||
end
|
||||
|
||||
def advertise_campaign_progress(campaign, &block)
|
||||
if campaign && campaign.advertised?
|
||||
campaign_progress(campaign, &block)
|
||||
end
|
||||
end
|
||||
|
||||
def campaign_progress(campaign, &block)
|
||||
if campaign
|
||||
if block_given?
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- content_for :before_title, campaign_progress(@campaign)
|
||||
- content_for :before_title, advertise_campaign_progress(@campaign)
|
||||
- content_for :title_category do
|
||||
#{t 'infinite_closet'}: #{t '.title_tagline'}
|
||||
- content_for :before_flashes do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
- hide_home_link
|
||||
|
||||
= campaign_progress @campaign
|
||||
= advertise_campaign_progress @campaign
|
||||
|
||||
%p#pet-not-found.alert= t 'pets.load.not_found'
|
||||
%p#neopia-error.alert= t 'pets.load.neopia_error'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
- title(@outfit.name || t('.default_outfit_name'))
|
||||
- content_for :before_title, campaign_progress(@campaign)
|
||||
- content_for :before_title, advertise_campaign_progress(@campaign)
|
||||
|
||||
- open_graph :type => 'openneo-impress:outfit', :title => yield(:title),
|
||||
:url => outfit_url(@outfit)
|
||||
|
|
5
db/migrate/20150225194522_add_advertised_to_campaign.rb
Normal file
5
db/migrate/20150225194522_add_advertised_to_campaign.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class AddAdvertisedToCampaign < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :campaigns, :advertised, :boolean, null: false, default: true
|
||||
end
|
||||
end
|
13
db/schema.rb
13
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20140910204043) do
|
||||
ActiveRecord::Schema.define(:version => 20150225194522) do
|
||||
|
||||
create_table "auth_servers", :force => true do |t|
|
||||
t.string "short_name", :limit => 10, :null => false
|
||||
|
@ -33,11 +33,12 @@ ActiveRecord::Schema.define(:version => 20140910204043) do
|
|||
add_index "campaign_translations", ["locale"], :name => "index_campaign_translations_on_locale"
|
||||
|
||||
create_table "campaigns", :force => true do |t|
|
||||
t.integer "progress", :null => false
|
||||
t.integer "goal", :null => false
|
||||
t.boolean "active", :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "progress", :null => false
|
||||
t.integer "goal", :null => false
|
||||
t.boolean "active", :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.boolean "advertised", :default => true, :null => false
|
||||
end
|
||||
|
||||
create_table "campaigns_old", :force => true do |t|
|
||||
|
|
Loading…
Reference in a new issue