oxen_printer 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/ox_printer.rb +7 -2
- data/app/views/oxen/printers/_user_printer.html.haml +3 -3
- data/lib/oxen_printer/version.rb +1 -1
- data/lib/print_engine.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af93710a84b071079b364de088730cdebcb7aa71
|
4
|
+
data.tar.gz: a678d74880a62ab8874489c572d53727854167bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12bfe5401a1776f02763886c7fb972c320013a9f759fc2303640f7716f56c1bde1774966c3a479e66caa2e20fe77fd12b863d1a3f6ecf541a5493dccffb546f1
|
7
|
+
data.tar.gz: 16d328802e1ec41e27242a2aa76c2400a1e887d5271736b2afbbd03dfd6bfd80ad82b39ea2a5a12c17c35ef59d2edc9c3127d22e4ba96459fc01ff441c403c96
|
data/app/models/ox_printer.rb
CHANGED
@@ -13,18 +13,23 @@ class OxPrinter < AbstractResource
|
|
13
13
|
|
14
14
|
scope :active, -> { where(active: true) }
|
15
15
|
scope :preferred_printer, ->{ where("printables.preferred=1")}
|
16
|
-
scope :on_paper, -> (pap){ where(paper: pap )}
|
16
|
+
scope :on_paper, -> (pap){ where("paper LIKE :pap", pap: "%#{pap}%")}
|
17
17
|
|
18
18
|
def list_title
|
19
19
|
name
|
20
20
|
end
|
21
21
|
|
22
|
+
def _ref
|
23
|
+
paper
|
24
|
+
end
|
25
|
+
|
22
26
|
def preferred? parent
|
23
27
|
printables.where(printable: parent).first.preferred?
|
24
28
|
end
|
25
29
|
|
26
30
|
def prefer parent
|
27
|
-
parent.
|
31
|
+
ps = parent.printers.preferred_printer.on_paper(self.paper)
|
32
|
+
parent.printables.each{ |p| p.update_columns(preferred: false) if ps.include? p.printer }
|
28
33
|
printables.where(printable: parent).first.update_columns( preferred: true )
|
29
34
|
end
|
30
35
|
|
@@ -11,8 +11,8 @@
|
|
11
11
|
%i.material-icons layers_clear
|
12
12
|
%td
|
13
13
|
- if user.printers.preferred_printer.include? printer
|
14
|
-
|
15
|
-
|
14
|
+
= link_to defer_url( user,printer), class: 'preferred green-text', ref: printer.paper, data: { id: printer.id }, title: t('defer_printers') do
|
15
|
+
%i.preferred.material-icons.green-text bookmark
|
16
16
|
- else
|
17
|
-
= link_to prefer_url( user,printer), class: 'deferred grey-text', data: { id: printer.id },title: t('prefer_printers') do
|
17
|
+
= link_to prefer_url( user,printer), class: 'deferred grey-text', ref: printer.paper, data: { id: printer.id },title: t('prefer_printers') do
|
18
18
|
%i.material-icons bookmark_border
|
data/lib/oxen_printer/version.rb
CHANGED
data/lib/print_engine.rb
CHANGED
@@ -61,6 +61,10 @@ module PrintEngine
|
|
61
61
|
rescue PrintJobPrinterNotAvailableError
|
62
62
|
logit :error, 'PrintJob could not be created - the user has no printers attached!!'
|
63
63
|
return false
|
64
|
+
|
65
|
+
rescue NoPreferredPrintersFound
|
66
|
+
logit :error, 'PrintJob could not be created - the user has no preferred printers attached!!'
|
67
|
+
false
|
64
68
|
end
|
65
69
|
|
66
70
|
begin
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oxen_printer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Walther H Diechmann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oxen_job
|