From 45d7d54c66e502a84dd3865fade341a53a8cc8ce Mon Sep 17 00:00:00 2001 From: danielvincent <danielgrippi@gmail.com> Date: Thu, 14 Oct 2010 16:23:29 -0700 Subject: [PATCH] added an empty message for the case of an aspect with no friends --- app/views/aspects/_empty_messages.haml | 18 ++++++++++++++++++ app/views/aspects/index.html.haml | 6 ++---- app/views/aspects/show.html.haml | 6 ++---- app/views/js/_websocket_js.haml | 6 +++--- app/views/shared/_aspect_friends.haml | 2 +- public/javascripts/view.js | 4 ++-- public/stylesheets/application.css | 16 +++++++++------- public/stylesheets/sass/application.sass | 15 ++++++++++----- 8 files changed, 47 insertions(+), 26 deletions(-) create mode 100644 app/views/aspects/_empty_messages.haml diff --git a/app/views/aspects/_empty_messages.haml b/app/views/aspects/_empty_messages.haml new file mode 100644 index 0000000000..28b97fab15 --- /dev/null +++ b/app/views/aspects/_empty_messages.haml @@ -0,0 +1,18 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +#no_posts.empty_message{:style => ("display:none" unless @posts.count == 0)} + .null_arrow ⇧ + %h3 Nobody has said anything yet. Get the conversation started! + +#no_friends.empty_message{:style => ("display:none" unless @friends.count == 0)} + %h3 You have no friends in this aspect. + + - unless (@aspect == :all) || (@aspect == :public) + %h4= link_to "Add a friend", "#add_request_pane", :class => "add_request_button" + - else + %h4= link_to "Add a friend", aspects_manage_path + + %h4= link_to "Invite a friend to join Diaspora!", "#invite_user_pane", :class => "invite_user_button", :class => "invite_user_button", :title => "Invite a friend" + diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index 23b1763e91..95c6c2dc45 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -8,14 +8,12 @@ - content_for :publish do = render "shared/publisher", :aspect_ids => :all, :broadcast => true += render 'aspects/empty_messages' + %ul#stream - for post in @posts = render type_partial(post), :post => post unless post.class == Album -#empty_message{:style => ("display:none" unless @posts.count == 0)} - .null_arrow ⇧ - %h3 Nobody has said anything yet. Get the conversation started! - #pagination = will_paginate @posts diff --git a/app/views/aspects/show.html.haml b/app/views/aspects/show.html.haml index 4e112155c4..d2cd9c04ca 100644 --- a/app/views/aspects/show.html.haml +++ b/app/views/aspects/show.html.haml @@ -8,14 +8,12 @@ - content_for :publish do = render "shared/publisher", :aspect_ids => :all += render 'aspects/empty_messages' + %ul#stream - for post in @posts = render type_partial(post), :post => post unless post.class == Album -#empty_message{:style => ("display:none" unless @posts.count == 0)} - .null_arrow ⇧ - %h3 Nobody has said anything yet. Get the conversation started! - #pagination = will_paginate @posts diff --git a/app/views/js/_websocket_js.haml b/app/views/js/_websocket_js.haml index addd0b053b..9bf801e0a5 100644 --- a/app/views/js/_websocket_js.haml +++ b/app/views/js/_websocket_js.haml @@ -39,7 +39,7 @@ function processRetraction(post_id){ $('#' + post_id ).fadeOut(500).remove(); if($("#stream")[0].childElementCount == 0){ - $("#empty_message").fadeIn(200); + $("#no_posts").fadeIn(200); } } @@ -68,8 +68,8 @@ ) }; - if( $("#empty_message").is(":visible") ){ - $("#empty_message").fadeOut(400, addPostToStream(html)).hide(); + if( $("#no_posts").is(":visible") ){ + $("#no_posts").fadeOut(400, addPostToStream(html)).hide(); } else { addPostToStream(html); } diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index dc0b991d34..508cabbb47 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -33,7 +33,7 @@ %br %h4 Invites - = link_to "Invite a friend!", "#invite_user_pane", :id => "invite_user_button", :class => "invite_user_button", :title => "Invite a friend" + = link_to "Invite a friend!", "#invite_user_pane", :class => "invite_user_button", :class => "invite_user_button", :title => "Invite a friend" %br = "You have #{@invites} invites." .yo{ :style => "display:none;"} diff --git a/public/javascripts/view.js b/public/javascripts/view.js index eec063bcdc..f79cace4df 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -27,8 +27,8 @@ $(document).ready(function(){ //buttons////// $("#add_aspect_button").fancybox({ 'titleShow' : false }); - $("#add_request_button").fancybox({ 'titleShow': false }); - $("#invite_user_button").fancybox({ 'titleShow': false }); + $(".add_request_button").fancybox({ 'titleShow': false }); + $(".invite_user_button").fancybox({ 'titleShow': false }); $(".add_request_button").fancybox({ 'titleShow': false }); $("input[type='submit']").addClass("button"); diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 7bb190bb6a..2cf862f1a4 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -752,20 +752,22 @@ ul#settings_nav { padding: 3px; border-bottom: 1px solid #cccccc; } #left_pane ul li a:hover:after { - content: " ►"; } + content: " ►"; } -#empty_message { +.empty_message { margin-top: 12px; + margin-bottom: 12px; text-align: center; color: #777777; margin-left: 70px; - padding: 1em; - padding-top: 0; - width: 80%; + padding: 2em; + padding-bottom: 0.7em; + width: 520px; border: 2px dashed #777777; border-radius: 5px; } - #empty_message h3 { + .empty_message h3 { color: #777777; } - #empty_message .null_arrow { + .empty_message .null_arrow { + margin-top: -14px; font-size: 80px; display: inline-block; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index dfc6662c6c..f1b8bee941 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -979,11 +979,12 @@ ul#settings_nav &:hover &:after - :content " ►" + :content " ►" -#empty_message +.empty_message :margin :top 12px + :bottom 12px :text :align center @@ -993,13 +994,17 @@ ul#settings_nav :margin :left 70px - :padding 1em - :top 0 - :width 80% + :padding 2em + :bottom 0.7em + + :width 520px + :border 2px dashed #777 :border-radius 5px .null_arrow + :margin + :top -14px :font :size 80px :display inline-block -- GitLab