notifly 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7dcf76340dfa95ff24b649a6bdf908dbbbfaafa2
4
- data.tar.gz: ee70a15bd945e508b4bbe4c81701bb2f3df0a1e1
3
+ metadata.gz: 65940f99d804f1a248f21de334ca2cfd2eb749c3
4
+ data.tar.gz: d4b365df60e2712776ee90b72eed3feee96e0905
5
5
  SHA512:
6
- metadata.gz: 62ad12ece6bc6fcdd874c83e26e7092ca7c4b65693f45c5bcaf8f8aa5d0762b0541b60acc23b6cbd27509bd881b0318256017171fb07a1711720b0b20810a7e1
7
- data.tar.gz: c6943c8fdc1c939ff618c8d37307ebe0436d705a74ba0c4d82517a7e263fad52d72c36f8d1645eaa06596c26789cec2ec12c27382a4f39a95b34a70c370acdc5
6
+ metadata.gz: 231ce6dc564754be301b7e682e42e4c26bea55fa2bac4676a8dfe9fefb7469edd720565ccd22051ea3c8d645471b41372139e282c6bbf59a724695ab7671ccdd
7
+ data.tar.gz: c6f8ae0734c6162cbcbe13c92ccfbe3fd91528294e89cdd088d2cfe3e0c598b8d93ef5387759f445db032698f6b8b14deede3b810fc1e2c0de230ac95efad179
data/README.md CHANGED
@@ -103,21 +103,21 @@ class TicketOrder < ActiveRecord::Base
103
103
  belongs_to :owner
104
104
 
105
105
  before_destroy do
106
- owner.notifly! template: :destroy, sender: :buyer, data: :attributes
106
+ owner.notifly! template: :destroy, sender: buyer, data: attributes
107
107
  end
108
108
 
109
109
  def send_gift!
110
110
  # code here
111
111
 
112
112
  if completed?
113
- owner.notifly! template: :ticket_gift, sender: :buyer, target: :ticket
113
+ owner.notifly! template: :ticket_gift, sender: buyer, target: ticket
114
114
  end
115
115
  end
116
116
 
117
117
  def accept_gift
118
118
  # code here
119
119
 
120
- buyer.notifly! sender: :owner, target: :ticket
120
+ buyer.notifly! sender: owner, target: ticket
121
121
  end
122
122
  end
