Skip to content

Commit

Permalink
Survey rewrite
Browse files Browse the repository at this point in the history
See openSUSE/osem#2712 for more.

Small bugfix with the chat embed.
  • Loading branch information
bennettscience committed Feb 23, 2021
1 parent 506deb4 commit 2be810c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
3 changes: 0 additions & 3 deletions app/assets/javascripts/yt-chat-embed.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// TODO: Load later in the script to avoid undefined containers
// TODO: Load only on event pages with commercials

window.onload = () => {
let wrapper = document.querySelector(`.chat-embed-wrapper`);
if(!wrapper) return
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/surveys_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ def reply
end
end

redirect_back(fallback_location: root_path)
redirect_to conference_program_proposal_path(@conference, @survey.event)
end
end
4 changes: 4 additions & 0 deletions app/models/survey.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ def active?
now <= end_date
end
end

def event
return surveyable_id
end
end
10 changes: 5 additions & 5 deletions app/views/proposals/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@
%dt Requires Registration:
%dd
= link_to "Yes (#{registered_text(@event)})", new_conference_conference_registration_path(@conference.short_title), class: 'btn btn-xs btn-danger', disabled: [email protected]_possible?
- if @surveys_after_event.any?
.col-md-12
%dt Survey:
%dd
= render partial: 'surveys/list', locals: { surveys: @surveys_after_event, conference: @conference }
- if concurrent_events(@event).present?
.col-md-12
%hr
Expand All @@ -126,8 +131,3 @@
%dt Room:
%dd
= event.room.name
.row
.col-md-12
- if @surveys_after_event.any? && @event.ended?
.page-header
= render partial: 'surveys/list', locals: { surveys: @surveys_after_event, conference: @conference }

0 comments on commit 2be810c

Please sign in to comment.