forked from bofh/fetsite
dependent and calendar
This commit is contained in:
@@ -7,7 +7,7 @@ class Meeting < ActiveRecord::Base
|
|||||||
belongs_to :neuigkeit, touch: true
|
belongs_to :neuigkeit, touch: true
|
||||||
has_one :protocol, :class_name=>'Document', :conditions=>{:typ=>10}, :as=>:parent
|
has_one :protocol, :class_name=>'Document', :conditions=>{:typ=>10}, :as=>:parent
|
||||||
has_one :agenda , :as=>:parent,:conditions=>{:typ=>11}, :class_name=>'Document'
|
has_one :agenda , :as=>:parent,:conditions=>{:typ=>11}, :class_name=>'Document'
|
||||||
has_one :calentry, as: :object
|
has_one :calentry, as: :object, :dependent=> :destroy
|
||||||
has_one :calendar, :through=>:meetingtyp
|
has_one :calendar, :through=>:meetingtyp
|
||||||
has_one :rubrik, :through=>:meetingtyp
|
has_one :rubrik, :through=>:meetingtyp
|
||||||
scope :upcomming, includes(:calentry).where("calentries.start>?",1.hour.ago)
|
scope :upcomming, includes(:calentry).where("calentries.start>?",1.hour.ago)
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ class Neuigkeit < ActiveRecord::Base
|
|||||||
belongs_to :author, :class_name =>'User'
|
belongs_to :author, :class_name =>'User'
|
||||||
belongs_to :rubrik, :class_name =>'Rubrik', :foreign_key => "rubrik_id"
|
belongs_to :rubrik, :class_name =>'Rubrik', :foreign_key => "rubrik_id"
|
||||||
has_one :calendar, through: :rubrik
|
has_one :calendar, through: :rubrik
|
||||||
has_many :calentries, as: :object
|
has_many :calentries, as: :object, :dependent=> :destroy
|
||||||
has_many :nlinks
|
has_many :nlinks, :dependent=> :destroy
|
||||||
has_one :meeting
|
has_one :meeting
|
||||||
has_many :attachments, :as=>:parent
|
has_many :attachments, :as=>:parent
|
||||||
|
|
||||||
|
|||||||
@@ -1,48 +1,50 @@
|
|||||||
<%= content_for :header do %>
|
<%= content_for :header do %>
|
||||||
<title>Fetsite - <%= I18n.t('home.news') %></title>
|
<title>Fetsite - <%= I18n.t('home.news') %></title>
|
||||||
<% set_meta_tags :og => {
|
<% set_meta_tags :og => {
|
||||||
:title => "Fetsite - "+I18n.t('home.news'),
|
:title => "Fetsite - "+I18n.t('home.news'),
|
||||||
:url=> rubriken_path(:theme=>nil)
|
:url=> rubriken_path(:theme=>nil)
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<%= display_meta_tags %>
|
<%= display_meta_tags %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= render 'tabs' %>
|
<%= render 'tabs' %>
|
||||||
<p id="notice"><%= notice %></p>
|
<p id="notice"><%= notice %></p>
|
||||||
<div class="content-wrap content-column">
|
<div class="content-wrap content-column">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
|
|
||||||
<h1><%= I18n.t("rubrik.title")%></h1>
|
<h1><%= I18n.t("rubrik.title")%></h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span9">
|
<div class="span9">
|
||||||
|
|
||||||
<ul class="unstyled linkbox-list" style="max-width:70em" id="neuigkeiten">
|
<ul class="unstyled linkbox-list" style="max-width:70em" id="neuigkeiten">
|
||||||
<% @neuigkeiten.each do |n| %>
|
<% @neuigkeiten.each do |n| %>
|
||||||
<li><%= render n %> </li>
|
<li><%= render n %> </li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div id="infinite-scrolling">
|
<div id="infinite-scrolling">
|
||||||
<%= paginate @neuigkeiten, theme:'twitter-bootstrap' %>
|
<%= paginate @neuigkeiten, theme:'twitter-bootstrap' %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="span3">
|
<div class="span3">
|
||||||
|
|
||||||
<% cache("calendar_" + @calentries.map{|c| c.id}.join('') + @calentries.max{|c|c.updated_at.to_i}.updated_at.to_i.to_s+"_"+I18n.locale.to_s+params[:month].to_s+params[:year].to_s) do %>
|
<% cache("calendar_" + @calentries.map{|c| c.id}.join('') + @calentries.max{|c|c.updated_at.to_i}.updated_at.to_i.to_s+"_"+I18n.locale.to_s+params[:month].to_s+params[:year].to_s) do %>
|
||||||
<%= render 'calendars/calentries', :object=>@calentries %>
|
<%= render 'calendars/calentries', :object=>@calentries %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% if current_user.has_role?(:fetuser) %>
|
||||||
</div>
|
<%= link_to calendars_path(:format=>:ics, :key=>Key.find_or_create(current_user,1).uuid) , calendars_path(:format=>:ics, :key=>Key.find_or_create(current_user,1).uuid)%>
|
||||||
</div>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,11 @@
|
|||||||
<%= render 'calendars/calentries', :object=>@calentries %>
|
<%= render 'calendars/calentries', :object=>@calentries %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= link_to "ics-format", calendar_path(@rubrik.calendar,:format=>:ics,:key=>current_user.nil? ? nil : Key.where(typ: 1, user_id: current_user.id,is_valid: true).last.try(:uuid)) %>
|
<% if current_user.has_role?(:fetuser) %>
|
||||||
|
<%= link_to calendar_path(@rubrik.calendar,:format=>:ics, :key=>Key.find_or_create(current_user,1).uuid) , calendars_path(:format=>:ics, :key=>Key.find_or_create(current_user,1).uuid)%>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user