123
123
  ```
@@ -138,11 +138,11 @@ class TicketOrder < ActiveRecord::Base
138
138
  notifly default_values: { receiver: :owner }
139
139
 
140
140
  notifly before: :destroy, template: :destroy_order_notification, sender: :buyer,
141
- data: :attributes, email: { template: :destroy_order_mail }
141
+ data: :attributes, mail: { template: :destroy_order_mail }
142
142
  notifly after: :send_gift!, template: :ticket_gift, sender: :buyer,
143
- target: :ticket, email: true, if: -> { completed? }
143
+ target: :ticket, mail: true, if: -> { completed? }
144
144
  notifly after: :accept_gift, sender: :owner, receiver: :buyer, target: :ticket,
145
- template: :accept_gift, email: { only: true }
145
+ template: :accept_gift, mail: { only: true }
146
146
 
147
147
  def send_gift!
148
148
  # code here
@@ -4,7 +4,7 @@ var notiflyLastNotification, notiflyFirstNotification;
4
4
  var _notiflyGetNotifications = function () {
5
5
  var $notifly = $('#notifly');
6
6
 
7
- if($notifly !== undefined) {
7
+ if($notifly.length !== 0) {
8
8
  $.ajax({
9
9
  url: '<%= notifly.notifications_path %>',
10
10
  data: {
@@ -1,16 +1,16 @@
1
1
  <% notifly = Notifly::Engine.routes.url_helpers %>
2
2
 
3
3
  var _notiflyMoreNotifications = function () {
4
- var $notifly = $('#notifly');
4
+ var $notifly = $('#notifly-notifications-content');
5
5
 
6
- if($notifly != undefined) {
7
- $notifly.find('#notifly-more-notifications-link').click(function () {
6
+ if($notifly.length !== 0) {
7
+ $('#notifly-more-notifications-link').click(function () {
8
8
  $.ajax({
9
9
  url: '<%= notifly.notifications_path %>',
10
10
  data: {
11
11
  scope: 'older',
12
12
  reference_notification_id: notiflyLastNotification,
13
- mark_as_seen: $notifly.hasClass('open')
13
+ mark_as_seen: true
14
14
  },
15
15
  type: 'GET'
16
16
  });
@@ -3,7 +3,7 @@
3
3
  var _notiflyReadNotifications = function () {
4
4
  var $notifly = $('#notifly-mark-as-read-link');
5
5
 
6
- if($notifly != undefined) {
6
+ if($notifly.length !== 0) {
7
7
  $notifly.click(function () {
8
8
  $.ajax({
9
9
  url: '<%= notifly.read_notifications_path %>',
@@ -3,7 +3,7 @@
3
3
  var _notiflySeenNotifications = function () {
4
4
  var $trigger = $('#notifly-trigger');
5
5
 
6
- if($trigger !== undefined) {
6
+ if($trigger.length !== 0) {
7
7
  $trigger.click(function () {
8
8
  $.ajax({
9
9
  url: '<%= notifly.seen_notifications_path %>',
@@ -4,7 +4,6 @@
4
4
  //= require 'notifly/seen_notifications'
5
5
  //= require 'notifly/read_notifications'
6
6
  //= require 'notifly/more_notifications'
7
- //= require 'twitter/bootstrap'
8
7
 
9
8
  $(document).ready(function() {
10
9
  $(document).on('click', '#notifly-notifications-panel.dropdown-menu', function (e) {
@@ -0,0 +1 @@
1
+ //= require 'twitter/bootstrap'
@@ -11,7 +11,7 @@ module Notifly
11
11
  def notifly_icon(have_notifications=false)
12
12
  icon = have_notifications ? Notifly.icon : Notifly.icon_empty
13
13
  size = Notifly.icon_size
14
- fa_icon "#{icon} #{size}"
14
+ fa_icon "#{icon} #{size}", id: 'notifly-icon'
15
15
  end
16
16
  end
17
17
  end
@@ -1,4 +1,4 @@
1
1
  <!-- This partial requires the locals: counter -->
2
- <span class="notifly-counter-label <%= counter > 0 ? '' : 'hide' %>">
2
+ <span id="notifly-counter" class="notifly-counter-label <%= counter > 0 ? '' : 'hide' %>">
3
3
  <%= counter %>
4
4
  </span>
@@ -29,5 +29,5 @@
29
29
  $('#notifly-more-notifications-link').remove();
30
30
  <% end %>
31
31
 
32
- $('#notifly-counter').html("<%= j(render 'notifly/layouts/counter', counter: @counter)%>");
33
- $('#notifly-icon').html("<%= j notifly_icon(@counter > 0) %>")
32
+ $('#notifly-counter').replaceWith("<%= j(render 'notifly/layouts/counter', counter: @counter)%>");
33
+ $('#notifly-icon').replaceWith("<%= j notifly_icon(@counter > 0) %>")
@@ -1,2 +1,2 @@
1
- $('#notifly-counter').html("<%= j(render 'notifly/layouts/counter', counter: @counter)%>");
2
- $('#notifly-icon').html("<%= j notifly_icon(@counter > 0) %>")
1
+ $('#notifly-counter').replaceWith("<%= j(render 'notifly/layouts/counter', counter: @counter)%>");
2
+ $('#notifly-icon').replaceWith("<%= j notifly_icon(@counter > 0) %>")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notifly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Passalini
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-04 00:00:00.000000000 Z
12
+ date: 2014-12-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -245,6 +245,7 @@ files:
245
245
  - app/assets/javascripts/notifly/more_notifications.js.erb
246
246
  - app/assets/javascripts/notifly/read_notifications.js.erb
247
247
  - app/assets/javascripts/notifly/seen_notifications.js.erb
248
+ - app/assets/javascripts/notifly_dropdown.js
248
249
  - app/assets/stylesheets/notifly.css
249
250
  - app/assets/stylesheets/notifly/layout.css
250
251
  - app/controllers/notifly/application_controller.rb