initial commit

This commit is contained in:
Connor Turland 2012-10-17 21:01:23 -04:00
parent 775d97cdbb
commit 3fa535b95b
73 changed files with 0 additions and 1011 deletions

View file

@ -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/

View file

@ -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/

View file

@ -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/

View file

@ -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/

View file

@ -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/

View file

@ -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/

View file

@ -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/

View file

@ -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/

View file

@ -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/

View file

@ -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/

View file

@ -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; }

View file

@ -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/

View file

@ -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; }

View file

@ -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/

View file

@ -1,2 +0,0 @@
class GroupgroupsController < ApplicationController
end

View file

@ -1,2 +0,0 @@
class GroupitemsController < ApplicationController
end

View file

@ -1,2 +0,0 @@
class GrouppeopleController < ApplicationController
end

View file

@ -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

View file

@ -1,2 +0,0 @@
class ItemitemsController < ApplicationController
end

View file

@ -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

View file

@ -1,2 +0,0 @@
class PersonitemsController < ApplicationController
end

View file

@ -1,2 +0,0 @@
module GroupgroupsHelper
end

View file

@ -1,2 +0,0 @@
module GroupitemsHelper
end

View file

@ -1,2 +0,0 @@
module GrouppeopleHelper
end

View file

@ -1,2 +0,0 @@
module GroupsHelper
end

View file

@ -1,2 +0,0 @@
module ItemitemsHelper
end

View file

@ -1,2 +0,0 @@
module PeopleHelper
end

View file

@ -1,2 +0,0 @@
module PersonitemsHelper
end

View file

@ -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

View file

@ -1,7 +0,0 @@
class Groupgroup < ActiveRecord::Base
belongs_to :group
belongs_to :parent_group, :class_name => "Group", :foreign_key => "parent_group_id"
end

View file

@ -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

View file

@ -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

View file

@ -1,7 +0,0 @@
class Itemitem < ActiveRecord::Base
belongs_to :item
belongs_to :parent_item, :class_name => "Item", :foreign_key => "parent_item_id"
end

View file

@ -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

View file

@ -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

View file

@ -1,8 +0,0 @@
<%= div_for group do %>
<p class="type">Group</p>
<%= image_tag "group.png", :class => 'icon', :size => '50x50' %>
<%= link_to group.name, group_url(group), :class => 'title' %>
<div class="desc"><p><%= group.desc %></p></div>
<%= link_to group.link, group.link, :class => 'link', :target => '_blank' %>
<% end %>

View file

@ -1,48 +0,0 @@
<%= form_for @group, url: group_url do |form| %>
<h3>Edit Group</h3>
<label for="group_name">Name</label>
<%= form.text_field :name, label: "Name", class: "name" %>
<label for="group_desc">Description</label>
<%= form.text_area :desc, label: "Description", class: "description", :rows => 5 %>
<label for="group_link">Link</label>
<%= form.text_field :link, label: "Link", class: "link" %>
<label for="group_city">City</label>
<%= form.text_field :city, class: "city" %>
<label for="group_province">Province/State</label>
<%= form.text_field :province, class: "province" %>
<label for="group_country">Country</label>
<%= form.text_field :country, class: "country" %>
<% if @ingroups1.count > 0 %>
<label for="ingroups1">Remove Parent Groups</label>
<%= select_tag "ingroups1", options_from_collection_for_select(@ingroups1, "id", "name"), { :multiple => true } %>
<% else %>
<div style="display:none">
<%= select_tag "ingroups1", options_from_collection_for_select(@ingroups1, "id", "name"), { :multiple => true } %>
</div>
<% end %>
<% if @outgroups1.count > 0 %>
<label for="outgroups1">Add Parent Groups</label>
<%= select_tag "outgroups1", options_from_collection_for_select(@outgroups1, "id", "name"), { :multiple => true } %>
<% else %>
<div style="display:none">
<%= select_tag "outgroups1", options_from_collection_for_select(@outgroups1, "id", "name"), { :multiple => true } %>
</div>
<% end %>
<% if @ingroups2.count > 0 %>
<label for="ingroups2">Remove Child Groups</label>
<%= select_tag "ingroups2", options_from_collection_for_select(@ingroups2, "id", "name"), { :multiple => true } %>
<% else %>
<div style="display:none">
<%= select_tag "ingroups2", options_from_collection_for_select(@ingroups2, "id", "name"), { :multiple => true } %>
</div>
<% end %>
<% if @outgroups2.count > 0 %>
<label for="outgroups2">Add Child Groups</label>
<%= select_tag "outgroups2", options_from_collection_for_select(@outgroups2, "id", "name"), { :multiple => true } %>
<% else %>
<div style="display:none">
<%= select_tag "outgroups2", options_from_collection_for_select(@outgroups2, "id", "name"), { :multiple => true } %>
</div>
<% end %>
<%= form.submit "Update", class: "update" %>
<% end %>

