AutoCommit Don Aug 6 23:03:01 CEST 2015
This commit is contained in:
@@ -210,7 +210,7 @@ float:clear; }
|
|||||||
|
|
||||||
a.flag-true { color: $color_schema_3_dark}
|
a.flag-true { color: $color_schema_3_dark}
|
||||||
a.flag-true.flag-goodquality-true { color: green}
|
a.flag-true.flag-goodquality-true { color: green}
|
||||||
|
a.flag-true.flag-template-true {color: $color_schema_1_dark}
|
||||||
a.flag-false { color: #CCC}
|
a.flag-false { color: #CCC}
|
||||||
|
|
||||||
ul.ui-menu
|
ul.ui-menu
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class Survey::QuestionsController < ApplicationController
|
|||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def answer
|
def answer
|
||||||
@survey_question = Survey::Question.find(params[:id])
|
@survey_question = Survey::Question.find(params[:id])
|
||||||
if (params[:key].nil? || params[:key].empty?)
|
if (params[:key].nil? || params[:key].empty?)
|
||||||
@@ -28,6 +29,11 @@ class Survey::QuestionsController < ApplicationController
|
|||||||
end
|
end
|
||||||
# GET /survey/questions/1
|
# GET /survey/questions/1
|
||||||
# GET /survey/questions/1.json
|
# GET /survey/questions/1.json
|
||||||
|
def create_from_template
|
||||||
|
@template = Survey::Question.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@survey_question = Survey::Question.find(params[:id])
|
@survey_question = Survey::Question.find(params[:id])
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
module Survey::QuestionsHelper
|
module Survey::QuestionsHelper
|
||||||
|
def new_question_for(obj)
|
||||||
|
render partial: "survey/questions/new_question", locals: {question_templates: Survey::Question.templates}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
class Survey::Question < ActiveRecord::Base
|
class Survey::Question < ActiveRecord::Base
|
||||||
attr_accessible :text, :title, :typ, :choice_ids
|
attr_accessible :text, :title, :typ, :choice_ids
|
||||||
belongs_to :parent, polymorphic: true
|
belongs_to :parent, polymorphic: true
|
||||||
@@ -5,10 +6,12 @@ class Survey::Question < ActiveRecord::Base
|
|||||||
has_many :answers, through: :choices
|
has_many :answers, through: :choices
|
||||||
include IsCommentable
|
include IsCommentable
|
||||||
FLAG_ICONS={"delete" => "fa fa-trash", "template"=> "ffi1-cleaning1"}
|
FLAG_ICONS={"delete" => "fa fa-trash", "template"=> "ffi1-cleaning1"}
|
||||||
FLAG_CONFIRM={}
|
FLAG_CONFIRM={"delete"=> "Sicher loeschen?"}
|
||||||
scope :templates, ->{ where(flag_template:true)}
|
scope :templates, ->{ where(flag_template:true)}
|
||||||
acts_as_flagable
|
acts_as_flagable
|
||||||
|
def attributes_for_copy
|
||||||
|
self.attributes
|
||||||
|
end
|
||||||
def add_yesno_choices
|
def add_yesno_choices
|
||||||
c=Survey::Choice.new(title: "Ja")
|
c=Survey::Choice.new(title: "Ja")
|
||||||
c.save
|
c.save
|
||||||
|
|||||||
@@ -14,10 +14,10 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="<%= divid_for(comment,"newform") %>">
|
|
||||||
</div>
|
|
||||||
<div id="<%= Comment.wrapid_for( comment)%>">
|
<div id="<%= Comment.wrapid_for( comment)%>">
|
||||||
<%= render partial:"comments/comments", object: comment.children.order(:created_at).reverse_order if comment.children.size >0 %>
|
<%= render partial:"comments/comments", object: comment.children.order(:created_at).reverse_order if comment.children.size >0 %>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="<%= divid_for(comment,"newform") %>"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
<% end%>
|
<% end%>
|
||||||
|
|
||||||
|
|
||||||
|
<%= new_question_for(neuigkeit_view) %>
|
||||||
<%= render_attachments_for(neuigkeit_view) %>
|
<%= render_attachments_for(neuigkeit_view) %>
|
||||||
|
|
||||||
<%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %>
|
<%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %>
|
||||||
|
|||||||
3
app/views/survey/questions/_new_question.html.erb
Normal file
3
app/views/survey/questions/_new_question.html.erb
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<% question_templates.each do |q| %>
|
||||||
|
<%= link_to q.title, new_survey_question_path() %>
|
||||||
|
<% end %>
|
||||||
Reference in New Issue
Block a user