From 566724a7658d2efe755ad12abbc901c885dce84e Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Thu, 25 Oct 2012 00:09:13 +0000 Subject: [PATCH] [work-assignment] Preparing base view --- plugins/work_assignment/lib/work_assignment_plugin/helper.rb | 5 +++++ plugins/work_assignment/lib/work_assignment_plugin/work_assignment.rb | 11 +++++++++++ plugins/work_assignment/views/cms/work_assignment_plugin/_work_assignment.html.erb | 3 +++ plugins/work_assignment/views/content_viewer/work_assignment.html.erb | 8 ++++++++ 4 files changed, 27 insertions(+), 0 deletions(-) create mode 100644 plugins/work_assignment/lib/work_assignment_plugin/helper.rb create mode 100644 plugins/work_assignment/views/cms/work_assignment_plugin/_work_assignment.html.erb create mode 100644 plugins/work_assignment/views/content_viewer/work_assignment.html.erb diff --git a/plugins/work_assignment/lib/work_assignment_plugin/helper.rb b/plugins/work_assignment/lib/work_assignment_plugin/helper.rb new file mode 100644 index 0000000..2c76821 --- /dev/null +++ b/plugins/work_assignment/lib/work_assignment_plugin/helper.rb @@ -0,0 +1,5 @@ +module WorkAssignmentPlugin::Helper + def display_submissions(work_assignment) + "Displaying submissions..." + end +end diff --git a/plugins/work_assignment/lib/work_assignment_plugin/work_assignment.rb b/plugins/work_assignment/lib/work_assignment_plugin/work_assignment.rb index c87f9b6..9887193 100644 --- a/plugins/work_assignment/lib/work_assignment_plugin/work_assignment.rb +++ b/plugins/work_assignment/lib/work_assignment_plugin/work_assignment.rb @@ -11,4 +11,15 @@ class WorkAssignmentPlugin::WorkAssignment < Folder def self.description _('Defines a work to be done by the members and receives their submissions about this work.') end + + def accept_comments? + true + end + + def to_html(options = {}) + lambda do + render :file => 'content_viewer/work_assignment.html.erb' + end + end + end diff --git a/plugins/work_assignment/views/cms/work_assignment_plugin/_work_assignment.html.erb b/plugins/work_assignment/views/cms/work_assignment_plugin/_work_assignment.html.erb new file mode 100644 index 0000000..8f3b090 --- /dev/null +++ b/plugins/work_assignment/views/cms/work_assignment_plugin/_work_assignment.html.erb @@ -0,0 +1,3 @@ +<%= render :partial => 'folder', :locals => {:f => f} %> + +Extra content... diff --git a/plugins/work_assignment/views/content_viewer/work_assignment.html.erb b/plugins/work_assignment/views/content_viewer/work_assignment.html.erb new file mode 100644 index 0000000..09a8b79 --- /dev/null +++ b/plugins/work_assignment/views/content_viewer/work_assignment.html.erb @@ -0,0 +1,8 @@ +<% extend WorkAssignmentPlugin::Helper %> + +<% unless @page.body.blank? %> +
<%= @page.body %>
+
+<% end %> + +<%= display_submissions(@page) %> -- libgit2 0.21.2