Merge branch 'survey'

This commit is contained in:
Andreas Stephanides
2015-08-22 17:55:32 +02:00
149 changed files with 4288 additions and 224 deletions

View File

@@ -10,7 +10,7 @@
<% if editor %>
<td>
<div class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><%= fa_icon("chevron-down") %> Actions</a>
<a class="dropdown-toggle" data-toggle="dropdown" href="#"> <%= fa_icon("chevron-down") %> </a>
<ul class="dropdown-menu">
<li>
<%= link_to fa_icon("tag")+" Titlepic", set_titlepic_attachment_path(a,:params=>{:titlepic=>true}), remote: true %>

View File

@@ -4,7 +4,7 @@
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<div class="row-fluid">
<div class="span7">
<div class="span12">
<div class="fileupload-buttonbar">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
@@ -28,6 +28,9 @@
</button>
<input type="checkbox" class="toggle">
</div>
</div>
<div class="row-fluid">
<div class="span5">
<!-- The global progress bar -->
<div class="progress progress-success progress-striped active fade">

View File

@@ -38,4 +38,5 @@
</div>
</div>
<% end %>
</div>

View File

@@ -3,4 +3,6 @@
<%= render ce unless ce.nil? %>
<% end %>
</div>
<div id="calentry_new_<%= parent.class.to_s + "_" + parent.id.to_s %>" ><%= link_to "new Calentry", new_calentry_path(:object_id=>@neuigkeit.id, :object_type=>"Neuigkeit"), :remote=>true if can? :edit, @neuigkeit %></div>
<%#= link_to "new Calentry", new_calentry_path(:object_id=>@neuigkeit.id, :object_type=>"Neuigkeit"), :remote=>true if can? :edit, @neuigkeit %>

View File

@@ -1,2 +1 @@
alert("sdf");
$("#calentry_new").replaceWith("<div id=\"calentry_<%= @calentry.id %>\"> <%=escape_javascript( render :partial=>"calentry", :object=>@calentry)%> </div><div id=\"calentry_new\"><%= escape_javascript( link_to "new Calentry", new_calentry_path, :remote=>true) %></div>");
$("#<%= divid_for(@calentry.object,"new_calentry") %>").replaceWith("<div id=\"calentry_<%= @calentry.id %>\"> <%=escape_javascript( render :partial=>"calentry", :object=>@calentry)%> </div><div id=\"<%= divid_for(@calentry.object,"new_calentry") %>\"><%= escape_javascript( link_to "new Calentry", new_calentry_path(:object_id=>@calentry.object.id.to_s, :object_type=>@calentry.object.class.to_s), :remote=>true) %></div>");

View File

@@ -1,3 +1,3 @@
$("#calentry_new_<%= @calentry.object.class.to_s + "_" + @calentry.object.id.to_s %>").replaceWith("<div id=\"calentry_new_<%= @calentry.object.class.to_s + "_" + @calentry.object.id.to_s %>\"><%=escape_javascript( render :partial=>"nested_form" ,:object=>@calentry) %></div>");
$("#<%= divid_for(@calentry.object,"new_calentry") %>").replaceWith("<div id=\"<%= divid_for(@calentry.object,"new_calentry") %>\"><%=escape_javascript( render :partial=>"nested_form" ,:object=>@calentry) %></div>");
$('.datetimepicker').datetimepicker({format: 'd.m.Y H:i', startDate: (!($(this).attr("value")==undefined))? $(this).attr("value"): ""})

View File

@@ -0,0 +1,26 @@
<div id="<%= divid_for(comment) %>">
<% if (!comment.anonym) %>
<a class="pull-left media-object" href="#"><%= image_tag comment.thumb_url %></a>
<% end %>
<div class="media-body">
<b><%= (!comment.anonym) ? comment.user.try(:email) : "Anonym" %>
</b> (<%= I18n.l(comment.created_at) %>)
<%= link_to ffi1_icon("remove9"), comment_path(comment), method: :delete, data: { confirm: 'Are you sure?' }, remote: true if can? :destroy, comment %>:
<p>
<%= comment.text %>
<% if can?(:comment, comment.commentable) && can?(:new, Comment) %>
<br><%= link_to fa_icon("mail-reply")+" antworten" , new_comment_path( commentable_type: "Comment", commentable_id: comment.id), remote:true %>
<% end %>
</p>
<div id="<%= Comment.wrapid_for( comment)%>">
<%= render partial:"comments/comments", object: comment.children.order(:created_at).reverse_order if comment.children.size >0 %>
<%= link_to fa_icon("mail-reply")+" ebenfalls antworten" , new_comment_path( commentable_type: "Comment", commentable_id: comment.id), remote:true if comment.children.size >0 %>
</div>
<div id="<%= divid_for(comment,"newform") %>"></div>
</div>
</div>

View File

@@ -0,0 +1,12 @@
<% unless comments.nil? || comments.empty? %>
<div class="contentbox" style="border-right:none;border-bottom:none; border-top:none">
<ul class="unstyled media-list">
<% comments.each do |c| %>
<li class="media"><%= render c %></li>
<% end %>
</ul>
</div>
<% if comments.first.root? %>
<%= paginate comments, :remote=>true , :theme=>'twitter-bootstrap'%>
<% end %>
<% end %>

