Merge branch 'master' of https://github.com/fetsite/fetsite
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -22,7 +22,7 @@ group :assets do
|
|||||||
gem 'therubyracer', :platforms => :ruby
|
gem 'therubyracer', :platforms => :ruby
|
||||||
gem 'uglifier', '>= 1.0.3'
|
gem 'uglifier', '>= 1.0.3'
|
||||||
end
|
end
|
||||||
|
gem 'active_record_query_trace'
|
||||||
|
|
||||||
gem 'jquery-rails'
|
gem 'jquery-rails'
|
||||||
|
|
||||||
|
|||||||
@@ -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}
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
*= require jquery.fileupload-ui
|
*= require jquery.fileupload-ui
|
||||||
*= require jquery.datetimepicker
|
*= require jquery.datetimepicker
|
||||||
*= require jquery.ui.dialog
|
*= require jquery.ui.dialog
|
||||||
|
*= require jquery.ui.tabs
|
||||||
* require 'bootstrap'
|
* require 'bootstrap'
|
||||||
|
|
||||||
* require 'neuigkeiten'
|
* require 'neuigkeiten'
|
||||||
@@ -77,8 +78,8 @@ $sansFontFamily: Helvetica, Arial;
|
|||||||
|
|
||||||
div.header {
|
div.header {
|
||||||
display: block;
|
display: block;
|
||||||
// backgro und: url('../../../../header1.png') no-repeat;
|
// background: url('../../../../header1.png') no-repeat;
|
||||||
// background-color:white;// $color_prim;
|
// background-color:white;// $color_prim;
|
||||||
// background-position: right;
|
// background-position: right;
|
||||||
vertical-align:middle;
|
vertical-align:middle;
|
||||||
float:left;
|
float:left;
|
||||||
@@ -128,3 +129,29 @@ body {
|
|||||||
background: #FFF; //#EFEFEF;
|
background: #FFF; //#EFEFEF;
|
||||||
background-size:100%;
|
background-size:100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ul.linklist_block a.linkbox
|
||||||
|
{
|
||||||
|
max-width:100%;
|
||||||
|
padding:0;
|
||||||
|
margin:5px;
|
||||||
|
width: 6em;
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
ul.linklist_block a.linkbox:hover
|
||||||
|
{background:lighten($color_schema_1,40%);
|
||||||
|
}
|
||||||
|
ul.linklist_block li
|
||||||
|
{text-decoration: none;
|
||||||
|
list-style:none;
|
||||||
|
margin-bottom:2px;
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
ul.linklist_block li a i{
|
||||||
|
display:block;
|
||||||
|
vertical-align:middle;
|
||||||
|
margin-right:6px;
|
||||||
|
font-size:5em;
|
||||||
|
line-height:70px;
|
||||||
|
}
|
||||||
|
ul.linklist_block { clear:left; float:none;}
|
||||||
|
|||||||
1
app/controllers/.#crawler_controller.rb
Symbolic link
1
app/controllers/.#crawler_controller.rb
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
andreas@andreas-ThinkPad-S430.4992:1434372676
|
||||||
@@ -51,6 +51,6 @@ def current_ability
|
|||||||
@current_ability ||= Ability.new(current_user, request, params[:key])
|
@current_ability ||= Ability.new(current_user, request, params[:key])
|
||||||
end
|
end
|
||||||
def default_url_options
|
def default_url_options
|
||||||
{locale: I18n.locale, theme: nil , ansicht: nil}
|
{locale: nil, theme: nil , ansicht: nil} # I18n.locale
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ class BeispieleController < ApplicationController
|
|||||||
|
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
include LikeVoteable
|
include LikeVoteable
|
||||||
|
acts_as_flagable
|
||||||
def index
|
def index
|
||||||
@beispiele = Beispiel.all
|
@beispiele = Beispiel.all
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ class CrawlerController < ApplicationController
|
|||||||
authorize! :doadmin, User
|
authorize! :doadmin, User
|
||||||
|
|
||||||
@crawlobjs=Crawlobject.where(:objtype=>5).order(:published_at).reverse_order
|
@crawlobjs=Crawlobject.where(:objtype=>5).order(:published_at).reverse_order
|
||||||
|
@crawlobjs_etit=Crawlobject.where(:objtype=>6).order(:published_at).reverse_order
|
||||||
|
|
||||||
end
|
end
|
||||||
def load_attachments
|
def load_attachments
|
||||||
authorize! :doadmin, User
|
authorize! :doadmin, User
|
||||||
@@ -19,11 +21,16 @@ class CrawlerController < ApplicationController
|
|||||||
end
|
end
|
||||||
def move_to_news
|
def move_to_news
|
||||||
authorize! :doadmin, User
|
authorize! :doadmin, User
|
||||||
|
|
||||||
co=Crawlobject.find(params[:id])
|
co=Crawlobject.find(params[:id])
|
||||||
if co.objtype == 5
|
if co.objtype == 5 || co.objtype==6
|
||||||
co.move_to_neuigkeit(User.find(Rails.configuration.crawlconfig[5]["user_id"]), Rubrik.find(Rails.configuration.crawlconfig[5]["rubrik_id"]))
|
co.move_to_neuigkeit(User.find(Rails.configuration.crawlconfig[co.objtype]["user_id"]), Rubrik.find(Rails.configuration.crawlconfig[co.objtype]["rubrik_id"]))
|
||||||
redirect_to co.something
|
redirect_to co.something
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def do_crawl_news
|
||||||
|
Crawlobject.crawl_news(5)
|
||||||
|
Crawlobject.crawl_news(6)
|
||||||
|
redirect_to action: :index
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ 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_all=@lva.beispiele.order(:datum).accessible_by(current_ability, :show)
|
||||||
|
@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)
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ end
|
|||||||
# Calendar
|
# Calendar
|
||||||
|
|
||||||
if( user.has_role?("fetuser") || user.has_role?("fetadmin"))
|
if( user.has_role?("fetuser") || user.has_role?("fetadmin"))
|
||||||
can [:show, :edit, :update,:new,:create,:write, :write_etherpad, :read_from_etherpad, :dump_to_etherpad], Document
|
can [:show, :edit, :update,:new,:create,:write, :write_etherpad, :read_from_etherpad, :dump_to_etherpad, :search], Document
|
||||||
can :manage, Meeting
|
can :manage, Meeting
|
||||||
can :manage, Meetingtyp
|
can :manage, Meetingtyp
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,7 +15,13 @@ class Beispiel < ActiveRecord::Base
|
|||||||
has_paper_trail
|
has_paper_trail
|
||||||
attr_accessible :desc, :name, :lva_id, :beispieldatei, :beispieldatei_cache, :datum
|
attr_accessible :desc, :name, :lva_id, :beispieldatei, :beispieldatei_cache, :datum
|
||||||
acts_as_votable
|
acts_as_votable
|
||||||
|
acts_as_flagable
|
||||||
belongs_to :lva
|
belongs_to :lva
|
||||||
|
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
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class Crawlobject < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
def move_to_neuigkeit(user,rubrik)
|
def move_to_neuigkeit(user,rubrik)
|
||||||
if self.objtype == 5 and self.something.nil?
|
if ( self.objtype == 5 || self.objtype == 6 )and self.something.nil?
|
||||||
n=Neuigkeit.new
|
n=Neuigkeit.new
|
||||||
n.title=self.name
|
n.title=self.name
|
||||||
n.text=self.text
|
n.text=self.text
|
||||||
@@ -27,7 +27,7 @@ class Crawlobject < ActiveRecord::Base
|
|||||||
self.something=n
|
self.something=n
|
||||||
self.save
|
self.save
|
||||||
return n
|
return n
|
||||||
elsif self.objtype == 5
|
elsif ( self.objtype == 5 || self.objtype==6)
|
||||||
n=self.something
|
n=self.something
|
||||||
n.title=self.name
|
n.title=self.name
|
||||||
n.text=self.text
|
n.text=self.text
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class Neuigkeit < ActiveRecord::Base
|
|||||||
has_many :nlinks, :dependent=> :destroy
|
has_many :nlinks, :dependent=> :destroy
|
||||||
has_one :meeting
|
has_one :meeting
|
||||||
has_many :attachments, :as=>:parent
|
has_many :attachments, :as=>:parent
|
||||||
|
has_one :title_pic, :class_name=>"Attachment", :as=>:parent, :conditions=>["attachments.flag_titlepic =?", true]
|
||||||
|
|
||||||
|
|
||||||
validates :rubrik, :presence=>true
|
validates :rubrik, :presence=>true
|
||||||
@@ -29,7 +29,7 @@ class Neuigkeit < ActiveRecord::Base
|
|||||||
translates :title,:text, :versioning=>{:gem=>:paper_trail, :options=>{:fallbacks_for_empty_translations => true}}
|
translates :title,:text, :versioning=>{:gem=>:paper_trail, :options=>{:fallbacks_for_empty_translations => true}}
|
||||||
mount_uploader :picture, PictureUploader
|
mount_uploader :picture, PictureUploader
|
||||||
|
|
||||||
default_scope order(:cache_order)
|
default_scope order(:cache_order).includes(:calentries).includes(:title_pic)
|
||||||
scope :recent, -> { published.limit(10)}
|
scope :recent, -> { published.limit(10)}
|
||||||
scope :unpublished, -> {where("datum > ? OR datum IS NULL", Time.now)}
|
scope :unpublished, -> {where("datum > ? OR datum IS NULL", Time.now)}
|
||||||
scope :published_scope, ->{where("datum <= ? AND datum IS NOT NULL", Time.now)}
|
scope :published_scope, ->{where("datum <= ? AND datum IS NOT NULL", Time.now)}
|
||||||
@@ -66,8 +66,9 @@ class Neuigkeit < ActiveRecord::Base
|
|||||||
if self.has_meeting?
|
if self.has_meeting?
|
||||||
return self.meeting.meetingtyp.picture
|
return self.meeting.meetingtyp.picture
|
||||||
else
|
else
|
||||||
unless self.attachments.where(flag_titlepic: true).first.nil?
|
unless self.title_pic.nil?
|
||||||
return self.attachments.where(flag_titlepic: true).first.datei
|
# return self.attachments.where(flag_titlepic: true).first.datei
|
||||||
|
return self.title_pic.datei
|
||||||
else
|
else
|
||||||
return self.picture
|
return self.picture
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,9 +1,39 @@
|
|||||||
<h2>HTU News</h2>
|
<h2>HTU News</h2>
|
||||||
<table>
|
|
||||||
<% @crawlobjs.each do |co| %>
|
<div id="tabs">
|
||||||
<tr> <td> <%= render co %> </td>
|
<ul>
|
||||||
<td>
|
<li><a href="#tab-htu">HTU-News</a></li>
|
||||||
<%= link_to "move_to_news",move_to_news_crawler_path(co) %>
|
<li><a href="#tab-etit">ETIT-News</a></li>
|
||||||
<%= render co.something unless co.something.nil? %>
|
</ul>
|
||||||
</td> </tr><% end %>
|
|
||||||
</table>
|
<div id="tab-htu">
|
||||||
|
<table>
|
||||||
|
<% @crawlobjs.each do |co| %>
|
||||||
|
<tr>
|
||||||
|
<td> <%= render co %> </td>
|
||||||
|
<td>
|
||||||
|
<%= link_to "move_to_news",move_to_news_crawler_path(co) %>
|
||||||
|
<%= render co.something unless co.something.nil? %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="tab-etit">
|
||||||
|
<table>
|
||||||
|
<% @crawlobjs_etit.each do |co| %>
|
||||||
|
<tr>
|
||||||
|
<td> <%= render co %> </td>
|
||||||
|
<td>
|
||||||
|
<%= link_to "move_to_news",move_to_news_crawler_path(co) %>
|
||||||
|
<%= render co.something unless co.something.nil? %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<script>$("#tabs").tabs()</script>
|
||||||
|
|||||||
1
app/views/flags/.#_flaglink.html.erb
Symbolic link
1
app/views/flags/.#_flaglink.html.erb
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
andreas@andreas-ThinkPad-S430.11733:1434727463
|
||||||
1
app/views/flags/_flag.js.erb
Normal file
1
app/views/flags/_flag.js.erb
Normal file
@@ -0,0 +1 @@
|
|||||||
|
$('#<%=@obj.flaglinkid(params[:flag]) %>').replaceWith("<%= escape_javascript( render(partial: "flags/flaglink", format: "html", locals: {flag: params[:flag]}) )%>");
|
||||||
2
app/views/flags/_flaglink.html.erb
Normal file
2
app/views/flags/_flaglink.html.erb
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<% fi = {"badquality"=>"fa fa-flag", "delete"=>"fa fa-trash"} %>
|
||||||
|
<%= flag_link(@obj,flag, ff_icon(fi[flag])) %>
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
<p><%= I18n.t("lva.ratebsp")%> <%= link_to ffi1_icon("facebook1") + I18n.t('home.fblogin'), user_omniauth_authorize_path(:facebook) ,class: :linkbox %>
|
<p><%= I18n.t("lva.ratebsp")%> <%= link_to ffi1_icon("facebook1") + I18n.t('home.fblogin'), user_omniauth_authorize_path(:facebook) ,class: :linkbox %>
|
||||||
</p>
|
</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| %>
|
<% @beispiele_all.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 %>
|
<% 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%>
|
<%= render b%>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<% end %> </small> <% else %> <% end %>
|
<% end %> </small> <% else %> <% end %>
|
||||||
</div>
|
</div>
|
||||||
<h1 >
|
<h1 >
|
||||||
<%= neuigkeit.title%>
|
<%= raw(neuigkeit.title) %>
|
||||||
</h1><div>
|
</h1><div>
|
||||||
<%= raw(neuigkeit.text_first_words) unless neuigkeit.text.nil?%></div>
|
<%= raw(neuigkeit.text_first_words) unless neuigkeit.text.nil?%></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12"><p>
|
<div class="span12"><p>
|
||||||
<div id="toolBar"></div></p>
|
<div id="toolBar"></div></p>
|
||||||
<div id="tabs">
|
<div id="tabs">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#tab-data">Daten</a></li>
|
<li><a href="#tab-data">Daten</a></li>
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
<%= tinymce :inline_div %>
|
<%= tinymce :inline_div %>
|
||||||
<%= f.actions do %>
|
<%= f.actions do %>
|
||||||
<%= f.action :submit, :as => :input %>
|
<%= f.action :submit, :as => :input %>
|
||||||
<%= link_to 'Back', studien_path, :data=>{:locale=>I18n.locale}, class: :btn%>
|
<%= link_to 'Back', studien_path, :data=>{:locale=>I18n.locale}, class: :btn %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
45
app/views/themes/blue2/beispiele/_beispiel.html.erb
Normal file
45
app/views/themes/blue2/beispiele/_beispiel.html.erb
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<div id="<%= beispiel.divid %>" class="contentbox">
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span6" >
|
||||||
|
<b><%=link_to ffi1_icon("note20")+" " + beispiel.name + " " + I18n.l(beispiel.datum), beispiel.beispieldatei.url, title: beispiel.desc %></b>
|
||||||
|
</div>
|
||||||
|
<div class="span1" >
|
||||||
|
<%= (beispiel.beispieldatei.size/1024.0).round(2).to_s %>KiB
|
||||||
|
</div>
|
||||||
|
<div class="span5">
|
||||||
|
<%= flag_link(beispiel, "goodquality")%>
|
||||||
|
|
||||||
|
<%= flag_link(beispiel, "badquality")%>
|
||||||
|
<%= flag_link(beispiel, "delete")%>
|
||||||
|
|
||||||
|
<%=
|
||||||
|
if can?(:like, beispiel)
|
||||||
|
link_to ffi1_icon("like3")+" like" + "("+beispiel.get_likes.size.to_s+")", like_beispiel_path(beispiel),title: "liked by " + ((current_user.liked?(beispiel)) ? ("you and " + ((beispiel.get_likes.size - 1).to_s + " others")) : beispiel.get_likes.size.to_s), remote: true
|
||||||
|
else
|
||||||
|
"liked by " + beispiel.get_likes.size.to_s
|
||||||
|
end
|
||||||
|
%>
|
||||||
|
|
||||||
|
<%=
|
||||||
|
if can?(:dislike, beispiel)
|
||||||
|
link_to ffi1_icon("dislike")+" dislike" + "("+beispiel.get_dislikes.size.to_s+")", dislike_beispiel_path(beispiel),title:"disliked by " + ((current_user.disliked?(beispiel)) ? ("you and " + ((beispiel.get_dislikes.size - 1).to_s + " others")) : beispiel.get_dislikes.size.to_s) , remote: true
|
||||||
|
else
|
||||||
|
"disliked by " + beispiel.get_dislikes.size.to_s
|
||||||
|
end
|
||||||
|
|
||||||
|
%>
|
||||||
|
|
||||||
|
<%= link_to ff_icon("icon-pencil")+"edit", edit_beispiel_path(beispiel) if can? :edit, beispiel%>
|
||||||
|
<%= link_to fa_icon("trash")+"delete", beispiel_path(beispiel), :method=>:delete, :data=>{:confirm=>I18n.t('beispiel.sure')} if can? :delete, beispiel %>
|
||||||
|
<% link_to "Refresh", beispiel_path(beispiel,show_comments: true), remote: true %></br>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% unless beispiel.desc.nil? || beispiel.desc.empty? %>
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
|
||||||
|
<%= beispiel.desc %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
@@ -2,17 +2,23 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
<ul class="linklist">
|
<div>
|
||||||
|
<ul class="linklist_block">
|
||||||
<li>
|
<li>
|
||||||
<%= link_to "Adressliste", internlist_fetprofiles_path ,class: :linkbox %>
|
<%= link_to fa_icon("list")+"Adressliste", internlist_fetprofiles_path ,class: :linkbox %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to "Admin" , admin_home_index_path, class: :linkbox if current_user.has_role?(:fetadmin) %>
|
<%= link_to ff_icon("ffi1-setting")+"Admin" , admin_home_index_path, class: :linkbox if current_user.has_role?(:fetadmin) %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to "Treeview" , treeview_home_index_path, class: :linkbox if current_user.has_role?(:fetadmin) %>
|
<%= link_to ff_icon("fa-folder")+"Treeview" , treeview_home_index_path, class: :linkbox if current_user.has_role?(:fetadmin) %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
<li>
|
||||||
|
<%= link_to ff_icon("ffi1-newspaper9")+"Crawler" , crawler_index_path, class: :linkbox if current_user.has_role?(:fetadmin) %>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul><br>
|
||||||
|
</div>
|
||||||
<div>Suche nach Protokollen
|
<div>Suche nach Protokollen
|
||||||
<%= semantic_form_for :search,:remote=>true, :url=>search_documents_path, :html=>{:id=>"search_form",:class=>"", :method=>'get'} do |f| %>
|
<%= semantic_form_for :search,:remote=>true, :url=>search_documents_path, :html=>{:id=>"search_form",:class=>"", :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" %>
|
||||||
|
|||||||
147
app/views/themes/blue2/lvas/show.html.erb
Executable file
147
app/views/themes/blue2/lvas/show.html.erb
Executable file
@@ -0,0 +1,147 @@
|
|||||||
|
<%= 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 %>
|
||||||
|
<% if @beispiele_badQ.count > 0 %>
|
||||||
|
<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 %>
|
||||||
|
<% end %>
|
||||||
|
<% if @beispiele_deleted.count > 0 %>
|
||||||
|
<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 %>
|
||||||
|
<% 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>
|
||||||
|
|
||||||
4
config/initializers/init_flagable.rb
Normal file
4
config/initializers/init_flagable.rb
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
require 'flagable'
|
||||||
|
ActionController::Base.send :include, Flagable::ActsAsFlagableController
|
||||||
|
ActiveRecord::Base.send :include, Flagable::ActsAsFlagableRecord
|
||||||
|
ActionView::Base.send :include, Flagable::FlagableHelper
|
||||||
1
config/initializers/query_trace.rb
Normal file
1
config/initializers/query_trace.rb
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ActiveRecordQueryTrace.enabled=true
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
resources :crawler, :only=>[] do
|
resources :crawler, :only=>[] do
|
||||||
collection do
|
collection do
|
||||||
get :index
|
get :index
|
||||||
|
get :do_crawl_news
|
||||||
end
|
end
|
||||||
member do
|
member do
|
||||||
get :move_to_news
|
get :move_to_news
|
||||||
@@ -31,8 +32,10 @@
|
|||||||
devise_for :users , :controllers=>{:omniauth_callbacks=> "users/omniauth_callbacks"}
|
devise_for :users , :controllers=>{:omniauth_callbacks=> "users/omniauth_callbacks"}
|
||||||
|
|
||||||
|
|
||||||
scope '(:locale)' do
|
scope '(:locale)', constraints: {:locale=>/en|de/i} do
|
||||||
scope '(t/:theme)' do
|
scope '(t/:theme)' do
|
||||||
|
get "" , controller: :home, action: :index
|
||||||
|
get "intern" , controller: :home, action: :intern
|
||||||
|
|
||||||
scope '(:ansicht)' do
|
scope '(:ansicht)' do
|
||||||
resources :studien, :only=>[:new,:edit,:update,:destroy,:show] do
|
resources :studien, :only=>[:new,:edit,:update,:destroy,:show] do
|
||||||
@@ -70,6 +73,7 @@
|
|||||||
member do
|
member do
|
||||||
get 'like'
|
get 'like'
|
||||||
get 'dislike'
|
get 'dislike'
|
||||||
|
get 'flag'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
resources :lvas do
|
resources :lvas do
|
||||||
@@ -106,7 +110,8 @@
|
|||||||
resources :fragen, :only =>[:new, :edit, :update, :destroy, :create]
|
resources :fragen, :only =>[:new, :edit, :update, :destroy, :create]
|
||||||
|
|
||||||
|
|
||||||
resources :neuigkeiten, :only => [:show]
|
resources :neuigkeiten, :only => [:show] , constraints: {id: /\d+/i}
|
||||||
|
get "neuigkeiten", controller: :rubriken, action: :index, as: "neuigkeiten"
|
||||||
resources :rubriken do
|
resources :rubriken do
|
||||||
collection do
|
collection do
|
||||||
get 'verwalten' , :action => :alle_verwalten
|
get 'verwalten' , :action => :alle_verwalten
|
||||||
|
|||||||
11
db/migrate/20150617105704_add_index_for_neuigkeiten.rb
Normal file
11
db/migrate/20150617105704_add_index_for_neuigkeiten.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
class AddIndexForNeuigkeiten < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_index :neuigkeiten, :rubrik_id
|
||||||
|
add_index :neuigkeiten, :cache_is_published
|
||||||
|
add_index :calentries, [:object_type, :object_id]
|
||||||
|
add_index :attachments, [:parent_type, :parent_id]
|
||||||
|
add_index :attachments, [:flag_titlepic, :parent_type, :parent_id]
|
||||||
|
add_index :rubriken, :public
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
14
db/migrate/20150620101949_add_flags_to_beispiel.rb
Normal file
14
db/migrate/20150620101949_add_flags_to_beispiel.rb
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
class AddFlagsToBeispiel < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :beispiele, :flag_badquality, :boolean
|
||||||
|
add_column :beispiele, :flag_duplicate, :boolean
|
||||||
|
add_column :beispiele, :flag_delete, :boolean
|
||||||
|
add_column :beispiele, :flag_goodquality, :boolean
|
||||||
|
add_column :beispiele, :lecturer_id, :integer
|
||||||
|
add_index :beispiele, :flag_badquality
|
||||||
|
add_index :beispiele, :flag_duplicate
|
||||||
|
add_index :beispiele, :flag_delete
|
||||||
|
add_index :beispiele, :flag_goodquality
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
1
lib/.#flagable.rb
Symbolic link
1
lib/.#flagable.rb
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
andreas@andreas-ThinkPad-S430.11733:1434727463
|
||||||
70
lib/flagable.rb
Normal file
70
lib/flagable.rb
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
module Flagable
|
||||||
|
module ActsAsFlagableController
|
||||||
|
extend ActiveSupport::Concern
|
||||||
|
included do
|
||||||
|
|
||||||
|
end
|
||||||
|
module ClassMethods
|
||||||
|
def acts_as_flagable(options={})
|
||||||
|
include Flagable::ActsAsFlagableController::LocalInstanceMethods
|
||||||
|
extend Flagable::ActsAsFlagableController::LocalClassMethods
|
||||||
|
end
|
||||||
|
end
|
||||||
|
module LocalClassMethods
|
||||||
|
|
||||||
|
end
|
||||||
|
module LocalInstanceMethods
|
||||||
|
|
||||||
|
def flag
|
||||||
|
fi = controller_name.classify.constantize::FLAG_ICONS
|
||||||
|
|
||||||
|
@obj=controller_name.classify.constantize.find(params[:id])
|
||||||
|
lflag=("flag_"+params[:flag]).to_sym
|
||||||
|
unless params[:flag].nil? || params[:flag].empty? || params[:value].nil?
|
||||||
|
if @obj.respond_to?(lflag.to_s+"=")
|
||||||
|
@obj.send(lflag.to_s+"=",params[:value]=="true")
|
||||||
|
@obj.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
respond_to do |format|
|
||||||
|
format.html {render partial: "flags/flaglink", locals: {flag: params[:flag],icon: fi[params[:flag]]}}
|
||||||
|
format.js {render partial: "flags/flag", locals: {flag: params[:flag], icon: fi[params[:flag]]}}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
module ActsAsFlagableRecord
|
||||||
|
extend ActiveSupport::Concern
|
||||||
|
included do
|
||||||
|
|
||||||
|
end
|
||||||
|
module ClassMethods
|
||||||
|
def acts_as_flagable(options={})
|
||||||
|
include Flagable::ActsAsFlagableRecord::LocalInstanceMethods
|
||||||
|
#extend class methods
|
||||||
|
end
|
||||||
|
end
|
||||||
|
module LocalInstanceMethods
|
||||||
|
def get_flag(flag)
|
||||||
|
v= @obj.send("flag_"+flag.to_s) if @obj.respond_to?("flag_"+flag.to_s)
|
||||||
|
v= false if v.nil?
|
||||||
|
v
|
||||||
|
end
|
||||||
|
def flaglinkid(flag)
|
||||||
|
return self.class.to_s + "_" + self.id.to_s + "_flag_"+flag.to_s
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
module FlagableHelper
|
||||||
|
|
||||||
|
def flag_link(obj, flag, text="")
|
||||||
|
flag=flag.to_s
|
||||||
|
fi = obj.class::FLAG_ICONS
|
||||||
|
value=obj.send("flag_"+flag)
|
||||||
|
cstyle=(value) ? "true" :"false"
|
||||||
|
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
|
||||||
|
ActionView::Base.send :include, Flagable::FlagableHelper
|
||||||
Reference in New Issue
Block a user