From 96ef48cb31976b4c3e5e48635ac6c916b935eaa0 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sun, 19 Oct 2014 19:25:34 +0200 Subject: [PATCH] =?UTF-8?q?is=20updated=20button=20f=C3=BCr=20themen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/themen_controller.rb | 8 +++++++- app/views/themen/_small.html.erb | 2 +- config/routes.rb | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/controllers/themen_controller.rb b/app/controllers/themen_controller.rb index 66a10eb..1b5a875 100644 --- a/app/controllers/themen_controller.rb +++ b/app/controllers/themen_controller.rb @@ -92,7 +92,13 @@ class ThemenController < ApplicationController end end end - def fragen + def is_updated + @thema = Thema.find(params[:id]) + @thema.translation.touch + + redirect_to @thema + end + def fragen @thema = Thema.find(params[:id]) @fragen=@thema.fragen respond_to do |format| diff --git a/app/views/themen/_small.html.erb b/app/views/themen/_small.html.erb index 2e4b269..7fa22c6 100644 --- a/app/views/themen/_small.html.erb +++ b/app/views/themen/_small.html.erb @@ -3,7 +3,7 @@

<%= small.title %> <%= link_to fa_icon("pencil"), verwalten_thema_path(small) if can? :edit, small %>

<% if small.is_outdated? %> -
<%= I18n.t("thema.outdated") %>
+
<%= I18n.t("thema.outdated") %> <%= link_to"Als aktuell markieren",is_updated_thema_path(small), :class=>:btn %>
<% end %> <% if small.isdraft %>
<%= I18n.t("thema.isdraft") %>
diff --git a/config/routes.rb b/config/routes.rb index ec9e760..a7c5835 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -155,6 +155,7 @@ Fetsite::Application.routes.draw do get :fragen get :verwalten get :sanitize + get :is_updated end resources :attachments end