diverse fixed
This commit is contained in:
@@ -22,6 +22,6 @@ else
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
def default_url_options
|
def default_url_options
|
||||||
{locale: I18n.locale, theme: theme_name}
|
{locale: I18n.locale, theme: theme_name, ansicht: nil}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ else
|
|||||||
@neuigkeiten = @rubrik.neuigkeiten.published
|
@neuigkeiten = @rubrik.neuigkeiten.published
|
||||||
end
|
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('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
|
@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
|
def create
|
||||||
@thema = Thema.new(params[:thema])
|
@thema = Thema.new(params[:thema])
|
||||||
|
|
||||||
|
@themen = @thema.themengruppe.themen.order(:priority).reverse
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @thema.save
|
if @thema.save
|
||||||
format.html { redirect_to @thema, notice: 'Thema was successfully created.' }
|
format.html { redirect_to @thema, notice: 'Thema was successfully created.' }
|
||||||
@@ -75,7 +76,7 @@ class ThemenController < ApplicationController
|
|||||||
# PUT /themen/1.json
|
# PUT /themen/1.json
|
||||||
def update
|
def update
|
||||||
@thema = Thema.find(params[:id])
|
@thema = Thema.find(params[:id])
|
||||||
|
@themen = @thema.themengruppe.themen.order(:priority).reverse
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @thema.update_attributes(params[:thema])
|
if @thema.update_attributes(params[:thema])
|
||||||
format.html { redirect_to @thema, notice: 'Thema was successfully updated.' }
|
format.html { redirect_to @thema, notice: 'Thema was successfully updated.' }
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
def current_url(overwrite={})
|
def current_url1(overwrite={})
|
||||||
url_for :params => params.merge(overwrite).except(:controller,:action)
|
url_for :params => params.merge(overwrite).except(:controller,:action,:ansicht)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def switch_locale_url(target_locale)
|
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
|
end
|
||||||
def toolbar_html(elemente)
|
def toolbar_html(elemente)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class Calentry < ActiveRecord::Base
|
|||||||
validates :typ, :presence => true
|
validates :typ, :presence => true
|
||||||
before_save :get_public
|
before_save :get_public
|
||||||
belongs_to :object, polymorphic: true # Objekt zu dem der Calentry gehört (derzeit ein Newsartikel)
|
belongs_to :object, polymorphic: true # Objekt zu dem der Calentry gehört (derzeit ein Newsartikel)
|
||||||
|
|
||||||
scope :upcoming, ->{ where("start >= ?", Time.now).order(:start)}
|
scope :upcoming, ->{ where("start >= ?", Time.now).order(:start)}
|
||||||
scope :recent,-> { where("start <= ?", Time.now).order(:start).reverse_order}
|
scope :recent,-> { where("start <= ?", Time.now).order(:start).reverse_order}
|
||||||
validate do |entry|
|
validate do |entry|
|
||||||
|
|||||||
@@ -36,21 +36,27 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="span1 "></div>
|
<div class="span1 "></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span1">
|
<div class="span1">
|
||||||
</div>
|
</div>
|
||||||
<div class="span10" id="contentdiv">
|
<div class="span10" id="contentdiv">
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
<span class="pull-right"> <%= render 'layouts/login' %></span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="span1">
|
<div class="span1">
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</div>
|
||||||
|
|
||||||
</body>
|
</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) )%>");
|
$("#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">
|
<div class="span4">
|
||||||
|
|
||||||
<ul id="themen" class="sort" >
|
<ul id="themen" class="sort" >
|
||||||
<% @themen.each do |thema| %>
|
<%= render partial:"themen/verw_liste", object: @themen %>
|
||||||
<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 %>
|
|
||||||
</ul>
|
</ul>
|
||||||
<%= link_to new_themengruppe_thema_path(@themengruppe),:remote=>true do %> New Thema <% end %>
|
<%= link_to new_themengruppe_thema_path(@themengruppe),:remote=>true do %> New Thema <% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,10 +20,12 @@ end
|
|||||||
|
|
||||||
devise_for :users , :controllers=>{:omniauth_callbacks=> "users/omniauth_callbacks"}
|
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
|
scope '(:ansicht)' do
|
||||||
|
resources :studien, :only=>[:new,:edit,:update,:destroy]
|
||||||
resources :studien, :only=>[:show]
|
resources :studien, :only=>[:show]
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -126,7 +128,7 @@ end
|
|||||||
|
|
||||||
resources :calentries
|
resources :calentries
|
||||||
end
|
end
|
||||||
|
end
|
||||||
# The priority is based upon order of creation:
|
# The priority is based upon order of creation:
|
||||||
# first created -> highest priority.
|
# first created -> highest priority.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user