From 741a357d2235577f0c2c8b6d3296f0f9db6ce2a9 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Sun, 9 Oct 2016 00:29:17 +0300 Subject: [PATCH] Display all events except the current one --- app/views/management/events/_speaker.slim | 45 ++++++++++++----------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/app/views/management/events/_speaker.slim b/app/views/management/events/_speaker.slim index af1138d..a49ccd1 100644 --- a/app/views/management/events/_speaker.slim +++ b/app/views/management/events/_speaker.slim @@ -43,30 +43,31 @@ = t('.no_profile') =< link_to icon(:plus, t('.create_profile')), new_management_conference_personal_profile_path(conference_id: @conference.id, user_id: speaker.id), class: ['btn', 'btn-primary', 'btn-xs'] - h4 = t '.previous_event_propositions' - table.table.table-striped.table-hover.record-table - thead - tr - th - = Event.human_attribute_name :title - th - = Event.human_attribute_name :conference - th - = Event.human_attribute_name :status - th - - tbody - - speaker.events_participated_in.each do |event| + - if speaker.events_participated_in.where.not(id: @event.id).any? + h4 = t '.previous_event_propositions' + table.table.table-striped.table-hover.record-table + thead tr - td = event.title - td = event.conference.title - td - span class="label label-lg label-#{proposition_status_class(@event.status)}" - = icon(proposition_status_glyph(@event.status), t("activerecord.attributes.proposition.statuses.#{@event.status}")) + th + = Event.human_attribute_name :title + th + = Event.human_attribute_name :conference + th + = Event.human_attribute_name :status + th - td.actions - .btn-group.btn-group-sm - = action_buttons event.conference, event, [:show] + tbody + - speaker.events_participated_in.where.not(id: @event.id).order(created_at: :desc).each do |event| + tr + td = event.title + td = event.conference.title + td + span class="label label-lg label-#{proposition_status_class(event.status)}" + = icon(proposition_status_glyph(event.status), t("activerecord.attributes.proposition.statuses.#{@event.status}")) + + td.actions + .btn-group.btn-group-sm + = action_buttons event.conference, event, [:show] - if personal_profile.present?