diff --git a/app/assets/javascripts/management/application.js b/app/assets/javascripts/management/application.js index 8d65666..e82c068 100644 --- a/app/assets/javascripts/management/application.js +++ b/app/assets/javascripts/management/application.js @@ -1,8 +1,6 @@ //= require jquery //= require jquery_ujs //= require jquery_nested_form -//= require dataTables/jquery.dataTables -//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap //= require bootstrap-sprockets //= require raphael //= require morris diff --git a/app/assets/javascripts/management/navigation.js.coffee b/app/assets/javascripts/management/navigation.js.coffee deleted file mode 100644 index 84396ee..0000000 --- a/app/assets/javascripts/management/navigation.js.coffee +++ /dev/null @@ -1,29 +0,0 @@ -$ -> - $('#side-menu').metisMenu(); - -$ -> - $(window).bind "load resize", -> - topOffset = 50 - width = if this.window.innerWidth > 0 - this.window.innerWidth - else - this.screen.width - - if width < 768 - $('.collapsable').addClass 'collapse' - topOffset = 100 - else - $('.collapsable').removeClass 'collapse' - - height = if this.window.innerHeight > 0 ? - this.window.innerHeight - else - this.screen.height - - height = height - topOffset - - if height < 1 - height = 1 - - if height > topOffset - $("#page-wrapper").css("min-height", (height) + "px") diff --git a/app/assets/javascripts/management/tables.js.coffee b/app/assets/javascripts/management/tables.js.coffee deleted file mode 100644 index bbbdf2d..0000000 --- a/app/assets/javascripts/management/tables.js.coffee +++ /dev/null @@ -1,2 +0,0 @@ -$ -> - $('[data-table]').dataTable(); diff --git a/app/assets/stylesheets/management/_navigation.scss b/app/assets/stylesheets/management/_navigation.scss deleted file mode 100644 index e69de29..0000000 diff --git a/app/assets/stylesheets/management/application.css.scss b/app/assets/stylesheets/management/application.css.scss index b703034..d83c409 100644 --- a/app/assets/stylesheets/management/application.css.scss +++ b/app/assets/stylesheets/management/application.css.scss @@ -6,12 +6,9 @@ @import "bootstrap"; @import "bootswatch/simplex/bootswatch"; -@import "dataTables/jquery.dataTables"; -@import "dataTables/bootstrap/3/jquery.dataTables.bootstrap"; @import "morris"; @import "layout"; -@import "navigation"; @import "forms"; @import "record_tables"; @import "dashboard"; \ No newline at end of file diff --git a/app/controllers/management/events_controller.rb b/app/controllers/management/events_controller.rb index 7f129f7..1600d3b 100644 --- a/app/controllers/management/events_controller.rb +++ b/app/controllers/management/events_controller.rb @@ -1,56 +1,9 @@ module Management class EventsController < ManagementController - before_action :assign_suggestion, only: [:show, :state] - def index - @suggestion_groups = SuggestionGroup.for_conference Conference.current - end - - def approved - @suggestion_groups = SuggestionGroup.for_conference Conference.current, state: Event.states[:approved] - render :index - end - - def undecided - @suggestion_groups = SuggestionGroup.for_conference Conference.current, state: Event.states[:undecided] - render :index - end - - def rejected - @suggestion_groups = SuggestionGroup.for_conference Conference.current, state: Event.states[:rejected] - render :index - end - - def backup - @suggestion_groups = SuggestionGroup.for_conference Conference.current, state: Event.states[:backup] - render :index end def show end - - def state - @suggestion.state = state_params - @suggestion.save - end - - def send_acceptance_notifications - @suggestions = Conference.current.events.approved.where acceptance_notification_sent_at: nil - if @suggestions.all?(&:send_acceptance_notification!) - head :no_content - else - head :unprocessable_entity - end - end - - private - - def state_params - params.require :state - end - - def assign_suggestion - @suggestion = Event.find params[:id] - end end end diff --git a/app/views/management/conferences/_conference.html.slim b/app/views/management/conferences/_conference.html.slim index 884a748..98f279b 100644 --- a/app/views/management/conferences/_conference.html.slim +++ b/app/views/management/conferences/_conference.html.slim @@ -4,10 +4,10 @@ tr td.hidden-xs.hidden-sm = l conference.end_date.to_date, format: :long td.action - if conference.call_for_papers_open? - = link_to cfp_management_conference_path(conference), method: :delete, class: 'btn btn-sm btn-success cfp-toggle', remote: true, onclick: '$(".cfp-toggle").addClass("disabled")' + = link_to '#', method: :delete, class: 'btn btn-sm btn-success cfp-toggle', remote: true, onclick: '$(".cfp-toggle").addClass("disabled")' = icon 'dot-circle-o', '', class: 'fa-fw' - else - = link_to cfp_management_conference_path(conference), method: :post, class: 'btn btn-sm btn-warning cfp-toggle', remote: true, onclick: '$(".cfp-toggle").addClass("disabled")' + = link_to '#', method: :post, class: 'btn btn-sm btn-warning cfp-toggle', remote: true, onclick: '$(".cfp-toggle").addClass("disabled")' = icon 'circle-o', class: 'fa-fw' td = conference.events.count diff --git a/app/views/management/conferences/show.html.slim b/app/views/management/conferences/show.html.slim index 7ec21be..0b384e5 100644 --- a/app/views/management/conferences/show.html.slim +++ b/app/views/management/conferences/show.html.slim @@ -32,7 +32,7 @@ = @conference.events.rejected.count div = t 'event_states.rejected', count: @conference.events.rejected.count - = link_to rejected_management_conference_events_path(@conference) + = link_to management_conference_events_path(@conference, status: :rejected) .panel-footer.text-danger span.pull-left = t 'views.conference.see_details' span.pull-right = icon 'arrow-circle-right' @@ -48,7 +48,7 @@ = @conference.events.approved.count div = t 'event_states.approved', count: @conference.events.approved.count - = link_to approved_management_conference_events_path(@conference) + = link_to management_conference_events_path(@conference, status: :approved) .panel-footer.text-info span.pull-left = t 'views.conference.see_details' span.pull-right = icon 'arrow-circle-right' @@ -64,7 +64,7 @@ = @conference.events.approved.confirmed.count div = t 'event_states.confirmed', count: @conference.events.approved.confirmed.count - = link_to confirmed_management_conference_events_path(@conference) + = link_to management_conference_events_path(@conference, status: :approved, confirmed: true) .panel-footer.text-success span.pull-left = t 'views.conference.see_details' span.pull-right = icon 'arrow-circle-right' diff --git a/app/views/management/events/_state.html.slim b/app/views/management/events/_state.html.slim deleted file mode 100644 index bacf668..0000000 --- a/app/views/management/events/_state.html.slim +++ /dev/null @@ -1,9 +0,0 @@ -.btn-group id="suggestion-#{suggestion.id}-state" - button class="btn dropdown-toggle btn-#{Event::STATE_TO_CLASS[suggestion.state.to_sym]}" type="button" title="#{suggestion.state}" data-toggle="dropdown" - => glyph Event::STATE_TO_GLYPH[suggestion.state.to_sym] - span.caret - ul.dropdown-menu role="menu" - - Event.states.each do |state, number| - - next if state == suggestion.state - li - = link_to glyph(Event::STATE_TO_GLYPH[state.to_sym]), state_management_event_path(suggestion, state: state), title: state, class: "btn text-#{Event::STATE_TO_CLASS[state.to_sym]}", remote: true, method: :patch diff --git a/app/views/management/events/_suggestion_details.html.slim b/app/views/management/events/_suggestion_details.html.slim deleted file mode 100644 index 299ebd9..0000000 --- a/app/views/management/events/_suggestion_details.html.slim +++ /dev/null @@ -1,54 +0,0 @@ -.model-details id="suggestion-#{@suggestion.id}-details" tabindex="-1" role="dialog" aria-hidden="true" - .modal-dialog - .modal-content - .modal-header - button type="button" class="close" data-dismiss="modal" aria-hidden="true" - h4.modal-title - = @suggestion.title - small< - = @suggestion.subtitle - br - = t :meta_data, language: @suggestion.language, track: @suggestion.track.name, length: @suggestion.length - - .modal-body - .center - h4 = @suggestion.class.human_attribute_name(:user) - - unless @suggestion.user.speaker_profile.present? - div.picture-placeholder - = glyph(:user) - h3.media-heading - = @suggestion.user.email - - - else - = image_tag @suggestion.user.speaker_profile.picture.medium.url, class: "profile-image" - h3.media-heading - = @suggestion.user.speaker_profile.name - - if @suggestion.user.speaker_profile.organisation.present? - div - => icon(:briefcase) - = @suggestion.user.speaker_profile.organisation - - div.social - = link_to "mailto://#{@suggestion.user.email}" - = icon :envelope - - if @suggestion.user.speaker_profile.github.present? - = link_to "https://github.com/#{@suggestion.user.speaker_profile.github}" - = icon :github - - if @suggestion.user.speaker_profile.twitter.present? - = link_to "https://twitter.com/#{@suggestion.user.speaker_profile.twitter}" - = icon :twitter - - h4 = @suggestion.class.human_attribute_name(:abstract) - = simple_format @suggestion.abstract - - h4 = @suggestion.class.human_attribute_name(:description) - = simple_format @suggestion.description - - - - if @suggestion.notes.present? - h4 = @suggestion.class.human_attribute_name(:notes) - = simple_format @suggestion.notes - - .modal-footer - button type="button" class="btn btn-default" data-dismiss="modal" - = t(:close) diff --git a/app/views/management/events/_suggestion_group.html.slim b/app/views/management/events/_suggestion_group.html.slim deleted file mode 100644 index 7fc2fbc..0000000 --- a/app/views/management/events/_suggestion_group.html.slim +++ /dev/null @@ -1,29 +0,0 @@ -- suggestion_group.suggestions.each_with_index do |suggestion, index| - tr - - if index == 0 - td.picture rowspan="#{suggestion_group.suggestions.count}" - - if suggestion_group.speaker.speaker_profile.present? - = link_to management_user_path(suggestion_group.speaker), remote: true - = image_tag suggestion_group.speaker.speaker_profile.picture.thumb.url, class: 'img-thumbnail' - br - = suggestion_group.speaker.speaker_profile.name - - else - .picture-placeholder - = glyph(:user) - = suggestion_group.speaker.email - - td - span.title - = link_to management_event_path(suggestion), title: t(:view), remote: true, class: "#{'text-success' if suggestion.confirmed?}" - = suggestion.title - br - span.subtitle - = suggestion.subtitle - td = suggestion.language - td = suggestion.track.name - td = suggestion.class.model_name.human - td.actions - div - = link_to management_event_path(suggestion), title: t(:view), remote: true - = glyph(:share) - = render partial: 'state', locals: {suggestion: suggestion} diff --git a/app/views/management/events/index.html.slim b/app/views/management/events/index.html.slim index ec991a7..3603360 100644 --- a/app/views/management/events/index.html.slim +++ b/app/views/management/events/index.html.slim @@ -1,22 +1 @@ -.row - .panel.panel-primary - .panel-heading - h3.panel-title - = Event.model_name.human(count: 2) - span.pull-right - = t(:suggestion_and_speaker_count, suggestions: @suggestion_groups.map(&:suggestions).flatten.count, speakers: @suggestion_groups.count) - table.record-table - thead - tr - th.picture = Event.human_attribute_name(:user) - th = Event.human_attribute_name(:title) - th = Event.human_attribute_name(:language) - th = Track.model_name.human - th = Event.human_attribute_name(:type) - th.actions - tbody - = render partial: 'suggestion_group', collection: @suggestion_groups - .panel-footer - .pull-right - = link_to 'Изпрати нотификации на одобрените', send_acceptance_notifications_management_events_path, remote: true, method: :post, data: {confirm: 'Сигурни ли сте'}, class: %w{btn btn-danger} - .clearfix +p Hello diff --git a/app/views/management/home/index.html.slim b/app/views/management/events/show.html.slim similarity index 100% rename from app/views/management/home/index.html.slim rename to app/views/management/events/show.html.slim diff --git a/app/views/management/events/show.js.erb b/app/views/management/events/show.js.erb deleted file mode 100644 index 6a007da..0000000 --- a/app/views/management/events/show.js.erb +++ /dev/null @@ -1,5 +0,0 @@ -$('body').append('<%= j render 'suggestion_details' %>'); -$('#suggestion-<%= @suggestion.id %>-details').on('hidden.bs.modal', function () { - $(this).remove(); -}); -$('#suggestion-<%= @suggestion.id %>-details').modal('show'); diff --git a/app/views/management/events/state.js.erb b/app/views/management/events/state.js.erb deleted file mode 100644 index 756cc18..0000000 --- a/app/views/management/events/state.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#suggestion-<%= @suggestion.id %>-state').replaceWith('<%= j render partial: 'state', locals: {suggestion: @suggestion} %>'); diff --git a/app/views/management/users/_about_user.html.slim b/app/views/management/users/_about_user.html.slim deleted file mode 100644 index b68c4fe..0000000 --- a/app/views/management/users/_about_user.html.slim +++ /dev/null @@ -1,41 +0,0 @@ -.model-details id="about-user-#{@user.id}" tabindex="-1" role="dialog" aria-hidden="true" - .modal-dialog - .modal-content - .modal-header - button type="button" class="close" data-dismiss="modal" aria-hidden="true" - h4.modal-title = t(:more_about_user, user: @user.speaker_profile.name) - .modal-body - .center - = image_tag @user.speaker_profile.picture.medium.url, class: "profile-image" - h3.media-heading - = @user.speaker_profile.name - - if @user.speaker_profile.organisation.present? - div - => icon(:briefcase) - = @user.speaker_profile.organisation - div.social - = link_to "mailto://#{@user.email}" - = icon :envelope - - if @user.speaker_profile.github.present? - = link_to "https://github.com/#{@user.speaker_profile.github}" - = icon :github - - if @user.speaker_profile.twitter.present? - = link_to "https://twitter.com/#{@user.speaker_profile.twitter}" - = icon :twitter - - hr - - h5 = SpeakerProfile.human_attribute_name(:biography) - = simple_format @user.speaker_profile.biography - - h5 = t :contacts - - if @user.speaker_profile.twitter.present? - p #{icon(:twitter)} @#{@user.speaker_profile.twitter} - - if @user.speaker_profile.public_email.present? - p #{icon(:envelope)} #{@user.speaker_profile.public_email} (#{t(:public)}) - p #{icon(:envelope)} #{@user.email} (#{t(:private)}) - p #{glyph(:phone)} #{Phony.format(@user.speaker_profile.mobile_phone, format: :international)} - - .modal-footer - button type="button" class="btn btn-default" data-dismiss="modal" - = t(:close) diff --git a/app/views/management/users/_user.html.slim b/app/views/management/users/_user.html.slim deleted file mode 100644 index 3217d29..0000000 --- a/app/views/management/users/_user.html.slim +++ /dev/null @@ -1,23 +0,0 @@ -tr id="user-#{user.id}" - td.picture - - if user.speaker_profile.present? - = image_tag user.speaker_profile.picture.thumb.url, class: 'img-thumbnail' - - else - .picture-placeholder - = glyph(:user) - td = user.email - td = user.speaker_profile.try(:first_name) or '-' - td = user.speaker_profile.try(:last_name) or '-' - td.admin - - if user.admin? - span.toggle - = link_to glyph(:check), toggle_admin_management_user_path(user), remote: true, method: :post, data: {confirm: t(:are_you_sure)}, class: 'checked' - - else - span.toggle - = link_to glyph(:unchecked), toggle_admin_management_user_path(user), remote: true, method: :post, data: {confirm: t(:are_you_sure)}, class: 'unchecked' - td.actions - div - = link_to management_user_path(user), title: t(:view), remote: true, disabled: user.speaker_profile.blank? - = glyph(:share) - = link_to edit_management_user_path(user), title: t(:edit) - = glyph(:edit) diff --git a/app/views/management/users/index.html.slim b/app/views/management/users/index.html.slim deleted file mode 100644 index 634f7d3..0000000 --- a/app/views/management/users/index.html.slim +++ /dev/null @@ -1,20 +0,0 @@ -- content_for :title - = User.model_name.human(count: 2).mb_chars.capitalize - -.row - .col-lg-12 - .panel.panel-primary - .panel-heading - h3.panel-title = User.model_name.human(count: 2) - .panel-body - table.table.table-striped data-table="true" - thead - tr - th.picture = SpeakerProfile.human_attribute_name(:picture) - th = User.human_attribute_name(:email) - th = SpeakerProfile.human_attribute_name(:first_name) - th = SpeakerProfile.human_attribute_name(:last_name) - th.admin = SpeakerProfile.human_attribute_name(:admin) - th.actions - tbody - = render @users diff --git a/app/views/management/users/show.js.erb b/app/views/management/users/show.js.erb deleted file mode 100644 index 36414ae..0000000 --- a/app/views/management/users/show.js.erb +++ /dev/null @@ -1,5 +0,0 @@ -$('body').append('<%= j render 'about_user' %>'); -$('#about-user-<%= @user.id %>').on('hidden.bs.modal', function () { - $(this).remove(); -}); -$('#about-user-<%= @user.id %>').modal('show'); diff --git a/app/views/management/users/toggle_admin.js.erb b/app/views/management/users/toggle_admin.js.erb deleted file mode 100644 index 2dd9be2..0000000 --- a/app/views/management/users/toggle_admin.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#user-<%= @user.id %>').replaceWith('<%= j render @user %>'); diff --git a/config/routes.rb b/config/routes.rb index bbee9ef..e44861c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,31 +5,11 @@ Rails.application.routes.draw do get '/', to: 'conferences#index' resources :conferences do - member do - post 'cfp', to: 'conferences#open_call_for_papers' - delete 'cfp', to: 'conferences#close_call_for_papers' - end - - resources :events do - member do - patch 'state' - end - - collection do - get 'approved' - get 'rejected' - get 'undecided' - get 'backup' - get 'confirmed' - end - end - end - - resources :users do - member do - post 'toggle_admin' - end + resources :events + resources :volunteers + resources :sponsorship_offers end + resources :users end root 'management/conferences#index'