View file

@ -1,11 +0,0 @@
<h1>Groups</h1>
<div class="groups" id="groups">
<% @groups.each do |group| %>
<%= render group %>
<% end %>
<% if @groups.empty? %>
<p><br>Shucks, there are no groups.<p>
<% end %>
</div>
<div class="clearfloat"></div>

View file

@ -1,16 +0,0 @@
<%= form_for @group || Group.new, url: groups_path do |form| %>
<h3>Add Group</h3>
<label for="group_name">Name</label>
<%= form.text_field :name, label: "Name", class: "name" %>
<label for="group_desc">Description</label>
<%= form.text_area :desc, label: "Description", class: "description", :rows => 5 %>
<label for="group_link">Link</label>
<%= form.text_field :link, label: "Link", class: "link" %>
<label for="group_city">City</label>
<%= form.text_field :city, class: "city" %>
<label for="group_province">Province/State</label>
<%= form.text_field :province, class: "province" %>
<label for="group_country">Country</label>
<%= form.text_field :country, class: "country" %>
<%= form.submit "Add Group", class: "add" %>
<% end %>

View file

@ -1,86 +0,0 @@
<div class="focus">
<div class="focusleft">
<p>Group</p>
<%= image_tag "group.png", :class => 'icon', :size => '50x50' %>
</div>
<div class="focusmiddle">
<h1 class="title"><%= @group.name %> <%= link_to "[edit]", edit_group_path(@group) %></h1>
<div class="desc">
<p><%= @group.desc %></p>
</div>
</div>
<div class="focusright">
<p>Location</p>
<Span class="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 %>
</span>
<p>Link</p>
<%= link_to @group.link, @group.link, :class => 'link', :target => '_blank' %>
</div>
</div>
<div class="clearfloat nodemargin"></div>
<div class="groups">
<div class="divider"><%= @group.name %> is included in these groups</div>
<% @gparents.each do |group| %>
<%= render group %>
<% end %>
<% if @gparents.empty? %>
<p class="empty">Shucks, there are no groups.</p>
<% end %>
</div>
<div class="clearfloat"></div>
<div class="relatives" id="container">
<div class="divider"><%= @group.name %> is connected to these groups</div>
<div id="center-container">
<div id="infovis"></div>
</div>
<div id="right-container">
<div id="log"></div>
<div id="inner-details"></div>
</div>
</div>
<div class="clearfloat"></div>
<script>
json = <%= @relatives %>;
console.log(json);
$(document).ready(function() {
init();
});
</script>
<div class="groups">
<div class="divider"><%= @group.name %> includes these groups</div>
<% @gchildren.each do |group| %>
<%= render group %>
<% end %>
<% if @gchildren.empty? %>
<p class="empty">Shucks, there are no groups.</p>
<% end %>
</div>
<div class="clearfloat"></div>
<div class="people">
<div class="divider"><%= @group.name %> includes these people</div>
<% @pchildren.each do |people| %>
<%= render people %>
<% end %>
<% if @pchildren.empty? %>
<p class="empty">Shucks, there are no people.</p>
<% end %>
</div>
<div class="clearfloat"></div>
<div class="items">
<div class="divider"><%= @group.name %> includes these items</div>
<% @ichildren.each do |item| %>
<%= render item %>
<% end %>
<% if @ichildren.empty? %>
<p class="empty">Shucks, there are no items.</p>
<% end %>
</div>
<div class="clearfloat"></div>

View file

@ -1,7 +0,0 @@
<%= div_for person do %>
<p class="type">Person</p>
<%= image_tag "person.png", :class => 'icon', :size => '50x50' %>
<%= link_to person.name, person_url(person), :class => 'title' %>
<div class="desc"><p><%=person.desc %></p></div>
<%= link_to person.link, person.link, :class => 'link', :target => '_blank' %>
<% end %>

