forked from bofh/fetsite
AutoCommit Don Aug 6 22:03:02 CEST 2015
This commit is contained in:
@@ -4,7 +4,7 @@ class Survey::Question < ActiveRecord::Base
|
|||||||
has_many :choices, dependent: :destroy
|
has_many :choices, dependent: :destroy
|
||||||
has_many :answers, through: :choices
|
has_many :answers, through: :choices
|
||||||
include IsCommentable
|
include IsCommentable
|
||||||
FLAG_ICONS={"delete" => "fa fa-trash"}
|
FLAG_ICONS={"delete" => "fa fa-trash", "template"=> "ffi1-cleaning1"}
|
||||||
FLAG_CONFIRM={}
|
FLAG_CONFIRM={}
|
||||||
scope :templates, ->{ where(flag_template:true)}
|
scope :templates, ->{ where(flag_template:true)}
|
||||||
acts_as_flagable
|
acts_as_flagable
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
$('#<%=@obj.flaglinkid(params[:flag]) %>').replaceWith("<%= escape_javascript( render(partial: "flags/flaglink", format: "html", locals: {flag: params[:flag]}) )%>");
|
$('#<%=@obj.flaglinkid(params[:flag]) %>').replaceWith("<%= escape_javascript( flag_link(@obj,flag)) %>");
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
<% fi = {"badquality"=>"fa fa-flag", "delete"=>"fa fa-trash"} %>
|
|
||||||
<%= flag_link(@obj,flag, ff_icon(fi[flag])) %>
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div id="container_question_<%= answeredquestion.id %>" style="min-width: 310px; max-width: 800px; height: <%= (100+answeredquestion.choices.count * 90).to_s %>px; margin: 0 auto" class="contentbox">
|
<div id="container_question_<%= answeredquestion.id %>" style="min-width: 310px; max-width: 800px; height: <%= (100+answeredquestion.choices.count * 90).to_s %>px; margin: 0 auto" class="contentbox">
|
||||||
<div style="background:red"><b><%= answeredquestion.title%></b>
|
<div style="background:red">
|
||||||
|
<b><%= answeredquestion.title%></b>
|
||||||
<ul>
|
<ul>
|
||||||
<% answeredquestion.choices.each do |c| %>
|
<% answeredquestion.choices.each do |c| %>
|
||||||
<li>
|
<li>
|
||||||
@@ -8,8 +8,6 @@
|
|||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|||||||
@@ -5,8 +5,11 @@
|
|||||||
<% else %>
|
<% else %>
|
||||||
<div class="contentbox" id ="<%= divid_for(question) %>" style="">
|
<div class="contentbox" id ="<%= divid_for(question) %>" style="">
|
||||||
<div >
|
<div >
|
||||||
<b><%= question.title%></b> <%=question.text%><%= link_to fa_icon("pencil"), edit_survey_question_path(question) , class: "btn btn-link navbar-btn" , remote: true%>
|
<b><%= question.title%></b>
|
||||||
|
<%= question.text %>
|
||||||
|
<%= link_to fa_icon("pencil"), edit_survey_question_path(question) , class: "btn btn-link navbar-btn" , remote: true %>
|
||||||
<%= flag_link(question, "delete")%>
|
<%= flag_link(question, "delete")%>
|
||||||
|
<%= flag_link(question, "template")%>
|
||||||
|
|
||||||
<ul class="choice-list">
|
<ul class="choice-list">
|
||||||
<% question.choices.each do |c| %>
|
<% question.choices.each do |c| %>
|
||||||
|
|||||||
Reference in New Issue
Block a user