Skip to content

Commit

Permalink
Remove legacy banner images and banner styles settings
Browse files Browse the repository at this point in the history
Also removed all content related with this.
  • Loading branch information
decabeza committed Feb 19, 2019
1 parent a5bc0fc commit a921620
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 217 deletions.
70 changes: 0 additions & 70 deletions app/assets/stylesheets/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2245,76 +2245,6 @@ table {
// 18. Banners
// -----------

.banner-style-one {
background-color: $brand;
}

.banner-style-two {
background-color: $budget;
}

.banner-style-three {
background-color: #33dadf;
}

@include breakpoint(large) {

.banner-img-one {
background-image: image-url("banners/banner1.png");
}

.banner-img-two {
background-image: image-url("banners/banner2.png");
}

.banner-img-three {
background-image: image-url("banners/banner3.png");
}
}

.banner-img-one,
.banner-img-two,
.banner-img-three {
background-position: bottom right;
background-repeat: no-repeat;
}

.banner-style-one,
.banner-style-two,
.banner-style-three,
.banner {
margin: 0;
margin-bottom: $line-height;

@include breakpoint(large) {

h3 {
width: 80%;
}
}

h2,
h3,
a {
color: #eaeaf2;
}

h2 {
padding: $line-height / 2;
padding-bottom: 0;
}

h3 {
padding: $line-height / 2;
padding-top: 0;
}

a:hover h2,
a:hover h3 {
color: #eaeaf2 !important;
text-decoration: none;
}
}

// 19. Recommendations
// -------------------
Expand Down
4 changes: 1 addition & 3 deletions app/controllers/admin/settings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ def index
all_settings = Setting.all.group_by { |s| s.type }
@settings = all_settings['common']
@feature_flags = all_settings['feature']
@banner_styles = all_settings['banner-style']
@banner_imgs = all_settings['banner-img']
end

def update
Expand All @@ -27,4 +25,4 @@ def settings_params
params.require(:setting).permit(:value)
end

end
end
14 changes: 0 additions & 14 deletions app/models/setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@ class Setting < ActiveRecord::Base
validates :key, presence: true, uniqueness: true

default_scope { order(id: :asc) }
scope :banner_style, -> { where("key ilike ?", "banner-style.%")}
scope :banner_img, -> { where("key ilike ?", "banner-img.%")}

def type
if feature_flag?
'feature'
elsif banner_style?
'banner-style'
elsif banner_img?
'banner-img'
else
'common'
end
Expand All @@ -25,14 +19,6 @@ def enabled?
feature_flag? && value.present?
end

def banner_style?
key.start_with?('banner-style.')
end

def banner_img?
key.start_with?('banner-img.')
end

class << self
def [](key)
where(key: key).pluck(:value).first.presence
Expand Down
24 changes: 0 additions & 24 deletions app/views/admin/settings/_banner_images.html.erb

This file was deleted.

24 changes: 0 additions & 24 deletions app/views/admin/settings/_banner_styles.html.erb

This file was deleted.

12 changes: 0 additions & 12 deletions app/views/admin/settings/_filter_subnav.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@
<% end %>
</li>

<li class="tabs-title">
<%= link_to "#tab-banner-styles" do %>
<%= t("admin.settings.index.banners") %>
<% end %>
</li>

<li class="tabs-title">
<%= link_to "#tab-banner-images" do %>
<%= t("admin.settings.index.banner_imgs") %>
<% end %>
</li>

<li class="tabs-title" id="map-tab">
<%= link_to "#tab-map-configuration" do %>
<%= t("admin.settings.index.map.title") %>
Expand Down
8 changes: 0 additions & 8 deletions app/views/admin/settings/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
<%= render "feature_flags" %>
</div>

<div class="tabs-panel" id="tab-banner-styles">
<%= render "banner_styles" %>
</div>

<div class="tabs-panel" id="tab-banner-images">
<%= render "banner_images" %>
</div>

<div class="tabs-panel" id="tab-map-configuration">
<%= render "map_configuration" %>
</div>
Expand Down
4 changes: 0 additions & 4 deletions config/locales/en/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1126,10 +1126,6 @@ en:
flash:
updated: Value updated
index:
banners: Banner styles
banner_imgs: Banner images
no_banners_images: No banner images
no_banners_styles: No banner styles
title: Configuration settings
update_setting: Update
feature_flags: Features
Expand Down
4 changes: 0 additions & 4 deletions config/locales/es/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1125,10 +1125,6 @@ es:
flash:
updated: Valor actualizado
index:
banners: Estilo del banner
banner_imgs: Imagenes del banner
no_banners_images: No hay imagenes de banner
no_banners_styles: No hay estilos de banner
title: Configuración global
update_setting: Actualizar
feature_flags: Funcionalidades
Expand Down
10 changes: 0 additions & 10 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,6 @@
# Spending proposals feature flags
Setting['feature.spending_proposal_features.voting_allowed'] = nil

# Banner styles
Setting['banner-style.banner-style-one'] = "Banner style 1"
Setting['banner-style.banner-style-two'] = "Banner style 2"
Setting['banner-style.banner-style-three'] = "Banner style 3"

# Banner images
Setting['banner-img.banner-img-one'] = "Banner image 1"
Setting['banner-img.banner-img-two'] = "Banner image 2"
Setting['banner-img.banner-img-three'] = "Banner image 3"

# Proposal notifications
Setting['proposal_notification_minimum_interval_in_days'] = 3
Setting['direct_message_max_per_day'] = 3
Expand Down
20 changes: 0 additions & 20 deletions lib/tasks/banners.rake

This file was deleted.

24 changes: 0 additions & 24 deletions spec/models/setting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,4 @@
expect(setting.enabled?).to eq false
end
end

describe "#banner_style?" do
it "is true if key starts with 'banner-style.'" do
setting = described_class.create(key: "banner-style.whatever")
expect(setting.banner_style?).to eq true
end

it "is false if key does not start with 'banner-style.'" do
setting = described_class.create(key: "whatever")
expect(setting.banner_style?).to eq false
end
end

describe "#banner_img?" do
it "is true if key starts with 'banner-img.'" do
setting = described_class.create(key: "banner-img.whatever")
expect(setting.banner_img?).to eq true
end

it "is false if key does not start with 'banner-img.'" do
setting = described_class.create(key: "whatever")
expect(setting.banner_img?).to eq false
end
end
end

0 comments on commit a921620

Please sign in to comment.