Sha256: e187f3b53771225ffd883e4038e474d8f9827297c18c38cb25fdc09a50754aae

Contents?: true

Size: 1.25 KB

Versions: 2

Compression:

Stored size: 1.25 KB

Contents

-total = Notification.pending.for(authenticated(User)).exclude_message.count
-notifications = Notification.for(authenticated(User)).exclude_message.order(:read_date,Sequel.desc(:id)).limit(5).all
li.dropdown.hidden-xs
  a.notifications-menu data-toggle="dropdown" href="" 
    i.tm-icon.zmdi.zmdi-notifications
    -unless total == 0
      i.notification-count.tmn-counts.animated.bounceIn #{total}
  .dropdown-menu.dropdown-menu-lg.pull-right
    .listview
      .lv-header
        | Notificaciones
        ul.actions
          li.dropdown
            -unless total == 0
              a data-clear="notification" role="button" onclick="read_all_notifications(#{{Notification.pending.for(authenticated(User)).exclude_message.all.collect { |notification| notification.id}}});this.onclick='';" 
                i.zmdi.zmdi-check-all
      .lv-body#notifications-list
        -for notification in notifications
          == slim :'sinatra-hexacta/notifications/item', locals: { :notification => notification }
      a.lv-footer href="/notifications" Ver todas


javascript:
  function read_all_notifications(ids) {
    $.ajax({
      url: '/notifications',
      type: 'POST',
      data: { ids : ids },
      success: function(result) {
        location.reload();
      }
    });
  }

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sinatra-hexacta-0.0.2 lib/sinatra/views/notifications/widget.slim
sinatra-hexacta-0.0.1 lib/sinatra/views/notifications/widget.slim