diff --git a/app/assets/fonts/mastodon.eot b/app/assets/fonts/mastodon.eot new file mode 100755 index 00000000..59cd79ab Binary files /dev/null and b/app/assets/fonts/mastodon.eot differ diff --git a/app/assets/fonts/mastodon.otf b/app/assets/fonts/mastodon.otf new file mode 100755 index 00000000..2d415249 Binary files /dev/null and b/app/assets/fonts/mastodon.otf differ diff --git a/app/assets/fonts/mastodon.svg b/app/assets/fonts/mastodon.svg new file mode 100755 index 00000000..8ea5bf6e --- /dev/null +++ b/app/assets/fonts/mastodon.svg @@ -0,0 +1,14 @@ + + + +Copyright (C) 2017 by original authors @ fontello.com + + + + + + + + + + \ No newline at end of file diff --git a/app/assets/fonts/mastodon.ttf b/app/assets/fonts/mastodon.ttf new file mode 100755 index 00000000..60c8ad30 Binary files /dev/null and b/app/assets/fonts/mastodon.ttf differ diff --git a/app/assets/fonts/mastodon.woff b/app/assets/fonts/mastodon.woff new file mode 100755 index 00000000..73365373 Binary files /dev/null and b/app/assets/fonts/mastodon.woff differ diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index c95bbb87..0767d15d 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -18,4 +18,5 @@ *= require osem-navbar *= require selectize *= require selectize.bootstrap3 + *= require mastodon */ diff --git a/app/assets/stylesheets/breakpoints.css.scss b/app/assets/stylesheets/breakpoints.scss similarity index 100% rename from app/assets/stylesheets/breakpoints.css.scss rename to app/assets/stylesheets/breakpoints.scss diff --git a/app/assets/stylesheets/mastodon.scss b/app/assets/stylesheets/mastodon.scss new file mode 100755 index 00000000..ddb481d1 --- /dev/null +++ b/app/assets/stylesheets/mastodon.scss @@ -0,0 +1,45 @@ +@font-face { + font-family: 'mastodon'; + src: font-url('mastodon.eot'); + src: local('☺'), + font-url('mastodon.otf') format('opentype'), + font-url('mastodon.woff') format('woff'), + font-url('mastodon.ttf') format('truetype'), + font-url('mastodon.svg') format('svg'); + font-weight: normal; + font-style: normal; +} + + [class^="icon-"]:before, [class*=" icon-"]:before { + font-family: "mastodon"; + font-style: normal; + font-weight: normal; + speak: none; + + display: inline-block; + text-decoration: inherit; + width: 1em; + margin-right: .2em; + text-align: center; + /* opacity: .8; */ + + /* For safety - reset parent styles, that can break glyph codes*/ + font-variant: normal; + text-transform: none; + + /* fix buttons height, for twitter bootstrap */ + line-height: 1em; + + /* you can be more comfortable with increased icons size */ + /* font-size: 120%; */ + + /* Font smoothing. That was taken from TWBS */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + /* Uncomment for 3D effect */ + /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */ +} + +.icon-mastodon:before { content: '\e800'; } /* '' */ +.icon-mastodon_alt:before { content: '\e801'; } /* '' */ diff --git a/app/assets/stylesheets/osem-dashboard.css.scss b/app/assets/stylesheets/osem-dashboard.scss similarity index 96% rename from app/assets/stylesheets/osem-dashboard.css.scss rename to app/assets/stylesheets/osem-dashboard.scss index 5dc69879..b2d0d125 100644 --- a/app/assets/stylesheets/osem-dashboard.css.scss +++ b/app/assets/stylesheets/osem-dashboard.scss @@ -1,4 +1,4 @@ -@import "breakpoints.css.scss"; +@import "breakpoints.scss"; .dashbox span.fa { line-height: 1.1em; diff --git a/app/assets/stylesheets/osem-fonts.css.scss b/app/assets/stylesheets/osem-fonts.scss similarity index 100% rename from app/assets/stylesheets/osem-fonts.css.scss rename to app/assets/stylesheets/osem-fonts.scss diff --git a/app/assets/stylesheets/osem-navbar.css.scss b/app/assets/stylesheets/osem-navbar.scss similarity index 96% rename from app/assets/stylesheets/osem-navbar.css.scss rename to app/assets/stylesheets/osem-navbar.scss index bfaac9ac..011ebc89 100644 --- a/app/assets/stylesheets/osem-navbar.css.scss +++ b/app/assets/stylesheets/osem-navbar.scss @@ -1,4 +1,4 @@ -@import "breakpoints.css.scss"; +@import "breakpoints.scss"; .nav-osem { border: none; @include breakpoint(xs) { diff --git a/app/assets/stylesheets/osem-payments.css.scss b/app/assets/stylesheets/osem-payments.scss similarity index 100% rename from app/assets/stylesheets/osem-payments.css.scss rename to app/assets/stylesheets/osem-payments.scss diff --git a/app/assets/stylesheets/osem-rating.css.scss b/app/assets/stylesheets/osem-rating.scss similarity index 100% rename from app/assets/stylesheets/osem-rating.css.scss rename to app/assets/stylesheets/osem-rating.scss diff --git a/app/assets/stylesheets/osem-schedule.css.scss b/app/assets/stylesheets/osem-schedule.scss similarity index 100% rename from app/assets/stylesheets/osem-schedule.css.scss rename to app/assets/stylesheets/osem-schedule.scss diff --git a/app/assets/stylesheets/osem-splash.css.scss b/app/assets/stylesheets/osem-splash.scss similarity index 99% rename from app/assets/stylesheets/osem-splash.css.scss rename to app/assets/stylesheets/osem-splash.scss index 387dfc00..32cbb822 100644 --- a/app/assets/stylesheets/osem-splash.css.scss +++ b/app/assets/stylesheets/osem-splash.scss @@ -1,4 +1,4 @@ -@import "breakpoints.css.scss"; +@import "breakpoints.scss"; #splash { // Counter the general padding for #content diff --git a/app/assets/stylesheets/osem.css.scss b/app/assets/stylesheets/osem.scss similarity index 100% rename from app/assets/stylesheets/osem.css.scss rename to app/assets/stylesheets/osem.scss diff --git a/app/assets/stylesheets/strap-on.css.scss b/app/assets/stylesheets/strap-on.scss similarity index 100% rename from app/assets/stylesheets/strap-on.css.scss rename to app/assets/stylesheets/strap-on.scss diff --git a/app/controllers/admin/contacts_controller.rb b/app/controllers/admin/contacts_controller.rb index 72ac0d42..1003e098 100644 --- a/app/controllers/admin/contacts_controller.rb +++ b/app/controllers/admin/contacts_controller.rb @@ -22,7 +22,7 @@ module Admin # Only allow a trusted parameter "white list" through. def contact_params - params.require(:contact).permit(:social_tag, :email, :facebook, :googleplus, :twitter, :instagram, :public, :sponsor_email) + params.require(:contact).permit(:social_tag, :email, :facebook, :googleplus, :twitter, :instagram, :mastodon, :public, :sponsor_email) end end end diff --git a/app/models/conference.rb b/app/models/conference.rb index 7f821cdc..03402652 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -595,11 +595,11 @@ class Conference < ApplicationRecord # * +ActiveRecord+ def self.get_active_conferences_for_dashboard result = Conference.where('start_date > ?', Time.now) - .select('id, short_title, color, start_date') + .select('id, short_title, color, start_date, organization_id') if result.empty? result = Conference - .select('id, short_title, color, start_date').limit(2) + .select('id, short_title, color, start_date, organization_id').limit(2) .order(start_date: :desc) end result @@ -611,7 +611,7 @@ class Conference < ApplicationRecord # ====Returns # * +ActiveRecord+ def self.get_conferences_without_active_for_dashboard(active_conferences) - result = Conference.select('id, short_title, color, start_date').order(start_date: :desc) + result = Conference.select('id, short_title, color, start_date, organization_id').order(start_date: :desc) result - active_conferences end @@ -719,7 +719,7 @@ class Conference < ApplicationRecord # * +True+ -> If the registration limit has been reached or exceeded # * +False+ -> If the registration limit hasn't been exceeded def registration_limit_exceeded? - registration_limit > 0 && registrations.count + program.speakers.confirmed.count - program.speakers.confirmed.registered(program.conference).count >= registration_limit + registration_limit > 0 && registrations.count + program.speakers.confirmed.unregistered(program.conference).count >= registration_limit end # Returns an hexadecimal color given a collection. The returned color changed diff --git a/app/models/contact.rb b/app/models/contact.rb index 799c8748..dd7196dd 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -5,11 +5,11 @@ class Contact < ApplicationRecord validates :conference, presence: true # Conferences only have one contact - validates :facebook, :twitter, :googleplus, :instagram, + validates :facebook, :twitter, :googleplus, :instagram, :mastodon, format: URI::regexp(%w(http https)), allow_blank: true def has_social_media? - return true if facebook.present? || twitter.present? || googleplus.present? || instagram.present? || email.present? + return true if facebook.present? || twitter.present? || googleplus.present? || instagram.present? || mastodon.present? || email.present? false end end diff --git a/app/models/program.rb b/app/models/program.rb index dab2f2b6..14554786 100644 --- a/app/models/program.rb +++ b/app/models/program.rb @@ -51,6 +51,10 @@ class Program < ApplicationRecord def registered(conference) joins(:registrations).where('registrations.conference_id = ?', conference.id) end + + def unregistered(conference) + self - registered(conference) + end end accepts_nested_attributes_for :event_types, allow_destroy: true diff --git a/app/views/admin/contacts/edit.html.haml b/app/views/admin/contacts/edit.html.haml index db06dd7e..1c48e48a 100644 --- a/app/views/admin/contacts/edit.html.haml +++ b/app/views/admin/contacts/edit.html.haml @@ -16,4 +16,5 @@ = f.input :googleplus, label: 'Google+ Url', hint: 'This will appear in the social media section as the link to the Google+ Page of your Conference' = f.input :twitter, hint: 'This will appear in the social media section as the link to the Twitter Page of your Conference' = f.input :instagram, hint: 'This will appear in the social media section as the link to the Instagram Page of your Conference' + = f.input :mastodon, hint: 'This will appear in the social media section as the link to the Mastodon Page of your Conference' = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } diff --git a/app/views/admin/venues/show.html.haml b/app/views/admin/venues/show.html.haml index b50c10da..36906e05 100644 --- a/app/views/admin/venues/show.html.haml +++ b/app/views/admin/venues/show.html.haml @@ -8,7 +8,7 @@ .row .col-md-6 - if @conference.venue.location? - = render '/conferences/venue_map' + = render '/conferences/venue_map', venue: @conference.venue -else - if @venue.commercial.nil? .row diff --git a/app/views/booths/show.html.haml b/app/views/booths/show.html.haml index 6b12229d..f1790504 100644 --- a/app/views/booths/show.html.haml +++ b/app/views/booths/show.html.haml @@ -6,7 +6,7 @@ = image_tag(@booth.picture.thumb.url, size: '20%', alt: '') = @booth.title .btn-group.pull-right - = link_to 'Edit', edit_admin_conference_booth_path(@conference.short_title, @booth), class: 'btn btn-mini btn-primary' + = link_to 'Edit', edit_conference_booth_path(@conference.short_title, @booth), class: 'btn btn-mini btn-primary' .row .col-md-12 diff --git a/app/views/conferences/_call_for_papers.haml b/app/views/conferences/_call_for_papers.haml index 3bf0f295..b47d7118 100644 --- a/app/views/conferences/_call_for_papers.haml +++ b/app/views/conferences/_call_for_papers.haml @@ -23,5 +23,5 @@ left! %p.cta-button = link_to "Submit your proposal now", - conference_program_proposals_path(conference_id), + new_conference_program_proposal_path(conference_id), class: 'btn btn-success btn-lg text-center' diff --git a/app/views/conferences/_call_for_tracks.haml b/app/views/conferences/_call_for_tracks.haml index 7eb80fa6..6d78bd05 100644 --- a/app/views/conferences/_call_for_tracks.haml +++ b/app/views/conferences/_call_for_tracks.haml @@ -15,5 +15,5 @@ left! %p.cta-button = link_to("Submit your request for track", - conference_program_tracks_path(conference_id), + new_conference_program_track_path(conference_id), class: 'btn btn-success btn-lg text-center') diff --git a/app/views/conferences/_social_media.html.haml b/app/views/conferences/_social_media.html.haml new file mode 100644 index 00000000..49216b6c --- /dev/null +++ b/app/views/conferences/_social_media.html.haml @@ -0,0 +1,21 @@ +.container + .row + .col-md-12.text-center + - unless @conference.contact.facebook.blank? + = link_to "#{ @conference.contact.facebook }" do + %i.fa.fa-facebook-square.fa-4x + - unless @conference.contact.twitter.blank? + = link_to "#{ @conference.contact.twitter }" do + %i.fa.fa-twitter.fa-4x + - unless @conference.contact.instagram.blank? + = link_to "#{ @conference.contact.instagram }" do + %i.fa.fa-instagram.fa-4x + - unless @conference.contact.googleplus.blank? + = link_to "#{ @conference.contact.googleplus }" do + %i.fa.fa-google-plus-square.fa-4x + - unless @conference.contact.mastodon.blank? + = link_to "#{ @conference.contact.mastodon }" do + %i.fa.icon-mastodon.fa-4x + - unless @conference.contact.email.blank? + = mail_to "#{ @conference.contact.email }" do + %i.fa.fa-envelope-o.fa-4x diff --git a/db/migrate/20171201163628_add_mastodon_to_contact.rb b/db/migrate/20171201163628_add_mastodon_to_contact.rb new file mode 100644 index 00000000..9b022019 --- /dev/null +++ b/db/migrate/20171201163628_add_mastodon_to_contact.rb @@ -0,0 +1,5 @@ +class AddMastodonToContact < ActiveRecord::Migration + def change + add_column :contacts, :mastodon, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 43602f9b..ed33d5a3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171130172334) do +ActiveRecord::Schema.define(version: 20171201163628) do create_table "ahoy_events", force: :cascade do |t| t.integer "visit_id" @@ -145,6 +145,7 @@ ActiveRecord::Schema.define(version: 20171130172334) do t.datetime "created_at" t.datetime "updated_at" t.string "sponsor_email" + t.string "mastodon" end create_table "delayed_jobs", force: :cascade do |t| diff --git a/docker-compose.env.example b/docker-compose.env.example index 905ff612..7bda181b 100644 --- a/docker-compose.env.example +++ b/docker-compose.env.example @@ -34,7 +34,7 @@ SECRET_KEY_BASE=changemechangemechangeme" OSEM_EMAIL_ADDRESS="osem@mailhog" OSEM_SMTP_AUTHENTICATION="login" OSEM_SMTP_ADDRESS="mailhog" -OSEM_SMTP_PORT="1025" +OSEM_SMTP_PORT=1025 OSEM_SMTP_USERNAME="mailhog" OSEM_SMTP_PASSWORD="mailhog"