From caebc366447aa4b239f9ca79c0b1c50068215534 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Wed, 23 Jul 2014 22:57:14 +0530 Subject: [PATCH 01/10] contact page new --- app/controllers/config_controller.rb | 2 + app/controllers/home_controller.rb | 7 +++ app/controllers/lvas_controller.rb | 11 ++++- app/controllers/neuigkeiten_controller.rb | 2 +- app/controllers/users_controller.rb | 2 +- app/views/home/admin.html.erb | 8 ++++ app/views/home/kontakt.html.erb | 14 +++--- app/views/themengruppen/show.html.erb | 16 +++---- app/views/themes/blue1/home/index.html.erb | 21 +++++---- .../white_1/themengruppen/show.html.erb | 47 +++++++++++-------- config/routes.rb | 4 +- 11 files changed, 87 insertions(+), 47 deletions(-) diff --git a/app/controllers/config_controller.rb b/app/controllers/config_controller.rb index 5caffd0..53cb795 100755 --- a/app/controllers/config_controller.rb +++ b/app/controllers/config_controller.rb @@ -4,4 +4,6 @@ class ConfigController < ApplicationController end + def choose_contact_topics + end end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 516cabb..df28c51 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -8,6 +8,8 @@ class HomeController < ApplicationController end def kontakt + t=YAML.load_file("#{::Rails.root.to_s}/config/contact_topic.yml") + @themen = Thema.where(:id=>t) end def intern authorize! :seeintern, User @@ -51,4 +53,9 @@ class HomeController < ApplicationController format.js end end + def choose_contact_topics +File.open("config/contact_topic.yml",'w'){|f| f.write(params[:themen].to_yaml)} + redirect_to admin_home_index_path + end + end diff --git a/app/controllers/lvas_controller.rb b/app/controllers/lvas_controller.rb index 5423e28..ee2732c 100755 --- a/app/controllers/lvas_controller.rb +++ b/app/controllers/lvas_controller.rb @@ -1,7 +1,7 @@ class LvasController < ApplicationController # GET /lvas require 'zip' - before_filter :load_toolbar, :only => [:show] + before_filter :load_toolbar, :only => [:verwalten] load_and_authorize_resource def index @lvas = Lva.all @@ -43,6 +43,15 @@ class LvasController < ApplicationController def show @lva = Lva.find_by_id(params[:id]) @beispiel=Beispiel.new + @toolbar_elements =[] + @toolbar_elements<<{:hicon=>'icon-pencil', :icon=>:pencil,:text =>I18n.t('common.manage'),:path => verwalten_lva_path(@lva)} if can? :verwalten, @lva + + end + def verwalten + @lva = Lva.find_by_id(params[:id]) + @beispiel=Beispiel.new + + render :show end # GET /lvas/new diff --git a/app/controllers/neuigkeiten_controller.rb b/app/controllers/neuigkeiten_controller.rb index 0af5eac..3e05c2c 100755 --- a/app/controllers/neuigkeiten_controller.rb +++ b/app/controllers/neuigkeiten_controller.rb @@ -69,7 +69,7 @@ class NeuigkeitenController < ApplicationController unless @neuigkeit.published? redirect_to [@neuigkeit.rubrik,@neuigkeit], notice: 'Neuigkeit muss veröffentlicht sein um sie auf Facebook zu posten.' else - page=YAML.load_file("#{::Rails.root.to_s}/tmp/page.yml") + page=YAML.load_file("#{::Rails.root.to_s}/config/page.yml") page.feed!(:access_token=>page.access_token, :message=>@neuigkeit.text_first_words, :name=>@neuigkeit.title, :link=>rubrik_neuigkeit_url(@neuigkeit.rubrik, @neuigkeit)+".html", :picture=>@neuigkeit.picture.url) redirect_to [@neuigkeit.rubrik,@neuigkeit], notice: 'Neuigkeit auf Facebook gepostet' diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index f5a0334..35a3051 100755 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -17,7 +17,7 @@ class UsersController < ApplicationController redirect_to intern_home_index_path else @fbu=FbGraph::User.new(current_user.uid.to_s).fetch(:access_token=>session["fbuser_access_token"]) - File.open("tmp/page.yml",'w'){|f| f.write(@fbu.accounts(:access_token=>session["fbuser_access_token"]).select { |p| p.name == params["page"] }.first.to_yaml)} + File.open("config/page.yml",'w'){|f| f.write(@fbu.accounts(:access_token=>session["fbuser_access_token"]).select { |p| p.name == params["page"] }.first.to_yaml)} logger.debug @fbu.to_s redirect_to admin_home_index_path end diff --git a/app/views/home/admin.html.erb b/app/views/home/admin.html.erb index 55cc15d..1c65a34 100644 --- a/app/views/home/admin.html.erb +++ b/app/views/home/admin.html.erb @@ -9,4 +9,12 @@ <%= semantic_form_for :set_page, url: fb_set_default_publish_page_user_path(current_user), html:{method: :get} do |f| %> <%= f.input :page , :input_html => { :name => 'page' }%> <% end %> + +<%= semantic_form_for :set_thema, url: choose_contact_topics_home_index_path, html:{method: :get} do |f| %> +<%= f.input :themen, :input_html=> {:name=>'themen'}, :as=>:select ,:multiple=>true,:collection =>Thema.all%> + + <%= f.actions do %> + <%= f.action :submit, :as => :button, :label=> I18n.t("common.save" ) %> +<% end %> +<% end %>

