has_accounts_engine 1.1.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/images/16x16/add.png +0 -0
- data/app/assets/images/16x16/alert.png +0 -0
- data/app/assets/images/16x16/combolink.png +0 -0
- data/app/assets/images/16x16/copy.png +0 -0
- data/app/assets/images/16x16/delete.png +0 -0
- data/app/assets/images/16x16/edit.png +0 -0
- data/app/assets/images/16x16/filter.png +0 -0
- data/app/assets/images/16x16/index.png +0 -0
- data/app/assets/images/16x16/notice.png +0 -0
- data/app/assets/images/16x16/pdf.png +0 -0
- data/app/assets/images/16x16/preferences.png +0 -0
- data/app/assets/images/16x16/print.png +0 -0
- data/app/assets/images/16x16/show.png +0 -0
- data/app/assets/images/22x22/arrow-right.png +0 -0
- data/app/assets/images/22x22/edit.png +0 -0
- data/app/assets/images/22x22/insert_booking.png +0 -0
- data/app/assets/images/22x22/remove.png +0 -0
- data/app/assets/images/32x32/edit.png +0 -0
- data/app/assets/images/32x32/remove.png +0 -0
- data/app/assets/images/48x48/accounting.png +0 -0
- data/app/assets/images/48x48/basic_claims_data.png +0 -0
- data/app/assets/images/48x48/contacts.png +0 -0
- data/app/assets/images/48x48/invoicing.png +0 -0
- data/app/assets/images/48x48/nav_users.png +0 -0
- data/app/assets/images/48x48/preferences.png +0 -0
- data/app/assets/images/48x48/projects.png +0 -0
- data/app/assets/images/48x48/salaries.png +0 -0
- data/app/assets/images/48x48/settings.png +0 -0
- data/app/assets/images/48x48/stocks.png +0 -0
- data/app/assets/images/48x48/store.png +0 -0
- data/app/assets/images/button_bg.png +0 -0
- data/app/assets/images/crystal-icons/16x16/filter.png +0 -0
- data/app/assets/images/down.png +0 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/images/flavour-extended/48x48/invoice.png +0 -0
- data/app/assets/images/free-business-desktop-icons/48x48/business.png +0 -0
- data/app/assets/images/gnome-web-icons/48x48/Gnome-X-Office-Address-Book-48.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_55_fbec88_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_75_759fcf_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_85_aeb9cf_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_55_aeb9cf_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-hard_100_759fcf_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-hard_100_f6f6f6_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_217bc0_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_469bdd_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_6da8d5_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_d8e7f3_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_f9bd01_256x240.png +0 -0
- data/app/assets/images/letter-logo.alpha.png +0 -0
- data/app/assets/images/letter-logo.big.png +0 -0
- data/app/assets/images/letter-logo.orig.png +0 -0
- data/app/assets/images/letter-logo.png +0 -0
- data/app/assets/images/loading.gif +0 -0
- data/app/assets/images/logo.png +0 -0
- data/app/assets/images/oxygen-icons/16x16/application-pdf.png +0 -0
- data/app/assets/images/oxygen-icons/16x16/document-preview.png +0 -0
- data/app/assets/images/oxygen-icons/16x16/document-print.png +0 -0
- data/app/assets/images/oxygen-icons/16x16/edit-copy.png +0 -0
- data/app/assets/images/oxygen-icons/16x16/go-next.png +0 -0
- data/app/assets/images/oxygen-icons/16x16/mail-mark-notjunk.png +0 -0
- data/app/assets/images/oxygen-icons/16x16/status_unknown.png +0 -0
- data/app/assets/images/oxygen-icons/48x48/preferences-system-time.png +0 -0
- data/app/assets/images/oxygen-icons/48x48/system-users.png +0 -0
- data/app/assets/images/oxygen-icons/48x48/view-bank-account-savings.png +0 -0
- data/app/assets/images/oxygen-icons/48x48/view-loan-asset.png +0 -0
- data/app/assets/images/rails.png +0 -0
- data/app/assets/images/up.png +0 -0
- data/app/assets/javascripts/has_accounts_engine/accounting-jquery.js +77 -0
- data/app/assets/javascripts/has_accounts_engine/accounting.js +411 -0
- data/app/assets/javascripts/has_accounts_engine/application.js +248 -0
- data/app/assets/javascripts/has_accounts_engine/bootstrap.datepicker.js +455 -0
- data/app/assets/javascripts/has_accounts_engine/cyt.js +117 -0
- data/app/assets/stylesheets/has_accounts_engine/.gitkeep +0 -0
- data/app/assets/stylesheets/has_accounts_engine/app_bootstrap.css.scss +5 -0
- data/app/assets/stylesheets/has_accounts_engine/application.css +14 -0
- data/app/assets/stylesheets/has_accounts_engine/bootstrap.datepicker.css +7 -0
- data/app/assets/stylesheets/has_accounts_engine/bootstrap.scss +1 -0
- data/app/assets/stylesheets/has_accounts_engine/partials/_base.sass +39 -0
- data/app/assets/stylesheets/has_accounts_engine/partials/_jquery.sass +1 -0
- data/app/assets/stylesheets/has_accounts_engine/partials/content/_accounting.sass +16 -0
- data/app/assets/stylesheets/has_accounts_engine/partials/content/_app.sass +46 -0
- data/app/assets/stylesheets/has_accounts_engine/partials/content/_combobox.sass +6 -0
- data/app/assets/stylesheets/has_accounts_engine/partials/content/_contextual.sass +10 -0
- data/app/assets/stylesheets/has_accounts_engine/partials/content/_fixed_sidebar.sass +11 -0
- data/app/assets/stylesheets/has_accounts_engine/partials/content/_form_view.sass +24 -0
- data/app/assets/stylesheets/has_accounts_engine/partials/content/_icons.sass +29 -0
- data/app/assets/stylesheets/has_accounts_engine/partials/content/_invoice.sass +10 -0
- data/app/assets/stylesheets/has_accounts_engine/partials/content/_overview.sass +44 -0
- data/app/assets/stylesheets/has_accounts_engine/partials/content/_select_form_labels.sass +28 -0
- data/app/assets/stylesheets/has_accounts_engine/partials/jquery/_jquery_ui.sass +1461 -0
- data/app/assets/stylesheets/has_accounts_engine/partials/print/_app.sass +2 -0
- data/app/assets/stylesheets/has_accounts_engine/partials/print/_layout.sass +66 -0
- data/app/assets/stylesheets/has_accounts_engine/print.scss +5 -0
- data/app/assets/stylesheets/has_accounts_engine/screen.scss +144 -0
- data/app/controllers/accounts_controller.rb +1 -1
- data/app/controllers/booking_templates_controller.rb +1 -1
- data/app/controllers/bookings_controller.rb +1 -1
- data/app/helpers/bootstrap_helper.rb +147 -0
- data/app/helpers/has_accounts_helper.rb +9 -0
- data/app/inputs/combobox_input.rb +22 -0
- data/app/inputs/date_field_input.rb +11 -0
- data/app/views/accounts/_booking_item.html.haml +2 -2
- data/app/views/accounts/_booking_list_header.html.haml +1 -1
- data/app/views/accounts/_booking_list_turnover.html.haml +1 -1
- data/app/views/accounts/_edit_booking.html.haml +1 -1
- data/app/views/accounts/_edit_bookings.html.haml +1 -1
- data/app/views/accounts/_show.html.haml +3 -2
- data/app/views/accounts/_show_bookings.html.haml +2 -2
- data/app/views/accounts/show.html.haml +1 -1
- data/app/views/booking_templates/_booking_template.html.haml +1 -1
- data/app/views/booking_templates/_form.html.haml +2 -2
- data/app/views/booking_templates/_list.html.haml +1 -1
- data/app/views/bookings/_booking.html.haml +1 -1
- data/app/views/bookings/_form.html.haml +6 -5
- data/app/views/bookings/_list.html.haml +1 -1
- data/app/views/bookings/_sidebar.html.haml +0 -5
- data/app/views/bookings/_simple_form.html.haml +2 -2
- data/app/views/has_accounts/_form.html.haml +5 -0
- data/app/views/has_accounts/_list.html.haml +15 -0
- data/app/views/has_accounts/_search_form.html.haml +6 -0
- data/app/views/has_accounts/_show.html.haml +2 -0
- data/app/views/has_accounts/_show_attachments.html.haml +9 -0
- data/app/views/has_accounts/_sidebar.html.haml +8 -0
- data/app/views/has_accounts/create.js.erb +3 -0
- data/app/views/has_accounts/destroy.js.erb +2 -0
- data/app/views/has_accounts/edit.html.haml +5 -0
- data/app/views/has_accounts/edit.js.erb +3 -0
- data/app/views/has_accounts/index.html.haml +6 -0
- data/app/views/has_accounts/new.html.haml +5 -0
- data/app/views/has_accounts/new.js.erb +3 -0
- data/app/views/has_accounts/show.html.haml +5 -0
- data/app/views/has_accounts/show_modal.js.erb +7 -0
- data/app/views/has_accounts/update.js.erb +3 -0
- data/app/views/layouts/has_accounts_engine.html.haml +48 -0
- data/config/locales/de.yml +14 -37
- data/config/locales/en.yml +26 -23
- data/lib/has_accounts_engine/railtie.rb +4 -0
- data/lib/has_accounts_engine/version.rb +1 -1
- metadata +169 -8
- data/app/controllers/bank_accounts_controller.rb +0 -3
- data/app/controllers/banks_controller.rb +0 -3
- data/app/views/bank_accounts/_bank_account.html.haml +0 -1
- data/app/views/bank_accounts/_form.html.haml +0 -10
- data/app/views/banks/_bank.html.haml +0 -3
- data/app/views/banks/_form.html.haml +0 -12
@@ -0,0 +1,66 @@
|
|
1
|
+
// Media print specific styles ****
|
2
|
+
|
3
|
+
// Navigation elements
|
4
|
+
.navbar,
|
5
|
+
#sidebar,
|
6
|
+
.pagination,
|
7
|
+
.search-form,
|
8
|
+
#footer
|
9
|
+
display: none
|
10
|
+
|
11
|
+
// Sidebar fix
|
12
|
+
.row-fluid
|
13
|
+
width: 150%
|
14
|
+
.row-fluid .row-fluid
|
15
|
+
width: 100%
|
16
|
+
|
17
|
+
.tab-content
|
18
|
+
table
|
19
|
+
width: 60%
|
20
|
+
|
21
|
+
// Content
|
22
|
+
.container-fluid .content
|
23
|
+
margin-right: 20px
|
24
|
+
|
25
|
+
// Alerts
|
26
|
+
.alert
|
27
|
+
display: none
|
28
|
+
|
29
|
+
// Actions
|
30
|
+
.contextual,
|
31
|
+
.action-links,
|
32
|
+
.btn
|
33
|
+
display: none
|
34
|
+
|
35
|
+
// Tabs
|
36
|
+
ul.nav.nav-tabs
|
37
|
+
border-bottom: none
|
38
|
+
|
39
|
+
ul.nav.nav-tabs li
|
40
|
+
display: none
|
41
|
+
|
42
|
+
&.active
|
43
|
+
display: block
|
44
|
+
|
45
|
+
a
|
46
|
+
border: none
|
47
|
+
outline: none
|
48
|
+
font-size: 24px
|
49
|
+
line-height: 36px
|
50
|
+
color: #333
|
51
|
+
font-weight: bold
|
52
|
+
margin: 0
|
53
|
+
padding: 0
|
54
|
+
|
55
|
+
// Elements
|
56
|
+
a
|
57
|
+
color: #484848
|
58
|
+
|
59
|
+
input,
|
60
|
+
textarea,
|
61
|
+
select
|
62
|
+
border: 0px none
|
63
|
+
box-shadow: none
|
64
|
+
|
65
|
+
.ui-widget-content
|
66
|
+
border: none
|
@@ -0,0 +1,144 @@
|
|
1
|
+
// CyT
|
2
|
+
@import 'partials/base';
|
3
|
+
@import 'partials/content/icons';
|
4
|
+
@import 'partials/content/combobox';
|
5
|
+
@import 'partials/content/overview';
|
6
|
+
@import 'partials/content/contextual';
|
7
|
+
@import 'partials/content/fixed_sidebar';
|
8
|
+
@import 'partials/content/select_form_labels';
|
9
|
+
@import 'partials/content/app';
|
10
|
+
|
11
|
+
// jQuery UI
|
12
|
+
|
13
|
+
.well:empty {
|
14
|
+
display: none;
|
15
|
+
}
|
16
|
+
|
17
|
+
.label.disabled {
|
18
|
+
background-color: transparent;
|
19
|
+
color: #404040;
|
20
|
+
}
|
21
|
+
|
22
|
+
.label.disabled:hover {
|
23
|
+
background-color: #BFBFBF;
|
24
|
+
color: white;
|
25
|
+
}
|
26
|
+
|
27
|
+
// Styles
|
28
|
+
.page-header {
|
29
|
+
margin-top: 0;
|
30
|
+
}
|
31
|
+
|
32
|
+
// Tabs
|
33
|
+
.tab-content {
|
34
|
+
overflow: visible;
|
35
|
+
}
|
36
|
+
|
37
|
+
// Buttons
|
38
|
+
.btn input {
|
39
|
+
float: none;
|
40
|
+
clear: both;
|
41
|
+
}
|
42
|
+
|
43
|
+
.content > a {
|
44
|
+
clear: both;
|
45
|
+
display: block;
|
46
|
+
float: none;
|
47
|
+
margin: 10px;
|
48
|
+
padding: 10px 0;
|
49
|
+
}
|
50
|
+
|
51
|
+
// Pagination
|
52
|
+
.pagination {
|
53
|
+
margin: 0;
|
54
|
+
}
|
55
|
+
|
56
|
+
.pagination ul {
|
57
|
+
float: right;
|
58
|
+
}
|
59
|
+
|
60
|
+
.pagination ul .gap {
|
61
|
+
border: none;
|
62
|
+
}
|
63
|
+
|
64
|
+
|
65
|
+
// Form
|
66
|
+
.search-form {
|
67
|
+
float: left;
|
68
|
+
}
|
69
|
+
|
70
|
+
.well .form-actions {
|
71
|
+
background-color: inherit;
|
72
|
+
padding-bottom: 0px;
|
73
|
+
}
|
74
|
+
|
75
|
+
// Sidebar
|
76
|
+
.sidebar.well {
|
77
|
+
padding: 8px 0;
|
78
|
+
}
|
79
|
+
|
80
|
+
.filter_style {
|
81
|
+
display: block;
|
82
|
+
list-style: none;
|
83
|
+
}
|
84
|
+
|
85
|
+
.filter_style li{
|
86
|
+
list-style: none;
|
87
|
+
padding: 5px 0 0 0;
|
88
|
+
text-decoration: none;
|
89
|
+
}
|
90
|
+
|
91
|
+
.filter_style li a{
|
92
|
+
text-decoration: none;
|
93
|
+
}
|
94
|
+
|
95
|
+
// Filter
|
96
|
+
.nav-list label.checkbox {
|
97
|
+
margin-bottom: 0;
|
98
|
+
padding: 3px 15px;
|
99
|
+
padding-left: 33px;
|
100
|
+
margin-left: -15px;
|
101
|
+
margin-right: -15px;
|
102
|
+
}
|
103
|
+
|
104
|
+
.nav-list > .active > label.checkbox {
|
105
|
+
background-color: #08C;
|
106
|
+
color: white;
|
107
|
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
|
108
|
+
}
|
109
|
+
|
110
|
+
// Forms
|
111
|
+
input, textarea, select {
|
112
|
+
background-color: #fff;
|
113
|
+
}
|
114
|
+
|
115
|
+
input, textarea {
|
116
|
+
width: 98%;
|
117
|
+
}
|
118
|
+
|
119
|
+
select {
|
120
|
+
width: 100%;
|
121
|
+
}
|
122
|
+
|
123
|
+
.input-prepend .add-on {
|
124
|
+
float: left;
|
125
|
+
}
|
126
|
+
|
127
|
+
// jQuery UI
|
128
|
+
.ui-widget-content{
|
129
|
+
border: 1px solid #e4e4e4 !important;
|
130
|
+
background-color: #fff !important;
|
131
|
+
background-image: none;
|
132
|
+
}
|
133
|
+
|
134
|
+
.ui-widget-content a{
|
135
|
+
background-color: #fff;
|
136
|
+
color: #222222
|
137
|
+
}
|
138
|
+
|
139
|
+
// Bookings
|
140
|
+
tr.booking {
|
141
|
+
.amount {
|
142
|
+
text-align: right;
|
143
|
+
}
|
144
|
+
}
|
@@ -0,0 +1,147 @@
|
|
1
|
+
module BootstrapHelper
|
2
|
+
def boot_page_title(action_or_title = nil, model = nil)
|
3
|
+
if action_or_title.is_a? String
|
4
|
+
title = action_or_title
|
5
|
+
else
|
6
|
+
action = action_or_title || action_name
|
7
|
+
if action.to_s == 'show' && defined?(resource) && resource.present?
|
8
|
+
title = resource.to_s
|
9
|
+
else
|
10
|
+
title = t_title(action, model)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
content_for :page_title, title
|
15
|
+
content_tag(:div, :class => 'page-header') do
|
16
|
+
content_tag(:h1, title)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# Icons
|
21
|
+
# =====
|
22
|
+
def boot_icon(type)
|
23
|
+
content_tag(:i, '', :class => "icon-#{type}")
|
24
|
+
end
|
25
|
+
|
26
|
+
# Labels
|
27
|
+
# ======
|
28
|
+
def boot_label(content, type = nil)
|
29
|
+
return "" unless content.present?
|
30
|
+
|
31
|
+
classes = ['label', "label-#{type}"].compact.join(' ')
|
32
|
+
content_tag(:span, content, :class => classes)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Modal
|
36
|
+
# =====
|
37
|
+
def modal_header(title)
|
38
|
+
content_tag(:div, :class => 'modal-header') do
|
39
|
+
content_tag(:button, '×'.html_safe, :type => 'button', :class => 'close', 'data-dismiss' => 'modal') +
|
40
|
+
content_tag(:h3, title)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# Messages
|
45
|
+
# ========
|
46
|
+
def boot_alert(*args, &block)
|
47
|
+
if block_given?
|
48
|
+
type = args[0]
|
49
|
+
content = capture(&block)
|
50
|
+
else
|
51
|
+
content = args[0]
|
52
|
+
type = args[1]
|
53
|
+
end
|
54
|
+
|
55
|
+
type ||= 'info'
|
56
|
+
content_tag(:div, :class => "alert alert-block alert-#{type} fade in") do
|
57
|
+
link_to('×'.html_safe, '#', :class => 'close', 'data-dismiss' => 'alert') + content
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def boot_no_entry_alert
|
62
|
+
boot_alert t('alerts.empty')
|
63
|
+
end
|
64
|
+
|
65
|
+
# Navigation
|
66
|
+
# ==========
|
67
|
+
def boot_nav_header(title, refresh_action = false)
|
68
|
+
if title.is_a? Symbol
|
69
|
+
title = t("#{title}.title")
|
70
|
+
end
|
71
|
+
|
72
|
+
content_tag(:li, :class => 'nav-header') do
|
73
|
+
content = [title]
|
74
|
+
if refresh_action
|
75
|
+
content << content_tag(:button, :type => "submit", :style => 'border: none; background-color: transparent; float: right') do
|
76
|
+
content_tag(:i, "", :class => 'icon-refresh')
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
content.join("\n").html_safe
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def boot_nav_li_link(filter_name, param_value, title = nil, param_name = filter_name, current_value = params[param_name], classes = [], &content)
|
85
|
+
classes << "active" if current_value.to_s == param_value.to_s
|
86
|
+
title ||= param_value
|
87
|
+
title = t("#{filter_name.to_s}.#{title}", :default => title)
|
88
|
+
|
89
|
+
if block_given?
|
90
|
+
content_tag(:li, :class => classes, &content)
|
91
|
+
else
|
92
|
+
content_tag(:li, :class => classes) do
|
93
|
+
url = url_for(params.merge({param_name => param_value}))
|
94
|
+
link_to title, url
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
def boot_nav_li_checkbox(filter_name, param_value, title = nil, param_name = filter_name, current_value = params[param_name], classes = [], &content)
|
100
|
+
active = current_value.include? param_value.to_s
|
101
|
+
classes << "active" if active
|
102
|
+
|
103
|
+
title ||= param_value
|
104
|
+
title = t("#{filter_name.to_s}.#{title}", :default => title)
|
105
|
+
|
106
|
+
if block_given?
|
107
|
+
content_tag(:li, :class => classes, &content)
|
108
|
+
else
|
109
|
+
content_tag(:li, :class => classes) do
|
110
|
+
content_tag 'label', :class => 'checkbox' do
|
111
|
+
content = []
|
112
|
+
content << content_tag('input', '', :type => 'checkbox', :checked => active, :name => "#{param_name}[]", :value => param_value)
|
113
|
+
content << title
|
114
|
+
|
115
|
+
content.join("\n").html_safe
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
def boot_nav_filter(name, entries, type = :link)
|
122
|
+
refresh_action = (type == :checkbox)
|
123
|
+
|
124
|
+
content_tag(:ul, :class => ['nav', 'nav-list']) do
|
125
|
+
content = []
|
126
|
+
content << boot_nav_header(name, refresh_action)
|
127
|
+
|
128
|
+
entries.each do |entry|
|
129
|
+
if entry.is_a? Hash
|
130
|
+
title = entry[:title]
|
131
|
+
value = entry[:value]
|
132
|
+
else
|
133
|
+
title = value = entry
|
134
|
+
end
|
135
|
+
|
136
|
+
case type
|
137
|
+
when :link
|
138
|
+
content << boot_nav_li_link(name, value, title)
|
139
|
+
when :checkbox
|
140
|
+
content << boot_nav_li_checkbox(name, value, title)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
content.join("\n").html_safe
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module HasAccountsHelper
|
2
|
+
include ActionView::Helpers::NumberHelper
|
3
|
+
def currency_fmt(value)
|
4
|
+
# We often do get -0.0 but don't like it
|
5
|
+
value = 0.0 if value.to_s.match %r{^-[0.]*$}
|
6
|
+
|
7
|
+
number = number_with_precision(value, :precision => 2, :separator => '.', :delimiter => "'")
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class ComboboxInput < SimpleForm::Inputs::CollectionSelectInput
|
2
|
+
include ActionView::Helpers::UrlHelper
|
3
|
+
include BootstrapHelper
|
4
|
+
|
5
|
+
def link_fragment
|
6
|
+
reference = object.send(reflection.name)
|
7
|
+
|
8
|
+
if reference
|
9
|
+
template.content_tag('span', template.link_to(boot_icon("eye-open"), object.send(reflection.name)), :class => 'combobox-link')
|
10
|
+
else
|
11
|
+
url_method = "new_#{reflection.name}_#{object.class.model_name.underscore.pluralize}_url"
|
12
|
+
if template.respond_to?(url_method)
|
13
|
+
template.content_tag('span', template.link_to(boot_icon("plus"), template.send(url_method), :remote => true), :class => "combobox-link new_#{reflection.name}")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def input
|
19
|
+
input_html_classes.push 'span'
|
20
|
+
super + link_fragment
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class DateFieldInput < SimpleForm::Inputs::StringInput
|
2
|
+
def input
|
3
|
+
input_html_options[:type] = 'text'
|
4
|
+
template.content_tag(:div, :class => 'input-append date-picker date') do
|
5
|
+
super +
|
6
|
+
template.content_tag(:div, :class => 'add-on') do
|
7
|
+
template.content_tag(:i, '', :class => 'icon-calendar')
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -5,9 +5,9 @@
|
|
5
5
|
- if @booking.comments.present?
|
6
6
|
%hr{:style => "height: 1px; margin: 0"}/
|
7
7
|
%i= @booking.comments
|
8
|
-
%td=
|
9
|
-
%td.currency= (@booking.credit_account == @account) ? currency_fmt(@booking.amount) : content_tag('i', link_to(@booking.credit_account.code, account_path(@booking.credit_account), :title => @booking.credit_account.title))
|
8
|
+
%td= @booking.reference.try(:to_s)
|
10
9
|
%td.currency= (@booking.debit_account == @account) ? currency_fmt(@booking.amount) : content_tag('i', link_to(@booking.debit_account.code, account_path(@booking.debit_account), :title => @booking.debit_account.title))
|
10
|
+
%td.currency= (@booking.credit_account == @account) ? currency_fmt(@booking.amount) : content_tag('i', link_to(@booking.credit_account.code, account_path(@booking.credit_account), :title => @booking.credit_account.title))
|
11
11
|
%td.currency= currency_fmt(@saldo)
|
12
12
|
%td.action-links
|
13
13
|
= list_link_for(:edit, [@account, @booking])
|