forked from bofh/fetsite
documents
This commit is contained in:
8
app/views/documents/_document.html.erb
Normal file
8
app/views/documents/_document.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="contentbox" id="document_<%= document.id%>">
|
||||
<% image_tag("/iconnavy/time.png") %>
|
||||
<% fa_icon("calendar 2x") %>
|
||||
|
||||
<%= document.title %>
|
||||
<%= link_to "edit", edit_document_path(document),:remote=>true if can? :edit, document %>
|
||||
<%= link_to 'Delete', document, method: :delete, data: { confirm: 'Are you sure?' } , remote: true if can? :delete, document %>
|
||||
</div>
|
||||
15
app/views/documents/_nested_form.html.erb
Normal file
15
app/views/documents/_nested_form.html.erb
Normal file
@@ -0,0 +1,15 @@
|
||||
<%= fa_icon("calendar 2x") %>
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<%= semantic_form_for @calentry, :remote=>true, :html=>{:class=>"inline"} do |f| %>
|
||||
|
||||
<%= f.input :start, :as => :datetimepicker %>
|
||||
<%= f.input :dauer , :as => :string, :append=>"h" %>
|
||||
<%= f.input :object_id , :as => :hidden %>
|
||||
<%= f.input :object_type , :as => :hidden %>
|
||||
<%= f.input :typ , :as => :hidden %>
|
||||
|
||||
|
||||
<%= f.action :submit, :as => :input_ %>
|
||||
|
||||
<% end %>
|
||||
1
app/views/documents/destroy.js.erb
Normal file
1
app/views/documents/destroy.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$("#document_<%= @document_id %>").remove();
|
||||
6
app/views/documents/edit.js.erb
Normal file
6
app/views/documents/edit.js.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
$("#document_<%= @document.id %>").html("<%=escape_javascript( render :partial=>"nested_form" ,:object=>@document)%>");
|
||||
|
||||
|
||||
|
||||
|
||||
3
app/views/documents/new.js.erb
Normal file
3
app/views/documents/new.js.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
$("#document_new").replaceWith("<div id=\"document_new\"><%=escape_javascript( render :partial=>"nested_form" ,:object=>@document) %></div>");
|
||||
|
||||
|
||||
1
app/views/documents/update.js.erb
Normal file
1
app/views/documents/update.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$("#document_<%= @document.id %>").replaceWith("<%=escape_javascript( render :partial=>"document", :object=>@document)%>");
|
||||
Reference in New Issue
Block a user