Added semi-functional administration pages
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
= form_tag administration_update_path(@this_conference.slug, :broadcast) do
|
||||
- if @broadcast_step == :preview || @broadcast_step == :test
|
||||
= hidden_field_tag :subject, @subject
|
||||
= hidden_field_tag :body, @body
|
||||
.test-preview
|
||||
%h4=@subject
|
||||
= richtext @body, 4
|
||||
.actions.right
|
||||
= button_tag :test, value: :test, class: :secondary if @broadcast_step == :preview
|
||||
= button_with_confirmation :send, (_'modals.admin.broadcast.confirm', vars: { number: @subscriber_count || 0 }), value: :send, class: :delete if @broadcast_step == :test
|
||||
= button_tag :edit, value: :edit
|
||||
- else
|
||||
= textfield :subject, @subject, required: true, big: true
|
||||
= textarea :body, @body, heading: 'articles.conference_registration.headings.admin.edit.info', help: 'articles.conference_registration.paragraphs.admin.edit.info', lang: @this_conference.locale, edit_on: :focus
|
||||
.actions.right
|
||||
= button_tag :preview, value: :preview
|
||||
-# I18n.backend.enabled_locales.each do | locale |
|
||||
-# if locale.to_s != @this_conference.locale.to_s
|
||||
-#= textarea "info_translations[#{locale.to_s}]", (richtext @this_conference._info(locale)), label: 'translate.pages.Locale_Translation', vars: { language: _("languages.#{locale}") }, lang: locale
|
||||
@@ -0,0 +1 @@
|
||||
Sent.
|
||||
@@ -0,0 +1,7 @@
|
||||
= form_tag administration_update_path(@this_conference.slug, :edit) do
|
||||
= textarea :info, @this_conference.info!, heading: 'articles.conference_registration.headings.admin.edit.info', help: 'articles.conference_registration.paragraphs.admin.edit.info', lang: @this_conference.locale, edit_on: :focus
|
||||
- I18n.backend.enabled_locales.each do | locale |
|
||||
- if locale.to_s != @this_conference.locale.to_s
|
||||
= textarea "info_translations[#{locale.to_s}]", @this_conference._info(locale), label: 'translate.pages.Locale_Translation', vars: { language: _("languages.#{locale}") }, lang: locale, edit_on: :focus
|
||||
.actions.right
|
||||
= button_tag :save, value: :save
|
||||
@@ -0,0 +1,36 @@
|
||||
- if @events.present?
|
||||
%ul.events.admin-blocks
|
||||
- @events.each do | event |
|
||||
%li
|
||||
%h4.title=event.title
|
||||
.details
|
||||
= data_set(:h5, 'forms.labels.generic.event_location', class: :location) do
|
||||
=event.event_location.present? ? event.event_location.title : ''
|
||||
= data_set(:h5, 'forms.labels.generic.day', class: :day) do
|
||||
= date(event.start_time.to_date, :weekday)
|
||||
= data_set(:h5, 'forms.labels.generic.time', class: :time) do
|
||||
= time(event.start_time, :short)
|
||||
= data_set(:h5, 'forms.labels.generic.time_span', class: 'time-span') do
|
||||
= hours(event.start_time, event.end_time)
|
||||
= form_tag administration_update_path(@this_conference.slug, :events), class: [:actions, :fill] do
|
||||
= hidden_field_tag :id, event.id
|
||||
= button_with_confirmation :delete, (_'modals.admin.generic.delete.confirm', :p, vars: { title: event.title }), value: :delete, class: [:delete, :small]
|
||||
= button_tag :edit, value: :edit, class: [:small]
|
||||
|
||||
%h4=_"articles.admin.locations.headings.#{@event.id.present? ? 'edit' : 'add'}_event", :t
|
||||
= form_tag administration_update_path(@this_conference.slug, :events) do
|
||||
= hidden_field_tag :id, @event.id if @event.id.present?
|
||||
= textfield :title, @event.title!, required: true, big: true, lang: @event.locale
|
||||
= textarea :info, @event.info!, heading: 'articles.conference_registration.headings.admin.edit.info', help: 'articles.conference_registration.paragraphs.admin.edit.info', lang: @event.locale, edit_on: :focus
|
||||
.flex-inputs
|
||||
= location_select @event.event_location_id, small: true, stretch: true
|
||||
= day_select @day, small: true, format: :weekday
|
||||
= time_select @time, small: true
|
||||
= length_select @length, small: true
|
||||
- I18n.backend.enabled_locales.each do | locale |
|
||||
- if locale.to_s != @event.locale.to_s
|
||||
= textfield "title_translations[#{locale.to_s}]", @event._title(locale), big: true, heading: 'translate.pages.Locale_Translation', vars: { language: _("languages.#{locale}") }, label: 'forms.labels.generic.title', lang: locale
|
||||
= textarea "info_translations[#{locale.to_s}]", @event._info(locale), lang: locale, label: 'forms.labels.generic.info', edit_on: :focus
|
||||
.actions.next-prev
|
||||
= button_tag :save, value: :save
|
||||
= button_tag :cancel, value: :cancel, class: :subdued, formnovalidate: true if @event.id.present?
|
||||
@@ -0,0 +1,26 @@
|
||||
- add_inline_script :housing
|
||||
= form_tag administration_update_path(@this_conference.slug, :housing), id: :hosts, class: 'on-top-target' do
|
||||
= hidden_field_tag :guest_id
|
||||
.on-top-controls
|
||||
= button_tag :close, type: :button, class: ['on-top-close']
|
||||
%ul
|
||||
- @hosts.each do | id, registration |
|
||||
- if registration.user.present?
|
||||
- widget_data = host_guests_widget(registration)
|
||||
%li{id: "host-#{id}", class: widget_data[:class]}
|
||||
%h4=registration.user.name
|
||||
.email=registration.user.email
|
||||
.address=registration.housing_data['address']
|
||||
.guests=widget_data[:html]
|
||||
#guests
|
||||
%h4=_'articles.admin.housing.headings.guests', :t
|
||||
%ul.guests
|
||||
- @guests.each do | id, registration |
|
||||
- if registration.user.present?
|
||||
%li.guest{id: "guest-#{id}", data: { id: id, 'affected-hosts': @hosts_affected_by_guests[id].join(',') }}
|
||||
%h4= registration.user.name
|
||||
.city.on-top-only=registration.city
|
||||
.email.on-top-only=registration.user.email
|
||||
= button_tag :set_host, type: :button, class: [:small, 'set-host', 'not-on-top']
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
- unless @location.present?
|
||||
%ul.locations.admin-blocks
|
||||
- @locations.each do | location |
|
||||
%li
|
||||
%h4.title=location.title
|
||||
.details
|
||||
= data_set(:h5, 'forms.labels.generic.address', class: :address) do
|
||||
=location.address
|
||||
= data_set(:h5, 'articles.workshops.headings.space', class: :space) do
|
||||
= _"workshop.options.space.#{location.space}"
|
||||
- amenities = location.amenities.present? ? JSON.parse(location.amenities) : []
|
||||
- if amenities.present?
|
||||
= data_set(:h5, 'articles.admin.locations.headings.amenities', class: :amenities) do
|
||||
%ul.amenities
|
||||
- amenities.each do | amenity |
|
||||
%li=_"workshop.options.needs.#{amenity}"
|
||||
= form_tag administration_update_path(@this_conference.slug, :locations), class: [:actions, :fill] do
|
||||
= hidden_field_tag :id, location.id
|
||||
= button_tag :edit, value: :edit, class: :small
|
||||
= button_with_confirmation :delete, (_'modals.admin.generic.delete.confirm', :p, vars: { title: location.title }), value: :delete, class: [:delete, :small]
|
||||
%h4=_"articles.admin.locations.headings.#{@location.present? ? 'edit' : 'add'}_location", :t
|
||||
= form_tag administration_update_path(@this_conference.slug, :locations) do
|
||||
= hidden_field_tag :id, @location.id if @location.present?
|
||||
= textfield :title, @location.present? ? @location.title : nil, required: true, big: true
|
||||
= textfield :address, @location.present? ? @location.address : nil, required: true
|
||||
= columns(medium: 6) do
|
||||
= radiobuttons :space, EventLocation.all_spaces, @location.present? ? @location.space : nil, 'workshop.options.space', vertical: true, heading: 'articles.workshops.headings.space'
|
||||
= columns(medium: 6) do
|
||||
= checkboxes :needs, EventLocation.all_amenities, @location.present? ? JSON.parse(@location.amenities) : [], 'workshop.options.needs', vertical: true, heading: 'articles.admin.locations.headings.amenities'
|
||||
.actions.next-prev
|
||||
- if @location.present?
|
||||
= button_tag :save, value: :save
|
||||
= button_tag :cancel, value: :cancel, class: :subdued, formnovalidate: true
|
||||
- else
|
||||
= button_tag :create, value: :create
|
||||
@@ -0,0 +1,30 @@
|
||||
- if @this_conference.meals.present?
|
||||
%table.meals
|
||||
%tr
|
||||
%th=_'forms.labels.generic.title'
|
||||
%th=_'forms.labels.generic.info'
|
||||
%th=_'forms.labels.generic.event_location'
|
||||
%th=_'forms.labels.generic.day'
|
||||
%th=_'forms.labels.generic.time'
|
||||
%th.form
|
||||
- Hash[@this_conference.meals.map{ |k, v| [k.to_i, v] }].sort.to_h.each do | time, meal |
|
||||
%tr
|
||||
%th
|
||||
=_!(meal['title'] || '')
|
||||
%td=_!(meal['info'] || '')
|
||||
%td=_!location_name(meal['location'].to_i)
|
||||
%td=date(meal['day'], :weekday)
|
||||
%td=time(meal['time'].to_f)
|
||||
%td.form
|
||||
= form_tag administration_update_path(@this_conference.slug, :meals) do
|
||||
= hidden_field_tag :meal, time
|
||||
= button_tag :delete, value: :delete, class: [:small, :delete]
|
||||
= form_tag administration_update_path(@this_conference.slug, :meals) do
|
||||
.flex-inputs
|
||||
= location_select nil, small: true, stretch: true
|
||||
= day_select nil, small: true, format: :weekday
|
||||
= time_select nil, small: true
|
||||
= textfield :title, nil, required: true, big: true
|
||||
= textfield :info, nil
|
||||
.actions.next-prev
|
||||
= button_tag :add_meal, value: :add_meal
|
||||
Reference in New Issue
Block a user