Merge branch 'cxt_course' of http://git.trustie.net/jacknudt/trustieforge into cxt_course
Conflicts: app/helpers/application_helper.rbcxt_course
commit
86516df88a
@ -0,0 +1,3 @@
|
|||||||
|
# Place all the behaviors and hooks related to the matching controller here.
|
||||||
|
# All this logic will automatically be available in application.js.
|
||||||
|
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
@ -0,0 +1,3 @@
|
|||||||
|
// Place all the styles related to the shield_activities controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,24 +1,32 @@
|
|||||||
class OrgSubfieldsController < ApplicationController
|
class OrgSubfieldsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
@subfield = OrgSubfield.create(:name => params[:name])
|
@subfield = OrgSubfield.create(:name => params[:name])
|
||||||
@organization = Organization.find(params[:organization_id])
|
@organization = Organization.find(params[:organization_id])
|
||||||
@organization.org_subfields << @subfield
|
@organization.org_subfields << @subfield
|
||||||
@subfield.update_attributes(:priority => @subfield.id, :field_type => params[:field_type])
|
@subfield.update_attributes(:priority => @subfield.id, :field_type => params[:field_type])
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def show
|
||||||
@subfield = OrgSubfield.find(params[:id])
|
@org_subfield = OrgSubfield.find(params[:id])
|
||||||
@organization = Organization.find(@subfield.organization_id)
|
@organization = @org_subfield.organization.id
|
||||||
@subfield.destroy
|
@messages = []
|
||||||
end
|
@messages << @org_subfield.org_document_comments
|
||||||
|
@messages << @org_subfield.messages
|
||||||
def update
|
@messages.sort{|a, b| b.updated_at <=> a.updated_at}
|
||||||
@subfield = OrgSubfield.find(params[:id])
|
respond_to do |format|
|
||||||
@organization = Organization.find(@subfield.organization_id)
|
format.html{render :layout => 'base_org'}
|
||||||
@subfield.update_attributes(:name => params[:name])
|
end
|
||||||
end
|
end
|
||||||
|
def destroy
|
||||||
def show
|
@subfield = OrgSubfield.find(params[:id])
|
||||||
|
@organization = Organization.find(@subfield.organization_id)
|
||||||
end
|
@subfield.destroy
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
@subfield = OrgSubfield.find(params[:id])
|
||||||
|
@organization = Organization.find(@subfield.organization_id)
|
||||||
|
@subfield.update_attributes(:name => params[:name])
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,43 @@
|
|||||||
|
class ShieldActivitiesController < ApplicationController
|
||||||
|
def create
|
||||||
|
if params[:org_id]
|
||||||
|
if params[:project_id]
|
||||||
|
ShieldActivity.create(:container_type => 'Organization', :container_id => params[:org_id].to_i, :shield_type => 'Project', :shield_id => params[:project_id].to_i)
|
||||||
|
elsif params[:course_id]
|
||||||
|
ShieldActivity.create(:container_type => 'Organization', :container_id => params[:org_id].to_i, :shield_type => 'Course', :shield_id => params[:course_id].to_i)
|
||||||
|
end
|
||||||
|
elsif params[:user_id]
|
||||||
|
if params[:project_id]
|
||||||
|
ShieldActivity.create(:container_type => 'User', :container_id => params[:user_id].to_i, :shield_type => 'Project', :shield_id => params[:project_id].to_i)
|
||||||
|
elsif params[:course_id]
|
||||||
|
ShieldActivity.create(:container_type => 'User', :container_id => params[:user_id].to_i, :shield_type => 'Course', :shield_id => params[:course_id].to_i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def show_acts
|
||||||
|
if params[:org_id]
|
||||||
|
if params[:project_id]
|
||||||
|
ShieldActivity.where("container_type='Organization' and container_id=#{params[:org_id].to_i} and shield_type='Project' and shield_id=#{params[:project_id]}").each do |act|
|
||||||
|
act.destroy
|
||||||
|
end
|
||||||
|
# ShieldActivity.create(:container_type => 'Organization', :container_id => params[:org_id].to_i, :shield_type => 'Project', :shield_id => params[:project_id].to_i)
|
||||||
|
elsif params[:course_id]
|
||||||
|
ShieldActivity.where("container_type='Organization' and container_id=#{params[:org_id].to_i} and shield_type='Course' and shield_id=#{params[:course_id]}").each do |act|
|
||||||
|
act.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elsif params[:user_id]
|
||||||
|
if params[:project_id]
|
||||||
|
ShieldActivity.where("container_type='User' and container_id=#{params[:user_id].to_i} and shield_type='Project' and shield_id=#{params[:project_id]}").each do |act|
|
||||||
|
act.destroy
|
||||||
|
end
|
||||||
|
# ShieldActivity.create(:container_type => 'Organization', :container_id => params[:org_id].to_i, :shield_type => 'Project', :shield_id => params[:project_id].to_i)
|
||||||
|
elsif params[:course_id]
|
||||||
|
ShieldActivity.where("container_type='User' and container_id=#{params[:user_id].to_i} and shield_type='Course' and shield_id=#{params[:course_id]}").each do |act|
|
||||||
|
act.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue