#143 fixed
themen fixed
This commit is contained in:
2014-06-10 18:47:16 +05:30
parent 6451c0f175
commit 67ccecaf51
10 changed files with 49 additions and 24 deletions

View File

@@ -9,6 +9,7 @@ GIT
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
RedCloth (4.2.9)
actionmailer (3.2.13) actionmailer (3.2.13)
actionpack (= 3.2.13) actionpack (= 3.2.13)
mail (~> 2.5.3) mail (~> 2.5.3)
@@ -53,6 +54,7 @@ GEM
activemodel (>= 3.2.0) activemodel (>= 3.2.0)
activesupport (>= 3.2.0) activesupport (>= 3.2.0)
json (>= 1.7) json (>= 1.7)
charlock_holmes (0.6.9.4)
climate_control (0.0.3) climate_control (0.0.3)
activesupport (>= 3.0) activesupport (>= 3.0)
cocaine (0.5.3) cocaine (0.5.3)
@@ -73,6 +75,7 @@ GEM
erubis (2.7.0) erubis (2.7.0)
execjs (1.4.0) execjs (1.4.0)
multi_json (~> 1.0) multi_json (~> 1.0)
expression_parser (0.9.0)
factory_girl (4.3.0) factory_girl (4.3.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
factory_girl_rails (4.3.0) factory_girl_rails (4.3.0)
@@ -87,12 +90,25 @@ GEM
formtastic-bootstrap (2.1.3) formtastic-bootstrap (2.1.3)
formtastic (~> 2.2) formtastic (~> 2.2)
git (1.2.6) git (1.2.6)
github-markup (0.7.5)
gitlab-grit (2.6.0)
charlock_holmes (~> 0.6.9)
diff-lcs (~> 1.1)
mime-types (~> 1.15)
posix-spawn (~> 0.3.6)
globalize (3.0.4) globalize (3.0.4)
activemodel (>= 3.0.0, < 4.0.0) activemodel (>= 3.0.0, < 4.0.0)
activerecord (>= 3.0.0, < 4.0.0) activerecord (>= 3.0.0, < 4.0.0)
globalize-versioning (0.1.0.alpha.1) globalize-versioning (0.1.0.alpha.1)
globalize (>= 3, < 5) globalize (>= 3, < 5)
paper_trail (~> 3.0.0) paper_trail (~> 3.0.0)
gollum-lib (2.0.0)
github-markup (>= 0.7.5, < 1.0.0)
gitlab-grit (= 2.6.0)
nokogiri (~> 1.6.0)
rouge (~> 1.3.1)
sanitize (~> 2.0.6)
stringex (~> 2.1.0)
haml (4.0.5) haml (4.0.5)
tilt tilt
hashie (2.0.5) hashie (2.0.5)
@@ -150,6 +166,7 @@ GEM
cocaine (~> 0.5.0) cocaine (~> 0.5.0)
mime-types mime-types
polyglot (0.3.3) polyglot (0.3.3)
posix-spawn (0.3.8)
pyu-ruby-sasl (0.0.3.3) pyu-ruby-sasl (0.0.3.3)
rack (1.4.5) rack (1.4.5)
rack-cache (1.2) rack-cache (1.2)
@@ -177,8 +194,10 @@ GEM
rdoc (3.12.2) rdoc (3.12.2)
json (~> 1.4) json (~> 1.4)
ref (1.0.5) ref (1.0.5)
rinku (1.7.3)
rmagick (2.13.2) rmagick (2.13.2)
rolify (3.2.0) rolify (3.2.0)
rouge (1.3.4)
rspec-core (2.14.7) rspec-core (2.14.7)
rspec-expectations (2.14.4) rspec-expectations (2.14.4)
diff-lcs (>= 1.1.3, < 2.0) diff-lcs (>= 1.1.3, < 2.0)
@@ -208,6 +227,7 @@ GEM
rack (~> 1.0) rack (~> 1.0)
tilt (~> 1.1, != 1.3.0) tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.8) sqlite3 (1.3.8)
stringex (2.1.2)
themes_for_rails (0.5.1) themes_for_rails (0.5.1)
rails (>= 3.0.0) rails (>= 3.0.0)
therubyracer (0.12.0) therubyracer (0.12.0)
@@ -226,11 +246,17 @@ GEM
json (>= 1.8.0) json (>= 1.8.0)
warden (1.2.3) warden (1.2.3)
rack (>= 1.0) rack (>= 1.0)
webrick (1.3.1)
wikicloth (0.8.1)
builder
expression_parser
rinku
PLATFORMS PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
RedCloth
annotate (>= 2.5.0) annotate (>= 2.5.0)
awesome_nested_set awesome_nested_set
bootstrap-addons-rails bootstrap-addons-rails
@@ -247,6 +273,7 @@ DEPENDENCIES
git git
globalize (~> 3.0.4) globalize (~> 3.0.4)
globalize-versioning globalize-versioning
gollum-lib
haml haml
jquery-fileupload-rails jquery-fileupload-rails
jquery-rails jquery-rails
@@ -271,3 +298,5 @@ DEPENDENCIES
therubyracer therubyracer
tinymce-rails (~> 3.5.8) tinymce-rails (~> 3.5.8)
uglifier (>= 1.0.3) uglifier (>= 1.0.3)
webrick (= 1.3.1)
wikicloth

