themengruppeprivate

This commit is contained in:
2014-05-27 19:42:05 +05:30
parent 13514317c9
commit adfec2446e
9 changed files with 19 additions and 6 deletions

View File

@@ -7,6 +7,8 @@ class GremienController < ApplicationController
@gremien = Gremium.all @gremien = Gremium.all
@gremientabs=Gremium.tabs @gremientabs=Gremium.tabs
@toolbar_elements << {:text=>I18n.t('gremium.new'),:path=>new_gremium_path() ,:icon=>:plus} if can? :new, Gremium @toolbar_elements << {:text=>I18n.t('gremium.new'),:path=>new_gremium_path() ,:icon=>:plus} if can? :new, Gremium
@toolbar_elements << {:text=>I18n.t('profile.new'),:path=>new_fetprofile_path() ,:icon=>:plus} if can? :new, Fetprofile
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.json { render json: @gremien } format.json { render json: @gremien }

View File

@@ -52,6 +52,8 @@ class ThemengruppenController < ApplicationController
end end
def verwalten_all def verwalten_all
@themengruppen =Themengruppe.order(:priority).reverse @themengruppen =Themengruppe.order(:priority).reverse
@toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()}]
end end
def verwalten def verwalten
@themengruppe = Themengruppe.find(params[:themengruppe_id]) @themengruppe = Themengruppe.find(params[:themengruppe_id])

View File

@@ -32,7 +32,7 @@ class Calentry < ActiveRecord::Base
resourcify resourcify
def get_public def get_public
self.public = (self.try(:object).nil?)? (self.calendar.try(:public)) : object.try(:public) self.public = (self.try(:object).nil?)? (self.calendar.try(:public?)) : object.try(:public?)
true true
end end
def start_time def start_time

View File

@@ -10,7 +10,7 @@
class Themengruppe < ActiveRecord::Base class Themengruppe < ActiveRecord::Base
WORD_COUNT = 50 WORD_COUNT = 50
attr_accessible :text, :title, :picture, :priority attr_accessible :text, :title, :picture, :priority, :public
has_many :themen, class_name: 'Thema' has_many :themen, class_name: 'Thema'
has_many :fragen, through: :themen has_many :fragen, through: :themen

View File

@@ -1,4 +1,5 @@
<h1>Listing gremien</h1> <h1>Listing gremien</h1>
<%= render 'layouts/pretty_toolbar' %>
<div class="container-fluid"> <div class="container-fluid">
<% @gremien.each do |gremium| %> <% @gremien.each do |gremium| %>
<div class="row-fluid"> <div class="row-fluid">
@@ -38,7 +39,7 @@
</table> </table>
<br /> <br />
<%= render 'layouts/pretty_toolbar' %>

View File

@@ -2,6 +2,7 @@
<%= f.inputs do %> <%= f.inputs do %>
<%= f.input :title %> <%= f.input :title %>
<%= f.input :priority %> <%= f.input :priority %>
<%= f.input :public %>
<%= f.input :picture, :as => :file %> <%= f.input :picture, :as => :file %>
<%= f.input :text %> <%= f.input :text %>

View File

@@ -1,4 +1,5 @@
<div class="content-wrap content-column"> <div class="content-wrap content-column">
<%= render :partial=>'layouts/pretty_toolbar' %>
<p> <%= link_to "FAQS", faqs_themengruppen_path,class: :btn %></p> <p> <%= link_to "FAQS", faqs_themengruppen_path,class: :btn %></p>
<ul class="unstyled linkbox-list"> <ul class="unstyled linkbox-list">
<li> <li>
@@ -29,7 +30,7 @@
--> -->
</script> </script>
<%= render :partial=>'layouts/pretty_toolbar' %>
<!-- <!--
<%= link_to 'New Themengruppe', new_themengruppe_path %> <%= link_to 'New Themengruppe', new_themengruppe_path %>
--> -->

View File

@@ -1,4 +1,6 @@
<%= render :partial=>'layouts/pretty_toolbar' %>
<ul id="themengruppen" class="sort" > <ul id="themengruppen" class="sort" >
<% @themengruppen.each do |themengruppe| %> <% @themengruppen.each do |themengruppe| %>
<li id="themengruppen_<%= themengruppe.id %>" class="sort" style="background:white;display:block;" ><%= themengruppe.title %>-<%= themengruppe.priority %></li> <li id="themengruppen_<%= themengruppe.id %>" class="sort" style="background:white;display:block;" ><%= themengruppe.title %>-<%= themengruppe.priority %></li>
@@ -6,7 +8,6 @@
</ul> </ul>
<script> <script>
$( document ).ready(function(){ $( document ).ready(function(){
$("#themengruppen").sortable({ $("#themengruppen").sortable({
cursor: 'crosshair', cursor: 'crosshair',

View File

@@ -0,0 +1,5 @@
class AddPublicToThemengruppe < ActiveRecord::Migration
def change
add_column :themengruppen, :public, :boolean
end
end