HDInnovations / UNIT3D-Community-Edition

Private Torrent Tracker Built With Laravel, Livewire and AlpineJS.
GNU Affero General Public License v3.0
1.97k stars 378 forks source link

Expand automatically or show an icon when new news are posted #409

Closed shlandturtle closed 6 years ago

shlandturtle commented 6 years ago

Issue Type

End User Info

-- UNIT3D Version: 1.8.5

Increase probability of users to read the news.

When new news are posted, users have no way of knowing unless they expand the banner on the front page. We believe not many bother to do this on regular basis. Therefore some sort of way to show if new news are posted would be great. This should work on per-user basis, otherwise this would be very irritating.

Two ideas how this could work:

  1. Automatically expand the banner when new news are posted, until the specific user has collapsed it back manually (which would in this case mean the user has checked it as read), after which the banner would work the same way as it currently does. I.e. it only expands automatically on new news that are newer than the user has marked read by collapsing the view manually. Once manually collapsed, it will not expand automatically until another news article is posted.
  2. Put a visible icon somewhere on the banner (thinking something along the lines of 🚨) that is activated when there are new news that the user has not checked as read. After expanding the view, have a button "mark as read", which would deactivate the icon for the specific user until next news article.

Also worth thinking is that when the article is marked as read by the user, there probably is no value in keeping the banner/box on the front page for that user. News articles can still be read from the link at the bottom of the pages if the user wants to do that.

Side effects

Server would need to store the info whether specific users have seen the latest news or not. As an another method this probably could be implemented with cookies?

HDVinnie commented 6 years ago

https://github.com/HDInnovations/UNIT3D/blob/df4d1b984c2dcd24f564f7767086802b899764b9/resources/views/blocks/news.blade.php#L3

already does something like this

        @if(auth()->user()->updated_at->getTimestamp() < $a->created_at->getTimestamp())
            <div class="panel panel-danger">
                <div class="panel-heading">
                    <h4 class="text-center">
                        <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion"
                           href="#collapse4" style="color:#fff">{{ trans('blocks.new-news') }}</a>
                    </h4>
                </div>
                @else
                    <div class="panel panel-success">
                        <div class="panel-heading">
                            <h4 class="text-center">
                                <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion"
                                   href="#collapse4" style="color:#fff">{{ trans('blocks.check-news') }}</a>
                            </h4>
                        </div>
                        @endif
HDVinnie commented 6 years ago

The issue is:

@if(auth()->user()->updated_at->getTimestamp() < $a->created_at->getTimestamp())

would probably be more effective as

@if(auth()->user()->last_login->getTimestamp() < $a->created_at->getTimestamp())

shlandturtle commented 6 years ago

So have I understood correctly that the banners color is changed as determined in css when user has been active before article creation time? Therefore it would mean that the theme has not worked correctly, and it seems that the dark theme indeed does not have input for panel-danger / panel-success. New themes for 1.8.6, but it does seem that in it too the dark-base css has the same color for panel-danger and panel-success. Or am I missing something here?

Obviously the coloring does solve what I was looking for. As long as it works.

HDVinnie commented 6 years ago

Screen_Shot_2018-10-04_at_9.04.53_AM.png