add a treeview

This commit is contained in:
Andreas Stephanides
2015-04-14 17:56:35 +02:00
parent fdecf48e43
commit b02dcad387
3 changed files with 74 additions and 0 deletions

View File

@@ -24,6 +24,10 @@ class HomeController < ApplicationController
t=YAML.load_file("#{::Rails.root.to_s}/config/contact_topic.yml") t=YAML.load_file("#{::Rails.root.to_s}/config/contact_topic.yml")
@themen = Thema.where(:id=>t) @themen = Thema.where(:id=>t)
end end
def treeview
authorize! :doadmin, User
@themengruppen = Themengruppe.intern.order(:priority).reverse
end
def intern def intern
authorize! :seeintern, User authorize! :seeintern, User
@neuigkeiten = Neuigkeit.intern.recent @neuigkeiten = Neuigkeit.intern.recent

View File

@@ -0,0 +1,69 @@
Intern
<ul>
<% @themengruppen.each do |tg| %>
<li><%= tg.title %>
<ul class="fa-ul">
<% tg.themen.each do |t| %>
<li><%= fa_icon("folder-open li")+ t.title %>
<ul class="fa-ul">
<% t.attachments.each do |a| %>
<li><%= fa_icon("file li")+a.name %></li>
<% end %>
<% t.documents.each do |d| %>
<li><%= fa_icon("li file-text-o")+d.name %>
<ul class="fa-ul">
<% d.attachments.each do |a| %>
<li><%= fa_icon("file li")+a.name %></li>
<% end %>
</ul>
</li>
<% end %>
<% t.nlinks.each do |n| %>
<li><%= fa_icon("li newspaper-o")+n.neuigkeit.name %>
<ul class="fa-ul">
<% n.neuigkeit.attachments.each do |a| %>
<li><%= fa_icon("file li")+a.name %></li>
<% end %>
</ul>
</li>
<% end %>
<% t.meetings.each do |m| %>
<li><%= fa_icon("group li")+m.text %>
<ul class="fa-ul">
<% d = m.agenda %>
<% unless d.nil? %>
<li><%= fa_icon("li file-text-o")+d.name %>
<ul class="fa-ul">
<% d.attachments.each do |a| %>
<li><%= fa_icon("file li")+a.name %></li>
<% end %>
</ul>
</li>
<% end %>
<% d = m.protocol %>
<% unless d.nil? %>
<li><%= fa_icon("li file-text-o")+d.name %>
<ul class="fa-ul">
<% d.attachments.each do |a| %>
<li><%= fa_icon("file li")+a.name %></li>
<% end %>
</ul>
</li>
<% end %>
</ul>
</li>
<% end %>
</ul>
</li>
<% end %></ul>
</li>
<% end %>
</ul>

View File

@@ -129,6 +129,7 @@
get :search, :on => :collection get :search, :on => :collection
collection do collection do
get 'intern' get 'intern'
get 'treeview'
get 'admin' get 'admin'
get 'dev' get 'dev'
get 'startdev' get 'startdev'