View File

@@ -0,0 +1,15 @@
<%= link_to "Comments:.."+ comments_block.comments.count().to_s, comments_path(commentable_type: comments_block.class.to_s.gsub("::","_"), commentable_id: comments_block.id), remote:true, id: Comment.switchshowid_for( comments_block) %> <%# load the comments in the comments block %>
<%= link_to content_tag(:span, content_tag(:i,"",class:"fa fa-comment-o fa-stack-2x")+ content_tag(:i,"",class:"fa fa-plus-square-o fa-stack-1x"),class:"fa-stack")+ "Comment" , new_comment_path( commentable_type: comments_block.class.to_s.gsub("::","_"), commentable_id: comments_block.id), remote:true if can? :comment, comments_block %> <%# This is the button to add a new comment %>
<div id="<%= divid_for(comments_block,"newform") %>">
</div>
<div id="<%= Comment.wrapid_for( comments_block)%>">
<% unless comments_block.comments.roots.empty? %>
<%= render partial:"comments/comments", object: comments_block.comments.order(:created_at).roots.reverse_order if params[:show_comments] %><%# can? fehlt!%>
<% end %>
</div>

View File

@@ -0,0 +1,14 @@
<%= semantic_form_for form , remote: true, html: {class: "form-inline"} do |f| %>
<%= f.inputs do %>
<%= f.input :commentable_id, as: :hidden %>
<%= f.input :commentable_type, as: :hidden %>
<%= f.input :text, as: :string %>
<%= f.input :anonym %>
<% end %>
<%= f.actions do %>
<%= f.action :submit, :as => :input %>
<% end %>
<% end %>

View File

@@ -0,0 +1,3 @@
$("#<%= divid_for(@comment.parent_object,"newform") %>").html("")
$("#<%= Comment.wrapid_for(@comment.parent_object) %>").html("<%= escape_javascript render partial:"comments/comments", object: @comments %>")
$("#<%= Comment.switchshowid_for(@commentable) %>").replaceWith("<%= escape_javascript link_to "Ausblenden", hide_comments_path(params: {commentable_type: @commentable.class.to_s.gsub("::","_"), commentable_id: @commentable.id}), remote: true , id: Comment.switchshowid_for( @commentable) %>")

View File

@@ -0,0 +1,2 @@
$("#<%= Comment.wrapid_for(@commentable) %>").html("<%= escape_javascript render partial:"comments/comments", object: @comments %>")

View File

@@ -0,0 +1,3 @@
$("#<%= Comment.wrapid_for(@commentable) %>").html("<%= escape_javascript "" %>")
$("#<%= Comment.switchshowid_for(@commentable) %>").replaceWith("<%= escape_javascript link_to "Comments...", comments_path(commentable_type: @commentable.class.to_s.gsub("::","_"), commentable_id: @commentable.id), remote: true, id: Comment.switchshowid_for( @commentable) %>")

View File

View File

@@ -0,0 +1,2 @@
$("#<%= Comment.wrapid_for(@commentable) %>").html("<%= escape_javascript render partial:"comments/comments", object: @comments %>")
$("#<%= Comment.switchshowid_for(@commentable) %>").replaceWith("<%= escape_javascript link_to "Ausblenden", hide_comments_path(params: {commentable_type: @commentable.class.to_s.gsub("::","_"), commentable_id: @commentable.id}), remote: true , id: Comment.switchshowid_for( @commentable) %>")

View File

@@ -0,0 +1,2 @@
$("#<%= divid_for(@comment.commentable,"newform") %>").html("<%= escape_javascript render partial: "form", object: @comment %>")

View File

@@ -1 +0,0 @@
andreas@andreas-ThinkPad-S430.11733:1434727463

View File

@@ -1 +1 @@
$('#<%=@obj.flaglinkid(params[:flag]) %>').replaceWith("<%= escape_javascript( render(partial: "flags/flaglink", format: "html", locals: {flag: params[:flag]}) )%>");
$('#<%=@obj.flaglinkid(params[:flag]) %>').replaceWith("<%= escape_javascript( flag_link(@obj,flag)) %>");

View File

@@ -1,2 +0,0 @@
<% fi = {"badquality"=>"fa fa-flag", "delete"=>"fa fa-trash"} %>
<%= flag_link(@obj,flag, ff_icon(fi[flag])) %>

View File

@@ -12,7 +12,7 @@ Verwendung: Aufruf mit
<% unless t[:method]==:versions %>
<% unless t[:method]==:dropdown %>
<% text=ff_icon(t[:hicon])+t[:text] %>
<% text=ff_icon(t[:hicon].to_s)+t[:text].to_s %>
<%= link_to text, t[:path], :method=>t[:method], :confirm=>t[:confirm].to_s, :data=>t[:data], :class=>((t[:method].to_s=='delete') ? "btn btn-danger" : "btn") ,:remote=>(t[:remote])?true : false %>
<% else %>
<div class="btn-group">

View File

@@ -1 +0,0 @@
andreas@andreas-ThinkPad-S430.6204:1435099079

View File