diff --git a/app/views/home/kontakt.html.erb b/app/views/home/kontakt.html.erb index f2d4a8b..68ff483 100644 --- a/app/views/home/kontakt.html.erb +++ b/app/views/home/kontakt.html.erb @@ -1,12 +1,10 @@

<%= I18n.t "kontakt.H1" %>

-

- <%= I18n.t "kontakt.text" %> -

-

<%= I18n.t "kontakt.service" %>

- <%= raw(I18n.t( "kontakt.service_text")) %> -

<%= I18n.t "kontakt.adresse" %>

-

<%= raw(I18n.t("kontakt.adresse_text")) %>

-

<%= raw(I18n.t ("kontakt.telefon_text")) %>

+<% @themen.each do |th| %> +<%= render partial: "themen/small", object: th %> +<% end %> + + +
diff --git a/app/views/themengruppen/show.html.erb b/app/views/themengruppen/show.html.erb index 73681e3..3764af0 100644 --- a/app/views/themengruppen/show.html.erb +++ b/app/views/themengruppen/show.html.erb @@ -1,13 +1,13 @@
+ <% if @themengruppe.public %> +
  • <%= link_to fa_icon("arrow-circle-left 2x")+I18n.t("themengruppe.showall"), themengruppen_path, :class=>"linkbox" %>
  • + <% else %> +
  • <%= link_to fa_icon("arrow-circle-left 2x")+I18n.t("common.intern"), intern_home_index_path, :class=>"linkbox" %>
  • + <% end %> +
  • <%= link_to fa_icon("question 2x")+ I18n.t("themengruppe.faqs"), faqs_themengruppen_path(:anchor=>"themengruppe_"+@themengruppe.id.to_s), :class=>"linkbox" %> +
  • + <%= render :partial=>'layouts/pretty_toolbar' %>

    <% unless @themengruppe.icon.nil? or @themengruppe.icon.empty? %> diff --git a/app/views/themes/blue1/home/index.html.erb b/app/views/themes/blue1/home/index.html.erb index 65429b0..5160276 100644 --- a/app/views/themes/blue1/home/index.html.erb +++ b/app/views/themes/blue1/home/index.html.erb @@ -3,11 +3,18 @@
    - - -

    -<%= ffi1_icon "academic" %><%= link_to I18n.t('home.login'), user_omniauth_authorize_path(:ldap) %> -

    + +

    Beta Test

    Die Webseite befindet sich derzeit in einem Entwicklungsstadium, @@ -28,9 +35,7 @@

    - <%= link_to "Entwicklungsstatus" , dev_home_index_path %> -

    - <%= link_to "FAQS", faqs_themengruppen_path,class: :btn %> +

    <%= render 'beispiele' %> diff --git a/app/views/themes/white_1/themengruppen/show.html.erb b/app/views/themes/white_1/themengruppen/show.html.erb index 6da95cd..36f2358 100644 --- a/app/views/themes/white_1/themengruppen/show.html.erb +++ b/app/views/themes/white_1/themengruppen/show.html.erb @@ -1,29 +1,38 @@ -

    <%= @themengruppe.title %>

    - +

    <% unless @themengruppe.icon.nil? or @themengruppe.icon.empty? %> + <% end %><%= @themengruppe.title %>

    <%= @themengruppe.text %>

    <% @themen.each do |thema| %> -
    - -
    -
    - <% unless thema.gremium.nil? %> -

    <%= link_to "Zu dem Gremium ..." , thema.gremium %> -

    -<% end %> - <%= render :partial => 'themen/small', :object => thema %> - +
    + +
    +
    -
    -
    -
    + <%= render :partial => 'themen/small', :object => thema %> +
      + <% unless thema.gremium.nil? %> +
    • + <%= link_to fa_icon("users 2x")+thema.gremium.name , thema.gremium,:class=>"linkbox" %> +
    • + <% end %> + + <% thema.nlinks.each do |l| %> +
    • + <%= render l.neuigkeit if can? :show, l.neuigkeit%> +
    • + <% end %> + +
    +
    +
    +
    <% end %>
    diff --git a/config/routes.rb b/config/routes.rb index 07d5b8f..d01752e 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -73,6 +73,7 @@ Fetsite::Application.routes.draw do get 'beispiel_sammlung' get 'compare_tiss' get 'load_tiss' + get 'verwalten' end resources :beispiele#, :only=>[:show,:index,:create] @@ -135,7 +136,8 @@ Fetsite::Application.routes.draw do get 'dev' get 'startdev' get 'linksnotimplemented' - get 'kontakt' + get 'kontakt' + get 'choose_contact_topics' end end From 74546b1d8db80176c5ae821a989c3086c3cd7a77 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Wed, 23 Jul 2014 22:57:25 +0530 Subject: [PATCH 02/10] geburtstag anzeigen --- app/views/fetprofiles/_interninfo.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/fetprofiles/_interninfo.html.erb b/app/views/fetprofiles/_interninfo.html.erb index bd5fc1f..4ea0119 100644 --- a/app/views/fetprofiles/_interninfo.html.erb +++ b/app/views/fetprofiles/_interninfo.html.erb @@ -1,5 +1,5 @@

    -Geburtstag <%= %> +Geburtstag <%= I18n.l(interninfo.birthday,format: :short) %>

    Adresse: From 3347ac89d9ef27a082b4a11a053a1f1c71e1724b Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Wed, 23 Jul 2014 22:57:40 +0530 Subject: [PATCH 03/10] thmen nur rendern wenn erlaubt --- app/views/layouts/_pretty_toolbar.html.erb | 4 ++-- app/views/themen/_small.html.erb | 4 ++++ app/views/themen/_thema.html.erb | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/_pretty_toolbar.html.erb b/app/views/layouts/_pretty_toolbar.html.erb index 3ec90f4..096cac6 100644 --- a/app/views/layouts/_pretty_toolbar.html.erb +++ b/app/views/layouts/_pretty_toolbar.html.erb @@ -6,8 +6,8 @@ Verwendung: Aufruf mit --> <% toolbar_elements = !pretty_toolbar.nil? ? pretty_toolbar : @toolbar_elements %> <% unless toolbar_elements.nil? || toolbar_elements.empty? %> -<%= I18n.t("common.actions")%> -

    +
    <% toolbar_elements.each do |t| %> <% unless t[:method]==:versions %> <% text=''.html_safe+t[:text] %> diff --git a/app/views/themen/_small.html.erb b/app/views/themen/_small.html.erb index dfa0fc3..2e4b269 100644 --- a/app/views/themen/_small.html.erb +++ b/app/views/themen/_small.html.erb @@ -1,3 +1,4 @@ +<% if can? :show, small %>

    <%= small.title %> <%= link_to fa_icon("pencil"), verwalten_thema_path(small) if can? :edit, small %>

    @@ -30,3 +31,6 @@ @small_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>small} if can? :edit, small @small_elements << {:hicon=>'icon-remove-circle',:text=>I18n.t('thema.remove'), :path=>small, :method=>:delete,:confirm=>I18n.t('thema.sure')} if can? :delete, small %> <% render :partial=>'layouts/pretty_toolbar', :object=>@small_elements unless @small_elements.empty? %> +<% else %> +Error +<% end %> diff --git a/app/views/themen/_thema.html.erb b/app/views/themen/_thema.html.erb index ede7bb2..7d24eff 100644 --- a/app/views/themen/_thema.html.erb +++ b/app/views/themen/_thema.html.erb @@ -1,2 +1,2 @@ - <%= thema.title%> + <%= thema.title if can? :show , thema %> From af9da058ab26d45829eceb3ec37089a9f6da7ea3 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Mon, 11 Aug 2014 14:38:14 +0530 Subject: [PATCH 04/10] Interface Neuigkeiten & Attachment --- app/controllers/neuigkeiten_controller.rb | 23 ++++++++++------ app/models/ability.rb | 1 + app/models/attachment.rb | 7 +++++ app/models/thema.rb | 4 ++- app/uploaders/attachment_uploader.rb | 9 ++++--- app/views/layouts/_pretty_toolbar.html.erb | 24 ++++++++++++++--- .../neuigkeiten/_nlink_list_search.html.erb | 3 ++- app/views/neuigkeiten/create_link.js.erb | 2 ++ app/views/themen/_attachment_list.html.erb | 12 ++++++--- app/views/themen/_select.html.erb | 26 ++++++++++++++----- app/views/themen/_verw_liste.html.erb | 17 +++++++----- .../themengruppen/_themengruppe.html.erb | 3 ++- app/views/themengruppen/index.html.erb | 24 ++++++++--------- 13 files changed, 111 insertions(+), 44 deletions(-) create mode 100644 app/views/neuigkeiten/create_link.js.erb diff --git a/app/controllers/neuigkeiten_controller.rb b/app/controllers/neuigkeiten_controller.rb index 3e05c2c..29a54b9 100755 --- a/app/controllers/neuigkeiten_controller.rb +++ b/app/controllers/neuigkeiten_controller.rb @@ -113,9 +113,14 @@ class NeuigkeitenController < ApplicationController render action:"show" end def create_link - Nlink.create(:link=>params[:link_type].constantize.find(params[:link_id]),:neuigkeit=>Neuigkeit.find(params[:id])) + @neuigkeit = Neuigkeit.find(params[:id]) - redirect_to action:"show" + Nlink.create(:link=>params[:link_type].constantize.find(params[:link_id]),:neuigkeit=>Neuigkeit.find(params[:id])) + @nlinks=@neuigkeit.nlinks + respond_to do |format| + format.html { edirect_to action:"show" } + format.js + end end def create @@ -159,21 +164,23 @@ private def load_toolbar_elements @neuigkeit=Neuigkeit.find(params[:id]) @toolbar_elements=[] - @toolbar_elements << {:hicon=>'icon-plus', :text=> I18n.t('neuigkeit.publish'),:path => publish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=> I18n.t('neuigkeit.publish_sure') } if can?(:publish, @neuigkeit) && !@neuigkeit.published? - @toolbar_elements << {:hicon=>'icon-facebook', :text=> I18n.t('neuigkeit.publishfb'),:path => publish_to_facebook_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>I18n.t('neuigkeit.publishfb_sure') } if can?(:publish, @neuigkeit) && @neuigkeit.published? + actions=[] + actions << {:hicon=>'icon-plus', :text=> I18n.t('neuigkeit.publish'),:path => publish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=> I18n.t('neuigkeit.publish_sure') } if can?(:publish, @neuigkeit) && !@neuigkeit.published? + actions << {:hicon=>'ffi1-facebook1', :text=> I18n.t('neuigkeit.publishfb'),:path => publish_to_facebook_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>I18n.t('neuigkeit.publishfb_sure') } if can?(:publish, @neuigkeit) && @neuigkeit.published? -@toolbar_elements << {:hicon=>'icon-facebook', :text=> I18n.t('neuigkeit.publishfetmail'),:path => mail_to_fet_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>I18n.t('neuigkeit.publishfetmail_sure') } if can?(:publish, @neuigkeit) && @neuigkeit.published? +actions << {:hicon=>'icon-facebook', :text=> I18n.t('neuigkeit.publishfetmail'),:path => mail_to_fet_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>I18n.t('neuigkeit.publishfetmail_sure') } if can?(:publish, @neuigkeit) && @neuigkeit.published? - @toolbar_elements << {:hicon=>'icon-minus', :text=> I18n.t('neuigkeit.unpublish'),:path => unpublish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=> I18n.t('neuigkeit.unpublish_sure') } if can?(:unpublish, @neuigkeit) && @neuigkeit.published? + actions << {:hicon=>'icon-minus', :text=> I18n.t('neuigkeit.unpublish'),:path => unpublish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=> I18n.t('neuigkeit.unpublish_sure') } if can?(:unpublish, @neuigkeit) && @neuigkeit.published? + @toolbar_elements << {:text=>I18n.t('common.edit'),:path=>edit_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:icon=>:pencil} if can? :edit, @neuigkeit.rubrik @versions= @neuigkeit.translation.versions.select([:created_at]).reverse @toolbar_elements <<{:path=>rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:method=>:versions,:versions=>@versions} - @toolbar_elements << {:hicon=>'icon-remove-circle', :text=> I18n.t('common.delete'),:path => rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit), :method=> :delete,:confirm=>'Sure?' } if can? :delete, @neuigkeit - + actions << {:hicon=>'icon-remove-circle', :text=> I18n.t('common.delete'),:path => rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit), :method=> :delete,:confirm=>'Sure?' } if can? :delete, @neuigkeit + @toolbar_elements << {:text => "action", :method => :dropdown, :elements=> actions} end diff --git a/app/models/ability.rb b/app/models/ability.rb index 616979b..99fe04a 100755 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -40,6 +40,7 @@ class Ability can :showintern, Thema can :manage, Thema can :manage, Themengruppe + can :manage, Attachment end unless user.has_role?("fetadmin") cannot :delete, Themengruppe diff --git a/app/models/attachment.rb b/app/models/attachment.rb index c61214f..3301381 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -18,6 +18,13 @@ class Attachment < ActiveRecord::Base validates :thema, :presence => true validates :name, :presence => true + def image? + + # data_ext = datei.file.extension.downcase + # %w(jpg png jpeg).include?(data_ext) + datei.image?(datei.file) + end + def to_jq_upload { "id" => read_attribute(:id), diff --git a/app/models/thema.rb b/app/models/thema.rb index 3f73b38..d61bf46 100644 --- a/app/models/thema.rb +++ b/app/models/thema.rb @@ -49,7 +49,9 @@ include Rails.application.routes.url_helpers def fix_links(host) full_url= URI.parse(root_url(:host=>host)) - self.text.gsub!(/src="[^"]*attachment\/datei\/(\d+)[^"]*"/){|s| full_url.path=Attachment.find($1.to_i).datei.url; 'src="'+full_url.to_s+'"'} + self.text.gsub!(/src="[\.\/]*uploads\/attachment\/datei\/(\d+)\/thumb_big[^"]*"/){|s| full_url.path=Attachment.find($1.to_i).datei.thumb_big.url; 'src="'+full_url.to_s+'"'} + self.text.gsub!(/src="[\.\/^"]*uploads\/attachment\/datei\/(\d+)\/[^"]*"/){|s| full_url.path=Attachment.find($1.to_i).datei.url; 'src="'+full_url.to_s+'"'} + self.text.gsub!(/href="[^"]*themen\/(\d+)[^"]*"/){|s| full_url.path=thema_path(Thema.find($1.to_i)); 'href="'+full_url.to_s+'"'} end diff --git a/app/uploaders/attachment_uploader.rb b/app/uploaders/attachment_uploader.rb index c7d10a4..d08f8cd 100644 --- a/app/uploaders/attachment_uploader.rb +++ b/app/uploaders/attachment_uploader.rb @@ -89,8 +89,11 @@ end # def filename # "something.jpg" if original_filename # end -protected - def image?(file) - %w(jpg png jpeg).include?(File.extname(full_filename(file))) + def extention + File.extname(full_filename(file.file)).downcase + end + + def image?(for_file) + %w(.jpg .png .jpeg).include?(File.extname(full_filename(for_file.file)).downcase) end end diff --git a/app/views/layouts/_pretty_toolbar.html.erb b/app/views/layouts/_pretty_toolbar.html.erb index 096cac6..8405a4c 100644 --- a/app/views/layouts/_pretty_toolbar.html.erb +++ b/app/views/layouts/_pretty_toolbar.html.erb @@ -10,8 +10,26 @@ Verwendung: Aufruf mit -->
    <% toolbar_elements.each do |t| %> <% unless t[:method]==:versions %> - <% text=''.html_safe+t[:text] %> + <% unless t[:method]==:dropdown %> + + <% text=ff_icon(t[:hicon])+t[:text] %> <%= 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 %> +
    + + <%= t[:text] %> + + +<% end %> <% else %>
    @@ -28,9 +46,9 @@ Verwendung: Aufruf mit q= q.merge(URI.decode_www_form(uri.query)) unless uri.query.nil? uri.query= URI.encode_www_form(q<<["version",i.to_s]) - %> + %> <%= link_to I18n.l(v[:created_at]).to_s,uri.to_s ,:version=>v[:id] %> -<% end %> + <% end %> <% end %> diff --git a/app/views/neuigkeiten/_nlink_list_search.html.erb b/app/views/neuigkeiten/_nlink_list_search.html.erb index be5a2c9..c50ead3 100644 --- a/app/views/neuigkeiten/_nlink_list_search.html.erb +++ b/app/views/neuigkeiten/_nlink_list_search.html.erb @@ -1,11 +1,12 @@
  • <%= link_to nlink_list_search.title, nlink_list_search %> - <%= link_to "add:"+nlink_list_search.title, create_link_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit, :link_id=>nlink_list_search.id, :link_type=>nlink_list_search.class.to_s) %> + <%= link_to create_link_rubrik_neuigkeit_path(@neuigkeit.rubrik, @neuigkeit, :link_id=>nlink_list_search.id, :link_type=>nlink_list_search.class.to_s), remote: true do %>
    <% p = nlink_list_search.class.to_s.downcase.pluralize+"/nlink" %> <%= render :partial=>p, :object=>nlink_list_search %>
    +<% end %>
  • diff --git a/app/views/neuigkeiten/create_link.js.erb b/app/views/neuigkeiten/create_link.js.erb new file mode 100644 index 0000000..d24f9fc --- /dev/null +++ b/app/views/neuigkeiten/create_link.js.erb @@ -0,0 +1,2 @@ +$('#nlink_list_search').html(""); +$('#nlink_list').html("<%= escape_javascript( render partial:"nlink_list", collection: @nlinks )%>"); \ No newline at end of file diff --git a/app/views/themen/_attachment_list.html.erb b/app/views/themen/_attachment_list.html.erb index a210446..818aa05 100644 --- a/app/views/themen/_attachment_list.html.erb +++ b/app/views/themen/_attachment_list.html.erb @@ -8,9 +8,15 @@ <% if editor %> -<%= link_to "Edit", edit_thema_attachment_path(a.thema,a) %> -<%= link_to "Delete", thema_attachment_path(a.thema,a), method: "DELETE", confirm: "Sure?" %> - +
    <% end %> diff --git a/app/views/themen/_select.html.erb b/app/views/themen/_select.html.erb index a693ec0..02401a7 100644 --- a/app/views/themen/_select.html.erb +++ b/app/views/themen/_select.html.erb @@ -2,19 +2,33 @@ <% select.attachments.each_slice(6) do |row| %>
    <% row.each do |attachment| - data_ext = attachment.datei.file.extension.downcase %> +%>
    - <%= link_to attachment.name, edit_thema_attachment_path(@thema,attachment) %>
    - <% if (!["jpg","png","jpeg"].find_index(data_ext).nil?) %> +
    <% end %>
    diff --git a/app/views/themen/_verw_liste.html.erb b/app/views/themen/_verw_liste.html.erb index 777a730..0c6f554 100644 --- a/app/views/themen/_verw_liste.html.erb +++ b/app/views/themen/_verw_liste.html.erb @@ -1,8 +1,13 @@ <% verw_liste.each do |thema| %> -
  • <%= thema.title %>
    - -<%= link_to thema_path(thema),:remote=>true do %> Show <% end %> -<%= link_to edit_thema_path(thema),:remote=>true do %> Edit <% end %> -<%= link_to fragen_thema_path(thema),:remote=>true do %> Fragen <% end %> -<%= link_to attachments_thema_path(thema),:remote=>true do %> Attachments <% end %>
  • +
  • +
  • <% end %> diff --git a/app/views/themengruppen/_themengruppe.html.erb b/app/views/themengruppen/_themengruppe.html.erb index 7e99e23..73c5c4f 100644 --- a/app/views/themengruppen/_themengruppe.html.erb +++ b/app/views/themengruppen/_themengruppe.html.erb @@ -1,4 +1,5 @@ <%= link_to themengruppe,{:class=>'linkbox color-1-dark'} do %> +
    @@ -45,5 +46,5 @@
    - +
    <% end %> diff --git a/app/views/themengruppen/index.html.erb b/app/views/themengruppen/index.html.erb index 9e5acf4..f2cc8a9 100644 --- a/app/views/themengruppen/index.html.erb +++ b/app/views/themengruppen/index.html.erb @@ -2,21 +2,21 @@ <%= render :partial=>'layouts/pretty_toolbar' %> -

    - +

    + + +