forked from bofh/fetsite
AutoCommit Sam Aug 1 16:03:03 CEST 2015
This commit is contained in:
@@ -9,8 +9,17 @@ class Survey::QuestionsController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
def answer
|
def answer
|
||||||
@survey_question = Survey::Question.find(params[:id])
|
@survey_question = Survey::Question.find(params[:id])
|
||||||
@survey_question.do_answer(params[:survey_question][:selected],current_user)
|
if (params[:key].nil? || params[:key].empty?)
|
||||||
|
user = current_user
|
||||||
|
else
|
||||||
|
k=Key.find_by_uuid(params[:key] )
|
||||||
|
if k.is_valid && k.typ==3 && k.parent == @survey_question
|
||||||
|
user = k.user
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
@survey_question.do_answer(params[:survey_question][:selected],user)
|
||||||
render :show
|
render :show
|
||||||
end
|
end
|
||||||
# GET /survey/questions/1
|
# GET /survey/questions/1
|
||||||
|
|||||||
@@ -34,11 +34,12 @@
|
|||||||
<%= link_to "Refresh", neuigkeit_path(@neuigkeit), remote: true %>
|
<%= link_to "Refresh", neuigkeit_path(@neuigkeit), remote: true %>
|
||||||
<p id="notice"><%= notice %></p>
|
<p id="notice"><%= notice %></p>
|
||||||
<%= render partial: "neuigkeit_view", object: @neuigkeit %>
|
<%= render partial: "neuigkeit_view", object: @neuigkeit %>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% @neuigkeit.questions.each do |q| %>
|
<% @neuigkeit.questions.each do |q| %>
|
||||||
<%= render q%>
|
<%= render q%>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="fb-like" data-href"<%= rubrik_neuigkeit_url(@rubrik,@neuigkeit,{themes: nil, locale: nil})%>" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
|
<div class="fb-like" data-href"<%= rubrik_neuigkeit_url(@rubrik,@neuigkeit,{themes: nil, locale: nil})%>" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
|
||||||
|
|
||||||
<% if can? :find_link , @neuigkeit %>
|
<% if can? :find_link , @neuigkeit %>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
<%= stylesheet_link_tag "application", :media=>"all" %>
|
|
||||||
|
<%= stylesheet_link_tag "http://"+ActionMailer::Base.default_url_options[:host].to_s + "/assets/themes/blue2/application.css", :media=>"all" %>
|
||||||
<h1>
|
<h1>
|
||||||
<%= @neuigkeit.title%>
|
<%= @neuigkeit.title%>
|
||||||
</h1>
|
</h1>
|
||||||
@@ -7,4 +8,4 @@
|
|||||||
<%=url_for controller: "neuigkeiten",action: :show, :id=>@neuigkeit.id, only_path: false %>
|
<%=url_for controller: "neuigkeiten",action: :show, :id=>@neuigkeit.id, only_path: false %>
|
||||||
<%= raw(@neuigkeit.text) %>
|
<%= raw(@neuigkeit.text) %>
|
||||||
<%= render partial:"survey/questions/mail", object: @neuigkeit.questions.first unless @neuigkeit.questions.empty?%>
|
<%= render partial:"survey/questions/mail", object: @neuigkeit.questions.first unless @neuigkeit.questions.empty?%>
|
||||||
<%= link_to "Auf Fet.at weiterlesen", rubrik_neuigkeit_url(@neuigkeit.rubrik, @neuigkeit,:locale=>:de, :theme=>nil,:host=> "www.fet.at") %>
|
<%= link_to "Auf Fet.at weiterlesen", rubrik_neuigkeit_url(@neuigkeit.rubrik, @neuigkeit,:locale=>:de, :theme=>nil) %>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ if @user.nil?
|
|||||||
else
|
else
|
||||||
value=(@user.id.nil?)? false : choice.answers.where(user_id: @user.id).count>0
|
value=(@user.id.nil?)? false : choice.answers.where(user_id: @user.id).count>0
|
||||||
cstyle=(value) ? "true" :"false"
|
cstyle=(value) ? "true" :"false"
|
||||||
t= link_to(raw("" + choice.html+ (( choice.picture.nil? || choice.picture.to_s.empty?) ? "":image_tag(choice.picture.thumb.url))), answer_survey_question_url(choice.question, params: {survey_question: {selected: [choice.id]}}),class: "choice-"+cstyle )
|
t= link_to(raw("" + choice.html+ (( choice.picture.nil? || choice.picture.to_s.empty?) ? "":image_tag(choice.picture.thumb.url))), answer_survey_question_url(choice.question, params: {key: Key.find_or_create(@user, 3, choice.question).uuid, survey_question: {selected: [choice.id]}}),class: "choice-"+cstyle )
|
||||||
end
|
end
|
||||||
|
|
||||||
%>
|
%>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<% if current_user.nil? %>
|
<% if current_user.nil? %>
|
||||||
<%= render partial: "answeredquestion", object: question %>
|
<%= render partial: "survey/questions/answeredquestion", object: question %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="contentbox" style="background: grey">
|
<div class="contentbox" style="background: grey">
|
||||||
<div class="contentbox">
|
<div class="contentbox">
|
||||||
|
|||||||
Reference in New Issue
Block a user