Extend Management::EventsController#show views
This commit is contained in:
parent
a19efc6c50
commit
4721b6bcda
|
@ -9,6 +9,8 @@ class User < ActiveRecord::Base
|
||||||
has_many :workshops
|
has_many :workshops
|
||||||
has_many :propositions, foreign_key: :proposer_id
|
has_many :propositions, foreign_key: :proposer_id
|
||||||
has_many :events, through: :propositions, source: :proposable, source_type: 'Event'
|
has_many :events, through: :propositions, source: :proposable, source_type: 'Event'
|
||||||
|
has_many :participations, foreign_key: :participant_id
|
||||||
|
has_many :events_participated_in, through: :participations, source: :event
|
||||||
has_many :volunteerships, foreign_key: :volunteer_id
|
has_many :volunteerships, foreign_key: :volunteer_id
|
||||||
|
|
||||||
def find_or_build_personal_profile(conference, params = {})
|
def find_or_build_personal_profile(conference, params = {})
|
||||||
|
|
|
@ -1,26 +1,76 @@
|
||||||
- personal_profile = speaker.personal_profile(@conference) || speaker.personal_profiles.last
|
- personal_profile = speaker.personal_profile(@conference) || speaker.personal_profiles.last
|
||||||
|
|
||||||
- if personal_profile.present?
|
|
||||||
.speaker-profile
|
|
||||||
.panel.panel-default
|
.panel.panel-default
|
||||||
.panel-heading
|
|
||||||
h1.panel-title
|
|
||||||
= personal_profile.name
|
|
||||||
= link_to icon(:edit), [:edit, :management, @conference, personal_profile], class: 'btn btn-xs btn-danger pull-right'
|
|
||||||
.panel-body
|
.panel-body
|
||||||
.center
|
.media
|
||||||
|
.media-left.hidden-sm.hidden-xs
|
||||||
|
- if personal_profile.present?
|
||||||
= image_tag personal_profile.picture.medium.url, class: "profile-image"
|
= image_tag personal_profile.picture.medium.url, class: "profile-image"
|
||||||
|
- else
|
||||||
|
= icon :user, class: 'fa-5x'
|
||||||
|
.media-body
|
||||||
|
.text-center.visible-sm.visible-xs
|
||||||
|
- if personal_profile.present?
|
||||||
|
= image_tag personal_profile.picture.medium.url, class: "profile-image img-thumbnail"
|
||||||
|
- else
|
||||||
|
= icon :user, class: 'fa-5x'
|
||||||
|
- if personal_profile.present?
|
||||||
|
h4.media-heading
|
||||||
|
= personal_profile.name
|
||||||
|
- unless personal_profile.conference == @conference
|
||||||
|
small<
|
||||||
|
| (
|
||||||
|
= t('.profile_from', conference: personal_profile.conference.title)
|
||||||
|
| )
|
||||||
hr
|
hr
|
||||||
- if personal_profile.organisation.present?
|
|
||||||
p #{icon :briefcase} @#{personal_profile.organisation}
|
|
||||||
|
|
||||||
h4 = PersonalProfile.human_attribute_name(:biography)
|
h4 = PersonalProfile.human_attribute_name(:biography)
|
||||||
= simple_format personal_profile.biography
|
= simple_format personal_profile.biography
|
||||||
|
|
||||||
h4 = t :contacts
|
h4 = t '.contacts'
|
||||||
|
- if personal_profile.organisation.present?
|
||||||
|
p #{icon :briefcase} @#{personal_profile.organisation}
|
||||||
- if personal_profile.twitter.present?
|
- if personal_profile.twitter.present?
|
||||||
p #{icon :twitter} @#{personal_profile.twitter}
|
p #{icon :twitter} @#{personal_profile.twitter}
|
||||||
- if personal_profile.public_email.present?
|
- if personal_profile.public_email.present?
|
||||||
p #{icon :envelope} #{personal_profile.public_email} (#{t(:public)})
|
p #{icon :envelope} #{personal_profile.public_email} (#{t(:public)})
|
||||||
p #{icon :envelope} #{speaker.email} (#{t(:private)})
|
p #{icon :envelope} #{speaker.email} (#{t(:private)})
|
||||||
p #{glyph :phone} #{Phony.format(personal_profile.mobile_phone, format: :international)}
|
p #{glyph :phone} #{Phony.format(personal_profile.mobile_phone, format: :international)}
|
||||||
|
- else
|
||||||
|
h4.media-heading
|
||||||
|
= speaker.email
|
||||||
|
hr
|
||||||
|
p
|
||||||
|
= 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|
|
||||||
|
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?
|
||||||
|
.panel-footer
|
||||||
|
.text-right
|
||||||
|
.btn-group.btn-group-sm
|
||||||
|
= action_buttons @conference, personal_profile, [:show, :edit]
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
|
- content_for :title
|
||||||
|
= t('.review', event_type: @event.event_type.name.mb_chars.downcase, event_title: @event.title)
|
||||||
|
|
||||||
.row
|
.row
|
||||||
|
.col-xs-12
|
||||||
h1.page-header
|
h1.page-header
|
||||||
= @event.title
|
= @event.title
|
||||||
small<
|
small<
|
||||||
|
@ -19,7 +23,8 @@
|
||||||
=< t "status.#{status}"
|
=< t "status.#{status}"
|
||||||
div.btn-group.btn-group-sm
|
div.btn-group.btn-group-sm
|
||||||
= action_buttons(@conference, @event, [:index, :edit])
|
= action_buttons(@conference, @event, [:index, :edit])
|
||||||
|
.row
|
||||||
|
.col-xs-12
|
||||||
h3 = Event.human_attribute_name :abstract
|
h3 = Event.human_attribute_name :abstract
|
||||||
p = simple_format @event.abstract
|
p = simple_format @event.abstract
|
||||||
|
|
||||||
|
@ -28,6 +33,6 @@
|
||||||
- if @event.notes.present?
|
- if @event.notes.present?
|
||||||
h3 = Event.human_attribute_name :notes
|
h3 = Event.human_attribute_name :notes
|
||||||
p = simple_format @event.notes
|
p = simple_format @event.notes
|
||||||
.row
|
.col-xs-12
|
||||||
.col-lg-12
|
h3 = Event.human_attribute_name :participants
|
||||||
= render partial: 'speaker', collection: @event.participants
|
= render partial: 'speaker', collection: @event.participants
|
||||||
|
|
|
@ -2,8 +2,17 @@ bg:
|
||||||
management:
|
management:
|
||||||
conferences:
|
conferences:
|
||||||
show:
|
show:
|
||||||
|
summary: 'Обобщение'
|
||||||
cfp_status: 'Състояние на CFP:'
|
cfp_status: 'Състояние на CFP:'
|
||||||
events:
|
events:
|
||||||
|
speaker:
|
||||||
|
no_profile: 'Този потребител няма въведени профили в системата.'
|
||||||
|
profile_from: "профил от %{conference}"
|
||||||
|
create_profile: "Създай нов профил"
|
||||||
|
previous_event_propositions: 'Предишни предложения за събития'
|
||||||
|
contacts: "Информация за контакт"
|
||||||
|
show:
|
||||||
|
review: "Преглед на %{event_type} „%{event_title}“"
|
||||||
index:
|
index:
|
||||||
all: "Всички"
|
all: "Всички"
|
||||||
event:
|
event:
|
||||||
|
@ -56,6 +65,8 @@ bg:
|
||||||
planned_cfp_end_date: "Планиран край на зова за лектори"
|
planned_cfp_end_date: "Планиран край на зова за лектори"
|
||||||
title: "Заглавие"
|
title: "Заглавие"
|
||||||
event:
|
event:
|
||||||
|
conference: "Конференция"
|
||||||
|
status: "Състояние"
|
||||||
abstract: "Резюме"
|
abstract: "Резюме"
|
||||||
agreement: "Съгласен(на) съм"
|
agreement: "Съгласен(на) съм"
|
||||||
description: "Описание"
|
description: "Описание"
|
||||||
|
@ -66,6 +77,7 @@ bg:
|
||||||
title: "Заглавие"
|
title: "Заглавие"
|
||||||
track: "Поток от лекции"
|
track: "Поток от лекции"
|
||||||
user: "Лектор"
|
user: "Лектор"
|
||||||
|
participants: "Участници"
|
||||||
event_type:
|
event_type:
|
||||||
description: "Описание"
|
description: "Описание"
|
||||||
name: "Име"
|
name: "Име"
|
||||||
|
|
Loading…
Reference in New Issue