diff --git a/Changelog.md b/Changelog.md index d3baa742d..cbc752990 100644 --- a/Changelog.md +++ b/Changelog.md @@ -93,6 +93,7 @@ This is disabled by default since it requires the installation of additional pac * Drop unneeded and too open crossdomain.xml * Fix hidden aspect dropdown on getting started page [#5407](https://github.com/diaspora/diaspora/pulls/5407) * Fix a few issues on Bootstrap pages [#5401](https://github.com/diaspora/diaspora/pull/5401) +* Improve handling of the `more` link on mobile stream pages [#5400](https://github.com/diaspora/diaspora/pull/5400) ## Features * Don't pull jQuery from a CDN by default [#5105](https://github.com/diaspora/diaspora/pull/5105) diff --git a/app/assets/stylesheets/mobile/mobile.css.scss b/app/assets/stylesheets/mobile/mobile.css.scss index 29a5b9a71..65497f600 100644 --- a/app/assets/stylesheets/mobile/mobile.css.scss +++ b/app/assets/stylesheets/mobile/mobile.css.scss @@ -192,7 +192,7 @@ h3 { } } -.more-link { +.more-link, .no-more-posts { -webkit-box-shadow: inset 0 1px 5px #777, 0 1px 1px rgba(0,0,0,0.4); display: block; text-align: center; @@ -204,10 +204,12 @@ h3 { color: rgba(220,220,220,0.8); } - h1 { + h1, h2 { color: $text-grey; padding: 20px; - text-shadow: 0 2px 0 #fff; } } + text-shadow: 0 2px 0 #fff; + } +} .info { color: #ccc; diff --git a/app/views/people/show.mobile.haml b/app/views/people/show.mobile.haml index 3794a2c94..ad142c8e7 100644 --- a/app/views/people/show.mobile.haml +++ b/app/views/people/show.mobile.haml @@ -22,10 +22,7 @@ - else #main_stream.stream = render 'shared/stream', :posts => @stream.stream_posts - #pagination - %a.more-link.paginate{:href => next_page_path} - %h1 - = t("more") + = render 'shared/stream_more_button' - else #main_stream .dull @@ -33,4 +30,3 @@ = t('.ignoring', :name => @person.first_name) - elsif user_signed_in? && (current_user.person != @person) = t('.has_not_shared_with_you_yet', :name => @person.first_name) - diff --git a/app/views/shared/_stream_more_button.mobile.haml b/app/views/shared/_stream_more_button.mobile.haml new file mode 100644 index 000000000..20f5f879a --- /dev/null +++ b/app/views/shared/_stream_more_button.mobile.haml @@ -0,0 +1,15 @@ +-if @stream.stream_posts.length == 15 + #pagination + %a.more-link.paginate{:href => next_page_path} + %h1 + = t("more") +-elsif params[:max_time].present? + #pagination + %div.no-more-posts + %h2 + = t("stream_helper.no_more_posts") +-else + #pagination + %div.no-more-posts + %h2 + = t("stream_helper.no_posts_yet") diff --git a/app/views/streams/main_stream.mobile.haml b/app/views/streams/main_stream.mobile.haml index 7aeb527fe..2cd8c0dbc 100644 --- a/app/views/streams/main_stream.mobile.haml +++ b/app/views/streams/main_stream.mobile.haml @@ -10,8 +10,4 @@ #main_stream.stream = render 'shared/stream', :posts => @stream.stream_posts - -if @stream.stream_posts.length > 0 - #pagination - %a.more-link.paginate{:href => next_page_path} - %h1 - = t("more") + = render 'shared/stream_more_button' diff --git a/app/views/tags/show.mobile.haml b/app/views/tags/show.mobile.haml index a99d0387c..581af773a 100644 --- a/app/views/tags/show.mobile.haml +++ b/app/views/tags/show.mobile.haml @@ -7,9 +7,5 @@ #main_stream.stream = render 'shared/stream', :posts => @stream.stream_posts - -if @stream.stream_posts.length > 0 - #pagination - %a.more-link.paginate{:href => next_page_path} - %h1 - = t("more") + = render 'shared/stream_more_button' diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 515745b8a..9826d2716 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -1188,6 +1188,8 @@ en: one: "Show one more comment" other: "Show %{count} more comments" hide_comments: "Hide all comments" + no_more_posts: "You have reached the end of the stream." + no_posts_yet: "There are no posts yet." tags: show: diff --git a/features/support/env.rb b/features/support/env.rb index dca7bceed..cd22cd58d 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -2,6 +2,10 @@ require 'rubygems' prefork = proc do ENV["RAILS_ENV"] ||= "test" + + # Have all rests run with english browser locale + ENV['LANG'] = 'C' + require 'cucumber/rails' require 'capybara/rails'