dorsale 2.6.0 → 2.6.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: 417a3baaae1d0c4f0a571105f17f905d2f184ec7
4
- data.tar.gz: 4f130e0a775040d72f956e142e609044e362817b
3
+ metadata.gz: 2b7376b6c7d46d198bbede8be8663db10631de53
4
+ data.tar.gz: 6b83f90d10b65ccc90b864f6f4fd0aaeb795d732
5
5
  SHA512:
6
- metadata.gz: 19ca08bba926fe3318e8c75cb8766982ad74a832ac05553fdd77f34b0fc222d43a67533d199364083272adf7724810838b3cb040138bc429a3e9f334958d4767
7
- data.tar.gz: 33b096a575ecb4b74529e19abe20811c3fbf87dbea5c131f48210934021f8df678910dc40b3163edcae198c313d88ded0150e57888408b768868eadf4ac4545f
6
+ metadata.gz: 57aef075a9310b76cca63a2f7da3b3e9e6edfb5d2e7b25689c78800e2d14f3bb452fb0c177f52c88287df18aeb70a452deb0ebc44399b1551025723fc235b33a
7
+ data.tar.gz: 24765f16d7bba8aef49ffe422c7f506e01b265beda6eebf86a292886819b95447ce1e5fc30c49edb5ca54bf23d9a4cd605f71aa21524a593cdc40a84fe85059e
@@ -0,0 +1,75 @@
1
+ window.modal =
2
+ i18n:
3
+ loading: "Loading..."
4
+ error: "Error."
5
+
6
+ template: """
7
+ <div id='modal' class='modal'>
8
+ <div class='modal-overlay modal-close'></div>
9
+ <button class='modal-close'></button>
10
+ <div class='modal-body'>
11
+ {{content}}
12
+ </div>
13
+ </div>
14
+ """
15
+
16
+ _generateModalHTML: (content) ->
17
+ $(modal.template.replace("{{content}}", content))
18
+
19
+ open: (content) ->
20
+ modal.close()
21
+ $("body").addClass("modal-open")
22
+ $("body").append(modal._generateModalHTML(content))
23
+ $(document).trigger("modal:open")
24
+
25
+ close: ->
26
+ $("#modal").remove()
27
+ $("body").removeClass("modal-open")
28
+ $(document).trigger("modal:close")
29
+ return false
30
+
31
+ openUrl: (url, type = "GET", data = {}) ->
32
+ modal.open(modal.i18n.loading)
33
+
34
+ $.ajax
35
+ url: url
36
+ type: type
37
+ data: data
38
+ dataType: "html"
39
+ success: (data) ->
40
+ modal.open(data)
41
+ error: ->
42
+ modal.open(modal.i18n.error)
43
+
44
+ _callbacks:
45
+ links: ->
46
+ modal.openUrl(this.href)
47
+ return false
48
+
49
+ forms: ->
50
+ modal.openUrl(this.href, this.action, $(this).serialize())
51
+ return false
52
+
53
+ escape: (event) ->
54
+ modal.close() if event.keyCode == 27
55
+
56
+ setup: ->
57
+ $(document)
58
+ .off("keyup", modal._callbacks.escape)
59
+ .on("keyup", modal._callbacks.escape)
60
+
61
+ $(".modal-close")
62
+ .off("click", modal.close)
63
+ .on("click", modal.close)
64
+
65
+ $("a[data-modal=1], .modal-body a:not([data-modal=0])")
66
+ .off("click", modal._callbacks.links)
67
+ .on("click", modal._callbacks.links)
68
+
69
+ $("form[data-modal=1], .modal-body form:not([data-modal=0])")
70
+ .off("submit", modal._callbacks.forms)
71
+ .on("submit", modal._callbacks.forms)
72
+
73
+
74
+ $(document).on "ready page:load modal:open", ->
75
+ modal.setup()
@@ -4,6 +4,7 @@
4
4
  @import font-awesome
5
5
  @import bootstrap-datepicker3
6
6
 
7
+ @import dorsale/modals
7
8
  @import dorsale/comments
8
9
  @import dorsale/contexts
9
10
  @import dorsale/filters
@@ -0,0 +1,38 @@
1
+ body.modal-open
2
+ height: 100%
3
+ overflow: hidden
4
+
5
+ .modal
6
+ display: block !important // override bootstrap
7
+
8
+ &, .modal-overlay
9
+ position: fixed
10
+ top: 0
11
+ right: 0
12
+ bottom: 0
13
+ left: 0
14
+ overflow: auto
15
+
16
+ .modal-overlay
17
+ background: rgba(0, 0, 0, 0.85)
18
+
19
+ .modal-body
20
+ position: relative
21
+ margin: 10vh auto
22
+ padding: 2em
23
+ width: auto
24
+ min-width: 50%
25
+ max-width: 980px
26
+ background: white
27
+ z-index: 9999
28
+
29
+ button.modal-close:after
30
+ content: "×"
31
+ color: white
32
+ position: absolute
33
+ font-size: 4em
34
+ line-height: 0.5em
35
+ top: 0.25em
36
+ right: 0.25em
37
+ border: none
38
+ background: none
@@ -3,5 +3,13 @@ module Dorsale
3
3
  def current_user_scope
4
4
  @current_user_scope ||= UserScope.new(current_user)
5
5
  end
6
+
7
+ layout -> {
8
+ if request.xhr?
9
+ false
10
+ else
11
+ "application"
12
+ end
13
+ }
6
14
  end
7
15
  end
@@ -1,3 +1,3 @@
1
1
  module Dorsale
2
- VERSION = "2.6.0"
2
+ VERSION = "2.6.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorsale
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - agilidée
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-07 00:00:00.000000000 Z
11
+ date: 2016-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -442,6 +442,7 @@ files:
442
442
  - app/assets/javascripts/dorsale/datepicker.coffee
443
443
  - app/assets/javascripts/dorsale/flyboy/all.coffee
444
444
  - app/assets/javascripts/dorsale/forms.coffee
445
+ - app/assets/javascripts/dorsale/modals.coffee
445
446
  - app/assets/javascripts/dorsale/tabs_loader.coffee
446
447
  - app/assets/stylesheets/dorsale/all.sass
447
448
  - app/assets/stylesheets/dorsale/billing_machine/all.sass
@@ -453,6 +454,7 @@ files:
453
454
  - app/assets/stylesheets/dorsale/flash.sass
454
455
  - app/assets/stylesheets/dorsale/flyboy/all.sass
455
456
  - app/assets/stylesheets/dorsale/forms.sass
457
+ - app/assets/stylesheets/dorsale/modals.sass
456
458
  - app/assets/stylesheets/dorsale/pagination.sass
457
459
  - app/assets/stylesheets/dorsale/styles.sass
458
460
  - app/assets/stylesheets/dorsale/tables.sass