@@ -1,10 +1,12 @@
<%= content_for :header do %>
<title>Fetsite - <%= @lva.full_name %></title>
<% set_meta_tags :og => {
:url=>lva_path(:theme=>nil) }
%>
<%= display_meta_tags %>
<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'%>
@@ -12,115 +14,106 @@
<div class="row-fluid">
<div class="span12">
<%= render 'layouts/pretty_toolbar' %>
<%= 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>
<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 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="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_all.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 + "_" + can?(:like, b).to_s + "_" + b.updated_at.try(:utc).try(:to_s) + get_theme_help(current_user).to_s) do %>
<%= render b%>
<% end %>
<% end %>
<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_all.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+ can?(:comment, b).to_s + "_" + can?(:like, b).to_s + "_" + b.updated_at.try(:utc).try(:to_s) + get_theme_help(current_user).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>
<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>
<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>
<div class="row-fluid">
<div class="span12">
<% @crawlobjects.each do |co| %>
<%= render co %>
<% end %>
</div>
</div>
<% end %>
</div>

View File

@@ -1 +0,0 @@
andreas@andreas-ThinkPad-S430.3674:1433770009

View File

@@ -1,30 +1,20 @@
<% if defined?(wrap_in) && !wrap_in.blank? %>
<% unless defined?(wrap_in) && !wrap_in.blank?
wrap_in=:div
end
%>
<%= content_tag wrap_in do %>
<% cache("neuigkeit_" + neuigkeit.id.to_s + "_" + I18n.locale.to_s+neuigkeit.updated_at.try(:utc).try(:to_s)) do %>
<% c =[:linkbox] %>
<% c << "color-" + neuigkeit.rubrik.color.to_s + "-dark" unless neuigkeit.rubrik.color.nil? %>
<% c << "unpublished" unless neuigkeit.published? %>
<%= link_to [neuigkeit.rubrik,neuigkeit], {class: c} do %>
<%= render :partial=>"neuigkeiten/compact",:locals=> {:neuigkeit=> neuigkeit} %>
<% end %>
<%= content_tag wrap_in do %>
<% cache("neuigkeit_"+neuigkeit.id.to_s+"_"+I18n.locale.to_s+neuigkeit.updated_at.try(:utc).try(:to_s)) do %>
<% c =[:linkbox] %>
<% c << "color-"+neuigkeit.rubrik.color.to_s+"-dark" unless neuigkeit.rubrik.color.nil? %>
<% c << "unpublished" unless neuigkeit.published? %>
<%= link_to [neuigkeit.rubrik,neuigkeit], {class: c} do %>
<%= render :partial=>"neuigkeiten/compact",:locals=> {:neuigkeit=> neuigkeit} %>
<% end %>
<% end %>
<% end %>
<% else %>
<% cache("neuigkeit_"+neuigkeit.id.to_s+"_"+I18n.locale.to_s+neuigkeit.updated_at.try(:utc).try(:to_s)) do %>
<% c =[:linkbox] %>
<% c << "color-"+neuigkeit.rubrik.color.to_s+"-dark" unless neuigkeit.rubrik.color.nil? %>
<% c << "unpublished" unless neuigkeit.published? %>
<%= link_to [neuigkeit.rubrik,neuigkeit], {class: c} do %>
<%= render :partial=>"neuigkeiten/compact",:locals=> {:neuigkeit=> neuigkeit} %>
<% end %>
<% end %>
<% end %>
<% end %>

View File

@@ -25,7 +25,7 @@
<div class="media">
<% unless neuigkeit_view.picture_robust.big_thumb.to_s.empty? %>
<div class="pull-left" href="#">
<p><br><%= link_to image_tag(neuigkeit_view.picture_robust.big_thumb.url),neuigkeit_view.picture_robust.try(:url) %>
<p><br><%= link_to image_tag(neuigkeit_view.picture_robust.big_thumb),neuigkeit_view.picture_robust.try(:url) %>
</p>
</div>
<% end %>
@@ -38,15 +38,16 @@
</div>
</div>
</div>
<%= render_calentries_for(neuigkeit_view)%>
<%= render_calentries_for(neuigkeit_view)%>
<% unless neuigkeit_view.meeting.nil? %>
<%= render neuigkeit_view.meeting %>
<% end%>
<%= render_attachments_for(neuigkeit_view) %>
<%= render_attachments_for(neuigkeit_view) %>
<%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %>
</div>

View File

