diff --git a/app/assets/stylesheets/partials/activities/_index.scss b/app/assets/stylesheets/partials/activities/_index.scss index 96658eaf..ac42ea8c 100644 --- a/app/assets/stylesheets/partials/activities/_index.scss +++ b/app/assets/stylesheets/partials/activities/_index.scss @@ -73,6 +73,17 @@ a#new-activity { } } + &.official { + span.icon { + background: image-url('shared/IoR_illustration.svg'); + background-repeat: no-repeat; + /*background-position: 0 10px;*/ + display: inline-block; + height: 40px; + width: 40px; + } + } + // links are actually stacked in this case // as one card has to support many purposes a { @@ -203,6 +214,18 @@ a#new-activity { } } + &.official { + .action { + background: image-url('shared/IoR_illustration.svg'); + background-repeat: no-repeat; + background-position: 0 20px; + display: block; + height: 96px; + margin: 0 auto 0.75em; + width: 96px; + } + } + // HOVER state &:hover { cursor: pointer; diff --git a/app/decorators/activity_decorator.rb b/app/decorators/activity_decorator.rb index 2662751d..d91538c7 100644 --- a/app/decorators/activity_decorator.rb +++ b/app/decorators/activity_decorator.rb @@ -2,7 +2,11 @@ class ActivityDecorator < Draper::Decorator delegate_all def css_classes - classes = [relation_ship_with(h.current_user)] + classes = [ + relation_ship_with(h.current_user) || + object.official? ? 'official' : default + ] + # classes << 'official' if object.official? classes << "today" if object.today? classes << "past" if object.in_past? classes << "full" if object.full? @@ -19,10 +23,10 @@ def creator_name end def relation_ship_with(user) - if user.nil? then "default" + if user.nil? elsif object.creator == user then "owner" elsif object.participants.include? user then "participant" - else "default" + else end end diff --git a/app/views/activities/_action.html.haml b/app/views/activities/_action.html.haml index 4909679a..38819c42 100644 --- a/app/views/activities/_action.html.haml +++ b/app/views/activities/_action.html.haml @@ -11,7 +11,11 @@ %span = t("activities.leave.label") - else - - unless activity.full? || activity.in_past? || activity.official + - if activity.official + = link_to activity_path(activity), title: t("activities.official.title") do + %span + = t("activities.official.label") + - elsif !activity.full? && !activity.in_past? = button_to activity_participation_path(activity), method: :post, remote: remote, title: t("activities.join.title") do %span = t("activities.join.label") diff --git a/app/views/activities/_activity.html.haml b/app/views/activities/_activity.html.haml index f97b5442..a67edff5 100644 --- a/app/views/activities/_activity.html.haml +++ b/app/views/activities/_activity.html.haml @@ -10,11 +10,6 @@ = activity.name %p.creator = activity.creator_name - - if activity.requires_event_ticket - = image_tag 'shared/IoR_illustration.svg', - class: 'requires_event_ticket', - alt: t('activities.requires_event_ticket'), - title: t('activities.requires_event_ticket') %p.time = activity.time.html_safe diff --git a/config/locales/en.yml b/config/locales/en.yml index 613a8eba..bcc3b76b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -69,6 +69,9 @@ en: leave: label: Cancel title: Cancel your participation + official: + label: Official + title: Part of Isle of Ruby official programme more_info: label: More info label_long: View activity details