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 %>