oxen_account 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 552a08429f12671826e8917ad9740ca6fc8b2c6d
4
- data.tar.gz: 4b5d6b8de1f0512d90d361716a21c88757094fe7
3
+ metadata.gz: 0b57dda1396e9487d64826ffabb0e0562e1dfde4
4
+ data.tar.gz: dea53c1746c29c80c0afbbb575498a72ea2c8c5d
5
5
  SHA512:
6
- metadata.gz: 349d29a9ca74306990b29642f35673592110b84f84cb1ed15f3734dbf756c1d4c2d0458f93de1ba9c60589acd03c44d4c09cafd59dd159186a67ed88cec86197
7
- data.tar.gz: ab7a30f2d5c220b612642495a6acea5d89957930e870fec719fa70477b65d8ce0b418ea049680167daa48b675a1ed4708ccc65424b07c0c3dc50b6c87fffcc1b
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
- params.require(:account).permit(:name, :active, :default_url, :chargeable, :last_charged_at, :free_users )
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
@@ -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
- = simple_form_for(resource, html: {class: 'col sl12'} ) do |f|
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
- / from oxen_user/views/accounts/_form.html.haml
51
- /
52
- / = simple_form_for(resource, html: {class: 'col sl12'} ) do |f|
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('')
@@ -38,6 +38,7 @@ Rails.application.routes.draw do
38
38
  scope '/admin' do
39
39
  resources :accounts, concerns: [:activating, :attaching, :printing] do
40
40
  resources :users, concerns: [:activating, :printing]
41
+ resources :photos
41
42
  end
42
43
  end
43
44
  end
@@ -1,8 +1,18 @@
1
1
  class CreateAccounts < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :accounts do |t|
4
- t.string :name
5
- t.boolean :active
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
@@ -1,3 +1,3 @@
1
1
  module OxenAccount
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
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.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-02-21 00:00:00.000000000 Z
11
+ date: 2016-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise