oxen_account 0.3.3 → 0.3.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/app/controllers/oxen/accounts_controller.rb +16 -1
- data/app/models/ox_account.rb +0 -1
- data/app/views/oxen/accounts/_form.html.haml +19 -34
- data/config/routes.rb +1 -0
- data/lib/generators/oxen_account/templates/account.rb +12 -2
- data/lib/oxen_account/version.rb +1 -1
- 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: 0b57dda1396e9487d64826ffabb0e0562e1dfde4
|
|
4
|
+
data.tar.gz: dea53c1746c29c80c0afbbb575498a72ea2c8c5d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ea8d2f4de0d574f76212b95c1f5496d0970500babb700c62751b71c08dcb58b657e5d29d82c9970389c277ba7ea1c642b99193f37f297f895b1710de0aa6de37
|
|
7
|
+
data.tar.gz: 52c0f0a6756f759c257cd1c79b5dde63762e1aa5ae7ee9f40306710dde1457e8d01de5dab53c84737b113a1fdf5277331e1962d846b70d599ca27f7e07a849a4
|
|
@@ -12,7 +12,22 @@ class Oxen::AccountsController < AbstractResourcesController
|
|
|
12
12
|
# end
|
|
13
13
|
|
|
14
14
|
def resource_params
|
|
15
|
-
|
|
15
|
+
raise 'implement in your controller'
|
|
16
|
+
# params.require(:account).permit(:name, :active, :default_url, :chargeable, :last_charged_at, :free_users )
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def set_fab_button_options
|
|
20
|
+
raise 'implement in your controller'
|
|
21
|
+
#
|
|
22
|
+
# opt = { items: {}}
|
|
23
|
+
# case params[:action]
|
|
24
|
+
# when 'new'; #opt[:items].merge! print: { ajax: 'get', icon: 'print', class: 'blue lighten-2', url: '/stocks/print?print_list=true', browser: 'new' }
|
|
25
|
+
# when 'edit'; #opt[:items].merge! print: { ajax: 'get', icon: 'print', class: 'blue lighten-2', url: '/stocks/print?print_list=true', browser: 'new' }
|
|
26
|
+
# when 'show'; #opt[:items].merge! print: { ajax: 'get', icon: 'print', class: 'blue lighten-2', url: '/stocks/print', browser: 'new' }
|
|
27
|
+
# when 'index'; #opt[:items].merge! print: { ajax: 'get', icon: 'print', class: 'blue lighten-2', url: '/stocks/print?print_list=true', browser: 'new' }
|
|
28
|
+
# end
|
|
29
|
+
#
|
|
30
|
+
# @fab_button_options = opt
|
|
16
31
|
end
|
|
17
32
|
|
|
18
33
|
end
|
data/app/models/ox_account.rb
CHANGED
|
@@ -2,7 +2,6 @@ class OxAccount < AbstractResource
|
|
|
2
2
|
self.table_name = 'accounts'
|
|
3
3
|
establish_connection ((Rails.env=="development") ? :dev_oxen_tables : :oxen_tables )
|
|
4
4
|
|
|
5
|
-
has_paper_trail
|
|
6
5
|
|
|
7
6
|
has_many :users, dependent: :destroy, foreign_key: 'account_id'
|
|
8
7
|
has_many :printers, dependent: :destroy, foreign_key: 'account_id'
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
:css
|
|
2
|
+
#drop_zone {
|
|
3
|
+
height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
border-radius: 10px;
|
|
6
|
+
padding: 5px;
|
|
7
|
+
}
|
|
1
8
|
|
|
2
|
-
|
|
9
|
+
|
|
10
|
+
= simple_form_for(resource, html: {class: 'col sl12', multipart: true}, data: { form_type:'record', form_id: 'accountsform'} ) do |f|
|
|
3
11
|
/ - if parent?
|
|
4
12
|
/ = render @parent
|
|
5
13
|
= f.error_notification
|
|
@@ -7,6 +15,9 @@
|
|
|
7
15
|
.form-inputs
|
|
8
16
|
.row
|
|
9
17
|
= f.input :name, class: :validate, disabled: @disabled, autofocus: true
|
|
18
|
+
-#
|
|
19
|
+
-# .row
|
|
20
|
+
-# = link_to 'Her kan du komprimere logo filen', 'http://www.base64css.com/', target: "_blank"
|
|
10
21
|
|
|
11
22
|
.row
|
|
12
23
|
= f.input :default_url, class: :validate, disabled: @disabled
|
|
@@ -45,38 +56,12 @@
|
|
|
45
56
|
.col.sl12{ style: "margin-bottom: 30px"}
|
|
46
57
|
%hr
|
|
47
58
|
|
|
59
|
+
= react_component 'DropZone', { url: (account_photos_url(resource) rescue ''), classes: 'files', id: 'drop_zone', entity: 'account' } if params[:action]!='show'
|
|
60
|
+
|
|
61
|
+
:coffeescript
|
|
48
62
|
|
|
63
|
+
$ ->
|
|
49
64
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/ / - if parent?
|
|
54
|
-
/ / = render @parent
|
|
55
|
-
/ = f.error_notification
|
|
56
|
-
/
|
|
57
|
-
/ .form-inputs
|
|
58
|
-
/ .row
|
|
59
|
-
/ = f.input :name, class: :validate, disabled: @disabled, autofocus: true
|
|
60
|
-
/
|
|
61
|
-
/ .row
|
|
62
|
-
/ .input-field.col.s12
|
|
63
|
-
/ %label{ style: "margin-top: -20px"}= t('.account_active')
|
|
64
|
-
/ .switch
|
|
65
|
-
/ %label
|
|
66
|
-
/ = t(:passive)
|
|
67
|
-
/ =f.check_box :active, disabled: @disabled
|
|
68
|
-
/ %span.lever
|
|
69
|
-
/ = t(:active)
|
|
70
|
-
/
|
|
71
|
-
/ .row
|
|
72
|
-
/ .col.sl12{ style: "margin-bottom: 30px"}
|
|
73
|
-
/ %hr
|
|
74
|
-
/
|
|
75
|
-
/ - unless @disabled
|
|
76
|
-
/ .row
|
|
77
|
-
/ .form-actions.right-align
|
|
78
|
-
/ = f.button :submit, t(".#{params[:action]}.submit")
|
|
79
|
-
/
|
|
80
|
-
/ - if %w{ show edit }.include? params[:action]
|
|
81
|
-
/ :coffeescript
|
|
82
|
-
/ $('form label').addClass('active')
|
|
65
|
+
window.build_drop_zone_photo = (file,entity) =>
|
|
66
|
+
[ '<input type="hidden" name="',entity,'[ps][',file.id,'][id]" id="photos_',file.id,'_id" class="files_uploaded" />',
|
|
67
|
+
'<input type="text" name="',entity,'[ps][',file.id,'][purpose]" id="photos_',file.id,'_purpose" class="files_uploaded" />'].join('')
|
data/config/routes.rb
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
class CreateAccounts < ActiveRecord::Migration
|
|
2
2
|
def change
|
|
3
3
|
create_table :accounts do |t|
|
|
4
|
-
t.string
|
|
5
|
-
t.
|
|
4
|
+
t.string :name
|
|
5
|
+
t.string :default_url
|
|
6
|
+
t.text :logo
|
|
7
|
+
|
|
8
|
+
## manageable
|
|
9
|
+
t.boolean :active
|
|
10
|
+
t.integer :lock_version
|
|
11
|
+
|
|
12
|
+
## chargeable
|
|
13
|
+
t.boolean :chargeable, null: false, default: true
|
|
14
|
+
t.datetime :last_charged_at
|
|
15
|
+
t.integer :free_users, null: false, default: 0
|
|
6
16
|
|
|
7
17
|
t.timestamps null: false
|
|
8
18
|
end
|
data/lib/oxen_account/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: oxen_account
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Walther H Diechmann
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-03-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: devise
|