Merge pull request #4369 from Team-D/feature/4347-add_photo_link_to_leftsidebar

Feature/4347 add photo link to leftsidebar
This commit is contained in:
Jonne Haß 2013-08-19 04:46:31 -07:00
commit c0b86dcf99
9 changed files with 65 additions and 27 deletions

View file

@ -55,7 +55,7 @@
* Uncheck 'make contacts visible to each other' by default when adding new aspect. [#4343](https://github.com/diaspora/diaspora/issues/4343)
* Add possibility to ask for Bitcoin donations [#4375](https://github.com/diaspora/diaspora/pull/4375)
* Remove posts, comments and private conversations from the mobile site. [#4408](https://github.com/diaspora/diaspora/pull/4408) [#4409](https://github.com/diaspora/diaspora/pull/4409)
* Added a link to user photos and thumbnails are shown in the left side bar [#4347](https://github.com/diaspora/diaspora/issues/4347)
# 0.1.1.0

View file

@ -2068,6 +2068,19 @@ ul#requested-scopes
.scope-description
:display none
.item_count
:width 16px
:line-height 16px
:text-align center
@include border-radius(4px)
:color #999
:background
:color #eee
:display inline-block
:font
:size 11px
:weight 700
ul.left_nav
:margin 0
:bottom 15px
@ -2100,9 +2113,7 @@ ul.left_nav
> a:not(.sub_selected)
:color #333
.contact_count
:font
:weight 700
.item_count
:color #666
a.aspect_selector,
@ -2155,22 +2166,9 @@ ul.left_nav
:display none
&:hover
@include opacity(1)
.contact_count
:width 16px
:line-height 16px
:text-align center
@include border-radius(4px)
:margin-top 1px
:color #999
:background
:color #eee
:display inline-block
:font
:size 11px
a.home_selector
.contact_count
.item_count
:float right
ul.sub_nav

View file

@ -297,7 +297,7 @@ ul.comments li.posted .controls .delete {
left: 10px;
}
ul.left_nav .contact_count, ul.left_nav .edit {
ul.left_nav .item_count, ul.left_nav .edit {
float: left;
}

View file

@ -81,7 +81,7 @@ class PeopleController < ApplicationController
@aspect = :profile
@stream = Stream::Person.new(current_user, @person, :max_time => max_time)
@profile = @person.profile
@photos = Photo.where(author_id: @profile.id).order('created_at desc')
unless params[:format] == "json" # hovercard
if current_user
@block = current_user.blocks.where(:person_id => @person.id).first

View file

@ -14,7 +14,7 @@ class PhotosController < ApplicationController
def index
@post_type = :photos
@person = Person.find_by_guid(params[:person_id])
@photos = Photo.where(author_id: @person.id).order('created_at desc')
if @person
@contact = current_user.contact_for(@person)

View file

@ -6,7 +6,7 @@
%li.all_aspects{:class => ("active" if params["set"] != "all" && params["set"] != "only_sharing" && !@spotlight)}
%a.home_selector{:href => contacts_path, :class => ("sub_selected" if params["a_id"])}
= t('contacts.index.my_contacts')
.contact_count
.item_count
= my_contacts_count
%ul.sub_nav
@ -15,7 +15,7 @@
.icons-check_yes_ok{:class => ("invisible" if params["a_id"].to_i != aspect.id) }
%a.community_aspect_selector{:href => contacts_path(:a_id => aspect.id)}
= aspect
.contact_count
.item_count
= aspect.contacts.size
%li
@ -24,7 +24,7 @@
%li.all_contacts{:class => ("active" if params["set"] == "all" || params["set"] == "only_sharing")}
%a.home_selector{:href => contacts_path(:set => "all"), :class => ("sub_selected" if params["set"] == "only_sharing")}
= t('contacts.index.all_contacts')
.contact_count
.item_count
= all_contacts_count
%ul.sub_nav
@ -32,6 +32,6 @@
.icons-check_yes_ok{:class => ("invisible" if params["set"] == "only_sharing")}
%a.community_aspect_selector{:href => contacts_path(:set => "only_sharing")}
= t('contacts.index.only_sharing_with_me')
.contact_count
.item_count
= only_sharing_count

View file

@ -19,6 +19,7 @@
%br
-if contact.sharing? || person == current_user.person
%ul#profile_information
- unless person.bio.blank?
%li
%h4
@ -43,6 +44,16 @@
%h4
=t('.born')
= birthday_format(person.birthday)
%li
- if @photos.present?
%h4
= t('_photos')
.item_count
= "#{@photos.count}"
- @photos.limit(3).each do |photo|
= image_tag(photo.url(:thumb_small))
%br
= link_to t('layouts.header.view_all'), person_photos_path(person)
%br
%br

View file

@ -0,0 +1,27 @@
@javascript
Feature: show photos
Background:
Given following users exist:
| username | email |
| Bob Jones | bob@bob.bob |
| Alice Smith | alice@alice.alice |
| Robert Grimm | robert@grimm.grimm |
And I sign in as "robert@grimm.grimm"
Given I expand the publisher
And I have turned off jQuery effects
And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
And I press "Share"
Scenario: see my own photos
When I am on "robert@grimm.grimm"'s page
And I follow "View all"
Then I should be on person_photos page
Scenario: I cannot see photos of people who don't share with me
When I sign in as "alice@alice.alice"
And I am on "robert@grimm.grimm"'s page
Then I should not see "photos" within "div#profile"

View file

@ -1,6 +1,8 @@
module NavigationHelpers
def path_to(page_name)
case page_name
when /^person_photos page$/
person_photos_path(@me.person)
when /^the home(?: )?page$/
stream_path
when /^step (\d)$/