forked from bofh/fetsite
AutoCommit Son Jun 21 00:03:01 CEST 2015
This commit is contained in:
@@ -206,3 +206,8 @@ form.inline {
|
|||||||
float:clear; }
|
float:clear; }
|
||||||
|
|
||||||
@import 'tinymce';
|
@import 'tinymce';
|
||||||
|
|
||||||
|
a.flag-true { color: $color_schema_3_dark}
|
||||||
|
a.flag-true.flag-goodquality-true { color: green}
|
||||||
|
|
||||||
|
a.flag-false { color: #CCC}
|
||||||
@@ -47,6 +47,9 @@ class LvasController < ApplicationController
|
|||||||
def show
|
def show
|
||||||
@lva = Lva.find_by_id(params[:id])
|
@lva = Lva.find_by_id(params[:id])
|
||||||
@beispiel=Beispiel.new
|
@beispiel=Beispiel.new
|
||||||
|
@beispiele = @lva.beispiele.not_flag_badquality.not_flag_delete.order(:datum).accessible_by(current_ability, :show)
|
||||||
|
@beispiele_badQ = @lva.beispiele.flag_badquality.not_flag_delete.order(:datum).accessible_by(current_ability, :show)
|
||||||
|
@beispiele_deleted = @lva.beispiele.flag_delete.order(:datum).accessible_by(current_ability, :show)
|
||||||
@toolbar_elements =[]
|
@toolbar_elements =[]
|
||||||
@toolbar_elements<<{:hicon=>'icon-pencil', :icon=>:pencil,:text =>I18n.t('common.manage'),:path => verwalten_lva_path(@lva)} if can? :verwalten, @lva
|
@toolbar_elements<<{:hicon=>'icon-pencil', :icon=>:pencil,:text =>I18n.t('common.manage'),:path => verwalten_lva_path(@lva)} if can? :verwalten, @lva
|
||||||
@crawlobjects = @lva.crawlobjects.roots.accessible_by(current_ability)
|
@crawlobjects = @lva.crawlobjects.roots.accessible_by(current_ability)
|
||||||
|
|||||||
@@ -17,7 +17,11 @@ class Beispiel < ActiveRecord::Base
|
|||||||
acts_as_votable
|
acts_as_votable
|
||||||
acts_as_flagable
|
acts_as_flagable
|
||||||
belongs_to :lva
|
belongs_to :lva
|
||||||
FLAG_ICONS = {"badquality"=>"fa fa-flag", "delete"=>"icon-trash"}
|
FLAG_ICONS = {"badquality"=>"fa fa-flag","goodquality"=>"fa fa-flag", "delete"=>"fa fa-trash"}
|
||||||
|
scope :not_flag_badquality, ->{where("flag_badquality IS NULL OR flag_badquality=?",false)}
|
||||||
|
scope :flag_badquality, ->{where("flag_badquality=?",true)}
|
||||||
|
scope :not_flag_delete, ->{where("flag_delete IS NULL OR flag_delete=?",false)}
|
||||||
|
scope :flag_delete, ->{where("flag_delete=?",true)}
|
||||||
|
|
||||||
mount_uploader :beispieldatei, AttachmentUploader
|
mount_uploader :beispieldatei, AttachmentUploader
|
||||||
validates :beispieldatei, :presence => true
|
validates :beispieldatei, :presence => true
|
||||||
|
|||||||
@@ -7,9 +7,10 @@
|
|||||||
<%= (beispiel.beispieldatei.size/1024.0).round(2).to_s %>KiB
|
<%= (beispiel.beispieldatei.size/1024.0).round(2).to_s %>KiB
|
||||||
</div>
|
</div>
|
||||||
<div class="span5">
|
<div class="span5">
|
||||||
<% fi = {"badquality"=>"fa fa-flag", "delete"=>"fa fa-trash"} %>
|
<%= flag_link(beispiel, "goodquality")%>
|
||||||
<%= flag_link(beispiel, "badquality", ff_icon(fi["badquality"]))%>
|
|
||||||
<%= flag_link(beispiel, "delete", ff_icon(fi["delete"]))%>
|
<%= flag_link(beispiel, "badquality")%>
|
||||||
|
<%= flag_link(beispiel, "delete")%>
|
||||||
|
|
||||||
<%=
|
<%=
|
||||||
if can?(:like, beispiel)
|
if can?(:like, beispiel)
|
||||||
|
|||||||
143
app/views/themes/blue2/lvas/show.html.erb
Executable file
143
app/views/themes/blue2/lvas/show.html.erb
Executable file
@@ -0,0 +1,143 @@
|
|||||||
|
<%= content_for :header do %>
|
||||||
|
<title>Fetsite - <%= @lva.full_name %></title>
|
||||||
|
<% set_meta_tags :og => {
|
||||||
|
:url=>lva_path(:theme=>nil) }
|
||||||
|
%>
|
||||||
|
<%= display_meta_tags %>
|
||||||
|
<% end %>
|
||||||
|
<div itemscope itemtype="schema.org/Article" >
|
||||||
|
<div class="container-fluid">
|
||||||
|
<%= render 'studien/tabs'%>
|
||||||
|
<p id="notice"><%= notice %></p>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<%= render 'layouts/pretty_toolbar' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span8">
|
||||||
|
<h1 itemprop="name"><%= @lva.full_name %></h1>
|
||||||
|
<meta itemprop="url" content="<%= lva_path(@lva) %>" />
|
||||||
|
<ul class="linklist">
|
||||||
|
<li>
|
||||||
|
<%= link_to ffi1_icon("live2")+"ET-Forum", @lva.forumlink, class: :linkbox, itemprop: "discussionUrl" unless @lva.forumlink.nil? or @lva.forumlink.empty?%>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<%= link_to "TISS", @lva.tisslink, class: :linkbox %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div itemprop="articleBody">
|
||||||
|
<h2><%= I18n.t('lva.pruefungsinfo')%></h2>
|
||||||
|
<div class="">
|
||||||
|
<%= @lva.pruefungsinformation.to_s.html_safe %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2><%= I18n.t('lva.lernaufwand')%></h2>
|
||||||
|
<div class="">
|
||||||
|
<%= @lva.lernaufwand %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2><%= I18n.t('lva.desc')%></h2>
|
||||||
|
<div class="">
|
||||||
|
<%= @lva.desc.to_s.html_safe %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="span4">
|
||||||
|
<div class="contentbox">
|
||||||
|
<ul>
|
||||||
|
<li><b><%= I18n.t('lva.lvanr')%>:</b> <%=@lva.lvanr %></li>
|
||||||
|
<li><b>ECTS:</b> <%=@lva.ects %></li>
|
||||||
|
<li><b><%= I18n.t('lva.stunden')%>:</b> <%=@lva.stunden %></li>
|
||||||
|
</ul>
|
||||||
|
<h2><%= I18n.t('lva.module')%></h2>
|
||||||
|
<ul>
|
||||||
|
<% @lva.modul.each do |modul| %>
|
||||||
|
<li><b><%= link_to modul.name , modul_path(modul)%></b>
|
||||||
|
<ul>
|
||||||
|
<% modul.modulgruppen.each do |g| %>
|
||||||
|
|
||||||
|
<li><%= link_to g.studium.title_context , studium_path(g.studium)%> (<%=link_to g.name, modulgruppe_path(g)%>)</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="contentbox">
|
||||||
|
<h2> <%= I18n.t "lecturers.lecturers" %> </h2>
|
||||||
|
<% @lva.lecturers.each do |lec| %>
|
||||||
|
<%= render :partial=>'lecturers/lec_lva', :object=>lec %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
|
||||||
|
<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 %>
|
||||||
|
<% @beispiele.each do |b| %>
|
||||||
|
<% cache("beispiel_" +I18n.locale.to_s+b.id.to_s+can?(:delete,b).to_s+"_"+can?(:edit,b).to_s + "_" + b.updated_at.try(:utc).try(:to_s)) do %>
|
||||||
|
<%= render b%>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<h3> Bad Quality or Outdated</h3>
|
||||||
|
<% @beispiele_badQ.each do |b| %>
|
||||||
|
<% cache("beispiel_" +I18n.locale.to_s+b.id.to_s+can?(:delete,b).to_s+"_"+can?(:edit,b).to_s + "_" + b.updated_at.try(:utc).try(:to_s)) do %>
|
||||||
|
<%= render b%>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<h3> Trash</h3>
|
||||||
|
<% @beispiele_deleted.each do |b| %>
|
||||||
|
<% cache("beispiel_" +I18n.locale.to_s+b.id.to_s+can?(:delete,b).to_s+"_"+can?(:edit,b).to_s +"_"+ can?(:flag,b).to_s+ "_" + b.updated_at.try(:utc).try(:to_s)) do %>
|
||||||
|
<%= render b%>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<% unless @lva.nlinks.empty? %>
|
||||||
|
<h2><%= I18n.t("rubrik.title") %></h2>
|
||||||
|
<% @lva.nlinks.each do |l| %>
|
||||||
|
<%= render l.neuigkeit %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% cache("lva_beispiel_form_bulk_"+@lva.id.to_s+I18n.locale.to_s+@lva.updated_at.to_i.to_s) do %>
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<%= render 'beispiele/form_bulk' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
<% unless @crawlobjects.nil? %>
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<% @crawlobjects.each do |co| %>
|
||||||
|
<%= render co %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ module Flagable
|
|||||||
module LocalInstanceMethods
|
module LocalInstanceMethods
|
||||||
|
|
||||||
def flag
|
def flag
|
||||||
fi = {"badquality"=>"fa fa-flag", "delete"=>"fa fa-trash"}
|
fi = controller_name.classify.constantize::FLAG_ICONS
|
||||||
|
|
||||||
@obj=controller_name.classify.constantize.find(params[:id])
|
@obj=controller_name.classify.constantize.find(params[:id])
|
||||||
lflag=("flag_"+params[:flag]).to_sym
|
lflag=("flag_"+params[:flag]).to_sym
|
||||||
@@ -58,11 +58,12 @@ module Flagable
|
|||||||
end
|
end
|
||||||
module FlagableHelper
|
module FlagableHelper
|
||||||
|
|
||||||
def flag_link(obj, flag, text)
|
def flag_link(obj, flag, text="")
|
||||||
flag=flag.to_s
|
flag=flag.to_s
|
||||||
|
fi = obj.class::FLAG_ICONS
|
||||||
value=obj.send("flag_"+flag)
|
value=obj.send("flag_"+flag)
|
||||||
color=(value) ? "red" :"grey"
|
cstyle=(value) ? "true" :"false"
|
||||||
link_to text, flag_beispiel_path(obj,{flag: flag, value: !value, theme: nil, locale: nil}), remote: true, style:("color:" +color ), id: obj.flaglinkid(flag)
|
link_to ff_icon(fi[flag]), flag_beispiel_path(obj,{flag: flag, value: !value, theme: nil, locale: nil}), remote: true, class:("flag-"+cstyle +" flag-"+flag + "-"+cstyle ), id: obj.flaglinkid(flag)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user