View File

@@ -33,9 +33,7 @@ class ThemenController < ApplicationController
def verwalten def verwalten
@thema = Thema.find(params[:id]) @thema = Thema.find(params[:id])
@attachment=Attachment.new @attachment=Attachment.new
unless (@thema.is_wiki?)
redirect_to verwalten_wiki_path(Wiki.find(@thema.id))
end
@fragen=@thema.fragen @fragen=@thema.fragen
@toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>"Verwalten", :path=>verwalten_thema_path(@thema)}] @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>"Verwalten", :path=>verwalten_thema_path(@thema)}]

View File

@@ -24,10 +24,7 @@ class ThemengruppenController < ApplicationController
@themen = @themengruppe.themen.order(:priority).reverse @themen = @themengruppe.themen.order(:priority).reverse
@toolbar_elements = [] @toolbar_elements = []
@toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('thema.add'), :path=>new_themengruppe_thema_path(@themengruppe)} if can? :new, Themengruppe
@toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('themengruppe.edit'), :path=>edit_themengruppe_path(@themengruppe)} if can? :edit, @themengruppe
@toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t("themengruppe.manage"), :path=>themengruppe_verwalten_path(@themengruppe)} if can? :edit, @themengruppe @toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t("themengruppe.manage"), :path=>themengruppe_verwalten_path(@themengruppe)} if can? :edit, @themengruppe
@toolbar_elements << {:hicon=>'icon-remove-circle',:text=>I18n.t('themengruppe.remove'), :path=>themengruppe_path(@themengruppe), :method=>:delete,:confirm=>I18n.t('themengruppe.sure')} if can? :delete, @themengruppe
respond_to do |format| respond_to do |format|
format.html # show.html.erb format.html # show.html.erb
@@ -58,6 +55,12 @@ class ThemengruppenController < ApplicationController
def verwalten def verwalten
@themengruppe = Themengruppe.find(params[:themengruppe_id]) @themengruppe = Themengruppe.find(params[:themengruppe_id])
@themen = @themengruppe.themen.order(:priority).reverse @themen = @themengruppe.themen.order(:priority).reverse
@toolbar_elements =[]
@toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('themengruppe.edit'), :path=>edit_themengruppe_path(@themengruppe)} if can? :edit, @themengruppe
@toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('thema.add'), :path=>new_themengruppe_thema_path(@themengruppe)} if can? :new, Themengruppe
@toolbar_elements << {:hicon=>'icon-remove-circle',:text=>I18n.t('themengruppe.remove'), :path=>themengruppe_path(@themengruppe), :method=>:delete,:confirm=>I18n.t('themengruppe.sure')} if can? :delete, @themengruppe
end end
def sort_themengruppen def sort_themengruppen

View File

@@ -16,11 +16,7 @@ class WikisController < ApplicationController
redirect_to wiki_path(@wiki) redirect_to wiki_path(@wiki)
end end
def verwalten
@wiki = Wiki.find(params[:id])
@toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('wiki.edit'), :path=>edit_wiki_path(@wiki)}]
end
def edit def edit
@wiki = Wiki.find(params[:id]) @wiki = Wiki.find(params[:id])
respond_to do |format| respond_to do |format|
@@ -36,7 +32,7 @@ class WikisController < ApplicationController
@wiki.raw_data=params[:wiki][:raw_data] @wiki.raw_data=params[:wiki][:raw_data]
respond_to do |format| respond_to do |format|
if @wiki.update_attributes(params[:wiki]) if @wiki.update_attributes(params[:wiki])
format.html { redirect_to @wiki, notice: 'Thema was successfully updated.' } format.html { redirect_to verwalten_thema_path(@wiki), notice: 'Thema was successfully updated.' }
format.json { head :no_content } format.json { head :no_content }
format.js format.js
else else

