Merge remote-tracking branch 'origin/documentmeeting' into documentmeeting

Conflicts:
	app/controllers/documents_controller.rb
	app/controllers/meetings_controller.rb
	app/models/ability.rb
	app/models/document.rb
	app/models/meeting.rb
	app/models/meetingtyp.rb
	app/views/documents/_document.html.erb
	app/views/documents/_nested_form.html.erb
	app/views/documents/edit.js.erb
	app/views/documents/new.js.erb
	app/views/meetings/_meeting.html.erb
	app/views/themen/_small.html.erb
	config/routes.rb
This commit is contained in:
Andreas Stephanides
2014-12-16 09:00:43 +01:00
13 changed files with 65 additions and 3 deletions

View File

@@ -1,7 +1,9 @@
<div class="contentbox" id="document_<%= document.id%>">
<% image_tag("/iconnavy/time.png") %>
<%= fa_icon("file-text") %>
<%= link_to document.name, document %>
<%= 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>

View File

@@ -4,8 +4,10 @@
<%= semantic_form_for @document, :remote=>true, :html=>{:class=>""} do |f| %>
<%= f.input :name %>
<%= f.input :parent_id, :as=>:hidden %>
<%= f.input :parent_type, :as=>:hidden %>
<%= f.action :submit, :as => :input_ %>
<% end %>

View File

@@ -1,5 +1,7 @@
$("#<%= @document.divid %>").html("<%=escape_javascript( render :partial=>"nested_form" ,:object=>@document)%>");

View File

@@ -1,3 +1,5 @@
$("#<%= Document.new_divid_for(@parent) %>").replaceWith("<div id=\"<%= Document.new_divid_for(@parent) %>\"><%=escape_javascript( render :partial=>"nested_form" ,:object=>@document) %></div>");

View File

@@ -1,4 +1,5 @@
<div class="contentbox" id="meeting_<%= meeting.id%>">
<b><%= link_to meeting.text, meeting %></b>
<%= link_to "Ankündigung", rubrik_neuigkeit_path(meeting.neuigkeit.rubrik, meeting.neuigkeit) unless meeting.neuigkeit.nil? %>
<%= link_to "ankündigen", announce_meeting_path(meeting), remote: true if meeting.neuigkeit.nil? %>
@@ -11,3 +12,4 @@
<%= render meeting.protocol unless meeting.protocol.nil? %>
</div>

View File

@@ -20,6 +20,7 @@
<%= raw(frage.text) %>
</p>
<% end %>
<<<<<<< HEAD
<% if can?(:edit,small) || !small.meetings.empty? %>
<b>Treffen/Sitzungen</b>
<%= link_to "Neues Meeting", new_meeting_path(:parent_id=>small.id, :parent_type=>"Thema"), :remote=>true %>
@@ -33,13 +34,30 @@
<%= link_to "Neues Dokument", new_document_path(:parent_id=>small.id, :parent_type=>"Thema"), :remote=>true %>
<div id="<%= Document.new_divid_for(small) %>"></div>
<% unless small.meetings.empty? %>
<b>Treffen/Sitzungen</b>
<% small.meetings.each do |m| %>
<%= render m %>
<% end%>
<% end%>
<% unless small.documents.empty? %>
<b>Dokumente</b>
<% small.documents.each do |d| %>
<%= render d %>
<% end%>
<% end%>
<% end %>
<% unless small.hideattachment %>
<%= render partial: "themen/attachment_list", object: small.attachments, locals:{editor: false} unless small.attachments.empty? %>
<% end %>