View file

@ -1,32 +0,0 @@
<%= form_for @person, url: person_url do |form| %>
<h3>Edit Person</h3>
<label for="person_name">Name</label>
<%= form.text_field :name, label: "Name", class: "name" %>
<label for="person_desc">Description</label>
<%= form.text_area :desc, label: "Description", class: "description", :rows => 5 %>
<label for="person_link">Link</label>
<%= form.text_field :link, label: "Link", class: "link" %>
<label for="person_city">City</label>
<%= form.text_field :city, class: "city" %>
<label for="person_province">Province/State</label>
<%= form.text_field :province, class: "province" %>
<label for="person_country">Country</label>
<%= form.text_field :country, class: "country" %>
<% if @ingroups.count > 0 %>
<label for="ingroups">Remove From Groups</label>
<%= select_tag "ingroups", options_from_collection_for_select(@ingroups, "id", "name"), { :multiple => true } %>
<% else %>
<div style="display:none">
<%= select_tag "ingroups", options_from_collection_for_select(@ingroups, "id", "name"), { :multiple => true } %>
</div>
<% end %>
<% if @outgroups.count > 0 %>
<label for="outgroups">Add To Groups</label>
<%= select_tag "outgroups", options_from_collection_for_select(@outgroups, "id", "name"), { :multiple => true } %>
<% else %>
<div style="display:none">
<%= select_tag "outgroups", options_from_collection_for_select(@outgroups, "id", "name"), { :multiple => true } %>
</div>
<% end %>
<%= form.submit "Update", class: "update" %>
<% end %>

View file

@ -1,11 +0,0 @@
<h1>People</h1>
<div class="people" id="people">
<% @people.each do |person| %>
<%= render person %>
<% end %>
<% if @people.empty? %>
<p><br>Shucks, there are no people.<p>
<% end %>
</div>
<div class="clearfloat"></div>

View file

@ -1,18 +0,0 @@
<%= form_for @person || Person.new, url: people_path do |form| %>
<h3>Add Person</h3>
<label for="person_name">Name</label>
<%= form.text_field :name, label: "Name", class: "name" %>
<label for="person_desc">Description</label>
<%= form.text_area :desc, label: "Description", class: "description", :rows => 5 %>
<label for="person_link">Link</label>
<%= form.text_field :link, label: "Link", class: "link" %>
<label for="ingroups">Add To Groups</label>
<%= select_tag "ingroups", options_from_collection_for_select(Group.all, "id", "name"), { :multiple => true } %>
<label for="person_city">City</label>
<%= form.text_field :city, class: "city" %>
<label for="person_province">Province/State</label>
<%= form.text_field :province, class: "province" %>
<label for="person_country">Country</label>
<%= form.text_field :country, class: "country" %>
<%= form.submit "Add Person", class: "add" %>
<% end %>

View file

@ -1,65 +0,0 @@
<div class="focus">
<div class="focusleft">
<p>Person</p>
<%= image_tag "person.png", :class => 'icon', :size => '50x50' %>
</div>
<div class="focusmiddle">
<h1 class="title"><%= @person.name %> <%= link_to "[edit]", edit_person_path(@person) %></h1>
<div class="desc">
<p><%= @person.desc %></p>
</div>
</div>
<div class="focusright">
<p>Location</p>
<Span class="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 %>
</span>
<p>Link</p>
<%= link_to @person.link, @person.link, :class => 'link', :target => '_blank' %>
</div>
<div class="clearfloat"></div>
</div>
<div class="clearfloat nodemargin"></div>
<div class="groups">
<div class="divider"><%= @person.name %> is included in these groups</div>
<% @gparents.each do |group| %>
<%= render group %>
<% end %>
<% if @gparents.empty? %>
<p class="empty">Shucks, there are no groups.</p>
<% end %>
</div>
<div class="clearfloat"></div>
<div class="relatives" id="container">
<div class="divider"><%= @person.name %> is connected to these people</div>
<div id="center-container">
<div id="infovis"></div>
</div>
<div id="right-container">
<div id="log"></div>
<div id="inner-details"></div>
</div>
</div>
<div class="clearfloat"></div>
<script>
json = <%= @relatives %>;
console.log(json);
$(document).ready(function() {
init();
});
</script>
<div class="items">
<div class="divider"><%= @person.name %> includes these items</div>
<% @ichildren.each do |item| %>
<%= render item %>
<% end %>
<% if @ichildren.empty? %>
<p class="empty">Shucks, there are no items.</p>
<% end %>
</div>
<div class="clearfloat"></div>