@@ -2,8 +2,10 @@
<title>Fetsite - <%= @neuigkeit.title %> (<%= @neuigkeit.rubrik.name %>)</title>
<% set_meta_tags :author => fetprofile_path(@neuigkeit.author.fetprofile) unless @neuigkeit.author.fetprofile.nil? %>
<% unless @neuigkeit.picture_robust.url.nil? %>
<% picture_url=URI(root_url)
picture_url.path=@neuigkeit.picture_robust.url(:locale=>nil, :theme=>nil) %>
<%
picture_url=URI(root_url)
picture_url.path=@neuigkeit.picture_robust.url(:locale=>nil, :theme=>nil)
%>
<% end %>
<% set_meta_tags :og =>
{
@@ -14,14 +16,13 @@
:url=>neuigkeit_url(:theme=>nil)
}
%>
<%= display_meta_tags %>
<% end %>
<%= render 'rubriken/tabs' %>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
@@ -32,27 +33,33 @@
<div class="content-column content-wrap">
<%= link_to "Refresh", neuigkeit_path(@neuigkeit), remote: true %>
<p id="notice"><%= notice %></p>
<p id="notice">
<%= notice %>
</p>
<%= render partial: "neuigkeit_view", object: @neuigkeit %>
</div>
</div>
<div class="fb-like" data-href"<%= rubrik_neuigkeit_url(@rubrik,@neuigkeit,{themes: nil, locale: nil})%>" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
<% if can? :find_link , @neuigkeit %>
<a id="findlink-open" href="#"><%= fa_icon("link")%> Neue Verknüpfungen </a>
<% end %>
<%= new_question_for(@neuigkeit) if can? :new, Survey::Question %>
<% @questions.each do |q| %>
<%= render q if can? :show, q %>
<% end %>
</div>
<div class="fb-like" data-href"<%= rubrik_neuigkeit_url(@rubrik,@neuigkeit,{themes: nil, locale: nil})%>" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
<%= link_to fa_icon("link") + "Neue Verknüpfung" , "#", id: "findlink-open" if can? :find_link, @neuigkeit %>
<% cache(cache_array_key(@neuigkeit.nlinks, "NLinks")) do %>
<%= render partial: 'neuigkeiten/nlink_list_whole', :object=>@neuigkeit.nlinks %>
<% end %>
<div id="findlink-body"class="ui-dialog" style="">
<div id="findlink-body" class="ui-dialog" style="">
<% if can? :find_link, @neuigkeit %>
Nach Element suchen:
<%= semantic_form_for :find_link, :url=>find_link_rubrik_neuigkeit_path(@rubrik,@neuigkeit), :html=>{:id=>"search_form", :method=>'get'} , :remote=> true do |f| %>
<%= f.input :query, :input_html => { :name => 'query' },:label=>false %>
<% end %>
<%= render partial: 'nlink_list_search_whole', object: @nlink_search %>
<% end %>
</div>
<script>
@@ -65,9 +72,9 @@ $(function(){
buttons: {
"Fertig": function() {
dialog.dialog( "close" );
}
}
}
});
$("#findlink-open").on("click",function(){dialog.dialog("open")})
});
});
</script>

View File

@@ -1,6 +1,13 @@
<%= stylesheet_link_tag "http://"+ActionMailer::Base.default_url_options[:host].to_s + "/assets/themes/blue2/application.css", :media=>"all" %>
<h1>
<%= @neuigkeit.title%>
</h1>
<%= image_tag "http://www.fet.at"+@neuigkeit.picture.big_thumb.url %>
<%= content_tag(:img,"",src: "http://"+ActionMailer::Base.default_url_options[:host].to_s+@neuigkeit.picture.big_thumb.url) %>
<%=url_for controller: "neuigkeiten",action: :show, :id=>@neuigkeit.id, only_path: false %>
<%= raw(@neuigkeit.text) %>
<%= link_to "Auf Fet.at weiterlesen", rubrik_neuigkeit_url(@neuigkeit.rubrik, @neuigkeit,:locale=>:de, :theme=>nil,:host=> "www.fet.at") %>
<% @neuigkeit.questions.each do |q| %>
<%= render partial:"survey/questions/mail", object: q %>
<% end %>
<%= link_to "Auf Fet.at weiterlesen", rubrik_neuigkeit_url(@neuigkeit.rubrik, @neuigkeit,:locale=>:de, :theme=>nil) %>

View File

@@ -0,0 +1,19 @@
<%= div_tag_for(choice) do %>
<%
unless can?(:answer,choice.question)
t=choice.text
else
value=(current_user.id.nil?)? false : choice.answers.where(user_id: current_user.id).count>0
cstyle=(value) ? "true" :"false"
t= link_to(raw("" + choice.html+ (( choice.picture.nil? || choice.picture.to_s.empty?) ? "":image_tag(choice.picture.thumb.url))), answer_survey_question_path(choice.question, params: {survey_question: {selected: [choice.id]}}),class: "choice choice-"+cstyle,remote: true )
end
%>
<%= t %> <%= link_to fa_icon("pencil"), edit_survey_choice_path(choice) , class: "btn btn-link navbar-btn" , remote: true if can? :edit, choice
%>
<%= link_to fa_icon("trash"), survey_choice_path(choice) , class: "btn btn-link navbar-btn" , remote: true , method: :delete, data: { confirm: 'Are you sure?' } if can? :delete,choice %>
<% end %>

View File

@@ -0,0 +1 @@
<div id="choice_<%= choice_form.id %>"

View File

