From 9c0f12a55acffdfe9ae74ba6f62dcb3f17496909 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Mon, 8 Oct 2012 01:45:44 -0400 Subject: [PATCH] updated location styling and output. increased card size. made links open in new tabs. removed create account link. added ability to see list of your personal objects that you've added. --- app/assets/stylesheets/application.css | 3 +- app/assets/stylesheets/groups.css.scss | 48 +++++++++++++------------- app/assets/stylesheets/items.css.scss | 46 ++++++++++++------------ app/assets/stylesheets/people.css.scss | 44 +++++++++++------------ app/controllers/groups_controller.rb | 2 +- app/controllers/items_controller.rb | 3 +- app/controllers/main_controller.rb | 9 +++++ app/controllers/people_controller.rb | 2 +- app/views/groups/_group.html.erb | 2 +- app/views/groups/show.html.erb | 7 ++-- app/views/items/_item.html.erb | 2 +- app/views/items/show.html.erb | 2 +- app/views/layouts/application.html.erb | 2 +- app/views/main/home.html.erb | 2 +- app/views/main/userobjects.html.erb | 9 +++++ app/views/people/_person.html.erb | 2 +- app/views/people/show.html.erb | 2 +- config/routes.rb | 2 ++ 18 files changed, 107 insertions(+), 82 deletions(-) create mode 100644 app/views/main/userobjects.html.erb diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 33613cf6..d3bfe851 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -54,7 +54,7 @@ input[type="submit"] { margin-top:5px; } .focus { position:fixed; top:0; left:0; width:90%; z-index:10; display: block; min-width:533px; margin: 50px 50px 25px 50px; background: #D1D1D1; border-radius: 20px; color:#000; border:1px solid #000; } .focusleft, .focusmiddle, .focusright { display:block; float:left; } .focusleft { width:20%; min-width:70px; text-align:center; } -.focusmiddle { display:block; width:49%; min-height:100px; border-right:2px solid #000; border-left:2px solid #000;} +.focusmiddle { display:block; width:49%; min-height:115px; border-right:2px solid #000; border-left:2px solid #000;} .focusright { width:30%; min-width:150px; } .focus .focusleft p { font-weight:bold; font-size:16px; line-height:20px; padding:10px 0 5px 0; } .focus .focusright p { font-weight:bold; font-size:16px; line-height:20px; padding:10px 0 5px 10px; } @@ -62,6 +62,7 @@ input[type="submit"] { margin-top:5px; } .focus .title { font-size:22px; line-height:25px; border-bottom:2px solid #000; padding:10px; } .focus .desc { font-style:italic; padding:10px; } .focus .desc h3 { font-style:normal; } +.focus .location { padding-left:10px; } .focus .link { padding:0 0 0 10px; display:block; width:90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .divider { margin: 20px 50px 20px 50px; border-bottom:2px solid #FFF; } diff --git a/app/assets/stylesheets/groups.css.scss b/app/assets/stylesheets/groups.css.scss index 5e6387aa..a0d9f13a 100644 --- a/app/assets/stylesheets/groups.css.scss +++ b/app/assets/stylesheets/groups.css.scss @@ -1,24 +1,24 @@ -// 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:155px; height:265px; 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:117px; 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; overflow-y:scroll;} -.group .desc h3 { font-style:normal; margin-top:5px; } - -.group .link { position:absolute; width:155px; top:260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } - - +// 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/items.css.scss b/app/assets/stylesheets/items.css.scss index 2948309f..ad18e634 100644 --- a/app/assets/stylesheets/items.css.scss +++ b/app/assets/stylesheets/items.css.scss @@ -1,23 +1,23 @@ -// Place all the styles related to the items controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -.item { display:block; float:left; position:relative; width:155px; height:265px; padding:10px 10px 10px 35px; background:#d1d1d1; border-radius:15px; margin:30px 0 30px 50px; color:#000; } - -.item .type {position: absolute; -color: white; -top: -22px; -right: 0; -font-weight: bold; -font-size: 20px; -line-height: 24px;} - -.item .icon { position:absolute; top:117px; left:-25px; } - -.item .title { font-size:22px; line-height:25px; display:block; border-bottom:2px solid #000; padding-bottom:5px; } - -.item .desc { font-style:italic; overflow-y:scroll;} -.item .desc h3 { font-style:normal; margin-top:5px; } - -.item .link { position:absolute; width:155px; top:260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } - +// Place all the styles related to the items controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ + +.item { 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; } + +.item .type {position: absolute; +color: white; +top: -22px; +right: 0; +font-weight: bold; +font-size: 20px; +line-height: 24px;} + +.item .icon { position:absolute; top:135px; left:-25px; } + +.item .title { font-size:22px; line-height:25px; display:block; border-bottom:2px solid #000; padding-bottom:5px; } + +.item .desc { font-style:italic; } +.item .desc h3 { font-style:normal; margin-top:5px; } + +.item .link { position:absolute; width:170px; top:295px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } + diff --git a/app/assets/stylesheets/people.css.scss b/app/assets/stylesheets/people.css.scss index 3a98b641..afbc7cd0 100644 --- a/app/assets/stylesheets/people.css.scss +++ b/app/assets/stylesheets/people.css.scss @@ -1,22 +1,22 @@ -// 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:155px; height:265px; 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:117px; 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; overflow-y:scroll;} -.person .desc h3 { font-style:normal; margin-top:5px; } - -.person .link { position:absolute; width:155px; top:260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } \ No newline at end of file +// 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/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 2259df53..cb521080 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -117,7 +117,7 @@ class GroupsController < ApplicationController end end - respond_with(@user, location: restore(default: root_url)) do |format| + respond_with(@user, location: restore(default: group_url(@group))) do |format| end end diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index 03300eb4..ae024dd5 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -176,8 +176,9 @@ class ItemsController < ApplicationController end end - respond_with(@user, location: restore(default: root_url)) do |format| + respond_with(@user, location: restore(default: item_url(@item))) do |format| end + end # DELETE /actions/:id diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index de3e4546..2505dd54 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -1,5 +1,6 @@ class MainController < ApplicationController + before_filter :require_user, only: [:userobjects] respond_to :html, :js, :json def home @@ -9,5 +10,13 @@ class MainController < ApplicationController respond_with(@all) end + + def userobjects + @user = current_user + + @all = @user.groups + @user.people + @user.items + + respond_with(@all) + end end diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 3c74bedf..1a3f0f29 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -101,7 +101,7 @@ class PeopleController < ApplicationController end end - respond_with(@user, location: restore(default: root_url)) do |format| + respond_with(@user, location: restore(default: person_url(@person))) do |format| end end diff --git a/app/views/groups/_group.html.erb b/app/views/groups/_group.html.erb index d8a4f249..a2c03975 100644 --- a/app/views/groups/_group.html.erb +++ b/app/views/groups/_group.html.erb @@ -4,5 +4,5 @@ <%= image_tag "group.png", :class => 'icon', :size => '50x50' %> <%= link_to group.name, group_url(group), :class => 'title' %>