View File

@@ -12,7 +12,7 @@
# #
class Modul < ActiveRecord::Base class Modul < ActiveRecord::Base
attr_accessible :desc,:name, :depend, :studium_id, :modulgruppen attr_accessible :desc,:name, :depend, :studium_id, :modulgruppen, :modulgruppe_ids
has_and_belongs_to_many :lvas , :uniq=>true has_and_belongs_to_many :lvas , :uniq=>true
has_and_belongs_to_many :modulgruppen has_and_belongs_to_many :modulgruppen

View File

@@ -7,7 +7,7 @@
<h2>Prüfungsinformation</h2> <h2>Prüfungsinformation</h2>
<div class=""> <div class="">
<%= @lva.pruefungsinformation.html_safe %> <%= @lva.pruefungsinformation.to_s.html_safe %>
</div> </div>
<h2>Lernaufwand</h2> <h2>Lernaufwand</h2>

View File

@@ -6,5 +6,5 @@
<div id="fragenform"> <div id="fragenform">
<%= render :partial=>'fragen/rform' %> <%= render :partial=>'fragen/rform' %>
</div> </div>
<% @frage_elements = [{:icon=>:plus, :hicon=>'icon-plus', :text=>I18n.t('frage.add'), :path=>new_frage_path}] %> <% # @frage_elements = [{:icon=>:plus, :hicon=>'icon-plus', :text=>I18n.t('frage.add'), :path=>new_frage_path}] %>
<%= render :partial=>'layouts/pretty_toolbar', :object=>@frage_elements %> <% # render :partial=>'layouts/pretty_toolbar', :object=>@frage_elements %>

View File

@@ -1,5 +1,5 @@
<a name="thema_<%=small.id%>" href="#<%=small.id%>"> <a name="thema_<%=small.id%>" href="#<%=small.id%>">
<h2><%= small.title %></h2> <h2><%= small.title %> <%= link_to fa_icon("pencil"), verwalten_thema_path(small) if can? :edit, small %></h2>
</a> </a>
<%= raw(small.text) %> <%= raw(small.text) %>
<br/> <br/>

View File

@@ -1,7 +1,10 @@
<div class="content-wrap content-column" > <div class="content-wrap content-column" >
<%= link_to fa_icon("arrow-circle-left 2x")+" Alle Themengruppen", themengruppen_path, :class=>"linkbox" %> <%= link_to fa_icon("arrow-circle-left 2x")+" Alle Themengruppen", themengruppen_path, :class=>"linkbox" %>
<%= link_to fa_icon("question 2x")+" Häufige Fragen", faqs_themengruppen_path(:anchor=>"themengruppe_"+@themengruppe.id.to_s), :class=>"linkbox" %> <%= link_to fa_icon("question 2x")+" Häufige Fragen", faqs_themengruppen_path(:anchor=>"themengruppe_"+@themengruppe.id.to_s), :class=>"linkbox" %>
<%= render :partial=>'layouts/pretty_toolbar' %>
<h1><%= @themengruppe.title %></h1> <h1><%= @themengruppe.title %></h1>
<p> <p>
<%= @themengruppe.text %> <%= @themengruppe.text %>
</p> </p>
@@ -10,13 +13,8 @@
<li> <li>
<div class="contentbox"> <div class="contentbox">
<%= render :partial => 'themen/small', :object => thema %> <%= render :partial => 'themen/small', :object => thema %>
tools:
<%
@small_elements2 = []
@small_elements2 << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('common.verwalten'), :path=>verwalten_thema_path(thema)} if can? :edit, thema
%>
<%= render :partial=>'layouts/pretty_toolbar', :object=>@small_elements2 unless @small_elements2.empty? %>
<ul class="unstyled"> <ul class="unstyled">
<% unless thema.gremium.nil? %> <% unless thema.gremium.nil? %>
@@ -37,5 +35,4 @@
<% end %> <% end %>
</ul> </ul>
<%= render :partial=>'layouts/pretty_toolbar' %>
</div> </div>

View File

@@ -2,6 +2,8 @@
#themen { list-style-type: none; margin: 0; padding: 0; margin-bottom: 15px;zoom: 1; } #themen { list-style-type: none; margin: 0; padding: 0; margin-bottom: 15px;zoom: 1; }
#themen li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 95%; } #themen li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 95%; }
</style> </style>
<%= render :partial=>'layouts/pretty_toolbar' %>
<div class="container-fluid"> <div class="container-fluid">
<div class="row-fluid"> <div class="row-fluid">
<div class="span4"> <div class="span4">