diff --git a/app/assets/javascripts/groupgroups.js.coffee b/app/assets/javascripts/groupgroups.js.coffee deleted file mode 100644 index 76156794..00000000 --- a/app/assets/javascripts/groupgroups.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# 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/ diff --git a/app/assets/javascripts/groupitems.js.coffee b/app/assets/javascripts/groupitems.js.coffee deleted file mode 100644 index 76156794..00000000 --- a/app/assets/javascripts/groupitems.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# 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/ diff --git a/app/assets/javascripts/grouppeople.js.coffee b/app/assets/javascripts/grouppeople.js.coffee deleted file mode 100644 index 76156794..00000000 --- a/app/assets/javascripts/grouppeople.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# 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/ diff --git a/app/assets/javascripts/groups.js.coffee b/app/assets/javascripts/groups.js.coffee deleted file mode 100644 index 76156794..00000000 --- a/app/assets/javascripts/groups.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# 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/ diff --git a/app/assets/javascripts/itemitems.js.coffee b/app/assets/javascripts/itemitems.js.coffee deleted file mode 100644 index 76156794..00000000 --- a/app/assets/javascripts/itemitems.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# 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/ diff --git a/app/assets/javascripts/people.js.coffee b/app/assets/javascripts/people.js.coffee deleted file mode 100644 index d3ccc53e..00000000 --- a/app/assets/javascripts/people.js.coffee +++ /dev/null @@ -1,5 +0,0 @@ -# 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/ - - diff --git a/app/assets/javascripts/personitems.js.coffee b/app/assets/javascripts/personitems.js.coffee deleted file mode 100644 index 76156794..00000000 --- a/app/assets/javascripts/personitems.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# 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/ diff --git a/app/assets/stylesheets/groupgroups.css.scss b/app/assets/stylesheets/groupgroups.css.scss deleted file mode 100644 index 57fcedd0..00000000 --- a/app/assets/stylesheets/groupgroups.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the Groupgroups controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/groupitems.css.scss b/app/assets/stylesheets/groupitems.css.scss deleted file mode 100644 index cc031fc6..00000000 --- a/app/assets/stylesheets/groupitems.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the Groupitems controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/grouppeople.css.scss b/app/assets/stylesheets/grouppeople.css.scss deleted file mode 100644 index 3e2ccadf..00000000 --- a/app/assets/stylesheets/grouppeople.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the Grouppeople controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/groups.css.scss b/app/assets/stylesheets/groups.css.scss deleted file mode 100644 index a0d9f13a..00000000 --- a/app/assets/stylesheets/groups.css.scss +++ /dev/null @@ -1,24 +0,0 @@ -// Place all the styles related to the groups controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -.group { display:block; float:left; position:relative; width:170px; height:300px; padding:10px 10px 10px 35px; background:#d1d1d1; border-radius:15px; margin:30px 0 30px 50px; color:#000; } - -.group .type {position: absolute; -color: white; -top: -22px; -right: 0; -font-weight: bold; -font-size: 20px; -line-height: 24px;} - -.group .icon { position:absolute; top:135px; left:-25px; } - -.group .title { font-size:22px; line-height:25px; display:block; border-bottom:2px solid #000; padding-bottom:5px; } - -.group .desc { font-style:italic; } -.group .desc h3 { font-style:normal; margin-top:5px; } - -.group .link { position:absolute; width:170px; top:295px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } - - diff --git a/app/assets/stylesheets/itemitems.css.scss b/app/assets/stylesheets/itemitems.css.scss deleted file mode 100644 index 65a12222..00000000 --- a/app/assets/stylesheets/itemitems.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the Itemitems controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/people.css.scss b/app/assets/stylesheets/people.css.scss deleted file mode 100644 index afbc7cd0..00000000 --- a/app/assets/stylesheets/people.css.scss +++ /dev/null @@ -1,22 +0,0 @@ -// Place all the styles related to the people controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -.person { display:block; float:left; position:relative; width:170px; height:300px; padding:10px 10px 10px 35px; background:#d1d1d1; border-radius:15px; margin:30px 0 30px 50px; color:#000; } - -.person .type {position: absolute; -color: white; -top: -22px; -right: 0; -font-weight: bold; -font-size: 20px; -line-height: 24px;} - -.person .icon { position:absolute; top:135px; left:-25px; } - -.person .title { font-size:22px; line-height:25px; display:block; border-bottom:2px solid #000; padding-bottom:5px; } - -.person .desc { font-style:italic; } -.person .desc h3 { font-style:normal; margin-top:5px; } - -.person .link { position:absolute; width:170px; top:295px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } \ No newline at end of file diff --git a/app/assets/stylesheets/personitems.css.scss b/app/assets/stylesheets/personitems.css.scss deleted file mode 100644 index b4511e20..00000000 --- a/app/assets/stylesheets/personitems.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the Personitems controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/groupgroups_controller.rb b/app/controllers/groupgroups_controller.rb deleted file mode 100644 index 94841926..00000000 --- a/app/controllers/groupgroups_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class GroupgroupsController < ApplicationController -end diff --git a/app/controllers/groupitems_controller.rb b/app/controllers/groupitems_controller.rb deleted file mode 100644 index 65ad0926..00000000 --- a/app/controllers/groupitems_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class GroupitemsController < ApplicationController -end diff --git a/app/controllers/grouppeople_controller.rb b/app/controllers/grouppeople_controller.rb deleted file mode 100644 index f820d69f..00000000 --- a/app/controllers/grouppeople_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class GrouppeopleController < ApplicationController -end diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb deleted file mode 100644 index ace56529..00000000 --- a/app/controllers/groups_controller.rb +++ /dev/null @@ -1,135 +0,0 @@ -class GroupsController < ApplicationController - - before_filter :require_user, only: [:new, :create, :edit, :update] - - respond_to :html, :js, :json - - # GET /groups - def index - @user = current_user - @groups = Group.all - - respond_with(@groups) - end - - # Get /groups/new - def new - @group = Group.new - @user = current_user - - respond_with(@group) - end - - # GET /groups/:id - def show - @group = Group.find(params[:id]) - - @gparents = @group.parent_groups - @relatives = @group.as_json.html_safe - @gchildren = @group.child_groups - @pchildren = @group.people - @ichildren = @group.items - - respond_to do |format| - format.html { respond_with(@group, @gparents, @gchildren, @pchildren, @ichildren) } - format.json { respond_with(@relatives) } - end - end - - # POST /groups - def create - - @user = current_user - @group = Group.create(params[:group]) - @group.user = @user - - @group.save - - respond_to do |format| - format.html { respond_with(@user, location: group_url(@group)) } - format.js { respond_with(@group) } - end - - end - - # GET /groups/:id/edit - def edit - @group = Group.find_by_id(params[:id]) - - @ingroups1 = @group.parent_groups - if @ingroups1.count > 0 - @outgroups1 = Group.find(:all, :conditions => ['id not in (?) AND id != ?', @ingroups1.map(&:id), @group.id]) - else - @outgroups1 = Group.find(:all, :conditions => ['id != ?', @group.id]) - end - - @ingroups2 = @group.child_groups - if @ingroups2.count > 0 - @outgroups2 = Group.find(:all, :conditions => ['id not in (?) AND id != ?', @ingroups2.map(&:id), @group.id]) - else - @outgroups2 = Group.find(:all, :conditions => ['id != ?', @group.id]) - end - - respond_with(@group, @ingroups1, @outgroups1, @ingroups2, @outgroups2) - end - - # PUT /groups/:id - def update - @user = current_user - @group = Group.find_by_id(params[:id]) - @group.attributes = params[:group] if @group - - @group.save if @group - - #remove the selected parent groups - if params[:ingroups1] - @ingroups1 = params[:ingroups1] - @ingroups1.each do |g| - @connection = Groupgroup.where("parent_group_id = ? AND group_id = ?", g, @group.id).first - @connection.delete - end - end - - #remove the selected parent groups - if params[:outgroups1] - @outgroups1 = params[:outgroups1] - @outgroups1.each do |g| - belongs = Groupgroup.new - belongs.parent_group_id = g - belongs.group_id = @group.id - belongs.save! - end - end - - #remove the selected children groups - if params[:ingroups2] - @ingroups2 = params[:ingroups2] - @ingroups2.each do |g| - @connection = Groupgroup.where("parent_group_id = ? AND group_id = ?", @group.id, g).first - @connection.delete - end - end - - #add the selected children groups - if params[:outgroups2] - @outgroups2 = params[:outgroups2] - @outgroups2.each do |g| - belongs = Groupgroup.new - belongs.parent_group_id = @group.id - belongs.group_id = g - belongs.save! - end - end - - respond_with(@user, location: group_url(@group)) do |format| - end - end - - # DELETE /groups/:id - def destroy - @group = Group.find_by_id(params[:id]) - - @group.delete - end - -end diff --git a/app/controllers/itemitems_controller.rb b/app/controllers/itemitems_controller.rb deleted file mode 100644 index ee80c7b8..00000000 --- a/app/controllers/itemitems_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class ItemitemsController < ApplicationController -end diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb deleted file mode 100644 index 3eff0c88..00000000 --- a/app/controllers/people_controller.rb +++ /dev/null @@ -1,119 +0,0 @@ -class PeopleController < ApplicationController - - before_filter :require_user, only: [:new, :create, :edit, :update] - - respond_to :html, :js, :json - - # GET /people - def index - @user = current_user - @people = Person.all - - respond_with(@people) - end - - # Get /people/new - def new - @person = Person.new - @user = current_user - - respond_with(@person) - end - - # GET /people/:id - def show - @person = Person.find(params[:id]) - - @gparents = @person.groups - @relatives = @person.as_json.html_safe - @ichildren = @person.items - - respond_to do |format| - format.html { respond_with(@person, @gparents, @ichildren) } - format.json { respond_with(@relatives) } - end - end - - # POST /people - def create - - @user = current_user - @person = Person.new() - @person.name = params[:person][:name] - @person.desc = params[:person][:desc] - @person.link = params[:person][:link] - @person.city = params[:person][:city] - @person.province = params[:person][:province] - @person.country = params[:person][:country] - @person.user = @user - - @person.save - - if params[:ingroups] - @groups = Group.find(params[:ingroups]) - @groups.each do |g| - belongs = Groupperson.new - belongs.group_id = g.id - belongs.person_id = @person.id - belongs.save! - end - end - - respond_to do |format| - format.html { respond_with(@user, location: person_url(@person)) } - format.js { respond_with(@person) } - end - - end - - # GET /people/:id/edit - def edit - @person = Person.find_by_id(params[:id]) - - @ingroups = @person.groups - if @ingroups.count > 0 - @outgroups = Group.find(:all, :conditions => ['id not in (?)', @ingroups.map(&:id)]) - else - @outgroups = Group.all - end - - respond_with(@person, @ingroups, @outgroups) - end - - # PUT /people/:id - def update - @user = current_user - @person = Person.find_by_id(params[:id]) - @person.attributes = params[:person] if @person - @person.save if @person - - if params[:ingroups] - @ingroups = params[:ingroups] - @ingroups.each do |g| - @connection = Groupperson.where("group_id = ? AND person_id = ?", g, @person.id).first - @connection.delete - end - end - - if params[:outgroups] - @outgroups = params[:outgroups] - @outgroups.each do |g| - belongs = Groupperson.new - belongs.group_id = g - belongs.person_id = @person.id - belongs.save! - end - end - - respond_with(@user, location: person_url(@person)) do |format| - end - end - - # DELETE /people/:id - def destroy - @person = Person.find_by_id(params[:id]) - - @person.delete - end - -end diff --git a/app/controllers/personitems_controller.rb b/app/controllers/personitems_controller.rb deleted file mode 100644 index 37b811b2..00000000 --- a/app/controllers/personitems_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class PersonitemsController < ApplicationController -end diff --git a/app/helpers/groupgroups_helper.rb b/app/helpers/groupgroups_helper.rb deleted file mode 100644 index 88e3e7d0..00000000 --- a/app/helpers/groupgroups_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module GroupgroupsHelper -end diff --git a/app/helpers/groupitems_helper.rb b/app/helpers/groupitems_helper.rb deleted file mode 100644 index 498b3ca8..00000000 --- a/app/helpers/groupitems_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module GroupitemsHelper -end diff --git a/app/helpers/grouppeople_helper.rb b/app/helpers/grouppeople_helper.rb deleted file mode 100644 index 7b023bbe..00000000 --- a/app/helpers/grouppeople_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module GrouppeopleHelper -end diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb deleted file mode 100644 index c091b2fc..00000000 --- a/app/helpers/groups_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module GroupsHelper -end diff --git a/app/helpers/itemitems_helper.rb b/app/helpers/itemitems_helper.rb deleted file mode 100644 index 1475bf83..00000000 --- a/app/helpers/itemitems_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module ItemitemsHelper -end diff --git a/app/helpers/people_helper.rb b/app/helpers/people_helper.rb deleted file mode 100644 index b682fbf1..00000000 --- a/app/helpers/people_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module PeopleHelper -end diff --git a/app/helpers/personitems_helper.rb b/app/helpers/personitems_helper.rb deleted file mode 100644 index ce10b1b3..00000000 --- a/app/helpers/personitems_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module PersonitemsHelper -end diff --git a/app/models/group.rb b/app/models/group.rb deleted file mode 100644 index 02e5c94e..00000000 --- a/app/models/group.rb +++ /dev/null @@ -1,56 +0,0 @@ -class Group < ActiveRecord::Base - -belongs_to :user - -has_many :groupgroup_c, :foreign_key => 'parent_group_id', :class_name => 'Groupgroup' -has_many :groupgroup_p, :foreign_key => 'group_id', :class_name => 'Groupgroup' - -has_many :synapses1, :class_name => 'Synapse', :foreign_key => 'node1_id', :conditions => {:category => 'Group'} -has_many :synapses2, :class_name => 'Synapse', :foreign_key => 'node2_id', :conditions => {:category => 'Group'} -has_many :groups1, :through => :synapses2, :source => :group1 -has_many :groups2, :through => :synapses1, :source => :group2 - - def synapses - synapses1 + synapses2 - end - - def relatives - groups1 + groups2 - end - -has_many :grouppeople -has_many :groupitems - -has_many :child_groups, :through => :groupgroup_c, :source => :group -has_many :parent_groups, :through => :groupgroup_p, :source => :parent_group - -has_many :people, :through => :grouppeople -has_many :items, :through => :groupitems - - def as_json - Jbuilder.encode do |json| - @single = Array.new - @single.push(self) - @groups = @single + self.relatives - - json.array!(@groups) do |group| - json.adjacencies group.synapses2.delete_if{|synapse| not @groups.include?(Group.find_by_id(synapse.node1_id))} do |json, synapse| - json.nodeTo synapse.node1_id - json.nodeFrom synapse.node2_id - - @synapsedata = Hash.new - @synapsedata['desc'] = synapse.desc - json.data @synapsedata - end - - @groupdata = Hash.new - @groupdata['desc'] = group.desc - @groupdata['link'] = group.link - json.data @groupdata - json.id group.id - json.name group.name - end - end - end - -end diff --git a/app/models/groupgroup.rb b/app/models/groupgroup.rb deleted file mode 100644 index d641f18d..00000000 --- a/app/models/groupgroup.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Groupgroup < ActiveRecord::Base - -belongs_to :group - -belongs_to :parent_group, :class_name => "Group", :foreign_key => "parent_group_id" - -end diff --git a/app/models/groupitem.rb b/app/models/groupitem.rb deleted file mode 100644 index 72b2c0e5..00000000 --- a/app/models/groupitem.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Groupitem < ActiveRecord::Base - -belongs_to :group, :class_name => "Group", :foreign_key => "group_id" - -belongs_to :item, :class_name => "Item", :foreign_key => "item_id" - -end diff --git a/app/models/groupperson.rb b/app/models/groupperson.rb deleted file mode 100644 index 2b11c0d4..00000000 --- a/app/models/groupperson.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Groupperson < ActiveRecord::Base - -belongs_to :group, :class_name => "Group", :foreign_key => "group_id" - -belongs_to :person, :class_name => "Person", :foreign_key => "person_id" - -end diff --git a/app/models/itemitem.rb b/app/models/itemitem.rb deleted file mode 100644 index 8d7d9fee..00000000 --- a/app/models/itemitem.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Itemitem < ActiveRecord::Base - -belongs_to :item - -belongs_to :parent_item, :class_name => "Item", :foreign_key => "parent_item_id" - -end diff --git a/app/models/person.rb b/app/models/person.rb deleted file mode 100644 index 192ea15e..00000000 --- a/app/models/person.rb +++ /dev/null @@ -1,50 +0,0 @@ -class Person < ActiveRecord::Base - -belongs_to :user - -has_many :grouppeople -has_many :personitems - -has_many :groups, :through => :grouppeople -has_many :items, :through => :personitems - -has_many :synapses1, :class_name => 'Synapse', :foreign_key => 'node1_id', :conditions => {:category => 'Person'} -has_many :synapses2, :class_name => 'Synapse', :foreign_key => 'node2_id', :conditions => {:category => 'Person'} -has_many :people1, :through => :synapses2, :source => :person1 -has_many :people2, :through => :synapses1, :source => :person2 - - def synapses - synapses1 + synapses2 - end - - def relatives - people1 + people2 - end - - def as_json - Jbuilder.encode do |json| - @single = Array.new - @single.push(self) - @people = @single + self.relatives - - json.array!(@people) do |person| - json.adjacencies person.synapses2.delete_if{|synapse| not @people.include?(Person.find_by_id(synapse.node1_id))} do |json, synapse| - json.nodeTo synapse.node1_id - json.nodeFrom synapse.node2_id - - @synapsedata = Hash.new - @synapsedata['desc'] = synapse.desc - json.data @synapsedata - end - - @persondata = Hash.new - @persondata['desc'] = person.desc - @persondata['link'] = person.link - json.data @persondata - json.id person.id - json.name person.name - end - end - end - -end diff --git a/app/models/personitem.rb b/app/models/personitem.rb deleted file mode 100644 index 54d96bf1..00000000 --- a/app/models/personitem.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Personitem < ActiveRecord::Base - -belongs_to :person, :class_name => "Person", :foreign_key => "person_id" - -belongs_to :item, :class_name => "Item", :foreign_key => "item_id" - -end diff --git a/app/views/groups/_group.html.erb b/app/views/groups/_group.html.erb deleted file mode 100644 index a2c03975..00000000 --- a/app/views/groups/_group.html.erb +++ /dev/null @@ -1,8 +0,0 @@ - -<%= div_for group do %> -
Group
- <%= image_tag "group.png", :class => 'icon', :size => '50x50' %> - <%= link_to group.name, group_url(group), :class => 'title' %> -<%= group.desc %>
Shucks, there are no groups.
- <% end %> -
Group
- <%= image_tag "group.png", :class => 'icon', :size => '50x50' %> -<%= @group.desc %>
-Location
- - <%= @group.city %><% if @group.city != "" && @group.province != "" %>, <% end %><%= @group.province %><% if (@group.city != "" || @group.province != "") && @group.country != "" %>, <% end %><%= @group.country %> - <% if (@group.city == "" && @group.province == "" && @group.country == "") %>Earth<% end %> - -Link
- <%= link_to @group.link, @group.link, :class => 'link', :target => '_blank' %> -Shucks, there are no groups.
- <% end %> -Shucks, there are no groups.
- <% end %> -Shucks, there are no people.
- <% end %> -Shucks, there are no items.
- <% end %> -Person
- <%= image_tag "person.png", :class => 'icon', :size => '50x50' %> - <%= link_to person.name, person_url(person), :class => 'title' %> -<%=person.desc %>
Shucks, there are no people.
- <% end %> -
Person
- <%= image_tag "person.png", :class => 'icon', :size => '50x50' %> -<%= @person.desc %>
-Location
- - <%= @person.city %><% if @person.city != "" && @person.province != "" %>, <% end %><%= @person.province %><% if (@person.city != "" || @person.province != "") && @person.country != "" %>, <% end %><%= @person.country %> - <% if (@person.city == "" && @person.province == "" && @person.country == "") %>Earth<% end %> - -Link
- <%= link_to @person.link, @person.link, :class => 'link', :target => '_blank' %> -Shucks, there are no groups.
- <% end %> -Shucks, there are no items.
- <% end %> -