forked from bofh/fetsite
AutoCommit Sam Aug 1 13:03:01 CEST 2015
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
<div id="choice_<%= choice.id %>"
|
||||
|
||||
<%= div_tag_for(choice) do %>
|
||||
|
||||
<%
|
||||
if current_user.nil?
|
||||
t=choice.text
|
||||
else
|
||||
value=(current_user.id.nil?)? false : choice.answers.where(user_id: current_user.id).count>0
|
||||
cstyle=(value) ? "true" :"false"
|
||||
t= link_to raw("" + choice.html), answer_survey_question_path(choice.question, params: {survey_question: {selected: [choice.id]}}),class: "choice-"+cstyle
|
||||
t= link_to(raw("" + choice.html+ (( choice.picture.nil?) ? "":image_tag(choice.picture.thumb.url))), answer_survey_question_path(choice.question, params: {survey_question: {selected: [choice.id]}}),class: "choice-"+cstyle )
|
||||
end
|
||||
|
||||
%>
|
||||
|
||||
|
||||
<%= t %> <%= link_to fa_icon("pencil"), edit_survey_choice_path(choice) , class: "btn btn-link navbar-btn"
|
||||
<%= t %> <%= link_to fa_icon("pencil"), edit_survey_choice_path(choice) , class: "btn btn-link navbar-btn" , remote: true
|
||||
%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
<%= semantic_form_for @choice do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :text %>
|
||||
<i id="icon" style="font-size:2em" class="<%= @choice.icon %>"></i><a href="#" id="openselect" onclick=""> Choose Icon</a>
|
||||
|
||||
<%= f.input :icon, :input_html=>{:id=>"iconfield"},:as=>:hidden %>
|
||||
|
||||
<label>Bild</label>
|
||||
<%= image_tag(@choice.picture.thumb.url) unless @choice.picture.nil? %>
|
||||
<%= f.file_field :picture %>
|
||||
<%= f.hidden_field :picture_cache %>
|
||||
|
||||
<%= f.input :sort %>
|
||||
<%= f.input :picture, :input_html=>{:id=>"iconfield"} %>
|
||||
<% end %>
|
||||
<i id="icon" style="font-size:2em" class="<%= @choice.picture %>"></i><a href="#" id="openselect" onclick=""> Choose Icon</a>
|
||||
|
||||
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
<% end %>
|
||||
|
||||
1
app/views/survey/choices/edit.js.erb
Normal file
1
app/views/survey/choices/edit.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$('#<%= divid_for( @choice) %>').replaceWith("<%= escape_javascript( render partial:"form", object: @choice )%>");
|
||||
@@ -1,4 +1,4 @@
|
||||
<div id="container_question_<%= answeredquestion.id %>" style="min-width: 310px; max-width: 800px; height: <%= (100+answeredquestion.choices.count * 50).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>
|
||||
|
||||
<ul>
|
||||
|
||||
Reference in New Issue
Block a user