notifications 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/app/assets/stylesheets/notifications.scss +1 -1
- data/app/controllers/notifications/notifications_controller.rb +1 -1
- data/app/models/notification.rb +2 -0
- data/app/views/notifications/notifications/_notification.html.erb +3 -1
- data/app/views/notifications/notifications/index.html.erb +2 -1
- data/lib/notifications.rb +2 -0
- data/lib/notifications/version.rb +1 -1
- metadata +15 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: cffadc0f064a8af337efc15ff1785d0f899b1db8
         | 
| 4 | 
            +
              data.tar.gz: 560ab10dcbaf32cb0a592c38bcf319407532eaed
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 93f88e81fa12af6f7a80009f85a93fb0deb738934a39da3fd6acf7703147f964bfba88e19134c35acf1a411ac829d30956f1cfc0d3ae2845497e47b0f82594e8
         | 
| 7 | 
            +
              data.tar.gz: 829ee50a228eae89a67554574a365786c8a87dc55ff9c92dc9b92afd7c16493eafc6d3db5bd4ece7f590a3bb298bcb71f44d167e50898f93244504060a7a7786
         | 
    
        data/README.md
    CHANGED
    
    | @@ -4,6 +4,10 @@ Rails mountable Notification for any applications. | |
| 4 4 |  | 
| 5 5 | 
             
            [](https://badge.fury.io/rb/notifications) [](https://travis-ci.org/rails-engine/notifications) [](https://codeclimate.com/github/rails-engine/notifications) [](https://codecov.io/github/rails-engine/notifications?branch=master) [](http://inch-ci.org/github/rails-engine/notifications?branch=master)
         | 
| 6 6 |  | 
| 7 | 
            +
            ## Example:
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            <img width="650" alt="2016-03-29 10 48 16" src="https://cloud.githubusercontent.com/assets/5518/14096499/d7555aaa-f59b-11e5-87f0-e4728db903c8.png">
         | 
| 10 | 
            +
             | 
| 7 11 | 
             
            ## Installation
         | 
| 8 12 |  | 
| 9 13 | 
             
            ```ruby
         | 
| @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            module Notifications
         | 
| 2 2 | 
             
              class NotificationsController < Notifications::ApplicationController
         | 
| 3 3 | 
             
                def index
         | 
| 4 | 
            -
                  @notifications = current_user.notifications.includes(:actor).order('id desc')
         | 
| 4 | 
            +
                  @notifications = current_user.notifications.includes(:actor).order('id desc').page(params[:page])
         | 
| 5 5 |  | 
| 6 6 | 
             
                  unread_ids = []
         | 
| 7 7 | 
             
                  @notifications.each do |n|
         | 
    
        data/app/models/notification.rb
    CHANGED
    
    
| @@ -1,6 +1,7 @@ | |
| 1 | 
            +
            <%= cache(['notifications', Notifications::VERSION, notification]) do %>
         | 
| 1 2 | 
             
            <div id="notification-<%= notification.id %>"
         | 
| 2 3 | 
             
                 data-id="<%= notification.id %>"
         | 
| 3 | 
            -
                 class="media notification | 
| 4 | 
            +
                 class="media notification notification-<%= notification.notify_type %><%= ' unread' if !notification.read? %>">
         | 
| 4 5 | 
             
              <div class="media-left">
         | 
| 5 6 | 
             
                <%= link_to image_tag(notification.actor_avatar_url), notification.actor_profile_url, title: notification.actor_name, class: 'user-avatar' %>
         | 
| 6 7 | 
             
              </div>
         | 
| @@ -11,3 +12,4 @@ | |
| 11 12 | 
             
                <%= l notification.created_at, format: :short %>
         | 
| 12 13 | 
             
              </div>
         | 
| 13 14 | 
             
            </div>
         | 
| 15 | 
            +
            <% end %>
         | 
| @@ -3,10 +3,11 @@ | |
| 3 3 | 
             
                <%= t('notifications.all_notifications') %>
         | 
| 4 4 |  | 
| 5 5 | 
             
                <span class="pull-xs-right">
         | 
| 6 | 
            -
                  <%= link_to t('notifications.clean_all'), notifications.clean_notifications_path, class: 'btn btn- | 
| 6 | 
            +
                  <%= link_to t('notifications.clean_all'), notifications.clean_notifications_path, class: 'btn btn-sm btn-secondary', method: 'delete' %>
         | 
| 7 7 | 
             
                </span>
         | 
| 8 8 | 
             
              </div>
         | 
| 9 9 | 
             
              <div class="list">
         | 
| 10 10 | 
             
                <%= render @notifications %>
         | 
| 11 11 | 
             
              </div>
         | 
| 12 | 
            +
              <%= will_paginate @notifications %>
         | 
| 12 13 | 
             
            </div>
         | 
    
        data/lib/notifications.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: notifications
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Jason Lee
         | 
| @@ -30,6 +30,20 @@ dependencies: | |
| 30 30 | 
             
                - - "<"
         | 
| 31 31 | 
             
                  - !ruby/object:Gem::Version
         | 
| 32 32 | 
             
                    version: '5.1'
         | 
| 33 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 34 | 
            +
              name: will_paginate
         | 
| 35 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 36 | 
            +
                requirements:
         | 
| 37 | 
            +
                - - ">="
         | 
| 38 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 39 | 
            +
                    version: 3.0.0
         | 
| 40 | 
            +
              type: :runtime
         | 
| 41 | 
            +
              prerelease: false
         | 
| 42 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 43 | 
            +
                requirements:
         | 
| 44 | 
            +
                - - ">="
         | 
| 45 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 46 | 
            +
                    version: 3.0.0
         | 
| 33 47 | 
             
            description: Rails mountable Notification for any applications.
         | 
| 34 48 | 
             
            email:
         | 
| 35 49 | 
             
            - huacnlee@gmail.com
         |