diff --git a/app/views/cms/upload_files.html.erb b/app/views/cms/upload_files.html.erb
index 30f5d2b..43bf141 100644
--- a/app/views/cms/upload_files.html.erb
+++ b/app/views/cms/upload_files.html.erb
@@ -20,7 +20,7 @@
<%= _('Uploading files to %s') % content_tag('code', @target) %>
<% if @plugins.dispatch(:upload_files_extra_contents).size == 0 %>
- <% form_for('uploaded_file', :url => { :action => 'upload_files' }, :html => {:multipart => true}) do |f| %>
+ <%= form_for('uploaded_file', :url => { :action => 'upload_files' }, :html => {:multipart => true}) do |f| %>
<%= render :partial => 'upload_file_form', :locals => { :size => '45'} %>
diff --git a/plugins/work_assignment/lib/work_assignment_plugin.rb b/plugins/work_assignment/lib/work_assignment_plugin.rb
index f3481ea..c283ea4 100644
--- a/plugins/work_assignment/lib/work_assignment_plugin.rb
+++ b/plugins/work_assignment/lib/work_assignment_plugin.rb
@@ -54,7 +54,17 @@ class WorkAssignmentPlugin < Noosfero::Plugin
def upload_files_extra_contents
proc do
- render :partial => 'work_assignment_form', :locals => { :size => '45'}
+ if params[:parent_id]
+ parent_id = params[:parent_id]
+ path = Article.find_by_id(parent_id).path.split("/")[0]
+ content = profile.articles.find_by_path(path)
+
+ if content.type == "WorkAssignmentPlugin::WorkAssignment"
+ render :partial => 'work_assignment_form', :locals => { :size => '45'}
+ end
+ else
+ render :partial => 'upload_file_form', :locals => { :size => '45'}
+ end
end
end
--
libgit2 0.21.2