View file

@ -1,15 +0,0 @@
class CreatePeople < ActiveRecord::Migration
def change
create_table :people do |t|
t.text :name
t.text :desc
t.text :city
t.text :province
t.text :country
t.text :link
t.integer :user_id
t.timestamps
end
end
end

View file

@ -1,15 +0,0 @@
class CreateGroups < ActiveRecord::Migration
def change
create_table :groups do |t|
t.text :name
t.text :desc
t.text :city
t.text :province
t.text :country
t.text :link
t.integer :user_id
t.timestamps
end
end
end

View file

@ -1,10 +0,0 @@
class CreateGroupgroups < ActiveRecord::Migration
def change
create_table :groupgroups do |t|
t.integer :group_id
t.integer :parent_group_id
t.timestamps
end
end
end

View file

@ -1,10 +0,0 @@
class CreateGrouppeople < ActiveRecord::Migration
def change
create_table :grouppeople do |t|
t.integer :group_id
t.integer :person_id
t.timestamps
end
end
end

View file

@ -1,10 +0,0 @@
class CreateGroupitems < ActiveRecord::Migration
def change
create_table :groupitems do |t|
t.integer :group_id
t.integer :item_id
t.timestamps
end
end
end

View file

@ -1,10 +0,0 @@
class CreatePersonitems < ActiveRecord::Migration
def change
create_table :personitems do |t|
t.integer :person_id
t.integer :item_id
t.timestamps
end
end
end

View file

@ -1,10 +0,0 @@
class CreateItemitems < ActiveRecord::Migration
def change
create_table :itemitems do |t|
t.integer :item_id
t.integer :parent_item_id
t.timestamps
end
end
end

View file

@ -1,7 +0,0 @@
require 'test_helper'
class GroupgroupsControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

View file

@ -1,7 +0,0 @@
require 'test_helper'
class GroupitemsControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

View file

@ -1,7 +0,0 @@
require 'test_helper'
class GrouppeopleControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

View file

@ -1,7 +0,0 @@
require 'test_helper'
class GroupsControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

View file

@ -1,7 +0,0 @@
require 'test_helper'
class ItemitemsControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

View file

@ -1,7 +0,0 @@
require 'test_helper'
class PeopleControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

View file

@ -1,7 +0,0 @@
require 'test_helper'
class PersonitemsControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

View file

@ -1,7 +0,0 @@
require 'test_helper'
class GroupTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View file

@ -1,7 +0,0 @@
require 'test_helper'
class GroupgroupTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View file

@ -1,7 +0,0 @@
require 'test_helper'
class GroupitemTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View file

@ -1,7 +0,0 @@
require 'test_helper'
class GrouppersonTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View file

@ -1,4 +0,0 @@
require 'test_helper'
class GroupgroupsHelperTest < ActionView::TestCase
end

View file

@ -1,4 +0,0 @@
require 'test_helper'
class GroupitemsHelperTest < ActionView::TestCase
end

View file

@ -1,4 +0,0 @@
require 'test_helper'
class GrouppeopleHelperTest < ActionView::TestCase
end

View file

@ -1,4 +0,0 @@
require 'test_helper'
class GroupsHelperTest < ActionView::TestCase
end

View file

@ -1,4 +0,0 @@
require 'test_helper'
class ItemitemsHelperTest < ActionView::TestCase
end

View file

@ -1,4 +0,0 @@
require 'test_helper'
class PeopleHelperTest < ActionView::TestCase
end

View file

@ -1,4 +0,0 @@
require 'test_helper'
class PersonitemsHelperTest < ActionView::TestCase
end

View file

@ -1,7 +0,0 @@
require 'test_helper'
class ItemitemTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View file

@ -1,7 +0,0 @@
require 'test_helper'
class PersonTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View file

@ -1,7 +0,0 @@
require 'test_helper'
class PersonitemTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end