added an empty message for the case of an aspect with no friends
This commit is contained in:
parent
750b4b4388
commit
45d7d54c66
8 changed files with 47 additions and 26 deletions
18
app/views/aspects/_empty_messages.haml
Normal file
18
app/views/aspects/_empty_messages.haml
Normal file
|
|
@ -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"
|
||||||
|
|
||||||
|
|
@ -8,14 +8,12 @@
|
||||||
- content_for :publish do
|
- content_for :publish do
|
||||||
= render "shared/publisher", :aspect_ids => :all, :broadcast => true
|
= render "shared/publisher", :aspect_ids => :all, :broadcast => true
|
||||||
|
|
||||||
|
= render 'aspects/empty_messages'
|
||||||
|
|
||||||
%ul#stream
|
%ul#stream
|
||||||
- for post in @posts
|
- for post in @posts
|
||||||
= render type_partial(post), :post => post unless post.class == Album
|
= 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
|
#pagination
|
||||||
= will_paginate @posts
|
= will_paginate @posts
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,12 @@
|
||||||
- content_for :publish do
|
- content_for :publish do
|
||||||
= render "shared/publisher", :aspect_ids => :all
|
= render "shared/publisher", :aspect_ids => :all
|
||||||
|
|
||||||
|
= render 'aspects/empty_messages'
|
||||||
|
|
||||||
%ul#stream
|
%ul#stream
|
||||||
- for post in @posts
|
- for post in @posts
|
||||||
= render type_partial(post), :post => post unless post.class == Album
|
= 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
|
#pagination
|
||||||
= will_paginate @posts
|
= will_paginate @posts
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
function processRetraction(post_id){
|
function processRetraction(post_id){
|
||||||
$('#' + post_id ).fadeOut(500).remove();
|
$('#' + post_id ).fadeOut(500).remove();
|
||||||
if($("#stream")[0].childElementCount == 0){
|
if($("#stream")[0].childElementCount == 0){
|
||||||
$("#empty_message").fadeIn(200);
|
$("#no_posts").fadeIn(200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -68,8 +68,8 @@
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
if( $("#empty_message").is(":visible") ){
|
if( $("#no_posts").is(":visible") ){
|
||||||
$("#empty_message").fadeOut(400, addPostToStream(html)).hide();
|
$("#no_posts").fadeOut(400, addPostToStream(html)).hide();
|
||||||
} else {
|
} else {
|
||||||
addPostToStream(html);
|
addPostToStream(html);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
%br
|
%br
|
||||||
|
|
||||||
%h4 Invites
|
%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
|
%br
|
||||||
= "You have #{@invites} invites."
|
= "You have #{@invites} invites."
|
||||||
.yo{ :style => "display:none;"}
|
.yo{ :style => "display:none;"}
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ $(document).ready(function(){
|
||||||
|
|
||||||
//buttons//////
|
//buttons//////
|
||||||
$("#add_aspect_button").fancybox({ 'titleShow' : false });
|
$("#add_aspect_button").fancybox({ 'titleShow' : false });
|
||||||
$("#add_request_button").fancybox({ 'titleShow': false });
|
$(".add_request_button").fancybox({ 'titleShow': false });
|
||||||
$("#invite_user_button").fancybox({ 'titleShow': false });
|
$(".invite_user_button").fancybox({ 'titleShow': false });
|
||||||
$(".add_request_button").fancybox({ 'titleShow': false });
|
$(".add_request_button").fancybox({ 'titleShow': false });
|
||||||
|
|
||||||
$("input[type='submit']").addClass("button");
|
$("input[type='submit']").addClass("button");
|
||||||
|
|
|
||||||
|
|
@ -752,20 +752,22 @@ ul#settings_nav {
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
border-bottom: 1px solid #cccccc; }
|
border-bottom: 1px solid #cccccc; }
|
||||||
#left_pane ul li a:hover:after {
|
#left_pane ul li a:hover:after {
|
||||||
content: " ►"; }
|
content: " ►"; }
|
||||||
|
|
||||||
#empty_message {
|
.empty_message {
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
|
margin-bottom: 12px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #777777;
|
color: #777777;
|
||||||
margin-left: 70px;
|
margin-left: 70px;
|
||||||
padding: 1em;
|
padding: 2em;
|
||||||
padding-top: 0;
|
padding-bottom: 0.7em;
|
||||||
width: 80%;
|
width: 520px;
|
||||||
border: 2px dashed #777777;
|
border: 2px dashed #777777;
|
||||||
border-radius: 5px; }
|
border-radius: 5px; }
|
||||||
#empty_message h3 {
|
.empty_message h3 {
|
||||||
color: #777777; }
|
color: #777777; }
|
||||||
#empty_message .null_arrow {
|
.empty_message .null_arrow {
|
||||||
|
margin-top: -14px;
|
||||||
font-size: 80px;
|
font-size: 80px;
|
||||||
display: inline-block; }
|
display: inline-block; }
|
||||||
|
|
|
||||||
|
|
@ -979,11 +979,12 @@ ul#settings_nav
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
&:after
|
&:after
|
||||||
:content " ►"
|
:content " ►"
|
||||||
|
|
||||||
#empty_message
|
.empty_message
|
||||||
:margin
|
:margin
|
||||||
:top 12px
|
:top 12px
|
||||||
|
:bottom 12px
|
||||||
:text
|
:text
|
||||||
:align center
|
:align center
|
||||||
|
|
||||||
|
|
@ -993,13 +994,17 @@ ul#settings_nav
|
||||||
|
|
||||||
:margin
|
:margin
|
||||||
:left 70px
|
:left 70px
|
||||||
:padding 1em
|
:padding 2em
|
||||||
:top 0
|
:bottom 0.7em
|
||||||
:width 80%
|
|
||||||
|
:width 520px
|
||||||
|
|
||||||
:border 2px dashed #777
|
:border 2px dashed #777
|
||||||
:border-radius 5px
|
:border-radius 5px
|
||||||
|
|
||||||
.null_arrow
|
.null_arrow
|
||||||
|
:margin
|
||||||
|
:top -14px
|
||||||
:font
|
:font
|
||||||
:size 80px
|
:size 80px
|
||||||
:display inline-block
|
:display inline-block
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue