CHANGE: Beschreibungstext wird abgeschnitten auf Themengruppe::WORD_COUNT sowie

locales für Thema
This commit is contained in:
HausdorffHimself
2013-08-19 19:28:53 +02:00
parent bb42e3b3a0
commit 29388ddcac
3 changed files with 11 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
class Themengruppe < ActiveRecord::Base class Themengruppe < ActiveRecord::Base
WORD_COUNT = 50
attr_accessible :text, :title attr_accessible :text, :title
has_many :themen, class_name: 'Thema' has_many :themen, class_name: 'Thema'
has_many :fragen, through: :themen has_many :fragen, through: :themen

View File

@@ -1,8 +1,14 @@
<h3> <%= link_to themengruppe.title, themengruppe %> </h3> <h3> <%= link_to themengruppe.title, themengruppe %> </h3>
<p> <p>
<%=themengruppe.text %> <%= if themengruppe.text.split.size > Themengruppe::WORD_COUNT
themengruppe.text.split[0..Themengruppe::WORD_COUNT].join(" ") + " ..."
else
themengruppe.text
end%>
</p> </p>
<br/>
<b><%= I18n.t("themengruppe.themen") %></b>
<ul> <ul>
<% themengruppe.themen.each do |t| %> <% themengruppe.themen.each do |t| %>
<li> <li>

View File

@@ -123,3 +123,5 @@ de:
support: support:
array: array:
two_words_connector: ', ' two_words_connector: ', '
themengruppe:
themen: "Themen"