forked from bofh/fetsite
time zone
This commit is contained in:
@@ -31,8 +31,8 @@ class Neuigkeit < ActiveRecord::Base
|
|||||||
|
|
||||||
default_scope order(:cache_order)
|
default_scope order(:cache_order)
|
||||||
scope :recent, -> { published.limit(10)}
|
scope :recent, -> { published.limit(10)}
|
||||||
scope :unpublished, -> {where("datum > ? OR datum IS NULL", Date.today)}
|
scope :unpublished, -> {where("datum > ? OR datum IS NULL", Time.now)}
|
||||||
scope :published_scope, ->{where("datum <= ? AND datum IS NOT NULL", Date.today)}
|
scope :published_scope, ->{where("datum <= ? AND datum IS NOT NULL", Time.now)}
|
||||||
scope :public, ->{includes(:rubrik).where("rubriken.public"=>true)}
|
scope :public, ->{includes(:rubrik).where("rubriken.public"=>true)}
|
||||||
scope :intern, ->{includes(:rubrik).where("rubriken.public"=>false)}
|
scope :intern, ->{includes(:rubrik).where("rubriken.public"=>false)}
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ class Neuigkeit < ActiveRecord::Base
|
|||||||
self.rubrik.public
|
self.rubrik.public
|
||||||
end
|
end
|
||||||
def published?
|
def published?
|
||||||
self.datum_nilsave<=Time.now.
|
self.datum_nilsave<=Time.now
|
||||||
end
|
end
|
||||||
|
|
||||||
def publish
|
def publish
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
<div class="hidden-print">
|
<div class="hidden-print">
|
||||||
|
|
||||||
<%= link_to "Back to parent" , @document.parent, class: "btn" %>
|
<%= link_to "Back to parent" , @document.parent, class: "btn" %>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
|
<%= link_to "PDF", document_path(@document, :format=>"pdf"),class: "btn" %>
|
||||||
<%= link_to ff_icon("icon-pencil") + "Edit", write_document_path(@document), class: "btn" %>
|
<%= link_to ff_icon("icon-pencil") + "Edit", write_document_path(@document), class: "btn" %>
|
||||||
<%= link_to ff_icon("icon-refresh")+"Refresh from Etherpad", read_from_etherpad_document_path(@document), class: "btn" if @document.is_etherpad? %>
|
<%= link_to ff_icon("icon-refresh")+"Refresh from Etherpad", read_from_etherpad_document_path(@document), class: "btn" if @document.is_etherpad? %>
|
||||||
<%= link_to "Copy Document to Etherpad", dump_to_etherpad_document_path(@document) , confirm: "Sicher? Löscht alle Änderungen im Etherpad" , class: "btn" %>
|
<%= link_to "Copy Document to Etherpad", dump_to_etherpad_document_path(@document) , confirm: "Sicher? Löscht alle Änderungen im Etherpad" , class: "btn" %>
|
||||||
<%= link_to 'Delete', @document, method: :delete, data: { confirm: 'Are you sure?' } , remote: true, class: "btn btn-danger" if can? :delete, @document %>
|
<%= link_to 'Delete', @document, method: :delete, data: { confirm: 'Are you sure?' } , remote: true, class: "btn btn-danger" if can? :delete, @document %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h2><%= @document.name %></h2>
|
<h2><%= @document.name %></h2>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ module Fetsite
|
|||||||
|
|
||||||
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
||||||
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
||||||
# config.time_zone = 'Central Time (US & Canada)'
|
config.time_zone = 'Vienna' #'Central Time (US & Canada)'
|
||||||
|
|
||||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||||
|
|||||||
Reference in New Issue
Block a user