@@ -0,0 +1,49 @@
<%= div_tag_for(@choice) do %>
<%= semantic_form_for @choice, remote: true do |f| %>
<%= f.inputs do %>
<%= f.input :text %>
<i id="icon" style="font-size:2em" class="<%= @choice.icon %>"></i><a href="#" id="openselect" onclick=""> Choose Icon</a>
<%= f.input :icon, :input_html=>{:id=>"iconfield"},:as=>:hidden %>
<%= f.input :question %>
<%= f.input :picture, as: :uploader %>
<%= f.hidden_field :picture_cache %>
<% end %>
<%= f.actions do %>
<%= f.action :submit, :as => :input %>
<% end %>
<% end %>
<script>
$(
function()
{$('#iconfield').on('change', function(){$('#icon').attr("class",$(this).val())});
$("#dialog").dialog({width:'100%', position:'center top', at:'left top',autoOpen: false,closeOnEscape: false});
$("#openselect").on('click', function(){$('#dialog').dialog('open')});
});
</script>
<div style="font-size:2em; line-height:1.2em" id ="dialog" title="Icon">
<p>
<% ffi1_list.each do |i| %>
<a onclick="$('#iconfield').val('ffi1-<%= i %>');$('#icon').attr('class','ffi1-<%= i %>'); $('#dialog').dialog('close')" href="#"><%=ffi1_icon(i)%>
</a>
<% end %>
</p>
<p>
<% ffi2_list.each do |i| %>
<a onclick="$('#iconfield').val('ffi2-<%= i %>');$('#icon').attr('class','ffi2-<%= i %>'); $('#dialog').dialog('close')" href="#"><%=ffi2_icon(i)%>
</a>
<% end %>
</p>
<p>
<% fa_list.each do |i| %>
<a onclick="$('#iconfield').val('fa <%= i %>');$('#icon').attr('class','fa <%= i %>'); $('#dialog').dialog('close')" href="#"><%=ff_icon('fa '+i)%>
</a>
<% end %>
</p>
</div>
<% end %>

View File

@@ -0,0 +1,15 @@
<% choice=mail %>
<%= div_tag_for(choice) do %>
<%
if @user.nil?
t=choice.text
else
value=(@user.id.nil?)? false : choice.answers.where(user_id: @user.id).count>0
cstyle=(value) ? "true" :"false"
t= link_to(raw("" + choice.html+ (( choice.picture.nil? || choice.picture.to_s.empty?) ? "":image_tag(choice.picture.thumb.url))), answer_survey_question_url(choice.question, params: {key: Key.find_or_create(@user, 3, choice.question).uuid, survey_question: {selected: [choice.id]}}),class: "choice-"+cstyle )
end
%>
<%= t %>
<% end %>

View File

@@ -0,0 +1 @@
$('#<%= @divid %>').replaceWith("<%= escape_javascript(render @survey_choice) %>")

View File

@@ -0,0 +1 @@
$('#<%= @divid %>').replaceWith("")

View File

@@ -0,0 +1,6 @@
<h1>Editing survey_choice</h1>
<%= render 'form' %>
<%= link_to 'Show', @survey_choice %> |
<%= link_to 'Back', survey_choices_path %>

View File

@@ -0,0 +1 @@
$('#<%= divid_for( @choice) %>').replaceWith("<%= escape_javascript( render partial:"form", object: @choice )%>");

View File

@@ -0,0 +1,29 @@
<h1>Listing survey_choices</h1>
<table>
<tr>
<th>Text</th>
<th>Question</th>
<th>Sort</th>
<th>Picture</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @survey_choices.each do |survey_choice| %>
<tr>
<td><%= survey_choice.text %></td>
<td><%= survey_choice.question %></td>
<td><%= survey_choice.sort %></td>
<td><%= survey_choice.picture %></td>
<td><%= link_to 'Show', survey_choice %></td>
<td><%= link_to 'Edit', edit_survey_choice_path(survey_choice) %></td>
<td><%= link_to 'Destroy', survey_choice, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Choice', new_survey_choice_path %>

View File

@@ -0,0 +1,5 @@
<h1>New survey_choice</h1>
<%= render 'form' %>
<%= link_to 'Back', survey_choices_path %>

View File

@@ -0,0 +1 @@
$('#<%= divid_for @question %>').find('ul.choice-list').append("<li><%= escape_javascript(render partial: "form", object:@choice) %></li>")

View File

@@ -0,0 +1,25 @@
<p id="notice"><%= notice %></p>
<p>
<b>Text:</b>
<%= @survey_choice.text %>
</p>
<p>
<b>Question:</b>
<%= @survey_choice.question %>
</p>
<p>
<b>Sort:</b>
<%= @survey_choice.sort %>
</p>
<p>
<b>Picture:</b>
<%= @survey_choice.picture %>
</p>
<%= link_to 'Edit', edit_survey_choice_path(@survey_choice) %> |
<%= link_to 'Back', survey_choices_path %>

View File

@@ -0,0 +1 @@
$('#<%= divid_for(@survey_choice) %>').replaceWith("<%= escape_javascript(render @survey_choice) %>")

View File

@@ -0,0 +1,68 @@
<div id="container_question_<%= answeredquestion.id %>" style="min-width: 310px; max-width: 800px; height: <%= (100+answeredquestion.choices.count * 90).to_s %>px; margin: 0 auto" class="contentbox">
<div style="background:red">
<b>
<%= answeredquestion.title%>
</b>
<ul>
<% answeredquestion.choices.each do |c| %>
<li>
<%= c.to_s %>: <%= answeredquestion.answers.where(choice_id: c.id).count %> votes
</li>
<% end %>
</ul>
</div>
<script>
$(function () {
$('#container_question_<%= answeredquestion.id %>').highcharts({
chart: {
type: 'bar'
},
title: {
text: '<%= answeredquestion.title%>'
},
subtitle: {
text: '<%= answeredquestion.text %>'
},
xAxis: {
categories: [<%= raw(answeredquestion.choices.map{|c| "'"+escape_javascript(c.html)+"'"}.join(",")) %>],
title: {
text: null
},
labels: {
useHTML: true
}
},
yAxis: {
min: 0,
title: {
text: 'Answers',
align: 'high'
},
labels: {
overflow: 'justify'
},
minTickInterval: 1
},
tooltip: {
valueSuffix: ' votes'
},
plotOptions: {
bar: {
dataLabels: {
enabled: true
}
}
},
credits: {
enabled: false
},
series: [{
name: '<%= answeredquestion.title %>',
data: [<%= raw(answeredquestion.choices.map{|c| c.answers.count.to_s}.join(",")) %>]
}]
});
});
</script>
</div>

