Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions app/assets/stylesheets/partials/activities/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 7 additions & 3 deletions app/decorators/activity_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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

Expand Down
6 changes: 5 additions & 1 deletion app/views/activities/_action.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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")
5 changes: 0 additions & 5 deletions app/views/activities/_activity.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down