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 %>
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' %><%=item.desc %>
Link
- <%= link_to @item.link, @item.link, :class => 'link' %> + <%= link_to @item.link, @item.link, :class => 'link', :target => '_blank' %>
Shucks, there is nothing in ISSAD.
+
Shucks, there is nothing in metamap.
<% end %>
diff --git a/app/views/main/userobjects.html.erb b/app/views/main/userobjects.html.erb new file mode 100644 index 00000000..b3b4691f --- /dev/null +++ b/app/views/main/userobjects.html.erb @@ -0,0 +1,9 @@ +
You haven't added any objects yet.
+ <% end %> +
<%=person.desc %>
Location
<%= @person.city %>, <%= @person.province %>, <%= @person.country %>Link
- <%= link_to @person.link, @person.link, :class => 'link' %> + <%= link_to @person.link, @person.link, :class => 'link', :target => '_blank' %> diff --git a/config/routes.rb b/config/routes.rb index 3fc82085..f77b4f38 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,6 +2,8 @@ ISSAD::Application.routes.draw do root to: 'main#home', via: :get + match 'my-objects', to: 'main#userobjects', via: :get, as: :userobjects + resource :user resource :session