View File

@@ -0,0 +1,15 @@
<%= semantic_form_for @survey_question do |f| %>
<%= f.inputs do %>
<%= f.input :title %>
<%= f.input :text %>
<%= f.input :parent_type, as: :hidden %>
<%= f.input :parent_id, as: :hidden %>
<%= f.input :typ %>
<% end %>
<%= f.actions do %>
<%= f.action :submit, :as => :input %>
<% end %>
<% end %>

View File

@@ -0,0 +1,7 @@
<% question=mail %>
<div class="contentbox">
<b><%= question.title%></b> <%=question.text%></div>
<% question.choices.each do |c| %>
<li><%= render partial:"survey/choices/mail",object: c %></li>
<% end %>

View File

@@ -0,0 +1,17 @@
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<%= text %>
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li>
<%= link_to "Neue Frage", new_survey_question_path(params: {parent_type: parent.class.to_s, parent_id: parent.id.to_s}) %>
</li>
<li>Templates:</li>
<% question_templates.each do |q| %>
<li>
<%= link_to q.title, create_from_template_survey_question_path(q, params: {parent_type: parent.class.to_s, parent_id: parent.id.to_s}) %>
</li>
<% end %>
</ul>
</div>

View File

@@ -0,0 +1,31 @@
<% unless can?(:answer,question) %>
<%= div_tag_for(question) do%>
<%= render partial: "survey/questions/answeredquestion", object: question unless question.flag_delete%>
<% end %>
<% else %>
<div class="contentbox" id ="<%= divid_for(question) %>" style="">
<div >
<b><%= question.title%></b>
<%= question.text %>
<%= link_to fa_icon("pencil"), edit_survey_question_path(question) , class: "btn btn-link navbar-btn" , remote: true if can? :edit, question %>
<%= flag_link(question, "locked") %>
<%= flag_link(question, "template") %>
<%= flag_link(question, "delete") %>
<% unless question.flag_delete %>
<ul class="choice-list">
<% question.choices.each do |c| %>
<li><%= render c %></li>
<% end %>
</ul>
<%= link_to "+" , new_survey_choice_path(params:{question_id: question.id}), remote: true if can? :edit, question %>
<% end %>
</div>
<%= render partial: "survey/questions/answeredquestion", object: question if question.answers.where(user_id: current_user.id).count>0 unless question.flag_delete %>
</div>
<% end %>

View File

@@ -0,0 +1,6 @@
<h1>Editing survey_question</h1>
<%= render 'form' %>
<%= link_to 'Show', @survey_question %> |
<%= link_to 'Back', survey_questions_path %>

View File

@@ -0,0 +1 @@
$('#<%= divid_for(@survey_question) %>').replaceWith("<%= escape_javascript(render partial: "form", object: @survey_question) %>")

View File

@@ -0,0 +1,27 @@
<h1>Listing survey_questions</h1>
<table>
<tr>
<th>Title</th>
<th>Text</th>
<th>Typ</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @survey_questions.each do |survey_question| %>
<tr>
<td><%= survey_question.title %></td>
<td><%= survey_question.text %></td>
<td><%= survey_question.typ %></td>
<td><%= link_to 'Show', survey_question %></td>
<td><%= link_to 'Edit', edit_survey_question_path(survey_question) %></td>
<td><%= link_to 'Destroy', survey_question, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Question', new_survey_question_path %>

View File

@@ -0,0 +1,5 @@
<h1>New survey_question</h1>
<%= render 'form' %>
<%= link_to 'Back', survey_questions_path %>

View File

@@ -0,0 +1,13 @@
<p id="notice"><%= notice %></p>
<p>
<b>Typ:</b>
<%= @survey_question.typ %>
</p>
<%= render partial: "/"+@survey_question.parent.to_partial_path, object: @survey_question.parent unless @survey_question.parent.nil? %>
<%= render @survey_question %>
<%= render_comments_for(@survey_question) %>
<%= link_to 'Edit', edit_survey_question_path(@survey_question) %> |
<%= link_to 'Back', polymorphic_path(@survey_question.parent)
%>

View File

@@ -0,0 +1 @@
$('#<%= divid_for(@survey_question) %>').replaceWith("<%= escape_javascript(render @survey_question) %>")

View File

@@ -27,4 +27,6 @@
</div>
</div>
<% end %>
<%= render_comments_for(beispiel) %>
</div>

View File

