diff --git a/app/models/thema.rb b/app/models/thema.rb
index 4295496..589ae6c 100644
--- a/app/models/thema.rb
+++ b/app/models/thema.rb
@@ -12,7 +12,7 @@
require 'uri'
class Thema < ActiveRecord::Base
include Rails.application.routes.url_helpers
- attr_accessible :text, :title, :themengruppe_id
+ attr_accessible :text, :title, :themengruppe_id,:isdraft, :hidelink, :hideattachment
has_many :fragen
has_many :attachments
belongs_to :themengruppe, :foreign_key => "themengruppe_id"
@@ -22,7 +22,11 @@ include Rails.application.routes.url_helpers
validates :title, :presence => true
validates :text, :presence => true
scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")}
+ scope :outdated, -> {where("updated_at < ?", 1.week.ago)}
translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true
+ def is_outdated?
+ updated_at < 1.week.ago
+ end
def is_wiki?
!(wikiname.nil? || wikiname.empty?)
end
diff --git a/app/views/fetprofiles/_form.html.erb b/app/views/fetprofiles/_form.html.erb
index 208c2d6..cfbd0ce 100644
--- a/app/views/fetprofiles/_form.html.erb
+++ b/app/views/fetprofiles/_form.html.erb
@@ -68,7 +68,7 @@
<%= f.actions do %>
<%= f.action :submit, :as => :input , :label=>I18n.t("common.save") %>
- <%= f.action :submit, :as => :input, :button_html=>{value: "continue"} , :label=>I18n.t("common.savecont") %>
+ <%= f.action :submit, :as => :input , :label=>I18n.t("common.savecont"), :button_html=>{value: "continue"} %>
<%= f.action :cancel, :as=> :link , :label=>I18n.t("common.cancel") %>
<% end %>
diff --git a/app/views/memberships/_form.html.erb b/app/views/memberships/_form.html.erb
deleted file mode 100644
index 252f116..0000000
--- a/app/views/memberships/_form.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<%= semantic_form_for [@membership.fetprofile,@membership] do |f| %>
- <%= f.inputs do %>
- <%= f.input :gremium, :as=>:radio %>
- <%= f.input :start %>
- <%= f.input :stop %>
- <%= f.input :typ ,:as=>:radio,:collection=>Membership::TYPEN.invert %>
- <% end %>
-
- <%= f.actions do %>
- <%= f.action :submit, :as => :input %>
- <% end %>
-<% end %>
diff --git a/app/views/memberships/edit.html.erb b/app/views/memberships/edit.html.erb
deleted file mode 100644
index 84851bd..0000000
--- a/app/views/memberships/edit.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-Editing membership
-
-<%= render 'form' %>
-
-<%= link_to 'Show', @membership %> |
-<%= link_to 'Back', memberships_path %>
diff --git a/app/views/memberships/index.html.erb b/app/views/memberships/index.html.erb
deleted file mode 100644
index 2a5e5ff..0000000
--- a/app/views/memberships/index.html.erb
+++ /dev/null
@@ -1,31 +0,0 @@
-Listing memberships
-
-
-
- | Fetprofile |
- Gremium |
- Start |
- Stop |
- Typ |
- |
- |
- |
-
-
-<% @memberships.each do |membership| %>
-
- | <%= membership.fetprofile_id %> |
- <%= membership.gremium_id %> |
- <%= membership.start %> |
- <%= membership.stop %> |
- <%= membership.typ %> |
- <%= link_to 'Show', membership %> |
- <%= link_to 'Edit', edit_membership_path(membership) %> |
- <%= link_to 'Destroy', membership, method: :delete, data: { confirm: 'Are you sure?' } %> |
-
-<% end %>
-
-
-
-
-<%= link_to 'New Membership', new_membership_path %>
diff --git a/app/views/memberships/new.html.erb b/app/views/memberships/new.html.erb
deleted file mode 100644
index 2e8e5ec..0000000
--- a/app/views/memberships/new.html.erb
+++ /dev/null
@@ -1,5 +0,0 @@
-New membership
-
-<%= render 'form' %>
-
-<%= link_to 'Back', @membership.fetprofile %>
diff --git a/app/views/memberships/show.html.erb b/app/views/memberships/show.html.erb
deleted file mode 100644
index e64ca53..0000000
--- a/app/views/memberships/show.html.erb
+++ /dev/null
@@ -1,30 +0,0 @@
-<%= notice %>
-
-
- Fetprofile:
- <%= @membership.fetprofile_id %>
-
-
-
- Gremium:
- <%= @membership.gremium_id %>
-
-
-
- Start:
- <%= @membership.start %>
-
-
-
- Stop:
- <%= @membership.stop %>
-
-
-
- Typ:
- <%= @membership.typ %>
-
-
-
-<%= link_to 'Edit', edit_membership_path(@membership) %> |
-<%= link_to 'Back', memberships_path %>
diff --git a/app/views/themen/_form.html.erb b/app/views/themen/_form.html.erb
index c952921..5d99eb7 100644
--- a/app/views/themen/_form.html.erb
+++ b/app/views/themen/_form.html.erb
@@ -10,13 +10,31 @@
<%= f.input :themengruppe %>
-
-
- <%= f.input :text, :as=>:tinymce_text,:label=>false, :input_html=>{:rows=>20} %>
-
-
+
+
+
+ <%= f.input :isdraft %>
+
+
+ <%= f.input :hidelink, :as=>:boolean %>
+
+
+
+ <%= f.input :hideattachment %>
+
+
+
+
+
+ <%= f.input :text, :as=>:tinymce_text,:label=>false, :input_html=>{:rows=>20} %>
+
+
+
+<% unless I18n.locale == :de %>
+@thema.text
+<% end %>
<%= f.actions do %>
<%= f.action :submit, :as => :button, :label=> I18n.t("thema.save" ) %>
<%= f.action :submit, :as => :button, :label=> I18n.t("thema.savecont"), :button_html=>{:value=>"continue"} %>
diff --git a/app/views/themen/_small.html.erb b/app/views/themen/_small.html.erb
index 8c40748..a2094b2 100644
--- a/app/views/themen/_small.html.erb
+++ b/app/views/themen/_small.html.erb
@@ -1,6 +1,13 @@
<%= small.title %> <%= link_to fa_icon("pencil"), verwalten_thema_path(small) if can? :edit, small %>
+<% if small.is_outdated? %>
+ Outdated
+<% end %>
+<% if small.isdraft %>
+ isdraft
+
+<% end %>
<%= raw(small.text) %>