diverse fixed
This commit is contained in:
@@ -22,6 +22,6 @@ else
|
||||
end
|
||||
end
|
||||
def default_url_options
|
||||
{locale: I18n.locale, theme: theme_name}
|
||||
{locale: I18n.locale, theme: theme_name, ansicht: nil}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,12 +12,11 @@ class RubrikenController < ApplicationController
|
||||
@moderatoren=User.with_role(:newsmoderator,@rubrik)
|
||||
if can?(:showunpublished, Neuigkeit)
|
||||
@neuigkeiten = @rubrik.neuigkeiten
|
||||
else
|
||||
else
|
||||
@neuigkeiten = @rubrik.neuigkeiten.published
|
||||
end
|
||||
@toolbar_elements << {:text=>I18n.t('neuigkeit.new.title'),:path=> new_rubrik_neuigkeit_path(@rubrik),:hicon=>'icon-plus-sign'} if can? :verwalten, @rubrik
|
||||
|
||||
@toolbar_elements << {:text=>I18n.t('common.verwalten'),:path=>verwalten_rubrik_path(@rubrik),:icon=>:pencil} if can? :verwalten, @rubrik
|
||||
end
|
||||
@toolbar_elements << {:text=>I18n.t('neuigkeit.new.title'), :path=> new_rubrik_neuigkeit_path(@rubrik),:hicon=>'icon-plus-sign'} if can? :verwalten, @rubrik
|
||||
@toolbar_elements << {:text=>I18n.t('common.verwalten'), :path=>verwalten_rubrik_path(@rubrik),:icon=>:pencil} if can? :verwalten, @rubrik
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ class ThemenController < ApplicationController
|
||||
def create
|
||||
@thema = Thema.new(params[:thema])
|
||||
|
||||
@themen = @thema.themengruppe.themen.order(:priority).reverse
|
||||
respond_to do |format|
|
||||
if @thema.save
|
||||
format.html { redirect_to @thema, notice: 'Thema was successfully created.' }
|
||||
@@ -75,7 +76,7 @@ class ThemenController < ApplicationController
|
||||
# PUT /themen/1.json
|
||||
def update
|
||||
@thema = Thema.find(params[:id])
|
||||
|
||||
@themen = @thema.themengruppe.themen.order(:priority).reverse
|
||||
respond_to do |format|
|
||||
if @thema.update_attributes(params[:thema])
|
||||
format.html { redirect_to @thema, notice: 'Thema was successfully updated.' }
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
module ApplicationHelper
|
||||
def current_url(overwrite={})
|
||||
url_for :params => params.merge(overwrite).except(:controller,:action)
|
||||
def current_url1(overwrite={})
|
||||
url_for :params => params.merge(overwrite).except(:controller,:action,:ansicht)
|
||||
end
|
||||
|
||||
|
||||
def switch_locale_url(target_locale)
|
||||
current_url({:locale=>target_locale}) .sub "/"+I18n.locale.to_s+"/", "/"+target_locale.to_s+"/"
|
||||
current_url1({:locale=>target_locale}) .sub "/"+I18n.locale.to_s+"/", "/"+target_locale.to_s+"/"
|
||||
|
||||
end
|
||||
def toolbar_html(elemente)
|
||||
|
||||
@@ -21,6 +21,7 @@ class Calentry < ActiveRecord::Base
|
||||
validates :typ, :presence => true
|
||||
before_save :get_public
|
||||
belongs_to :object, polymorphic: true # Objekt zu dem der Calentry gehört (derzeit ein Newsartikel)
|
||||
|
||||
scope :upcoming, ->{ where("start >= ?", Time.now).order(:start)}
|
||||
scope :recent,-> { where("start <= ?", Time.now).order(:start).reverse_order}
|
||||
validate do |entry|
|
||||
|
||||
@@ -36,21 +36,27 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="span1 "></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span1">
|
||||
</div>
|
||||
<div class="span10" id="contentdiv">
|
||||
<%= yield %>
|
||||
<span class="pull-right"> <%= render 'layouts/login' %></span>
|
||||
</div>
|
||||
<div class="span1">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span1">
|
||||
</div>
|
||||
<div class="span10" id="contentdiv">
|
||||
<span class="pull-right"> <%= render 'layouts/login' %></span> Version 0.0.3
|
||||
</div>
|
||||
<div class="span1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
3
app/views/themen/_verw_liste.html.erb
Normal file
3
app/views/themen/_verw_liste.html.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
<% verw_liste.each do |thema| %>
|
||||
<li id="themen_<%= thema.id %>" class="sort" ><div class="contentbox handle" ><h2><%= thema.title %></h2> </div> <%= link_to edit_thema_path(thema),:remote=>true do %> Edit <% end %> <%= link_to thema_fragen_path(thema),:remote=>true do %> Fragen <% end %></li>
|
||||
<% end %>
|
||||
@@ -1,2 +1,4 @@
|
||||
alert('t');
|
||||
|
||||
$("#themaview").html("<%= escape_javascript(raw("<h2>Bearbeiten</h2>")+render(:partial=>"themen/small", :object=>@thema) )%>");
|
||||
|
||||
$("#themen").html("<%= escape_javascript(render(:partial=>"themen/verw_liste", :object=>@themen) )%>");
|
||||
|
||||
@@ -7,9 +7,7 @@
|
||||
<div class="span4">
|
||||
|
||||
<ul id="themen" class="sort" >
|
||||
<% @themen.each do |thema| %>
|
||||
<li id="themen_<%= thema.id %>" class="sort" ><div class="contentbox handle" ><h2><%= thema.title %></h2> </div> <%= link_to edit_thema_path(thema),:remote=>true do %> Edit <% end %> <%= link_to thema_fragen_path(thema),:remote=>true do %> Fragen <% end %></li>
|
||||
<% end %>
|
||||
<%= render partial:"themen/verw_liste", object: @themen %>
|
||||
</ul>
|
||||
<%= link_to new_themengruppe_thema_path(@themengruppe),:remote=>true do %> New Thema <% end %>
|
||||
</div>
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
#get 'home',:controller=>home,:action=>:index,:as=>"home_index"
|
||||
scope '(:locale)/admin' do
|
||||
resources :users, :only=>[] do
|
||||
collection do
|
||||
collection do
|
||||
get :index
|
||||
post :all_update
|
||||
end
|
||||
end
|
||||
end
|
||||
get 'users/:id/add_role/:role', :controller=>:users, :action=>:add_role, :as=>'user_add_role'
|
||||
get 'users/:id/do_confirm', :controller=>:users, :action=>:do_confirm, :as=>'user_do_confirm'
|
||||
@@ -20,10 +20,12 @@ end
|
||||
|
||||
devise_for :users , :controllers=>{:omniauth_callbacks=> "users/omniauth_callbacks"}
|
||||
|
||||
scope '(:locale)' do
|
||||
scope ':locale' do
|
||||
scope '(t/:theme)' do
|
||||
# Studien
|
||||
|
||||
resources :studien, :only=>[:new,:edit,:update,:destroy]
|
||||
scope '(:ansicht)' do
|
||||
resources :studien, :only=>[:new,:edit,:update,:destroy]
|
||||
resources :studien, :only=>[:show]
|
||||
end
|
||||
|
||||
@@ -126,7 +128,7 @@ end
|
||||
|
||||
resources :calentries
|
||||
end
|
||||
|
||||
end
|
||||
# The priority is based upon order of creation:
|
||||
# first created -> highest priority.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user