This commit is contained in:
2015-01-14 09:08:51 +01:00
7 changed files with 17 additions and 50 deletions

View File

@@ -33,7 +33,7 @@ class HomeController < ApplicationController
def search def search
unless params['query'].nil? || params['query'].empty? unless params['query'].nil? || params['query'].empty?
@results = Sunspot.search Neuigkeit,Rubrik, Fetprofile, Thema, Themengruppe, Lva, Studium, Modul, Modulgruppe do @results = Sunspot.search Neuigkeit,Rubrik, Fetprofile, Thema, Themengruppe, Lva, Studium, Modul, Modulgruppe, Gremium do
fulltext params['query'] fulltext params['query']
end end
@neuigkeiten=[]; @neuigkeiten=[];
@@ -42,6 +42,11 @@ class HomeController < ApplicationController
else else
# @neuigkeiten =Neuigkeit.search(params['query']).public # @neuigkeiten =Neuigkeit.search(params['query']).public
end end
@res=[]
@results.results.each do |r|
@res << r if can?(:show,r)
end
# @fetprofiles = Fetprofile.search(params['query']) # @fetprofiles = Fetprofile.search(params['query'])
@fetprofiles=[] @fetprofiles=[]
# if can?(:showintern, Neuigkeit) # if can?(:showintern, Neuigkeit)

View File

@@ -1,8 +1,5 @@
class MeetingsController < ApplicationController class MeetingsController < ApplicationController
load_and_authorize_resource load_and_authorize_resource
def index def index
parent=params[:parent_type].constantize.find(params[:parent_id]) parent=params[:parent_type].constantize.find(params[:parent_id])

View File

@@ -120,10 +120,13 @@ class Ability
# Calendar # Calendar
if( user.has_role?("fetuser") || user.has_role?("fetadmin")) if( user.has_role?("fetuser") || user.has_role?("fetadmin"))
can :manage, Document can [:edit, :update,:new,:create], Document
can :manage, Meeting can :manage, Meeting
can :manage, Meetingtyp can :manage, Meetingtyp
end end
if user.has_role?("fetadmin")
can :manage, Document
end
if loggedin if loggedin
end end
can :show, Document, :typ=>11 can :show, Document, :typ=>11

View File

@@ -1,7 +1,7 @@
<% unless @results.nil? %> <% unless @results.nil? %>
<ul class="unstyled linkbox-list"> <ul class="unstyled linkbox-list">
<% @results.results.each do |res| %> <% @res.each do |res| %>
<% if can?(:show, res) %> <% if can?(:show, res) %>
<li> <li>
<%= link_to res, :class=>:linkbox do %> <%= link_to res, :class=>:linkbox do %>
@@ -13,44 +13,4 @@
</ul> </ul>
<% end %> <% end %>
<% unless @neuigkeiten.empty? %> <%= @res %>
<h2>Neuigkeiten</h2>
<% end %>
<% @neuigkeiten.each do |neuigkeit| %>
<ul class="unstyled linkbox-list" style="max-width:70em">
<li>
<%= render neuigkeit %>
</li>
</ul>
<% end %>
<% unless @fetprofiles.empty? %>
<h2>Mitarbeiter</h2>
<% end %>
<% @fetprofiles.each do |fetprofile| %>
<ul class="unstyled linkbox-list" style="max-width:70em">
<li>
<%= render fetprofile %>
</li>
</ul>
<% end %>
<% unless @fetprofiles.empty? %>
<h2>Themen</h2>
<% end %>
<ul class="unstyled content-list" style="max-width:70em">
<% @themen.each do |thema| %>
<% if can? :show, thema %>
<li><%= link_to thema.title,thema %>
<div class="contentbox">
<%= render :partial=>"themen/small", :object=>thema %>
</div>
</li>
<% end %>
<% end %>
</ul>

View File

@@ -25,7 +25,8 @@
<li> <li>
<%= link_to 'Intern' , intern_home_index_path %> <%= link_to 'Intern' , intern_home_index_path %>
</li><% end %> </li><% end %>
</ul>
<ul class="nav nav-pills nav-stacked pull-right">
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= image_tag("/flaggen/png/"+I18n.locale.to_s+".png") + " " +I18n.t('sprache',:scope=>'home')%><b class="caret"></b></a> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= image_tag("/flaggen/png/"+I18n.locale.to_s+".png") + " " +I18n.t('sprache',:scope=>'home')%><b class="caret"></b></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">

View File

@@ -1,3 +1,4 @@
<%= render :partial=>"neuigkeiten/compact",:locals=> {:neuigkeit=> nlink} %>
<h2> <%= nlink.title %> </h2> <h2> <% nlink.title %> </h2>

View File

@@ -1,2 +1,2 @@
<h2><%= fa_icon("info-circle 2x")+" "+ nlink.title %></h2> <h2><%= fa_icon("info 2x")+" "+ nlink.title %></h2>
<p><%= raw(nlink.text_first_words) %></p> <p><%= raw(nlink.text_first_words) %></p>