@@ -11,12 +11,14 @@
<%= link_to ff_icon("ffi1-setting")+"Admin" , admin_home_index_path, class: :linkbox if current_user.has_role?(:fetadmin) %>
</li>
<li>
<%= link_to ff_icon("fa-folder")+"Treeview" , treeview_home_index_path, class: :linkbox if current_user.has_role?(:fetadmin) %>
<%= link_to ff_icon("fa fa-folder")+"Treeview" , treeview_home_index_path, class: :linkbox if current_user.has_role?(:fetadmin) %>
</li>
<li>
<%= link_to ff_icon("ffi1-newspaper9")+"Crawler" , crawler_index_path, class: :linkbox if current_user.has_role?(:fetadmin) %>
</li>
<li>
<%= link_to ff_icon("ffi1-setting")+"Meetings" , meetingtyps_path, class: :linkbox if current_user.has_role?(:fetadmin) %>
</li>
</ul><br>
</div>
<div>Suche nach Protokollen

View File

@@ -44,6 +44,7 @@
<%= @lva.desc.to_s.html_safe %>
</div>
</div>
</div>
<div class="span4">
<div class="contentbox">
@@ -80,6 +81,10 @@
<div class="row-fluid">
<div class="span12">
<%= new_question_for(@lva) %>
<% @questions.each do |q| %>
<%= render q if can? :show, q %>
<% end %>
<h2><%= I18n.t("lva.bspe") %></h2>
<p>
@@ -116,6 +121,7 @@
<div class="row-fluid">
<div class="span12">
<% unless @lva.nlinks.empty? %>
<h2><%= I18n.t("rubrik.title") %></h2>
<% @lva.nlinks.each do |l| %>
@@ -133,6 +139,7 @@
</div>
<% end %>
<% unless @crawlobjects.nil? %>
<div class="row-fluid">
<div class="span12">

View File

@@ -0,0 +1,57 @@
<div class="toolbar-inline">
<%= link_to(fa_icon("edit"), edit_rubrik_neuigkeit_path( @neuigkeit.rubrik, @neuigkeit), remote: true , class: "btn", title: "Edit") if can? :edit, @neuigkeit
%>
<span class="btn-group">
<%= link_to(fa_icon("paperclip"), "#", class: "btn", id: "attachments-form-open", title: "Attachments") if can? :edit, @neuigkeit
%>
<%= link_to(fa_icon("calendar-o"), new_calentry_path(:object_id=>@neuigkeit.id, :object_type=>"Neuigkeit"), :remote=>true, class: :btn) if can? :edit, @neuigkeit
%>
<%= link_to(fa_icon("link") , "#", id: "findlink-open",title: "Neue Verknüpfung" , class: "btn") if can? :find_link, @neuigkeit
%>
</span>
<%= new_question_for(@neuigkeit, fa_icon("question")) if can? :new, Survey::Question %>
<span class=" pull-right">
<%= link_to(fa_icon("globe"), publish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit), title: I18n.t('neuigkeit.publish'), class: "btn") if can?(:publish, @neuigkeit) && !@neuigkeit.published?
%>
<%= link_to (fa_stack("globe","ban"), unpublish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit), :remote=>true, class: "btn stacked") if can?(:unpublish, @neuigkeit) && @neuigkeit.published?
%>
<% if @neuigkeit.published? %>
<div class="dropdown" style=" display:inline"">
<a class="dropdown-toggle btn" data-toggle="dropdown" title="publish" href="#">
<%= fa_icon("mail-forward")%><span class="caret"></span>
</a>
<ul class="dropdown-menu">
<%= li_tag(link_to(fa_icon("facebook-square") + " post on facebook", publish_to_facebook_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit))) if can?(:publish, @neuigkeit) && @neuigkeit.published?
%>
<%= li_tag(link_to(fa_icon("envelope-o") + " send mail", mail_to_fet_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit))) if can?(:publish, @neuigkeit) && @neuigkeit.published?
%>
</ul>
</div>
<% end %>
</span>
<div class="ui-dialog" id="attachments-form">
<%= render_new_attachments_for(@neuigkeit, fa_icon("plus"), {class: "btn"}) %>
</div>
</div>
<script>
$(function(){
dialogatt = $( "#attachments-form" ).dialog({
autoOpen: false,
width: "90%",
modal: true,
title: "Neue Attachments",
buttons: {
"Fertig": function() {
dialogatt.dialog( "close" );
}
}
});
$("#attachments-form-open").on("click",function(){dialogatt.dialog("open")})
});
</script>

View File

