Management fixes

This commit is contained in:
Andrew Radev 2015-08-05 15:05:31 +03:00
parent 9f5d7f2bb2
commit f5249be3d4
5 changed files with 22 additions and 28 deletions

View File

@ -45,5 +45,5 @@ nav.navbar.navbar-static-top.navbar-inverse role="navigation"
= link_to t("locales.#{locale}"), "?locale=#{locale}"
- if user_signed_in?
li
= link_to destroy_user_session_path, method: :delete do
= link_to destroy_management_user_session_path, method: :delete do
= icon 'sign-out', t('sessions.sign_out')

View File

@ -22,7 +22,12 @@
tr
td= event.title
td= event.subtitle
td= link_to proposer_profile.name, [:management, @conference, proposer]
td
- if proposer_profile
= link_to proposer_profile.name, [:management, @conference, proposer_profile]
- else
| No profile for user #{proposer.email}
td #{event.length} minutes
td= event.language

View File

@ -6,8 +6,11 @@ class CreateParticipationRecords < ActiveRecord::Migration
event_to_speaker_profiles = execute 'SELECT * FROM events_speaker_profiles'
event_to_speaker_profiles.each do |event_to_speaker_profile|
profile = PersonalProfile.find_by(id: event_to_speaker_profile['speaker_profile_id'])
next if not profile
Participation.create! event_id: event_to_speaker_profile['event_id'],
participant_id: PersonalProfile.find(event_to_speaker_profile['speaker_profile_id']).user_id,
participant_id: profile.user_id,
approved: true
end
end

View File

@ -1,14 +1,15 @@
FactoryGirl.define do
factory :personal_profile do
association :user
first_name "Some"
last_name "Person"
picture File.open(Rails.root.join("spec/support/picture.jpg"))
mobile_phone "0883 123 456"
biography "Biography"
sequence(:public_email) { |n| "email#{n}@example.com" }
twitter "example"
github "example"
first_name 'Foo'
last_name 'Bar'
organisation 'foo inc.'
public_email 'foo@example.com'
picture { Rack::Test::UploadedFile.new(File.join(Rails.root, 'spec', 'support', 'picture.jpg')) }
mobile_phone '+359883444555'
biography 'Just a bio'
github 'foobar'
twitter 'foobar'
user
conference
end
end

View File

@ -1,15 +0,0 @@
FactoryGirl.define do
factory :personal_profile do
first_name 'Foo'
last_name 'Bar'
organisation 'foo inc.'
public_email 'foo@example.com'
picture { Rack::Test::UploadedFile.new(File.join(Rails.root, 'spec', 'support', 'picture.jpg')) }
mobile_phone '+359883444555'
biography 'Just a bio'
github 'foobar'
twitter 'foobar'
user
conference
end
end