<%= group.desc %>

- <%= link_to group.link, group.link, :class => 'link' %> + <%= link_to group.link, group.link, :class => 'link', :target => '_blank' %> <% end %> \ No newline at end of file diff --git a/app/views/groups/show.html.erb b/app/views/groups/show.html.erb index 51d6b881..7084b9bb 100644 --- a/app/views/groups/show.html.erb +++ b/app/views/groups/show.html.erb @@ -11,9 +11,12 @@

Location

- <%= @group.city %>, <%= @group.province %>, <%= @group.country %> + + <%= @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' %> + <%= link_to @group.link, @group.link, :class => 'link', :target => '_blank' %>
diff --git a/app/views/items/_item.html.erb b/app/views/items/_item.html.erb index ed4e3370..861321e3 100644 --- a/app/views/items/_item.html.erb +++ b/app/views/items/_item.html.erb @@ -3,5 +3,5 @@ <%= image_tag item.item_category.icon, :class => 'icon', :size => '50x50' %> <%= link_to item.name, item_url(item), :class => 'title' %>

<%=item.desc %>

- <%= link_to item.link, item.link, :class => 'link' %> + <%= link_to item.link, item.link, :class => 'link', :target => '_blank' %> <% end %> \ No newline at end of file diff --git a/app/views/items/show.html.erb b/app/views/items/show.html.erb index b34a8721..5666381d 100644 --- a/app/views/items/show.html.erb +++ b/app/views/items/show.html.erb @@ -12,7 +12,7 @@

Link

- <%= link_to @item.link, @item.link, :class => 'link' %> + <%= link_to @item.link, @item.link, :class => 'link', :target => '_blank' %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 38b60bd6..dbb53b24 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -14,7 +14,6 @@ <% unless authenticated? %>