From 2688bca831c17274d9cb23fd5739989d5362f3a0 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Tue, 28 Oct 2014 08:43:44 +0100 Subject: [PATCH 1/3] calentry inline form --- app/assets/stylesheets/layout.css.scss | 10 +++++++++- app/controllers/calendars_controller.rb | 5 +++++ app/controllers/calentries_controller.rb | 3 +++ app/views/calentries/_calentry.html.erb | 2 +- app/views/calentries/_nested_form.html.erb | 10 ++++++++++ app/views/calentries/edit.js.erb | 2 ++ app/views/calentries/update.js.erb | 1 + app/views/lvas/show.html.erb | 10 ++++++++++ 8 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 app/views/calentries/_nested_form.html.erb create mode 100644 app/views/calentries/edit.js.erb create mode 100644 app/views/calentries/update.js.erb diff --git a/app/assets/stylesheets/layout.css.scss b/app/assets/stylesheets/layout.css.scss index 65995e4..34fc843 100755 --- a/app/assets/stylesheets/layout.css.scss +++ b/app/assets/stylesheets/layout.css.scss @@ -172,4 +172,12 @@ span.linklist a { display:block; float:left; -} \ No newline at end of file +} + +form.inline div { +float:left;} + +form.inline input { +} +form.inline { +float:clear; } \ No newline at end of file diff --git a/app/controllers/calendars_controller.rb b/app/controllers/calendars_controller.rb index 441a39a..96dbbc4 100644 --- a/app/controllers/calendars_controller.rb +++ b/app/controllers/calendars_controller.rb @@ -37,6 +37,11 @@ class CalendarsController < ApplicationController # GET /calendars/1/edit def edit @calendar = Calendar.find(params[:id]) + respond_to do |format| + format.html # new.html.erb + format.js + end + end # POST /calendars diff --git a/app/controllers/calentries_controller.rb b/app/controllers/calentries_controller.rb index 7bb1c07..3a4be9a 100644 --- a/app/controllers/calentries_controller.rb +++ b/app/controllers/calentries_controller.rb @@ -39,6 +39,7 @@ class CalentriesController < ApplicationController @calentry = Calentry.find(params[:id]) respond_to do |format| format.html + format.js end end @@ -67,9 +68,11 @@ class CalentriesController < ApplicationController if @calentry.update_attributes(params[:calentry]) format.html { redirect_to @calentry, notice: 'Calentry was successfully updated.' } format.json { head :no_content } + format.js else format.html { render action: "edit" } format.json { render json: @calentry.errors, status: :unprocessable_entity } + format.js { render action: "edit"} end end end diff --git a/app/views/calentries/_calentry.html.erb b/app/views/calentries/_calentry.html.erb index 94e45e5..909737a 100644 --- a/app/views/calentries/_calentry.html.erb +++ b/app/views/calentries/_calentry.html.erb @@ -9,5 +9,5 @@ format =:default end%> <%= calentry.text %> -<%= link_to "edit", edit_calentry_path(calentry) if can? :edit, calentry %> +<%= link_to "edit", edit_calentry_path(calentry),:remote=>true if can? :edit, calentry %> diff --git a/app/views/calentries/_nested_form.html.erb b/app/views/calentries/_nested_form.html.erb new file mode 100644 index 0000000..9797fba --- /dev/null +++ b/app/views/calentries/_nested_form.html.erb @@ -0,0 +1,10 @@ +<%= fa_icon("calendar 2x") %> +<%= semantic_form_for @calentry, :remote=>true, :html=>{:class=>"inline"} do |f| %> + + <%= f.input :start, :as => :datetimepicker %> +<%= f.input :dauer , :as => :string, :append=>"h" %> + + + <%= f.action :submit, :as => :input_ %> + +<% end %> diff --git a/app/views/calentries/edit.js.erb b/app/views/calentries/edit.js.erb new file mode 100644 index 0000000..77e8826 --- /dev/null +++ b/app/views/calentries/edit.js.erb @@ -0,0 +1,2 @@ +alert("sdf"); +$("#calentry_<%= @calentry.id %>").html("<%=escape_javascript( render :partial=>"nested_form" ,:object=>@calentry)%>"); diff --git a/app/views/calentries/update.js.erb b/app/views/calentries/update.js.erb new file mode 100644 index 0000000..5b6ad49 --- /dev/null +++ b/app/views/calentries/update.js.erb @@ -0,0 +1 @@ +$("#calentry_<%= @calentry.id %>").replaceWith("<%=escape_javascript( render :partial=>"calentry", :object=>@calentry)%>"); diff --git a/app/views/lvas/show.html.erb b/app/views/lvas/show.html.erb index a1d5bc9..7ff86cd 100755 --- a/app/views/lvas/show.html.erb +++ b/app/views/lvas/show.html.erb @@ -1,3 +1,13 @@ +<%= content_for :header do %> +Fetsite - <%= @lva.full_name %> +<% set_meta_tags :og => { + :url=>lva_path(:theme=>nil) } +%> +<%= display_meta_tags %> +<% end %> + + +
<%= render 'studien/tabs'%>

<%= notice %>

From bff600a8969e9868d1af92859ea9c60bf741985e Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Tue, 28 Oct 2014 08:44:19 +0100 Subject: [PATCH 2/3] remove hallo welt --- app/views/calentries/edit.js.erb | 2 +- app/views/themengruppen/edit.js.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/calentries/edit.js.erb b/app/views/calentries/edit.js.erb index 77e8826..8c1f421 100644 --- a/app/views/calentries/edit.js.erb +++ b/app/views/calentries/edit.js.erb @@ -1,2 +1,2 @@ -alert("sdf"); + $("#calentry_<%= @calentry.id %>").html("<%=escape_javascript( render :partial=>"nested_form" ,:object=>@calentry)%>"); diff --git a/app/views/themengruppen/edit.js.erb b/app/views/themengruppen/edit.js.erb index 43f7f1b..5ef2eb8 100644 --- a/app/views/themengruppen/edit.js.erb +++ b/app/views/themengruppen/edit.js.erb @@ -1,2 +1,2 @@ -alert("hallo Welt"); + $("#themaview").html("<%=escape_javascript( render :action=>:edit, :layout=>false )%>"); From dce5acefebbee3f5f2cb771aaa5e170717c0e944 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Tue, 28 Oct 2014 16:53:07 +0100 Subject: [PATCH 3/3] no robots --- app/views/themengruppen/_themengruppe.html.erb | 4 ++-- public/robots.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/themengruppen/_themengruppe.html.erb b/app/views/themengruppen/_themengruppe.html.erb index a64641c..5e25be7 100644 --- a/app/views/themengruppen/_themengruppe.html.erb +++ b/app/views/themengruppen/_themengruppe.html.erb @@ -14,7 +14,7 @@ <% unless themengruppe.icon.nil? or themengruppe.icon.empty? %> <% end %> -<%=themengruppe.title%> + <%= themengruppe.title%>
@@ -24,7 +24,7 @@

- <%= if themengruppe.text.split.size > Themengruppe::WORD_COUNT + <%= if themengruppe.text.split.size > Themengruppe::WORD_COUNT themengruppe.text.split[0..Themengruppe::WORD_COUNT].join(" ") + " ..." else themengruppe.text diff --git a/public/robots.txt b/public/robots.txt index 085187f..8e1d420 100755 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,5 +1,5 @@ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file # # To ban all spiders from the entire site uncomment the next two lines: -# User-Agent: * -# Disallow: / +User-Agent: * +Disallow: /