@@ -0,0 +1,68 @@
<div id="neuigkeit_<%= neuigkeit_view.id %>" class="contentbox" itemscope itemtype="http://schema.org/Article">
<%= meta_itemprop("about", neuigkeit_view.text_first_words) %>
<%= meta_itemprop("sameAs", neuigkeit_url(neuigkeit_view,:theme=>nil)) %>
<%= meta_itemprop("url", neuigkeit_url(neuigkeit_view,:theme=>nil)) %>
<div>
<% cache("menu_neuigkeit"+ can?(:edit,@neuigkeit).to_s +can?(:find_link, @neuigkeit).to_s + can?(:new, Survey::Question).to_s + can?(:publish, @neuigkeit).to_s + can?(:unpublish, @neuigkeit).to_s + @neuigkeit.published?.to_s ) do %>
<%= render partial: "menu" %>
<% end %>
</div>
<div>
<%#= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %>
</div>
<div class="media">
<span itemprop="articleSection">
<%= ff_icon(neuigkeit_view.rubrik.icon) unless neuigkeit_view.rubrik.icon.nil? or neuigkeit_view.rubrik.icon.empty? %>&nbsp;<%= neuigkeit_view.rubrik.name %>
</span>
<span class="pull-right">
<span itemprop="author"><%= neuigkeit_view.author.email.to_s unless neuigkeit_view.try(:author).try(:email).to_s %>
<%= neuigkeit_view.author.text %></span>
<% unless neuigkeit_view.try(:datum).try(:to_date).nil? %>
<%= " "+ I18n.t("neuigkeit.am")+" " %><span itemprop="datePublished"><%= I18n.l(neuigkeit_view.try(:datum).try(:to_date)) %>
</span>
<% end %>
</div>
<% unless neuigkeit_view.published? %>
<div class="sticker sticker-red"> Not Published <%= link_to "Publish", publish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),remote:true, class: :btn if can? :publish, neuigkeit_view %></div>
<% end %>
<% unless neuigkeit_view.origurl.nil? || neuigkeit_view.origurl.empty? %>
<div class="alert"><%= link_to "Zitiert von "+ neuigkeit_view.origurl, neuigkeit_view.origurl %>
</div>
<% end %>
<div class="media">
<% unless neuigkeit_view.picture_robust.big_thumb.to_s.empty? %>
<div class="pull-left" href="#">
<p><br><%= link_to image_tag(neuigkeit_view.picture_robust.big_thumb),neuigkeit_view.picture_robust.try(:url) %>
</p>
</div>
<% end %>
<div class="media-body">
<h1 itemprop="name">
<%= raw(neuigkeit_view.title) %> <%#= link_to fa_icon("edit"), edit_rubrik_neuigkeit_path(neuigkeit_view.rubrik, neuigkeit_view), remote: true if can? :edit, neuigkeit_view %>
</h1>
<div itemprop="articleBody">
<%= raw(neuigkeit_view.text) %>
</div>
</div>
</div>
<%= render_calentries_for(neuigkeit_view)%>
<%= new_calentry_div(neuigkeit_view) %>
<% unless neuigkeit_view.meeting.nil? %>
<%= render neuigkeit_view.meeting %>
<% end%>
<%= render_attachments_list_for(neuigkeit_view) %>
</div>
<% @questions.each do |q| %>
<%= render q if can? :show, q %>
<% end %>

View File

@@ -0,0 +1,76 @@
<%= content_for :header do %>
<title>Fetsite - <%= @neuigkeit.title %> (<%= @neuigkeit.rubrik.name %>)</title>
<% set_meta_tags :author => fetprofile_path(@neuigkeit.author.fetprofile) unless @neuigkeit.author.fetprofile.nil? %>
<% unless @neuigkeit.picture_robust.url.nil? %>
<%
picture_url=URI(root_url)
picture_url.path=@neuigkeit.picture_robust.url(:locale=>nil, :theme=>nil)
%>
<% end %>
<% set_meta_tags :og =>
{
:image => picture_url.to_s,
:title => @neuigkeit.title.to_s + " (" + @neuigkeit.rubrik.name.to_s + ")",
:type => "article",
:description =>@neuigkeit.text_first_words,
:url=>neuigkeit_url(:theme=>nil)
}
%>
<%= display_meta_tags %>
<% end %>
<%= render 'rubriken/tabs' %>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/de_DE/sdk.js#xfbml=1&appId=120379864660921&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="content-column content-wrap">
<%= link_to "Refresh", neuigkeit_path(@neuigkeit), remote: true %>
<p id="notice">
<%= notice %>
</p>
<%= render partial: "neuigkeit_view", object: @neuigkeit %>
</div>
<div class="fb-like" data-href"<%= rubrik_neuigkeit_url(@rubrik,@neuigkeit,{themes: nil, locale: nil})%>" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
<%= link_to fa_icon("link") + "Neue Verknüpfung" , "#", id: "findlink-open" if can? :find_link, @neuigkeit %>
<% cache(cache_array_key(@neuigkeit.nlinks, "NLinks")) do %>
<%= render partial: 'neuigkeiten/nlink_list_whole', :object=>@neuigkeit.nlinks %>
<% end %>
<div id="findlink-body" class="ui-dialog" style="">
<% if can? :find_link, @neuigkeit %>
Nach Element suchen:
<%= semantic_form_for :find_link, :url=>find_link_rubrik_neuigkeit_path(@rubrik,@neuigkeit), :html=>{:id=>"search_form", :method=>'get'} , :remote=> true do |f| %>
<%= f.input :query, :input_html => { :name => 'query' },:label=>false %>
<% end %>
<%= render partial: 'nlink_list_search_whole', object: @nlink_search %>
<% end %>
</div>
<script>
$(function(){
dialog = $( "#findlink-body" ).dialog({
autoOpen: false,
width: 350,
modal: true,
title: "Neue Verknüpfung hinzufügen",
buttons: {
"Fertig": function() {
dialog.dialog( "close" );
}
}
});
$("#findlink-open").on("click",function(){dialog.dialog("open")})
});
</script>