From 091cdd6f94ba3a7f8aafa7c908047edff55451bd Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Wed, 10 Aug 2011 16:23:33 -0700 Subject: [PATCH] Basic contacts index page on the mobile site --- app/controllers/contacts_controller.rb | 1 + app/views/contacts/index.mobile.haml | 24 ++++++++++++++++++++++++ app/views/people/_person.mobile.haml | 8 +------- public/stylesheets/sass/mobile.sass | 3 +++ 4 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 app/views/contacts/index.mobile.haml diff --git a/app/controllers/contacts_controller.rb b/app/controllers/contacts_controller.rb index 96c33807c..c87aeec93 100644 --- a/app/controllers/contacts_controller.rb +++ b/app/controllers/contacts_controller.rb @@ -22,6 +22,7 @@ class ContactsController < ApplicationController respond_to do |format| format.html { @contacts = sort_and_paginate_profiles(@contacts) } + format.mobile { @contacts = sort_and_paginate_profiles(@contacts) } format.json { @people = Person.joins(:contacts => :aspect_memberships). where(:contacts => { :user_id => current_user.id }, diff --git a/app/views/contacts/index.mobile.haml b/app/views/contacts/index.mobile.haml new file mode 100644 index 000000000..7760daa20 --- /dev/null +++ b/app/views/contacts/index.mobile.haml @@ -0,0 +1,24 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +- content_for :page_title do + = t('.title') + +- content_for :head do + = include_javascripts :people + +#section_header + %h2 + = t('.title') + +.span-18.last + #people_stream.stream.contacts + - if @contacts.size > 0 + - for contact in @contacts + = render 'people/person', :person => contact.person, :contact => contact + = will_paginate @contacts + - else + %h3.no_contacts + = t('.no_contacts') + diff --git a/app/views/people/_person.mobile.haml b/app/views/people/_person.mobile.haml index 4982b4542..7c9c4696d 100644 --- a/app/views/people/_person.mobile.haml +++ b/app/views/people/_person.mobile.haml @@ -3,11 +3,6 @@ -# the COPYRIGHT file. .stream_element{:id => person.id} - - .right{:style=>"display:inline;"} - = render :partial => 'people/relationship_action', - :locals => { :person => person, :contact => contact, :request => request} - = person_image_link(person) .content @@ -15,5 +10,4 @@ =person_link(person) .info - = person.diaspora_handle - + = link_to person.diaspora_handle, person_path(person), :class => 'black' diff --git a/public/stylesheets/sass/mobile.sass b/public/stylesheets/sass/mobile.sass index c0e1f7604..32f0609fb 100755 --- a/public/stylesheets/sass/mobile.sass +++ b/public/stylesheets/sass/mobile.sass @@ -126,6 +126,9 @@ a p :margin 0 auto :line-height 1.4em + + .black + :color #333 .reshare .content