forked from bofh/fetsite
Merge branch 'master' of https://github.com/fetsite/fetsite
This commit is contained in:
@@ -23,9 +23,9 @@ class ThemengruppenController < ApplicationController
|
|||||||
def show
|
def show
|
||||||
@themengruppe = Themengruppe.find(params[:id])
|
@themengruppe = Themengruppe.find(params[:id])
|
||||||
if can? :showdraft , Thema
|
if can? :showdraft , Thema
|
||||||
@themen = @themengruppe.themen.order(:priority).reverse
|
@themen = @themengruppe.themen
|
||||||
else
|
else
|
||||||
@themen = @themengruppe.themen.where(:isdraft=>false).order(:priority).reverse
|
@themen = @themengruppe.themen.public
|
||||||
end
|
end
|
||||||
@toolbar_elements = []
|
@toolbar_elements = []
|
||||||
@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
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ include Rails.application.routes.url_helpers
|
|||||||
validates :themengruppe, :presence => true
|
validates :themengruppe, :presence => true
|
||||||
validates :title, :presence => true
|
validates :title, :presence => true
|
||||||
validates :text, :presence => true
|
validates :text, :presence => true
|
||||||
|
scope :public, where(:isdraft=>false)
|
||||||
|
default_scope order(:priority).reverse_order
|
||||||
scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")}
|
scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")}
|
||||||
scope :outdated, -> {includes(:translations).where("thema_translations.updated_at<?",2.month.ago).where("thema_translations.locale"=>I18n.t.locale)
|
scope :outdated, -> {includes(:translations).where("thema_translations.updated_at<?",2.month.ago).where("thema_translations.locale"=>I18n.t.locale)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,20 @@
|
|||||||
<div class="content-wrap content-column">
|
<div class="content-wrap content-column">
|
||||||
|
<p>
|
||||||
<%= semantic_form_for :search,:remote=>true, :url=>search_home_index_path, :html=>{:id=>"search_form",:class=>"navbar-search", :method=>'get'} do |f| %>
|
<%= semantic_form_for :search,:remote=>true, :url=>search_home_index_path, :html=>{:id=>"search_form",:class=>"navbar-search", :method=>'get'} do |f| %>
|
||||||
<%= f.input :query, :input_html => { :name => 'query' } , :label=>false, :class=>"search-query" %>
|
<%= f.input :query, :input_html => { :name => 'query' } , :label=>false, :class=>"search-query" %>
|
||||||
|
<%= f.actions do %>
|
||||||
|
<%= f.action :submit, :as => :input %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<script>
|
|
||||||
$( document ).ready(function() {
|
<% end %>
|
||||||
$("#search_query").bind("keyup", function(event){
|
|
||||||
$("#search_form").submit();
|
</p>
|
||||||
});
|
<p>
|
||||||
$("#search_query").value="df"
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<div id="searchresults">
|
<div id="searchresults">
|
||||||
<%= render :partial=>"home/search_results" %>
|
<%= render :partial=>"home/search_results" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -36,11 +36,11 @@
|
|||||||
<div class="span4">
|
<div class="span4">
|
||||||
<div class="contentbox">
|
<div class="contentbox">
|
||||||
<ul>
|
<ul>
|
||||||
<li><b>LVA-Nummer:</b> <%=@lva.lvanr %></li>
|
<li><b><%= I18n.t('lva.lvanr')%>:</b> <%=@lva.lvanr %></li>
|
||||||
<li><b>ECTS:</b> <%=@lva.ects %></li>
|
<li><b>ECTS:</b> <%=@lva.ects %></li>
|
||||||
<li><b>Stunden:</b> <%=@lva.stunden %></li>
|
<li><b><%= I18n.t('lva.stunden')%>:</b> <%=@lva.stunden %></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>Module</h2>
|
<h2><%= I18n.t('lva.module')%></h2>
|
||||||
<ul>
|
<ul>
|
||||||
<% @lva.modul.each do |modul| %>
|
<% @lva.modul.each do |modul| %>
|
||||||
<li><b><%= link_to modul.name , modul_path(modul)%></b>
|
<li><b><%= link_to modul.name , modul_path(modul)%></b>
|
||||||
@@ -68,6 +68,8 @@
|
|||||||
<div class="span12">
|
<div class="span12">
|
||||||
|
|
||||||
<h2><%= I18n.t("lva.bspe") %></h2>
|
<h2><%= I18n.t("lva.bspe") %></h2>
|
||||||
|
<p><%= I18n.t("lva.ratebsp")%> <%= link_to ffi1_icon("facebook1") + I18n.t('home.fblogin'), user_omniauth_authorize_path(:facebook) ,class: :linkbox %>
|
||||||
|
</p>
|
||||||
<%= link_to t("beispiel.zip") , beispiel_sammlung_lva_path(@lva), class: :linkbox %>
|
<%= link_to t("beispiel.zip") , beispiel_sammlung_lva_path(@lva), class: :linkbox %>
|
||||||
<% @lva.beispiele.order(:datum).each do |b| %>
|
<% @lva.beispiele.order(:datum).each do |b| %>
|
||||||
<%= render b%>
|
<%= render b%>
|
||||||
@@ -78,7 +80,7 @@
|
|||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<% unless @lva.nlinks.empty? %>
|
<% unless @lva.nlinks.empty? %>
|
||||||
<h2>Neuigkeiten</h2>
|
<h2><%= I18n.t("rubrik.title") %></h2>
|
||||||
<% @lva.nlinks.each do |l| %>
|
<% @lva.nlinks.each do |l| %>
|
||||||
<%= render l.neuigkeit %>
|
<%= render l.neuigkeit %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li><%= link_to thema_path(thema),:remote=>true do %> <%= fa_icon('eye') %> Show <% end %></li>
|
<li><%= link_to thema_path(thema),:remote=>true do %> <%= fa_icon('eye') %> Show <% end %></li>
|
||||||
<li><%= link_to edit_thema_path(thema),:remote=>true do %> <%= ff_icon('icon-pencil') %> Edit <% end %> </li>
|
<li><%= link_to edit_thema_path(thema),:remote=>true do %> <%= ff_icon('icon-pencil') %> Edit <% end %> </li>
|
||||||
|
<li><%= link_to sanitize_thema_path(thema),:remote=>true do %> <%= ff_icon('icon-leaf') %> Sanitize <% end %> </li>
|
||||||
|
|
||||||
<li><%= link_to fragen_thema_path(thema),:remote=>true do %> Fragen <% end %></li>
|
<li><%= link_to fragen_thema_path(thema),:remote=>true do %> Fragen <% end %></li>
|
||||||
<li><%= link_to attachments_thema_path(thema),:remote=>true do %> Attachments <% end %></li>
|
<li><%= link_to attachments_thema_path(thema),:remote=>true do %> Attachments <% end %></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -34,8 +34,9 @@
|
|||||||
|
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
<!--<b><%= I18n.t("themengruppe.themen") %></b>
|
<!--<b><%= I18n.t("themengruppe.themen") %></b>
|
||||||
--><ul>
|
-->
|
||||||
<% themengruppe.themen.where(" (NOT hidelink) and ( NOT isdraft) ").order(:priority).reverse.each do |t| %>
|
<ul>
|
||||||
|
<% themengruppe.themen.where(:hidelink=>false).where(:isdraft=>false).each do |t| %>
|
||||||
<li>
|
<li>
|
||||||
<%= render t %>
|
<%= render t %>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -29,5 +29,9 @@ de:
|
|||||||
lernaufwand: "Lernaufwand"
|
lernaufwand: "Lernaufwand"
|
||||||
desc: "Beschreibung"
|
desc: "Beschreibung"
|
||||||
bspe: "Beispiele"
|
bspe: "Beispiele"
|
||||||
|
module: "Module"
|
||||||
|
lvanr: "LVA-Nummer"
|
||||||
|
stunden: "Stunden"
|
||||||
|
ratebsp: "Möchtest du die Beispiele bewerten musst du dich einloggen. Derzeit funktioniert das über Facebook, wir arbeiten an einem Login über TISS!"
|
||||||
home:
|
home:
|
||||||
newexamples: "Neueste Beispiele"
|
newexamples: "Neueste Beispiele"
|
||||||
Reference in New Issue
Block a user