From 29388ddcac1ae5c08418c78deea1f6acec539a50 Mon Sep 17 00:00:00 2001 From: HausdorffHimself Date: Mon, 19 Aug 2013 19:28:53 +0200 Subject: [PATCH] =?UTF-8?q?CHANGE:=20Beschreibungstext=20wird=20abgeschnit?= =?UTF-8?q?ten=20auf=20Themengruppe::WORD=5FCOUNT=20sowie=20locales=20f?= =?UTF-8?q?=C3=BCr=20Thema?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/themengruppe.rb | 1 + app/views/themengruppen/_themengruppe.html.erb | 8 +++++++- config/locales/de.yml | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/models/themengruppe.rb b/app/models/themengruppe.rb index 034558f..0966914 100644 --- a/app/models/themengruppe.rb +++ b/app/models/themengruppe.rb @@ -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 diff --git a/app/views/themengruppen/_themengruppe.html.erb b/app/views/themengruppen/_themengruppe.html.erb index 9fe5849..450e18e 100644 --- a/app/views/themengruppen/_themengruppe.html.erb +++ b/app/views/themengruppen/_themengruppe.html.erb @@ -1,8 +1,14 @@

<%= link_to themengruppe.title, themengruppe %>

- <%=themengruppe.text %> + <%= if themengruppe.text.split.size > Themengruppe::WORD_COUNT + themengruppe.text.split[0..Themengruppe::WORD_COUNT].join(" ") + " ..." + else + themengruppe.text + end%>

+
+<%= I18n.t("themengruppe.themen") %>