Add the ability for Rooms to have a URL.
The URL is shown on the schedule and the event/proposal page. The URL is only when a user is logged in and registered.
This commit is contained in:
parent
636ad2cebd
commit
7d2135f851
9 changed files with 39 additions and 17 deletions
|
|
@ -115,6 +115,9 @@ $(document).ready( function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
function eventClicked(e, element){
|
function eventClicked(e, element){
|
||||||
|
if (e.target.href) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var url = $(element).data('url');
|
var url = $(element).data('url');
|
||||||
if(e.ctrlKey)
|
if(e.ctrlKey)
|
||||||
window.open(url,'_blank');
|
window.open(url,'_blank');
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ module Admin
|
||||||
private
|
private
|
||||||
|
|
||||||
def room_params
|
def room_params
|
||||||
params.require(:room).permit(:name, :size)
|
params.require(:room).permit(:name, :size, :url)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -11,5 +11,8 @@
|
||||||
= semantic_form_for(@room, url: (@room.new_record? ? admin_conference_venue_rooms_path : admin_conference_venue_room_path(@conference.short_title, @room))) do |f|
|
= semantic_form_for(@room, url: (@room.new_record? ? admin_conference_venue_rooms_path : admin_conference_venue_room_path(@conference.short_title, @room))) do |f|
|
||||||
= f.input :name, input_html: { autofocus: true }
|
= f.input :name, input_html: { autofocus: true }
|
||||||
= f.input :size, label: 'Capacity', input_html: {size: 5}
|
= f.input :size, label: 'Capacity', input_html: {size: 5}
|
||||||
|
= f.input :url, label: 'URL'
|
||||||
|
%p.small
|
||||||
|
The URL is only visible to registered attendees.
|
||||||
%p.text-right
|
%p.text-right
|
||||||
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
|
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
%thead
|
%thead
|
||||||
%th Name
|
%th Name
|
||||||
%th Capacity
|
%th Capacity
|
||||||
|
%th URL
|
||||||
%th Actions
|
%th Actions
|
||||||
%tbody
|
%tbody
|
||||||
- @rooms.each_with_index do |room, index|
|
- @rooms.each_with_index do |room, index|
|
||||||
|
|
@ -21,11 +22,13 @@
|
||||||
%td
|
%td
|
||||||
= room.size
|
= room.size
|
||||||
%td
|
%td
|
||||||
= link_to 'Edit', edit_admin_conference_venue_room_path(@conference.short_title, room.id),
|
= room.url
|
||||||
method: :get, class: 'btn btn-primary'
|
%td
|
||||||
= link_to 'Delete', admin_conference_venue_room_path(@conference.short_title, room.id),
|
= link_to 'Edit', edit_admin_conference_venue_room_path(@conference.short_title, room.id), class: 'btn btn-primary'
|
||||||
|
= link_to('Delete',
|
||||||
|
admin_conference_venue_room_path(@conference.short_title, room.id),
|
||||||
method: :delete, class: 'btn btn-danger',
|
method: :delete, class: 'btn btn-danger',
|
||||||
data: { confirm: "Do you really want to delete #{room.name}? Attention: This room will be removed from all Events that have it set"}
|
data: { confirm: "Do you really want to delete #{room.name}? Attention: This room will be removed from all Events that have it set"})
|
||||||
.row
|
.row
|
||||||
.col-md-12.text-right
|
.col-md-12.text-right
|
||||||
= link_to 'Add Room', new_admin_conference_venue_room_path(@conference.short_title), class: 'btn btn-primary'
|
= link_to 'Add Room', new_admin_conference_venue_room_path(@conference.short_title), class: 'btn btn-primary'
|
||||||
|
|
|
||||||
|
|
@ -8,18 +8,22 @@
|
||||||
%meta{ property: "og:image:secure_url", content: @speakers_ordered.first.gravatar_url }
|
%meta{ property: "og:image:secure_url", content: @speakers_ordered.first.gravatar_url }
|
||||||
|
|
||||||
.container
|
.container
|
||||||
.row
|
.row.page-header
|
||||||
.col-md-12.page-header
|
.col-md-10
|
||||||
%h2
|
%h2
|
||||||
= @event.title
|
= @event.title
|
||||||
- if @event.subtitle
|
- if @event.subtitle
|
||||||
%br
|
%br
|
||||||
%small
|
%small
|
||||||
= @event.subtitle
|
= @event.subtitle
|
||||||
.btn-group.pull-right
|
- if @event.room&.url && @conference.user_registered?(current_user)
|
||||||
- if can? :update, @event
|
%h3
|
||||||
|
= link_to('Join Event', @event.room.url, target: '_blank')
|
||||||
|
.col-md-2
|
||||||
|
%p{style: "margin-top: 20px"}
|
||||||
|
- if can?(:update, @event) && @event.require_registration?
|
||||||
= link_to 'Registrations', registrations_conference_program_proposal_path(@conference.short_title, @event), class: 'btn btn-mini btn-success'
|
= link_to 'Registrations', registrations_conference_program_proposal_path(@conference.short_title, @event), class: 'btn btn-mini btn-success'
|
||||||
- if can? :edit, @event
|
- if can?(:edit, @event)
|
||||||
= link_to "Edit", edit_conference_program_proposal_path(@conference.short_title, @event), class: 'btn btn-mini btn-primary'
|
= link_to "Edit", edit_conference_program_proposal_path(@conference.short_title, @event), class: 'btn btn-mini btn-primary'
|
||||||
- if can? :schedule, @conference
|
- if can? :schedule, @conference
|
||||||
= link_to "Schedule", conference_schedule_path(@conference.short_title), class: 'btn btn-success'
|
= link_to "Schedule", conference_schedule_path(@conference.short_title), class: 'btn btn-success'
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,9 @@
|
||||||
%h4
|
%h4
|
||||||
- if(event.speakers.any?)
|
- if(event.speakers.any?)
|
||||||
presented by #{event.speaker_names}
|
presented by #{event.speaker_names}
|
||||||
|
- if event.room&.url && @conference.user_registered?(current_user)
|
||||||
|
%p
|
||||||
|
= link_to('Join Event', event.room.url, target: '_blank')
|
||||||
%p
|
%p
|
||||||
= markdown(truncate(event.abstract, length: 400))
|
= markdown(truncate(event.abstract, length: 400))
|
||||||
= link_to 'more', conference_program_proposal_path(@conference.short_title, event.id) if event.abstract.length > 400
|
= link_to 'more', conference_program_proposal_path(@conference.short_title, event.id) if event.abstract.length > 400
|
||||||
|
|
|
||||||
5
db/migrate/20200710215300_add_url_to_rooms.rb
Normal file
5
db/migrate/20200710215300_add_url_to_rooms.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddUrlToRooms < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
add_column :rooms, :url, :text
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 2020_03_31_214534) do
|
ActiveRecord::Schema.define(version: 2020_07_10_215300) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
@ -406,6 +406,7 @@ ActiveRecord::Schema.define(version: 2020_03_31_214534) do
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.integer "size"
|
t.integer "size"
|
||||||
t.integer "venue_id", null: false
|
t.integer "venue_id", null: false
|
||||||
|
t.text "url"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "schedules", force: :cascade do |t|
|
create_table "schedules", force: :cascade do |t|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue