diff --git a/app/assets/images/labels/cologne.ico b/app/assets/images/labels/cologne.ico deleted file mode 100644 index cad99c250..000000000 Binary files a/app/assets/images/labels/cologne.ico and /dev/null differ diff --git a/app/assets/images/labels/cologne.png b/app/assets/images/labels/cologne.png deleted file mode 100644 index 4d5da98f8..000000000 Binary files a/app/assets/images/labels/cologne.png and /dev/null differ diff --git a/app/assets/javascripts/labels/cologne.js b/app/assets/javascripts/labels/cologne.js deleted file mode 100644 index 75cd742cd..000000000 --- a/app/assets/javascripts/labels/cologne.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ -const CGN = { - ratio: 0, - // header animation - showKoelsch() { - $("header h1").text("Kölsch.rb"); - return $("header h2").text("De Kölsche Ruby Jecke"); - }, - - showCologne() { - $("header h1").text("Cologne.rb"); - return $("header h2").text("Ruby User Group Cologne"); - } -}; - -$(document).ready(function() { - // assign header animation listeners - $("#title").mouseover(CGN.showKoelsch).mouseout(CGN.showCologne); - // append custom markup for gem beer glas - $(".main").append("
refill?"); - // animate gem beer glas - CGN.beer_height = $("#gem").height(); - return $(window).scroll(function() { - CGN.ratio = $(window).scrollTop() / ($(document).height() - $(window).height()); - $("#beer").height((1 - CGN.ratio) * CGN.beer_height); - return $("#refill").css("opacity", CGN.ratio); - }); -}); diff --git a/app/assets/stylesheets/labels/cologne.sass b/app/assets/stylesheets/labels/cologne.sass deleted file mode 100644 index 8a24cb342..000000000 --- a/app/assets/stylesheets/labels/cologne.sass +++ /dev/null @@ -1,48 +0,0 @@ -@import "cologne/colors" -@import "cologne/dimensions" - -header - #title - &:hover - color: $red !important - single-text-shadow: $dark-text-color, 1px, 1px, 2px - - #logo - margin-left: 1em - margin-top: -0.25em - -a:hover - color: $red - -#gem - width: 149px - height: 449px - position: fixed !important - bottom: 180px - left: 20px - z-index: 90 - img - z-index: 95 - #beer - position: absolute - bottom: 0px - width: 149px - height: 449px - background: image-url("labels/cologne/gem-glas-full.png") left bottom no-repeat - z-index: 96 - -#refill - position: fixed !important - bottom: 140px - left: 70px - text-decoration: none - font-size: 2em - z-index: 90 - opacity: 0 - a:hover - text-shadow: 0px 0px 1px $dark-grey - color: $red - -@media (max-width: 1400px) - #gem, #beer, #refill - display: none diff --git a/app/assets/stylesheets/labels/cologne/_colors.sass b/app/assets/stylesheets/labels/cologne/_colors.sass deleted file mode 100644 index 754bd4f95..000000000 --- a/app/assets/stylesheets/labels/cologne/_colors.sass +++ /dev/null @@ -1,12 +0,0 @@ -$red: #de1f26 -$black: black -$white: white - -$light-grey: #999 -$dark-grey: #444444 - -$light-gold: #dfc07d -$dark-gold: #cda85a - -$light-text-color: $white -$dark-text-color: $dark-grey diff --git a/app/assets/stylesheets/labels/cologne/_dimensions.sass b/app/assets/stylesheets/labels/cologne/_dimensions.sass deleted file mode 100644 index fae8ef29a..000000000 --- a/app/assets/stylesheets/labels/cologne/_dimensions.sass +++ /dev/null @@ -1,7 +0,0 @@ -$content-width: 780px -$ipad-width: 620px -$iphone-width: 380px - -$padding: 20px - -$margin: 30px \ No newline at end of file diff --git a/config/locales/de.label.yml b/config/locales/de.label.yml index 6eea07fb4..eb02adcc2 100644 --- a/config/locales/de.label.yml +++ b/config/locales/de.label.yml @@ -19,13 +19,6 @@ de: title: RUG::B subtitle: Ruby User Group Berlin meta_desc: RUG::B—Ruby User Group Berlin - cologne: - city: Köln - name: Kölsch.rb - title: Cologne.rb - subtitle: Ruby User Group Cologne - meta_desc: Ruby / Rails User Group Cologne - custom_recurrence: "jeweils am 3. Mittwoch in jedem 2. Monat (Januar, März, Mai, Juli, September, November) um 19:00 Uhr" saar: city: Saarland name: RUGSaar diff --git a/config/locales/en.label.yml b/config/locales/en.label.yml index 828602938..eaefb375e 100644 --- a/config/locales/en.label.yml +++ b/config/locales/en.label.yml @@ -19,13 +19,6 @@ en: title: RUG::B subtitle: Ruby User Group Berlin meta_desc: RUG::B—Ruby User Group Berlin - cologne: - city: Köln - name: Kölsch.rb - title: Cologne.rb - subtitle: Ruby User Group Cologne - meta_desc: Ruby / Rails User Group Cologne - custom_recurrence: "every 3rd Wednesday in every second month (January, March, May, July, September, November) at 7:00 p.m." saar: city: Saarland name: RUGSaar diff --git a/config/locales/es.label.yml b/config/locales/es.label.yml index a247d5806..b9620fb09 100644 --- a/config/locales/es.label.yml +++ b/config/locales/es.label.yml @@ -19,13 +19,6 @@ es: title: RUG::B subtitle: Ruby User Group Berlin meta_desc: RUG::B—Ruby User Group Berlin - cologne: - city: Colonia - name: Kölsch.rb - title: Cologne.rb - subtitle: Ruby User Group Cologne - meta_desc: Ruby / Rails User Group Cologne - custom_recurrence: 3er Miércoles de Enero, Marzo, Mayo, Julio, Septiembre y Noviembre, a las 19.00 saar: city: Saarland name: RUGSaar diff --git a/config/locales/pl.label.yml b/config/locales/pl.label.yml index 0f900edcb..f4fe9b63e 100644 --- a/config/locales/pl.label.yml +++ b/config/locales/pl.label.yml @@ -19,13 +19,6 @@ pl: title: RUG::B subtitle: Ruby User Group Berlin meta_desc: RUG::B—Ruby User Group Berlin - cologne: - city: Köln - name: Kölsch.rb - title: Cologne.rb - subtitle: Ruby User Group Cologne - meta_desc: Ruby / Rails User Group Cologne - custom_recurrence: "w trzecią środę nieparzystych miesięcy (styczeń, marzec, maj, lipiec, wrzesień, listopad) o 19:00" saar: city: Saarland name: RUGSaar diff --git a/config/whitelabel.yml b/config/whitelabel.yml index 5ed212c61..be2b4341a 100644 --- a/config/whitelabel.yml +++ b/config/whitelabel.yml @@ -40,53 +40,6 @@ :twitter: cocoaheads_hh tld: de coc: http://rubyberlin.github.io/code-of-conduct -- !ruby/object:Usergroup - label_id: cologne - canonical_url: https://www.colognerb.de - status: enabled - default_locale: de - country: Deutschland - recurring: third wednesday - email: colognerb@googlegroups.com - twitter: colognerb - organizers: - - jkwebs - location: - :zoom: 12 - :lat: 50.941231 - :long: 6.957092 - default_time_zone: Europe/Berlin - imprint: - :address: "An der Bottmühle 5\n50678 Köln" - :contributors: - - :name: Jakob Hilden - :email: jakob@railslove.com - - :name: Marco Schaden - :email: hello@donschado.de - - :name: Railslove GmbH - :email: http://railslove.com - other_usergroups: - - :name: Cologne.js - :url: http://colognejs.de/ - :twitter: cgnjs - - :name: DevHouse Friday - :url: http://devhousefriday.org/ - :twitter: devhousefriday - - :name: NoSQL User Group Cologne - :url: http://www.nosql-cologne.org/ - :twitter: nosqlcgn - - :name: pyCologne - :url: http://wiki.python.de/pycologne/ - :twitter: pycologne - - :name: hacken.in - :url: http://hacken.in/ - tld: de - coc: http://rubyberlin.github.io/code-of-conduct - custom_recurring: true - domains: - - colognerb.de - google_group: colognerb - slackin_url: https://colognerb.fly.dev/slackin.js - !ruby/object:Usergroup label_id: saar default_locale: de diff --git a/spec/helpers/external_link_helper_spec.rb b/spec/helpers/external_link_helper_spec.rb index 581def6ab..b15a1cf3e 100644 --- a/spec/helpers/external_link_helper_spec.rb +++ b/spec/helpers/external_link_helper_spec.rb @@ -42,9 +42,11 @@ end describe '#mailing_list_url' do + let(:colognerb) { Usergroup.from_name('colognerb').tap { _1.recurring = 'thrid wednesday' } } + it 'creates an url' do expect(helper.mailing_list_url).to eql('https://groups.google.com/group/rubyonrails-ug-germany') - Whitelabel.with_label(Whitelabel.label_for('cologne')) do + Whitelabel.with_label(colognerb) do expect(helper.mailing_list_url).to eql('https://groups.google.com/group/colognerb') end end diff --git a/spec/models/location_spec.rb b/spec/models/location_spec.rb index 0aee0693b..c239376f2 100644 --- a/spec/models/location_spec.rb +++ b/spec/models/location_spec.rb @@ -3,7 +3,6 @@ describe Location do before do @location = create(:location, name: 'Test-Location', street: 'Schanzenstr.', house_number: '85', zip: '20357', city: 'Hamburg') - @other_location = create(:location, label: 'cologne') @es_location = create(:location, label: 'madridrb') @virtual_location = create(:virtual_location, label: 'madridrb') end @@ -29,7 +28,7 @@ hamburg_locations = Location.all expect(hamburg_locations).to have(1).elements expect(hamburg_locations.first).to eql(@location) - expect(Location.unscoped.size).to be(4) + expect(Location.unscoped.size).to be(3) end end diff --git a/spec/models/usergroup_spec.rb b/spec/models/usergroup_spec.rb index 92ee4382a..1c32ecc24 100644 --- a/spec/models/usergroup_spec.rb +++ b/spec/models/usergroup_spec.rb @@ -4,7 +4,7 @@ let(:every_second_wednesday) { Usergroup.new.tap { |it| it.recurring = 'second wednesday 18:30' } } let(:every_last_wednesday) { Usergroup.new.tap { |it| it.recurring = 'last wednesday 18:30' } } let(:rughh) { Whitelabel.label_for('hamburg') } - let(:colognerb) { Whitelabel.label_for('cologne') } + let(:colognerb) { Usergroup.from_name('cologne').tap { _1.recurring = 'third wednesday 20:00' } } context 'parsing of recurring' do context 'as string' do @@ -78,13 +78,6 @@ end end - describe '#custom_recurring' do - specify do - expect(colognerb.custom_recurring).to be true - expect(rughh.custom_recurring).to be_nil - end - end - describe '#localized_custom_recurrence' do context 'no custom recurring' do it 'returns nil' do @@ -93,22 +86,14 @@ end context 'with custom recurring' do - specify 'de' do - I18n.with_locale(:de) do - expect(colognerb.localized_custom_recurrence).to eql 'jeweils am 3. Mittwoch in jedem 2. Monat (Januar, März, Mai, Juli, September, November) um 19:00 Uhr' - end + before do + rughh.custom_recurring = true end - specify 'en' do - I18n.with_locale(:en) do - expect(colognerb.localized_custom_recurrence).to eql 'every 3rd Wednesday in every second month (January, March, May, July, September, November) at 7:00 p.m.' - end - end + specify 'de' do + allow(I18n).to receive(:tw).with('custom_recurrence').and_return('custom_recurrence') - specify 'es' do - I18n.with_locale(:es) do - expect(colognerb.localized_custom_recurrence).to eql '3er Miércoles de Enero, Marzo, Mayo, Julio, Septiembre y Noviembre, a las 19.00' - end + expect(rughh.localized_custom_recurrence).to eql 'custom_recurrence' end context 'translation for locale is missing (> es)' do @@ -116,8 +101,8 @@ I18n.with_locale(:es) do default_translation = 'jeweils am 3. Mittwoch in jedem 2. Monat (Januar, März, Mai, Juli, September, November) um 19:00 Uhr' allow(I18n).to receive(:tw).with('custom_recurrence').and_return('n/a') - allow(I18n).to receive(:tw).with('custom_recurrence', locale: colognerb.default_locale).and_return(default_translation) - expect(colognerb.localized_custom_recurrence).to eql default_translation + allow(I18n).to receive(:tw).with('custom_recurrence', locale: rughh.default_locale).and_return(default_translation) + expect(rughh.localized_custom_recurrence).to eql default_translation end end end diff --git a/spec/requests/whitelabel_spec.rb b/spec/requests/whitelabel_spec.rb index aeaa3208f..f2a1f3217 100644 --- a/spec/requests/whitelabel_spec.rb +++ b/spec/requests/whitelabel_spec.rb @@ -1,6 +1,22 @@ require 'spec_helper' describe 'Whitelabel' do + let(:hamburg) { Usergroup.from_name('hamburg') } + let(:berlin) { Usergroup.from_name('berlin') } + let(:tokio) { Usergroup.from_name('tokio') } + + around do |example| + whitelabel_backup = Whitelabel.labels + Whitelabel.labels = [ + hamburg, + berlin, + tokio + ] + example.run + ensure + Whitelabel.labels = whitelabel_backup + end + context 'GET label page with non existing subdomain' do it 'does not do an endless redirect but halts' do host! 'www.onruby.test' @@ -18,11 +34,11 @@ context 'GET page with custom domain' do it 'shows the label' do - host! 'www.colognerb.de' + host! 'www.tokio.de' get root_url expect(response).to be_a_successful - expect(Whitelabel[:label_id]).to eql('cologne') + expect(Whitelabel[:label_id]).to eql(tokio.label_id) end end end