forked from bofh/fetsite
Merge branch 'master' of https://github.com/HausdorffHimself/fetsite
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
div.themengruppe
|
||||
{padding:10px;
|
||||
margin:2px;
|
||||
border-radius:10px;
|
||||
border-radius: 10px;
|
||||
min-width:13em;
|
||||
border: #91B4FF solid 2px;
|
||||
border: #91B4FF solid 0px;
|
||||
height: 90%
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class FragenController < ApplicationController
|
||||
@frage = Frage.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.html
|
||||
format.json { render json: @frage }
|
||||
end
|
||||
end
|
||||
@@ -44,7 +44,7 @@ class FragenController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
if @frage.save
|
||||
format.html { redirect_to @frage, notice: 'Frage was successfully created.' }
|
||||
format.html { redirect_to @frage.thema, notice: 'Frage was successfully created.' }
|
||||
format.json { render json: @frage, status: :created, location: @frage }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
@@ -76,7 +76,7 @@ class FragenController < ApplicationController
|
||||
@frage.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to fragen_url }
|
||||
format.html { redirect_to @frage.thema }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Frage < ActiveRecord::Base
|
||||
attr_accessible :text, :title
|
||||
attr_accessible :text, :title, :thema_id
|
||||
belongs_to :thema
|
||||
|
||||
validates :thema, :presence => true
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class Themengruppe < ActiveRecord::Base
|
||||
WORD_COUNT = 50
|
||||
attr_accessible :text, :title
|
||||
has_many :themen, class_name: 'Thema'
|
||||
has_many :fragen, through: :themen
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<%= tinymce_assets %>
|
||||
<%= semantic_form_for @frage do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :title %>
|
||||
<%= f.input :text %>
|
||||
<%= f.input :thema %>
|
||||
<%= f.input :text, :as=>:tinymce_text%>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
|
||||
@@ -10,4 +10,4 @@
|
||||
|
||||
|
||||
<%= link_to 'Edit', edit_frage_path(@frage) %> |
|
||||
<%= link_to 'Back', fragen_path %>
|
||||
<%= link_to 'Back', @frage.thema %>
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
<%= raw(small.text) %>
|
||||
<br/>
|
||||
<%= link_to 'Edit', edit_thema_path(small) %>
|
||||
<%= raw("<b>FAQs:</b>") unless small.fragen.empty? %>
|
||||
|
||||
<br/>
|
||||
<% small.fragen.each do |frage| %>
|
||||
<p>
|
||||
<b> <%= frage.title %> </b> <br/>
|
||||
<%= raw(frage.text) %>
|
||||
</p>
|
||||
<br/>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
<%= link_to 'Edit', small %>
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<%= link_to thema.title,themengruppe_thema_path(thema.themengruppe,thema)%>
|
||||
<%= thema.title%>
|
||||
|
||||
|
||||
@@ -8,3 +8,18 @@
|
||||
|
||||
<%= link_to 'Edit', edit_thema_path(@thema) %> |
|
||||
<%= link_to 'Back', themengruppe_path(@thema.themengruppe) %>
|
||||
|
||||
<h2>FAQs:</h2>
|
||||
<% @thema.fragen.each do |frage| %>
|
||||
<p>
|
||||
<b> <%= frage.title %> </b> <br/>
|
||||
<%= raw(frage.text) %>
|
||||
<br/>
|
||||
<%= link_to 'Edit', edit_frage_path(frage) %> |
|
||||
<%= link_to 'Destroy',frage, method: :delete, data: { confirm: 'Are you sure?' } %>
|
||||
|
||||
</p>
|
||||
<% end %>
|
||||
<br/>
|
||||
|
||||
<%= link_to 'Neue Frage', new_frage_path %>
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
|
||||
<h3> <%= link_to themengruppe.title, themengruppe %> </h3>
|
||||
<p>
|
||||
<%=themengruppe.text %>
|
||||
<%= if themengruppe.text.split.size > Themengruppe::WORD_COUNT
|
||||
themengruppe.text.split[0..Themengruppe::WORD_COUNT].join(" ") + " ..."
|
||||
else
|
||||
themengruppe.text
|
||||
end%>
|
||||
</p>
|
||||
<br/>
|
||||
<b><%= I18n.t("themengruppe.themen") %></b>
|
||||
<ul>
|
||||
<% themengruppe.themen.each do |t| %>
|
||||
<li>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="container-fluid">
|
||||
|
||||
<% @themengruppen.each_slice(2) do |row| %>
|
||||
<% @themengruppen.each_slice(2) do |row| %>
|
||||
<div class="row-fluid">
|
||||
<% row.each do |themengruppe| %>
|
||||
<div class="span6 equalheight">
|
||||
@@ -13,12 +13,14 @@
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<script>
|
||||
make_equal_height();
|
||||
<script class="hidden-phone">
|
||||
|
||||
<!-- make_equal_height();
|
||||
-->
|
||||
</script>
|
||||
|
||||
<%= link_to 'New Themengruppe', new_themengruppe_path %>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</div>
|
||||
<div id="collapse<%=thema.id%>" class="accordion-body collapse">
|
||||
<div class="accordion-inner">
|
||||
<%= render partial: "themen/small", object: thema %>
|
||||
<%= render :partial => 'themen/small', :object => thema %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -25,5 +25,6 @@
|
||||
|
||||
<br/><br/>
|
||||
|
||||
|
||||
<%= link_to 'Edit', edit_themengruppe_path(@themengruppe) %> |
|
||||
<%= link_to 'Back', themengruppen_path %>
|
||||
|
||||
@@ -124,3 +124,5 @@ de:
|
||||
support:
|
||||
array:
|
||||
two_words_connector: ', '
|
||||
themengruppe:
|
||||
themen: "Themen"
|
||||
|
||||
Reference in New Issue
Block a user