ish_manager 0.1.8.60 → 0.1.8.61
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/ish_manager/application.js +4 -0
- data/app/assets/stylesheets/ish_manager/application.css +9 -1
- data/app/controllers/ish_manager/invoices_controller.rb +49 -0
- data/app/controllers/ish_manager/user_profiles_controller.rb +22 -0
- data/app/views/ish_manager/application/_main_header.haml +9 -5
- data/app/views/ish_manager/invoices/_form.haml +22 -0
- data/app/views/ish_manager/invoices/index.haml +19 -0
- data/app/views/ish_manager/invoices/new.haml +5 -0
- data/app/views/ish_manager/user_profiles/_form.haml +28 -0
- data/app/views/ish_manager/user_profiles/edit.haml +1 -17
- data/app/views/ish_manager/user_profiles/index.haml +2 -1
- data/app/views/ish_manager/user_profiles/new.haml +5 -0
- data/config/routes.rb +7 -2
- metadata +7 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0efa407c47d2f4d4c653a4025a4921a3b14dc71
|
4
|
+
data.tar.gz: b0a9e162688c3698b081b241cb4a6cbe4d36c613
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4979ca3745f84c1765edc86fd44c02b68cee1a6d22f0848b0338060c6344239a679251194d7df1fff431f733ce1fcb4531d7fd10154f008883cc03a525707a4
|
7
|
+
data.tar.gz: bfdced44d182daab3c68ab39b7b2490f7d6e7e4be1eef171ee02abbf09381da5d84a4fb8a16637db0373054fa74cff646f8ec84a472ef280ab93a38340758114
|
@@ -46,7 +46,7 @@ body {
|
|
46
46
|
|
47
47
|
hr {
|
48
48
|
background: red;
|
49
|
-
height: 1px;
|
49
|
+
height: 1px !important;
|
50
50
|
}
|
51
51
|
|
52
52
|
.thumb {
|
@@ -73,6 +73,14 @@ hr {
|
|
73
73
|
color: white;
|
74
74
|
}
|
75
75
|
|
76
|
+
.panel-content {
|
77
|
+
padding: .5em;
|
78
|
+
}
|
79
|
+
|
80
|
+
/**
|
81
|
+
* manager... wut?
|
82
|
+
*/
|
83
|
+
|
76
84
|
.manager--main-header {
|
77
85
|
background: url('/assets/bg/weather.png');
|
78
86
|
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
|
2
|
+
class IshManager::InvoicesController < IshManager::ApplicationController
|
3
|
+
|
4
|
+
before_action :set_lists
|
5
|
+
|
6
|
+
def index
|
7
|
+
authorize! :index, Ish::Invoice
|
8
|
+
@invoices = Ish::Invoice.all
|
9
|
+
end
|
10
|
+
|
11
|
+
def new
|
12
|
+
authorize! :new, @invoice
|
13
|
+
end
|
14
|
+
|
15
|
+
def create
|
16
|
+
@invoice = Ish::Invoice.new params[:invoice].permit!
|
17
|
+
authorize! :create, @invoice
|
18
|
+
if @invoice.save
|
19
|
+
flash[:notice] = "created invoice"
|
20
|
+
else
|
21
|
+
flash[:alert] = "Cannot create invoice: #{@invoice.errors.messages}"
|
22
|
+
end
|
23
|
+
redirect_to :action => 'index'
|
24
|
+
end
|
25
|
+
|
26
|
+
def update
|
27
|
+
@invoice = Ish::Invoice.find params[:id]
|
28
|
+
authorize! :update, @invoice
|
29
|
+
if @invoice.update_attributes params[:invoice].permit!
|
30
|
+
flash[:notice] = 'Success'
|
31
|
+
redirect_to :action => 'index'
|
32
|
+
else
|
33
|
+
flash[:alert] = "Cannot update invoice: #{@invoice.errors.messages}"
|
34
|
+
end
|
35
|
+
redirect_to :action => 'index'
|
36
|
+
end
|
37
|
+
|
38
|
+
#
|
39
|
+
# private
|
40
|
+
#
|
41
|
+
private
|
42
|
+
|
43
|
+
def set_lists
|
44
|
+
@invoice_number = Ish::Invoice.order_by( :number => :desc ).first
|
45
|
+
@invoice_number = @invoice_number ? @invoice_number.number + 1 : 1
|
46
|
+
@new_invoice = Ish::Invoice.new :number => @invoice_number
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
@@ -32,5 +32,27 @@ class IshManager::UserProfilesController < IshManager::ApplicationController
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
def new
|
36
|
+
@profile = IshModels::UserProfile.new
|
37
|
+
authorize! :new, @profile
|
38
|
+
end
|
39
|
+
|
40
|
+
def create
|
41
|
+
@profile = IshModels::UserProfile.new params[:profile].permit!
|
42
|
+
authorize! :create, @profile
|
43
|
+
@profile.user = User.find_or_create_by( :email => params[:profile][:email] )
|
44
|
+
@profile.user.password ||= (0...12).map { rand(100) }.join
|
45
|
+
if !@profile.user.save
|
46
|
+
puts! @profile.user.errors.messages
|
47
|
+
raise 'cannot save profile.user'
|
48
|
+
end
|
49
|
+
if @profile.save
|
50
|
+
flash[:notice] = "Created profile"
|
51
|
+
else
|
52
|
+
flash[:alert] = "Cannot create profile: #{@profile.errors.messages}"
|
53
|
+
end
|
54
|
+
redirect_to :action => :index
|
55
|
+
end
|
56
|
+
|
35
57
|
end
|
36
58
|
|
@@ -7,17 +7,21 @@
|
|
7
7
|
%ul.nav.nav-pills
|
8
8
|
%li{ :class => params[:controller] == 'ish_manager/cities' ? 'active' : '' }= link_to 'Cities', cities_path
|
9
9
|
%li{ :class => params[:controller] == 'ish_manager/events' ? 'active' : '' }= link_to 'Events', events_path
|
10
|
-
%li{ :class => params[:controller] == 'ish_manager/
|
10
|
+
%li{ :class => params[:controller] == 'ish_manager/venues' ? 'active' : '' }= link_to 'Venues', venues_path
|
11
11
|
%li{ :class => params[:controller] == 'ish_manager/user_profiles' ? 'active' : '' }= link_to 'Profiles', user_profiles_path
|
12
|
-
|
12
|
+
%ul.nav.nav-pills
|
13
13
|
%li{ :class => params[:controller] == 'ish_manager/sites' ? 'active' : '' }= link_to 'Sites', sites_path
|
14
|
-
%li{ :class => params[:controller] == 'ish_manager/
|
15
|
-
%li{ :class => params[:controller] == 'ish_manager/
|
14
|
+
%li{ :class => params[:controller] == 'ish_manager/galleries' ? 'active' : '' }= link_to 'Galleries', galleries_path
|
15
|
+
%li{ :class => params[:controller] == 'ish_manager/reports' ? 'active' : '' }= link_to 'Reports', reports_path
|
16
16
|
%li{ :class => params[:controller] == 'ish_manager/videos' ? 'active' : '' }= link_to 'Videos', videos_path
|
17
|
+
%li{ :class => params[:controller] == 'ish_manager/tags' ? 'active' : '' }= link_to 'Tags', tags_path
|
17
18
|
%ul.nav.nav-pills
|
18
|
-
%li{ :class => params[:controller] == 'ish_manager/ally' ? 'active' : '' }= link_to 'Ally', ally_root_path
|
19
|
+
-# %li{ :class => params[:controller] == 'ish_manager/ally' ? 'active' : '' }= link_to 'Ally', ally_root_path
|
19
20
|
%li{ :class => params[:controller] == 'ish_manager/stock_actions' ? 'active' : '' }= link_to 'Stock Actions', stock_actions_path
|
20
21
|
%li{ :class => params[:controller] == 'ish_manager/stock_options' ? 'active' : '' }= link_to 'Stock Options', stock_options_path
|
21
22
|
%li{ :class => params[:controller] == 'ish_manager/stock_watches' ? 'active' : '' }= link_to 'Stock Watches', stock_watches_path
|
23
|
+
%ul.nav.nav-pills
|
24
|
+
%li{ :class => params[:controller] == 'ish_manager/invoices' ? 'active' : '' }= link_to 'Invoices', invoices_path
|
25
|
+
%li{ :class => params[:controller] == 'ish_manager/payments' ? 'active' : '' }= link_to 'Payments', payments_path
|
22
26
|
%hr
|
23
27
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
- url = invoice.persisted? ? invoice_path( invoice.id ) : invoices_path
|
3
|
+
|
4
|
+
= form_for invoice, :as => :invoice, :url => url do |f|
|
5
|
+
-# .input-field
|
6
|
+
%label email
|
7
|
+
= text_field_tag :email
|
8
|
+
.a
|
9
|
+
%label profile
|
10
|
+
= f.select :profile, options_for_select( IshModels::UserProfile.all.map{ |p| [ p.email, p.id ] } )
|
11
|
+
|
12
|
+
%label amount
|
13
|
+
= f.number_field :amount, :step => 0.01, :default => 0.0
|
14
|
+
|
15
|
+
%label number
|
16
|
+
= f.number_field :number
|
17
|
+
|
18
|
+
.a
|
19
|
+
%label Description
|
20
|
+
= f.text_area :description
|
21
|
+
|
22
|
+
= f.submit 'Save'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
%h3
|
3
|
+
Invoices
|
4
|
+
= link_to '[+]', new_invoice_path
|
5
|
+
|
6
|
+
.row
|
7
|
+
.col-xs-12.col-md-6.col-md-offset-3
|
8
|
+
= render 'form', :invoice => @new_invoice
|
9
|
+
%hr
|
10
|
+
|
11
|
+
%ul
|
12
|
+
- @invoices.each do |i|
|
13
|
+
%li
|
14
|
+
.panel
|
15
|
+
.panel-content
|
16
|
+
.a Number: #{i.number}
|
17
|
+
.a Email: #{i.profile.email}
|
18
|
+
.a Amount: #{i.amount}
|
19
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
- url = profile.persisted? ? profile_path( profile.id ) : profiles_path
|
3
|
+
|
4
|
+
= form_for profile, :as => :profile, :url => url do |f|
|
5
|
+
%label name
|
6
|
+
= f.text_field :name
|
7
|
+
|
8
|
+
.input-field
|
9
|
+
%label email
|
10
|
+
= f.text_field :email
|
11
|
+
.a
|
12
|
+
%label role name
|
13
|
+
= f.select :role_name, options_for_select( [[nil, nil]] + IshModels::UserProfile::ROLES.map { |r| [ r, r ] }, :selected => profile.role_name )
|
14
|
+
|
15
|
+
.a
|
16
|
+
%label About
|
17
|
+
= f.text_area :about, :rows => 10
|
18
|
+
|
19
|
+
.input-field
|
20
|
+
= f.label :fb_access_token
|
21
|
+
= f.text_field :fb_access_token
|
22
|
+
.input-field
|
23
|
+
= f.label :fb_long_access_token
|
24
|
+
= f.text_field :fb_long_access_token
|
25
|
+
|
26
|
+
= f.submit 'Save', :class => %w(button)
|
27
|
+
|
28
|
+
|
@@ -1,19 +1,3 @@
|
|
1
1
|
|
2
2
|
%h5 Editing profile of user #{@profile.user.email}
|
3
|
-
|
4
|
-
= form_for @profile do |f|
|
5
|
-
.field
|
6
|
-
= f.label :email
|
7
|
-
= f.text_field :email
|
8
|
-
.field
|
9
|
-
= f.label :role_name
|
10
|
-
= f.select :role_name, ::IshModels::UserProfile::ROLES
|
11
|
-
.field
|
12
|
-
= f.label :fb_access_token
|
13
|
-
= f.text_field :fb_access_token
|
14
|
-
.field
|
15
|
-
= f.label :fb_long_access_token
|
16
|
-
= f.text_field :fb_long_access_token
|
17
|
-
.action
|
18
|
-
= f.submit 'Submit', :class => %w(button)
|
19
|
-
|
3
|
+
= render 'form', :profile => @profile
|
@@ -11,5 +11,6 @@
|
|
11
11
|
%li <b>Email:</b> #{profile.email}
|
12
12
|
%li <b>Name:</b> #{profile.name}
|
13
13
|
%li <b>Role:</b> #{profile.role_name}
|
14
|
-
%li <b>User.email:</b> #{profile.user.email}
|
14
|
+
%li <b>User.email:</b> #{profile.user ? profile.user.email : nil}
|
15
|
+
%li <b>About:</b> #{profile.about}
|
15
16
|
%br
|
data/config/routes.rb
CHANGED
@@ -20,9 +20,14 @@ IshManager::Engine.routes.draw do
|
|
20
20
|
post 'multiadd', :to => 'photos#j_create', :as => :multiadd
|
21
21
|
end
|
22
22
|
|
23
|
+
resources :invoices do
|
24
|
+
resources :payments
|
25
|
+
end
|
26
|
+
|
23
27
|
resources :newsitems
|
24
28
|
|
25
29
|
resources :photos
|
30
|
+
resources :payments
|
26
31
|
|
27
32
|
resources :reports
|
28
33
|
|
@@ -33,7 +38,6 @@ IshManager::Engine.routes.draw do
|
|
33
38
|
resources :reports
|
34
39
|
end
|
35
40
|
|
36
|
-
get 'ally', :to => 'ally#home', :as => :ally_root
|
37
41
|
resources :stock_actions
|
38
42
|
resources :stock_options
|
39
43
|
resources :stock_watches
|
@@ -41,7 +45,8 @@ IshManager::Engine.routes.draw do
|
|
41
45
|
resources :tags
|
42
46
|
|
43
47
|
resources :user_profiles
|
44
|
-
resources :user_profiles, :as => :ish_models_user_profiles
|
48
|
+
# resources :user_profiles, :as => :ish_models_user_profiles
|
49
|
+
resources :user_profiles, :as => :profiles
|
45
50
|
|
46
51
|
resources :venues
|
47
52
|
resources :videos
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ish_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.8.
|
4
|
+
version: 0.1.8.61
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
@@ -158,6 +158,7 @@ files:
|
|
158
158
|
- app/controllers/ish_manager/features_controller.rb
|
159
159
|
- app/controllers/ish_manager/galleries_controller.rb
|
160
160
|
- app/controllers/ish_manager/galleries_controller.rb~
|
161
|
+
- app/controllers/ish_manager/invoices_controller.rb
|
161
162
|
- app/controllers/ish_manager/newsitems_controller.rb
|
162
163
|
- app/controllers/ish_manager/photos_controller.rb
|
163
164
|
- app/controllers/ish_manager/reports_controller.rb
|
@@ -235,6 +236,9 @@ files:
|
|
235
236
|
- app/views/ish_manager/galleries/new.haml
|
236
237
|
- app/views/ish_manager/galleries/show.haml
|
237
238
|
- app/views/ish_manager/galleries/show.haml~
|
239
|
+
- app/views/ish_manager/invoices/_form.haml
|
240
|
+
- app/views/ish_manager/invoices/index.haml
|
241
|
+
- app/views/ish_manager/invoices/new.haml
|
238
242
|
- app/views/ish_manager/kaminari/_first_page.html.erb
|
239
243
|
- app/views/ish_manager/kaminari/_first_page.html.erb~
|
240
244
|
- app/views/ish_manager/kaminari/_gap.html.erb
|
@@ -291,10 +295,12 @@ files:
|
|
291
295
|
- app/views/ish_manager/tags/index.haml
|
292
296
|
- app/views/ish_manager/tags/new.haml
|
293
297
|
- app/views/ish_manager/tags/show.haml
|
298
|
+
- app/views/ish_manager/user_profiles/_form.haml
|
294
299
|
- app/views/ish_manager/user_profiles/edit.haml
|
295
300
|
- app/views/ish_manager/user_profiles/edit.haml~
|
296
301
|
- app/views/ish_manager/user_profiles/index.haml
|
297
302
|
- app/views/ish_manager/user_profiles/index.haml~
|
303
|
+
- app/views/ish_manager/user_profiles/new.haml
|
298
304
|
- app/views/ish_manager/users/_index.haml
|
299
305
|
- app/views/ish_manager/users/_index.haml~
|
300
306
|
- app/views/ish_manager/venues/_form.haml
|