Skip to content

Commit

Permalink
removes deprecated conference tile bg image and font color
Browse files Browse the repository at this point in the history
  • Loading branch information
eug3nix committed Jul 22, 2021
1 parent 6392abf commit 506bc7c
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 23 deletions.
1 change: 0 additions & 1 deletion app/controllers/admin/conferences_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ def conference_params
:rooms_attributes, :tracks_attributes,
:tickets_attributes, :event_types_attributes,
:picture, :picture_cache, :background, :background_cache,
:tile_background, :tile_background_cache, :tile_font_color,
:policies_attributes,:policy_ids,
:questions_attributes,:question_ids, :answers_attributes,
:answer_ids, :difficulty_levels_attributes,
Expand Down
7 changes: 3 additions & 4 deletions app/models/conference.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class Conference < ActiveRecord::Base

mount_uploader :picture, PictureUploader, mount_on: :logo_file_name
mount_uploader :background, BackgroundUploader, mount_on: :background_file_name
mount_uploader :tile_background, BackgroundUploader, mount_on: :tile_background_file_name

validates_presence_of :title,
:short_title,
Expand Down Expand Up @@ -719,7 +718,7 @@ def highlighted_speakers
def previous_conferences
Conference.where("conference_group_id = ? AND start_date < ?", conference_group_id, start_date).order('start_date')
end

private

# Returns a different html colour for every i and consecutive colors are
Expand Down Expand Up @@ -1177,7 +1176,7 @@ def self.calculate_user_submission_hash(submitters, counter)


def create_email_settings
build_email_settings(EMAIL_SETTINGS_DEFAULTS)
build_email_settings(EMAIL_SETTINGS_DEFAULTS)
true
end

Expand Down Expand Up @@ -1250,7 +1249,7 @@ def handle_timezone_change
tz_old = ActiveSupport::TimeZone.new(tzchanges[0])
tz_new = ActiveSupport::TimeZone.new(tzchanges[1])
tzdiff = tz_old.utc_offset - tz_new.utc_offset
if tzdiff != 0
if tzdiff != 0
program.selected_schedule.event_schedules.destroy_all if program.selected_schedule
end
end
Expand Down
3 changes: 1 addition & 2 deletions app/uploaders/background_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ def object_class_name

# compatibility with our paperclip storage paths..
def extra_store_dir
return 'backgrounds' if mounted_as == :background
'tile_backgrounds'
'backgrounds'
end

# Returns the id of the instance in a split path form. e.g. returns
Expand Down
10 changes: 0 additions & 10 deletions app/views/admin/conferences/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@
= f.input :background, :label => false, :hint => "This image will be used as the splashpage background."
= f.hidden_field :background_cache

= f.input :tile_font_color, :hint => "The color to be used for the conference tile font", :input_html => {:size => 6, :type => "color", :class => 'color-picker'}

= f.label 'Conference Tile Background Image'
%br
- if @conference.tile_background?
= image_tag @conference.tile_background.thumb.url
= f.input :tile_background, :label => false, :hint => "This image will be used as conference tile background."
= f.hidden_field :tile_background_cache


= f.input :ticket_layout, as: :select, collection: Conference.ticket_layouts.keys, hint: "Layout type for tickets of the conference."

= f.inputs :name => "Scheduling" do
Expand Down
2 changes: 0 additions & 2 deletions app/views/refinery/pages/home.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@
$(document).ready(function() {
//override background if conference has one
var banner_bg = "#{::Refinery::Setting.find_or_set(:banner_background, '')}"
console.log(banner_bg)
if(banner_bg !== '') {
$('.home-banner').css('background', banner_bg);
}
});
});

6 changes: 2 additions & 4 deletions app/views/refinery/pages/shared/_conference_block_tile.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
- card_style = conference.tile_background? ? "background: url(#{conference.tile_background.url}) no-repeat scroll 0px 0px / cover;" : "background-color: #{conference.color};"
.card.conference-card.text-white{style: "#{card_style}"}
.card.conference-card.text-white
%img.card-img-top{src: "#{conference.picture? ? conference.picture.url : 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'}"}
.card-block{style: "color: #{conference.tile_font_color}"}
.card-block
.card-text.h3
= date_string(conference.start_date, conference.end_date)
.card-text.h4
Expand All @@ -16,7 +15,6 @@
= link_to "Register", main_app.conference_buytickets_path(conference.short_title), class: "btn btn-success btn-block", disabled: conference.registration_limit_exceeded?
- elsif conference.splashpage.include_sponsors && !conference.ended?
= link_to "Sponsor!", main_app.conference_sponsorships_path(conference.short_title), :class =>"btn btn-warning btn-block"


.col-md-6
= link_to "Learn More", main_app.conference_path(conference.short_title), :class =>"btn btn-info btn-block"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RemoveTileFontColorFromConference < ActiveRecord::Migration
def change
remove_column :conferences, :tile_font_color, :string
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RemoveTileBackgroundImageFromConference < ActiveRecord::Migration
def change
remove_column :conferences, :tile_background_file_name, :string
end
end

0 comments on commit 506bc7c

Please sign in to comment.