kaui 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/Gemfile +1 -1
  4. data/README.md +10 -15
  5. data/app/assets/images/kaui/duck.png +0 -0
  6. data/app/assets/images/kaui/logo.png +0 -0
  7. data/app/assets/images/kaui/search.png +0 -0
  8. data/app/assets/images/kaui/search_white.png +0 -0
  9. data/app/assets/javascripts/application.js +3 -0
  10. data/app/assets/javascripts/kaui/bootstrap-tweaks.js +3 -0
  11. data/app/assets/javascripts/kaui/kaui.js +99 -0
  12. data/app/assets/stylesheets/application.css +3 -1
  13. data/app/assets/stylesheets/bootstrap_and_overrides.less +39 -0
  14. data/app/assets/stylesheets/kaui/common.less +538 -0
  15. data/app/assets/stylesheets/kaui/datatable.less +75 -0
  16. data/app/assets/stylesheets/kaui/header.less +186 -0
  17. data/app/assets/stylesheets/kaui/home.less +82 -0
  18. data/app/assets/stylesheets/kaui/invoice.less +54 -0
  19. data/app/assets/stylesheets/kaui/kaui.less +16 -0
  20. data/app/assets/stylesheets/kaui/payment.less +29 -0
  21. data/app/assets/stylesheets/kaui/subscription.less +5 -0
  22. data/app/assets/stylesheets/kaui/tags.less +175 -0
  23. data/app/assets/stylesheets/kaui/timeline.less +4 -0
  24. data/app/controllers/kaui/account_emails_controller.rb +18 -18
  25. data/app/controllers/kaui/account_tags_controller.rb +8 -30
  26. data/app/controllers/kaui/account_timelines_controller.rb +13 -23
  27. data/app/controllers/kaui/accounts_controller.rb +65 -62
  28. data/app/controllers/kaui/admin_allowed_users_controller.rb +48 -32
  29. data/app/controllers/kaui/admin_tenants_controller.rb +147 -142
  30. data/app/controllers/kaui/bundle_tags_controller.rb +9 -33
  31. data/app/controllers/kaui/bundles_controller.rb +23 -62
  32. data/app/controllers/kaui/chargebacks_controller.rb +5 -11
  33. data/app/controllers/kaui/charges_controller.rb +11 -18
  34. data/app/controllers/kaui/credits_controller.rb +19 -22
  35. data/app/controllers/kaui/custom_fields_controller.rb +44 -16
  36. data/app/controllers/kaui/engine_controller.rb +56 -3
  37. data/app/controllers/kaui/engine_controller_util.rb +75 -1
  38. data/app/controllers/kaui/home_controller.rb +19 -0
  39. data/app/controllers/kaui/invoice_items_controller.rb +16 -21
  40. data/app/controllers/kaui/invoices_controller.rb +31 -53
  41. data/app/controllers/kaui/payment_methods_controller.rb +14 -46
  42. data/app/controllers/kaui/payments_controller.rb +60 -69
  43. data/app/controllers/kaui/refunds_controller.rb +11 -25
  44. data/app/controllers/kaui/registrations_controller.rb +38 -0
  45. data/app/controllers/kaui/subscriptions_controller.rb +82 -95
  46. data/app/controllers/kaui/tag_definitions_controller.rb +1 -5
  47. data/app/controllers/kaui/tags_controller.rb +17 -17
  48. data/app/controllers/kaui/tenants_controller.rb +38 -55
  49. data/app/controllers/kaui/transactions_controller.rb +8 -15
  50. data/app/helpers/kaui/application_helper.rb +4 -0
  51. data/app/helpers/kaui/object_helper.rb +24 -0
  52. data/app/helpers/kaui/payment_method_helper.rb +9 -0
  53. data/app/helpers/kaui/subscription_helper.rb +1 -1
  54. data/app/helpers/kaui/uuid_helper.rb +1 -0
  55. data/app/models/kaui/ability.rb +7 -1
  56. data/app/models/kaui/account.rb +6 -2
  57. data/app/models/kaui/account_email.rb +10 -0
  58. data/app/models/kaui/allowed_user.rb +16 -4
  59. data/app/models/kaui/audit_log.rb +5 -3
  60. data/app/models/kaui/bundle.rb +6 -11
  61. data/app/models/kaui/credit.rb +3 -0
  62. data/app/models/kaui/invoice.rb +10 -15
  63. data/app/models/kaui/invoice_payment.rb +10 -13
  64. data/app/models/kaui/killbill_registerable.rb +7 -0
  65. data/app/models/kaui/payment.rb +19 -12
  66. data/app/models/kaui/payment_method.rb +9 -0
  67. data/app/models/kaui/payment_state.rb +52 -0
  68. data/app/models/kaui/tag.rb +14 -0
  69. data/app/models/kaui/tag_definition.rb +8 -2
  70. data/app/models/kaui/user.rb +5 -4
  71. data/app/views/kaui/account_emails/_account_emails_table.html.erb +12 -9
  72. data/app/views/kaui/account_emails/_form.html.erb +9 -9
  73. data/app/views/kaui/account_emails/new.html.erb +9 -2
  74. data/app/views/kaui/account_tags/_form.html.erb +20 -29
  75. data/app/views/kaui/account_tags/_form_bar.html.erb +21 -0
  76. data/app/views/kaui/account_tags/edit.html.erb +9 -4
  77. data/app/views/kaui/account_timelines/show.html.erb +204 -287
  78. data/app/views/kaui/accounts/_account_info.html.erb +108 -0
  79. data/app/views/kaui/accounts/_billing_info.html.erb +129 -0
  80. data/app/views/kaui/accounts/_form.html.erb +127 -115
  81. data/app/views/kaui/accounts/_payment_methods.html.erb +28 -0
  82. data/app/views/kaui/accounts/edit.html.erb +10 -0
  83. data/app/views/kaui/accounts/index.html.erb +38 -23
  84. data/app/views/kaui/accounts/new.html.erb +9 -4
  85. data/app/views/kaui/accounts/show.html.erb +4 -106
  86. data/app/views/kaui/admin_allowed_users/_form.html.erb +19 -0
  87. data/app/views/kaui/admin_allowed_users/index.html.erb +35 -18
  88. data/app/views/kaui/admin_allowed_users/new.html.erb +9 -21
  89. data/app/views/kaui/admin_allowed_users/show.html.erb +42 -50
  90. data/app/views/kaui/admin_tenants/_form.html.erb +25 -0
  91. data/app/views/kaui/admin_tenants/_tenants_table.html.erb +27 -0
  92. data/app/views/kaui/admin_tenants/index.html.erb +14 -23
  93. data/app/views/kaui/admin_tenants/new.html.erb +8 -37
  94. data/app/views/kaui/admin_tenants/show.html.erb +128 -113
  95. data/app/views/kaui/bundle_tags/_form.html.erb +20 -28
  96. data/app/views/kaui/bundle_tags/_form_bar.html.erb +21 -0
  97. data/app/views/kaui/bundle_tags/edit.html.erb +9 -4
  98. data/app/views/kaui/bundles/index.html.erb +76 -29
  99. data/app/views/kaui/bundles/transfer.html.erb +28 -28
  100. data/app/views/kaui/chargebacks/_form.html.erb +31 -29
  101. data/app/views/kaui/chargebacks/new.html.erb +9 -4
  102. data/app/views/kaui/charges/_form.html.erb +35 -59
  103. data/app/views/kaui/charges/new.html.erb +9 -4
  104. data/app/views/kaui/credits/_form.html.erb +32 -59
  105. data/app/views/kaui/credits/new.html.erb +9 -4
  106. data/app/views/kaui/custom_fields/_form.html.erb +31 -0
  107. data/app/views/kaui/custom_fields/index.html.erb +33 -20
  108. data/app/views/kaui/custom_fields/new.html.erb +10 -0
  109. data/app/views/kaui/home/index.html.erb +12 -9
  110. data/app/views/kaui/invoice_items/_edit_form.html.erb +30 -0
  111. data/app/views/kaui/invoice_items/edit.html.erb +10 -91
  112. data/app/views/kaui/invoices/_invoice_table.html.erb +113 -0
  113. data/app/views/kaui/invoices/index.html.erb +31 -22
  114. data/app/views/kaui/invoices/show.html.erb +77 -91
  115. data/app/views/kaui/layouts/kaui_account_navbar.html.erb +11 -0
  116. data/app/views/kaui/layouts/kaui_application.html.erb +14 -53
  117. data/app/views/kaui/layouts/kaui_flash.html.erb +17 -0
  118. data/app/views/kaui/layouts/kaui_footer.html.erb +2 -0
  119. data/app/views/kaui/layouts/kaui_header.html.erb +17 -0
  120. data/app/views/kaui/layouts/kaui_navbar.html.erb +75 -0
  121. data/app/views/kaui/payment_methods/_form.html.erb +26 -23
  122. data/app/views/kaui/payment_methods/_new_creditcard_payment_method.html.erb +46 -41
  123. data/app/views/kaui/payment_methods/_payment_methods_details_table.html.erb +25 -0
  124. data/app/views/kaui/payment_methods/_payment_methods_table.html.erb +50 -52
  125. data/app/views/kaui/payment_methods/new.html.erb +9 -4
  126. data/app/views/kaui/payments/_form.html.erb +55 -0
  127. data/app/views/kaui/payments/_payment_table.html.erb +117 -0
  128. data/app/views/kaui/payments/index.html.erb +31 -22
  129. data/app/views/kaui/payments/new.html.erb +9 -92
  130. data/app/views/kaui/payments/show.html.erb +38 -2
  131. data/app/views/kaui/refunds/_form.html.erb +240 -0
  132. data/app/views/kaui/refunds/new.html.erb +8 -280
  133. data/app/views/kaui/registrations/_form.html.erb +19 -0
  134. data/app/views/kaui/registrations/new.html.erb +10 -0
  135. data/app/views/kaui/sessions/_form.html.erb +19 -0
  136. data/app/views/kaui/sessions/new.html.erb +7 -18
  137. data/app/views/kaui/subscriptions/_edit_form.html.erb +26 -0
  138. data/app/views/kaui/subscriptions/_form.html.erb +34 -31
  139. data/app/views/kaui/subscriptions/_subscriptions_table.html.erb +37 -24
  140. data/app/views/kaui/subscriptions/edit.html.erb +10 -30
  141. data/app/views/kaui/subscriptions/new.html.erb +14 -11
  142. data/app/views/kaui/tag_definitions/_form.html.erb +14 -11
  143. data/app/views/kaui/tag_definitions/index.html.erb +56 -30
  144. data/app/views/kaui/tag_definitions/new.html.erb +9 -2
  145. data/app/views/kaui/tags/_tags_table.html.erb +7 -10
  146. data/app/views/kaui/tags/index.html.erb +29 -20
  147. data/app/views/kaui/tenants/_form.html.erb +13 -0
  148. data/app/views/kaui/tenants/index.html.erb +9 -16
  149. data/app/views/kaui/transactions/_form.html.erb +47 -67
  150. data/app/views/kaui/transactions/new.html.erb +9 -2
  151. data/config/initializers/killbill_registerable.rb +4 -0
  152. data/config/routes.rb +88 -93
  153. data/kaui.gemspec +11 -2
  154. data/lib/kaui/engine.rb +6 -4
  155. data/lib/kaui/version.rb +1 -1
  156. data/lib/kaui.rb +24 -1
  157. data/test/dummy/config/application.rb +2 -0
  158. data/test/dummy/config/database.yml +6 -3
  159. data/test/dummy/config/initializers/killbill_client.rb +0 -2
  160. data/test/fixtures/catalog-v1.xml +74 -0
  161. data/test/fixtures/catalog_translation_fr-v1.properties +1 -0
  162. data/test/fixtures/invoice_template-v1.html +100 -0
  163. data/test/fixtures/invoice_translation_fr-v1.properties +23 -0
  164. data/test/fixtures/overdue-v1.xml +49 -0
  165. data/test/fixtures/stripe.yml +2 -0
  166. data/test/functional/kaui/account_emails_controller_test.rb +35 -8
  167. data/test/functional/kaui/account_tags_controller_test.rb +8 -8
  168. data/test/functional/kaui/account_timelines_controller_test.rb +6 -7
  169. data/test/functional/kaui/accounts_controller_test.rb +72 -10
  170. data/test/functional/kaui/admin_allowed_users_controller_test.rb +6 -5
  171. data/test/functional/kaui/admin_tenants_controller_test.rb +104 -48
  172. data/test/functional/kaui/bundle_tags_controller_test.rb +14 -9
  173. data/test/functional/kaui/bundles_controller_test.rb +59 -23
  174. data/test/functional/kaui/chargebacks_controller_test.rb +29 -7
  175. data/test/functional/kaui/charges_controller_test.rb +31 -10
  176. data/test/functional/kaui/credits_controller_test.rb +25 -6
  177. data/test/functional/kaui/custom_fields_controller_test.rb +25 -1
  178. data/test/functional/kaui/functional_test_helper_nosetup.rb +6 -4
  179. data/test/functional/kaui/home_controller_test.rb +24 -0
  180. data/test/functional/kaui/invoice_items_controller_test.rb +56 -8
  181. data/test/functional/kaui/invoices_controller_test.rb +27 -18
  182. data/test/functional/kaui/payment_methods_controller_test.rb +2 -22
  183. data/test/functional/kaui/payments_controller_test.rb +8 -3
  184. data/test/functional/kaui/refunds_controller_test.rb +40 -21
  185. data/test/functional/kaui/subscriptions_controller_test.rb +77 -24
  186. data/test/functional/kaui/tag_definitions_controller_test.rb +1 -7
  187. data/test/functional/kaui/tags_controller_test.rb +1 -1
  188. data/test/functional/kaui/tenants_controller_test.rb +9 -9
  189. data/test/functional/kaui/transactions_controller_test.rb +41 -16
  190. data/test/integration/kaui/integration_test_helper.rb +0 -1
  191. data/test/integration/kaui/navigation_test.rb +4 -6
  192. data/test/test_helper.rb +2 -0
  193. metadata +155 -28
  194. data/Gemfile.lock +0 -210
  195. data/app/assets/stylesheets/bootstrap_and_overrides.css +0 -7
  196. data/app/assets/stylesheets/datatables.scss +0 -14
  197. data/app/assets/stylesheets/layout.scss +0 -19
  198. data/app/views/kaui/account_emails/show.html.erb +0 -25
  199. data/app/views/kaui/account_tags/_account_tags_table.html.erb +0 -32
  200. data/app/views/kaui/account_tags/show.html.erb +0 -6
  201. data/app/views/kaui/account_timelines/index.html.erb +0 -14
  202. data/app/views/kaui/bundle_tags/_bundle_tags_table.html.erb +0 -31
  203. data/app/views/kaui/bundle_tags/show.html.erb +0 -6
  204. data/app/views/kaui/bundles/show.html.erb +0 -18
  205. data/app/views/kaui/payment_methods/index.html.erb +0 -30
  206. data/app/views/kaui/payment_methods/show.html.erb +0 -3
  207. data/app/views/kaui/payments/_payments_table.html.erb +0 -41
  208. data/app/views/kaui/subscriptions/index.html.erb +0 -15
  209. data/app/views/kaui/subscriptions/show.html.erb +0 -33
  210. data/app/views/kaui/tag_definitions/show.html.erb +0 -15
  211. data/vendor/assets/images/img/glyphicons-halflings-white.png +0 -0
  212. data/vendor/assets/images/img/glyphicons-halflings.png +0 -0
  213. data/vendor/assets/stylesheets/css/bootstrap-datepicker.cd46d38.css +0 -274
@@ -1,36 +1,39 @@
1
- <%= form_for(@subscription, :html => {:class => 'form-horizontal'}) do |f| %>
2
- <fieldset>
3
- <%= f.hidden_field :bundle_id %>
4
- <%= f.hidden_field :account_id %>
5
- <%= f.hidden_field :product_category %>
6
- <% if @subscription.product_category == 'ADD_ON' %>
7
- <%= hidden_field_tag :base_product_name, @base_product_name %>
8
- <div class="control-group">
9
- <%= label_tag :plan_name, 'Available Plans:', :class => 'control-label' %>
10
- <div class="controls">
11
- <%= select_tag :plan_name, options_for_select(@plans) %>
12
- <p class="help-block">
13
- Proration on customer's invoice will be done automatically.
14
- </p>
15
- </div>
1
+ <%= form_for @subscription, :html => {:class => 'form-horizontal'} do |f| %>
2
+ <%= f.hidden_field :bundle_id %>
3
+ <%= f.hidden_field :account_id %>
4
+ <%= f.hidden_field :product_category %>
5
+
6
+ <% if @subscription.product_category == 'ADD_ON' %>
7
+ <%= hidden_field_tag :base_product_name, @base_product_name %>
8
+ <div class="form-group">
9
+ <%= label_tag :plan_name, 'Plan', :class => 'col-sm-2 control-label' %>
10
+ <div class="col-sm-10">
11
+ <%= select_tag :plan_name, options_for_select(@plans), :class => 'form-control' %>
16
12
  </div>
17
- <% else %>
18
- <div class="control-group">
19
- <%= f.label :external_key, 'Bundle External Key:', :class => 'control-label' %>
20
- <div class="controls">
21
- <%= f.text_field :external_key, :class => 'input-xlarge', :id => 'external_key' %>
22
- </div>
13
+ </div>
14
+ <% else %>
15
+ <div class="form-group">
16
+ <%= f.label :external_key, 'Key', :class => 'col-sm-2 control-label' %>
17
+ <div class="col-sm-10">
18
+ <%= f.text_field :external_key, :class => 'form-control', :id => 'external_key' %>
23
19
  </div>
24
- <div class="control-group">
25
- <%= label_tag :plan_name, 'Available Plans:', :class => 'control-label' %>
26
- <div class="controls">
27
- <%= select_tag :plan_name, options_for_select(@plans) %>
28
- </div>
20
+ </div>
21
+ <div class="form-group">
22
+ <%= label_tag :plan_name, 'Plan', :class => 'col-sm-2 control-label' %>
23
+ <div class="col-sm-10">
24
+ <%= select_tag :plan_name, options_for_select(@plans), :class => 'form-control' %>
29
25
  </div>
30
- <% end %>
31
- <div class="form-actions">
32
- <%= f.submit 'Create Subscription', :class => 'btn btn-primary' %>
33
- <%= link_to 'Back', :back, :class => 'btn' %>
26
+ </div>
27
+ <% end %>
28
+ <div class="form-group">
29
+ <%= label_tag :requested_date, 'Date', :class => 'col-sm-2 control-label' %>
30
+ <div class="col-sm-10">
31
+ <%= text_field_tag :requested_date, Date.parse(Time.now.to_s).to_s, :class => 'form-control date-picker' %>
34
32
  </div>
35
- </fieldset>
33
+ </div>
34
+ <div class="form-group">
35
+ <div class="col-sm-offset-2 col-sm-10">
36
+ <%= submit_tag 'Save', :class => 'btn btn-default' %>
37
+ </div>
38
+ </div>
36
39
  <% end %>
@@ -1,7 +1,4 @@
1
- <div class="page-header">
2
- <h3>Subscriptions</h3>
3
- </div>
4
- <table class="table table-condensed table-striped data-table">
1
+ <table id="subscriptions_<%= bundle.bundle_id %>" class="table table-condensed mobile-data">
5
2
  <thead>
6
3
  <tr>
7
4
  <th>Product category</th>
@@ -13,39 +10,55 @@
13
10
  </tr>
14
11
  </thead>
15
12
  <tbody>
16
- <% if subscriptions.present? && !subscriptions.nil? %>
17
- <% subscriptions.each do |sub| %>
18
- <tr>
19
- <td><%= humanized_product_category(sub) %></td>
20
- <td><%= humanized_full_product_name(sub) %></td>
21
- <td><%= humanized_start_date(sub, account) %></td>
22
- <td><%= humanized_charged_through_date(sub, account) %></td>
23
- <td><%= humanized_cancelled_date(sub, account) %></td>
24
- <td>
25
- <%= link_to 'Details', kaui_engine.subscription_path(:id => sub.subscription_id), :class => 'btn btn-xs' %>
26
- <% if is_future_cancelled?(sub) %>
27
- <%= link_to 'Reinstate', kaui_engine.reinstate_subscription_path(:id => sub.subscription_id), :method => :put, :class => 'btn btn-xs' %>
28
- <% elsif is_cancelled?(sub) %>
13
+ <% (bundle.subscriptions || []).each do |sub| %>
14
+ <tr class="<%= is_cancelled?(sub) ? 'expired' : 'non-expired' %>">
15
+ <td><%= humanized_product_category(sub) %></td>
16
+ <td><%= humanized_full_product_name(sub) %></td>
17
+ <td><%= humanized_start_date(sub, account) %></td>
18
+ <td><%= humanized_charged_through_date(sub, account) %></td>
19
+ <td><%= humanized_cancelled_date(sub, account) %></td>
20
+ <td class="text-center">
21
+ <% if is_future_cancelled?(sub) %>
22
+ <%= link_to 'Reinstate', kaui_engine.reinstate_subscription_path(:id => sub.subscription_id), :method => :put, :class => 'btn btn-xs' %>
23
+ <% elsif !is_cancelled?(sub) %>
24
+ <% if can? :change_plan, Kaui::Subscription %>
29
25
  <%= link_to 'Change', kaui_engine.edit_subscription_path(sub.subscription_id), :class => 'btn btn-xs' %>
26
+ <% end %>
27
+ <% if can? :cancel, Kaui::Subscription %>
30
28
  <div class="btn-group">
31
29
  <a class="btn btn-xs dropdown-toggle" data-toggle="dropdown" href="#">
32
30
  Cancel
33
31
  <span class="caret"></span>
34
32
  </a>
35
33
  <ul class="dropdown-menu">
36
- <li><%= link_to 'Cancel (default policy)', kaui_engine.subscription_path(:id => sub.subscription_id, :policy => 'END_OF_TERM'), :method => :delete %></li>
34
+ <li><%= link_to 'Cancel (default policy)', kaui_engine.subscription_path(:id => sub.subscription_id), :method => :delete %></li>
37
35
  <li><%= link_to 'Cancel at previous CTD (no proration)', kaui_engine.subscription_path(:id => sub.subscription_id, :policy => 'IMMEDIATE', :ctd => sub.charged_through_date, :billing_period => sub.billing_period), :method => :delete %></li>
38
36
  <li><%= link_to 'Cancel immediately (generate proration)', kaui_engine.subscription_path(:id => sub.subscription_id, :policy => 'IMMEDIATE'), :method => :delete %></li>
39
37
  <li><%= link_to 'Cancel end of term', kaui_engine.subscription_path(:id => sub.subscription_id, :policy => 'END_OF_TERM'), :method => :delete %></li>
40
38
  </ul>
41
39
  </div>
42
- <% if sub.product_category == 'BASE' %>
43
- <%= link_to 'Add add-ons', kaui_engine.new_subscription_path(:params => {:bundle_id => sub.bundle_id, :base_product_name => sub.product_name, :product_category => 'ADD_ON'}), :class => 'btn btn-xs' %>
44
- <% end %>
45
40
  <% end %>
46
- </td>
47
- </tr>
48
- <% end %>
41
+ <% end %>
42
+ </td>
43
+ </tr>
49
44
  <% end %>
50
45
  </tbody>
51
46
  </table>
47
+
48
+ <%= javascript_tag do %>
49
+ $(document).ready(function() {
50
+ $('#subscriptions_<%= bundle.bundle_id %>').dataTable({
51
+ "dom": "t",
52
+ "paging": false,
53
+ "order": [[ 2, "asc" ]],
54
+ "columns": [
55
+ null,
56
+ null,
57
+ null,
58
+ null,
59
+ null,
60
+ { "orderable": false }
61
+ ]
62
+ });
63
+ });
64
+ <% end %>
@@ -1,30 +1,10 @@
1
- <% @page_title = 'Edit Subscription' %>
2
- <%= form_for(@subscription, :url => subscription_path(@subscription.subscription_id), :html => {:method => :put, :class => 'form-horizontal'}) do |f| %>
3
- <div class="control-group">
4
- <%= label_tag :current_plan, 'Current plan:', :class => 'control-label' %>
5
- <div class="controls">
6
- <%= text_field_tag :current_plan, @current_plan, :class => 'input-xlarge disabled', :disabled => 'disabled' %>
7
- </div>
8
- </div>
9
- <div class="control-group">
10
- <%= label_tag :plan_name, 'New plan:', :class => 'control-label' %>
11
- <div class="controls">
12
- <%= select_tag :plan_name, options_for_select(@plans) %>
13
- </div>
14
- </div>
15
- <div class="control-group">
16
- <%= label_tag :requested_date, 'Change Date:', :class => 'control-label' %>
17
- <div class="controls">
18
- <%= text_field_tag :requested_date, Date.parse(Time.now.to_s).to_s, :class => 'input-xlarge date-picker' %>
19
- </div>
20
- </div>
21
- <div class="control-group">
22
- <%= label_tag :policy, 'Policy Override (leave blank for default; select an option to force plan change):', :class => 'control-label' %>
23
- <div class="controls">
24
- <%= select_tag :policy, options_for_select(['', 'IMMEDIATE', 'END_OF_TERM']) %>
25
- </div>
26
- </div>
27
- <div class="form-actions">
28
- <%= f.submit 'Change', :class => 'btn btn-primary' %>
29
- </div>
30
- <% end %>
1
+ <div class="register">
2
+ <div class="col-md-8 col-md-offset-2">
3
+
4
+ <div class="column-block">
5
+ <h1>Change subscription</h1>
6
+ <%= render 'edit_form' %>
7
+ </div>
8
+
9
+ </div>
10
+ </div>
@@ -1,12 +1,15 @@
1
- <div class="page-header">
2
- <% if @subscription.product_category == 'ADD_ON' %>
3
- <h1>Add input-group-addon subscription
4
- <% if @bundle.external_key %> to <%= Kaui.bundle_key_display_string.call(@bundle.external_key) %>
5
- <% end %>
6
- </h1>
7
- <% else %>
8
- <h1>Create new base subscription to account <%= @subscription.account_id %></h1>
9
- <% end %>
10
- </div>
1
+ <div class="register">
2
+ <div class="col-md-8 col-md-offset-2">
3
+
4
+ <div class="column-block">
5
+ <% if @subscription.product_category == 'ADD_ON' %>
6
+ <h1>Add new add-on</h1>
7
+ <% else %>
8
+ <h1>Add new base subscription</h1>
9
+ <% end %>
11
10
 
12
- <%= render 'form' %>
11
+ <%= render 'form' %>
12
+ </div>
13
+
14
+ </div>
15
+ </div>
@@ -1,18 +1,21 @@
1
- <%= form_for(@tag_definition) do |f| %>
1
+ <%= form_for @tag_definition, :html => {:class => 'form-horizontal'} do |f| %>
2
2
  <%= f.hidden_field :id %>
3
- <div class='control-group'>
4
- <%= f.label :name, 'Name:', :class => 'control-label' %>
5
- <div class='controls'>
6
- <%= f.text_field :name %>
3
+
4
+ <div class='form-group'>
5
+ <%= f.label :name, 'Name', :class => 'col-sm-2 control-label' %>
6
+ <div class='col-sm-10'>
7
+ <%= f.text_field :name, :class => 'form-control' %>
7
8
  </div>
8
9
  </div>
9
- <div class='control-group'>
10
- <%= f.label :description, 'Description:', :class => 'control-label' %>
11
- <div class='controls'>
12
- <%= f.text_field :description, :class => 'input-xxlarge' %>
10
+ <div class='form-group'>
11
+ <%= f.label :description, 'Description', :class => 'col-sm-2 control-label' %>
12
+ <div class='col-sm-10'>
13
+ <%= f.text_field :description, :class => 'form-control' %>
13
14
  </div>
14
15
  </div>
15
- <div class='form-actions'>
16
- <%= f.submit 'Create', :class => 'btn btn-primary' %>
16
+ <div class="form-group">
17
+ <div class="col-sm-offset-2 col-sm-10">
18
+ <%= submit_tag 'Save', :class => 'btn btn-default' %>
19
+ </div>
17
20
  </div>
18
21
  <% end %>
@@ -1,34 +1,60 @@
1
- <h3 class="pageHeader">Tag Definitions: <%= link_to 'New Tag Definition', kaui_engine.new_tag_definition_path %></h3>
1
+ <div class="search">
2
2
 
3
- <table id='invoice_table' class='table table-condensed data-table'>
4
- <thead>
5
- <tr>
6
- <th style='width: 30%'>Id</th>
7
- <th style='width: 20%'>Name</th>
8
- <th style='width: 20%'>Description</th>
9
- <th style='width: 5%'>System tag?</th>
10
- <th style='width: 15%'>Applicable types</th>
11
- <th style='width: 5%'></th>
12
- <th style='width: 5%'></th>
13
- </tr>
14
- </thead>
15
- <tbody>
16
- <% @tag_definitions.each do |tag_definition| %>
3
+ <div class="column-block">
4
+
5
+ <h1>Tag Definitions
6
+ <% if can? :create_tag_definition, Kaui::Tag %>
7
+ <%= link_to '&nbsp;<i class="fa fa-plus-square"></i>'.html_safe, kaui_engine.new_tag_definition_path %>
8
+ <% end %>
9
+ </h1>
10
+
11
+ <table id='tag_definitions-table' class='table table-condensed mobile-data'>
12
+ <thead>
17
13
  <tr>
18
- <td><%= truncate_uuid(tag_definition.id) %></td>
19
- <td><%= tag_definition.name %></td>
20
- <td><%= tag_definition.description %></td>
21
- <td><%= tag_definition.is_system_tag? %></td>
22
- <td><%= !tag_definition.is_system_tag? ? 'Any' : tag_definition.applicable_object_types.join(', ') %></td>
23
- <td><%= link_to 'Show', kaui_engine.tag_definition_path(tag_definition.id) %></td>
24
- <td>
25
- <% unless tag_definition.is_system_tag? %>
26
- <%= link_to 'Destroy', kaui_engine.tag_definition_path(tag_definition.id), :confirm => 'Are you sure?', :method => :delete %>
27
- <% end %>
28
- </td>
14
+ <th>Id</th>
15
+ <th>Name</th>
16
+ <th>Description</th>
17
+ <th>System tag?</th>
18
+ <th>Applicable types</th>
19
+ <th></th>
29
20
  </tr>
30
- <% end %>
31
- </tbody>
32
- </table>
21
+ </thead>
22
+ <tbody>
23
+ <% @tag_definitions.each do |tag_definition| %>
24
+ <tr>
25
+ <td><%= truncate_uuid(tag_definition.id) %></td>
26
+ <td><%= tag_definition.name %></td>
27
+ <td><%= tag_definition.description %></td>
28
+ <td><%= tag_definition.is_system_tag? %></td>
29
+ <td><%= tag_definition.pretty_applicable_object_types %></td>
30
+ <td>
31
+ <% unless tag_definition.is_system_tag? %>
32
+ <%= link_to 'Destroy', kaui_engine.tag_definition_path(tag_definition.id), :confirm => 'Are you sure?', :method => :delete %>
33
+ <% end %>
34
+ </td>
35
+ </tr>
36
+ <% end %>
37
+ </tbody>
38
+ </table>
39
+
40
+ </div>
41
+
42
+ </div>
33
43
 
34
- <br />
44
+ <%= javascript_tag do %>
45
+ $(document).ready(function() {
46
+ $('#tag_definitions-table').dataTable({
47
+ "dom": "t",
48
+ "paging": "false",
49
+ "order": [],
50
+ "columns": [
51
+ null,
52
+ null,
53
+ null,
54
+ null,
55
+ null,
56
+ { "orderable": false }
57
+ ]
58
+ });
59
+ });
60
+ <% end %>
@@ -1,3 +1,10 @@
1
- <h1>New tag definition</h1>
1
+ <div class="register">
2
+ <div class="col-md-8 col-md-offset-2">
2
3
 
3
- <%= render 'form' %>
4
+ <div class="column-block">
5
+ <h1>Add new tag definition</h1>
6
+ <%= render 'form' %>
7
+ </div>
8
+
9
+ </div>
10
+ </div>
@@ -1,13 +1,10 @@
1
- <dt>Tags:</dt>
2
- <dd>
3
- <% if tags.present? %>
1
+ <% if can? :add, Kaui::Tag or can? :remove, Kaui::Tag %>
2
+ <%= link_to 'Add/Remove', tags_url_or_path, :class => 'btn btn-xs' %>
3
+ <% end %>
4
+ <% if tags.present? %>
4
5
  <% tags.each_with_index do |tag, idx| %>
5
- <span><%= tag.tag_definition_name %><% if idx < tags.length - 1 %>, <% end %></span>
6
+ <span><%= tag.tag_definition_name %>
7
+ <% if idx < tags.length - 1 %>, <% end %></span>
6
8
  <% end %>
7
9
  <br/>
8
- <% end %>
9
- <% if can? :add, Kaui::Tag or can? :remove, Kaui::Tag %>
10
- <%= link_to 'Add/Remove', tags_url_or_path, :class => 'btn btn-xs' %>
11
- <% end %>
12
- <%= link_to 'Tags Audit', tags_show_path, :class => 'btn btn-xs' %>
13
- </dd>
10
+ <% end %>
@@ -1,28 +1,37 @@
1
- <h3 class="pageHeader">Tags</h3>
1
+ <div class="search">
2
2
 
3
- <table id="tags-table" class="table table-condensed">
4
- <thead>
5
- <tr>
6
- <th>Tag ID</th>
7
- <th>Object type</th>
8
- <th>Tag definition name</th>
9
- </tr>
10
- </thead>
11
- <tbody>
12
- <tr>
13
- <td colspan="1" class="dataTables_empty">Loading data from server</td>
14
- </tr>
15
- </tbody>
16
- </table>
3
+ <div class="column-block">
4
+
5
+ <h1>Tags</h1>
6
+
7
+ <table id="tags-table" class="table table-condensed mobile-data">
8
+ <thead>
9
+ <tr>
10
+ <th>Tag ID</th>
11
+ <th>Object ID</th>
12
+ <th>Object type</th>
13
+ <th>Tag definition name</th>
14
+ </tr>
15
+ </thead>
16
+ <tbody>
17
+ <tr>
18
+ <td colspan="1" class="dataTables_empty">Loading data from server</td>
19
+ </tr>
20
+ </tbody>
21
+ </table>
22
+
23
+ </div>
24
+
25
+ </div>
17
26
 
18
27
  <%= javascript_tag do %>
19
28
  $(document).ready(function() {
20
29
  $('#tags-table').dataTable({
21
- "sDom": "<'row'<'col-md-6'l><'col-md-6'f>r>t<'row'<'col-md-6'i><'col-md-6'p>>",
22
- "sPaginationType": "simple_numbers",
23
- "bProcessing": true,
24
- "bServerSide": true,
25
- "sAjaxSource": "<%= tags_pagination_path :format => :json %>"
30
+ "dom": "<'row'<'col-md-6'l><'col-md-6'f>r>t<'row'<'col-md-6'i><'col-md-6'p>>",
31
+ "pagingType": "full_numbers",
32
+ "processing": true,
33
+ "serverSide": true,
34
+ "ajax": "<%= tags_pagination_path :format => :json %>"
26
35
  });
27
36
  });
28
37
  <% end %>
@@ -0,0 +1,13 @@
1
+ <%= form_for :tenants, :url => {:action => :select_tenant}, :html => {:class => 'form-horizontal'} do |f| %>
2
+ <div class="form-group">
3
+ <%= label_tag :tenant_name, 'Tenant', :class => 'col-sm-2 control-label' %>
4
+ <div class="col-sm-10">
5
+ <%= select_tag :kb_tenant_id, options_for_select(@tenants.map { |t| [t.name || t.api_key, t.kb_tenant_id] }), :class => 'form-control' %>
6
+ </div>
7
+ </div>
8
+ <div class="form-group">
9
+ <div class="col-sm-offset-2 col-sm-10">
10
+ <%= f.submit 'Save', :class => 'btn btn-default' %>
11
+ </div>
12
+ </div>
13
+ <% end %>
@@ -1,17 +1,10 @@
1
- <% unless @tenants.empty? %>
2
- <%= form_for(:tenants, :url => {:action => :select_tenant}, :html => {:method => :post, :class => "form-horizontal"}) do |f| %>
3
- <fieldset>
4
- <div class="control-group">
5
- <%= label_tag :tenant_name, "Available Tenants:", :class => "control-label" %>
6
- <div class="controls">
7
- <%= select_tag :kb_tenant_id, options_for_select(@tenants.map { |t| [t.name, t.kb_tenant_id] }) %>
8
- </div>
9
- </div>
10
- <div class="form-actions">
11
- <%= f.submit 'Chose Tenant', :class => 'btn btn-primary' %>
12
- <%= link_to 'Back', :back, :class => 'btn' %>
13
- </div>
1
+ <div class="register">
2
+ <div class="col-md-8 col-md-offset-2">
14
3
 
15
- </fieldset>
16
- <% end %>
17
- <% end %>
4
+ <div class="column-block">
5
+ <h1>Choose tenant</h1>
6
+ <%= render 'form' %>
7
+ </div>
8
+
9
+ </div>
10
+ </div>
@@ -1,77 +1,57 @@
1
- <%= form_for(@transaction) do |f| %>
2
- <fieldset>
3
- <% if @account_id.present? %>
4
- <div class="control-group">
5
- <%= label_tag :account_id, 'Account id:', :class => 'control-label' %>
6
- <div class="controls">
7
- <%= text_field_tag :account_id, @account_id, :class => 'input-xlarge disabled', :readonly => true %>
8
- </div>
9
- </div>
10
- <% end %>
11
- <% if @payment_method_id.present? %>
12
- <div class="control-group">
13
- <%= label_tag :payment_method_id, 'Payment method id:', :class => 'control-label' %>
14
- <div class="controls">
15
- <%= text_field_tag :payment_method_id, @payment_method_id, :class => 'input-xlarge disabled', :readonly => true %>
16
- </div>
17
- </div>
18
- <% end %>
19
- <% if @transaction.payment_id.present? %>
20
- <div class="control-group">
21
- <%= f.label :payment_id, 'Payment id:', :class => 'control-label' %>
22
- <div class="controls">
23
- <%= f.text_field :payment_id, :class => 'input-xlarge disabled', :readonly => true %>
24
- </div>
25
- </div>
26
- <% end %>
27
- <div class="control-group">
28
- <%= f.label :transaction_type, 'Transaction type', :class => 'control-label' %>
29
- <div class="controls">
30
- <%= f.select :transaction_type, %w(AUTHORIZE CAPTURE CHARGEBACK CREDIT PURCHASE REFUND VOID), {}, :class => 'input-medium' %>
31
- </div>
1
+ <%= form_for @transaction, :url => {:action => :create}, :html => {:class => 'form-horizontal'} do |f| %>
2
+ <%= f.hidden_field :payment_id %>
3
+ <%= hidden_field_tag :account_id, @account_id %>
4
+ <%= hidden_field_tag :payment_method_id, @payment_method_id %>
5
+
6
+ <div class="form-group">
7
+ <%= f.label :transaction_type, 'Transaction type', :class => 'col-sm-3 control-label' %>
8
+ <div class="col-sm-9">
9
+ <%= f.select :transaction_type, %w(AUTHORIZE CAPTURE CHARGEBACK CREDIT PURCHASE REFUND VOID), {}, :class => 'form-control' %>
32
10
  </div>
33
- <% unless @transaction.transaction_type == 'VOID' %>
34
- <div class="control-group">
35
- <%= f.label :amount, 'Amount', :class => 'control-label' %>
36
- <div class="controls">
37
- <%= f.text_field :amount, :id => 'amount', :class => 'input-sm' %>
38
- </div>
11
+ </div>
12
+ <% unless @transaction.transaction_type == 'VOID' %>
13
+ <div class="form-group">
14
+ <%= f.label :amount, 'Amount', :class => 'col-sm-3 control-label' %>
15
+ <div class="col-sm-9">
16
+ <%= f.text_field :amount, :id => 'charge_amount', :class => 'form-control' %>
39
17
  </div>
40
- <div class="control-group">
41
- <%= f.label :currency, 'Currency', :class => 'control-label' %>
42
- <div class="controls">
43
- <%= f.select :currency, currencies, {}, :class => 'input-sm' %>
44
- </div>
18
+ </div>
19
+ <div class="form-group">
20
+ <%= f.label :currency, 'Currency', :class => 'col-sm-3 control-label' %>
21
+ <div class="col-sm-9">
22
+ <%= f.select :currency, currencies, {}, :class => 'form-control' %>
45
23
  </div>
46
- <% end %>
47
- <% unless @transaction.payment_id.present? %>
48
- <div class="control-group">
49
- <%= f.label :payment_external_key, 'Payment external key', :class => 'control-label' %>
50
- <div class="controls">
51
- <%= f.text_field :payment_external_key, :class => 'input-medium' %>
52
- </div>
24
+ </div>
25
+ <% end %>
26
+ <% unless @transaction.payment_id.present? %>
27
+ <div class="form-group">
28
+ <%= f.label :payment_external_key, 'Payment key', :class => 'col-sm-3 control-label' %>
29
+ <div class="col-sm-9">
30
+ <%= f.text_field :payment_external_key, :class => 'form-control' %>
53
31
  </div>
54
- <% end %>
55
- <div class="control-group">
56
- <%= f.label :transaction_external_key, 'Transaction external key', :class => 'control-label' %>
57
- <div class="controls">
58
- <%= f.text_field :transaction_external_key, :class => 'input-medium' %>
59
32
  </div>
33
+ <% end %>
34
+ <div class="form-group">
35
+ <%= f.label :transaction_external_key, 'Transaction key', :class => 'col-sm-3 control-label' %>
36
+ <div class="col-sm-9">
37
+ <%= f.text_field :transaction_external_key, :class => 'form-control' %>
60
38
  </div>
61
- <div class="control-group">
62
- <%= label_tag :reason, 'Reason', :class => 'control-label' %>
63
- <div class="controls">
64
- <%= select_tag :reason, options_for_select(Kaui::Payment::SAMPLE_REASON_CODES) %>
65
- </div>
39
+ </div>
40
+ <div class="form-group">
41
+ <%= label_tag :reason, 'Reason', :class => 'col-sm-3 control-label' %>
42
+ <div class="col-sm-9">
43
+ <%= select_tag :reason, options_for_select(Kaui::Payment::SAMPLE_REASON_CODES), :class => 'form-control' %>
66
44
  </div>
67
- <div class="control-group">
68
- <%= label_tag :comment, 'Comment', :class => 'control-label' %>
69
- <div class="controls">
70
- <%= text_area_tag :comment, '', :rows => 3, :class => 'input-xlarge' %>
71
- </div>
45
+ </div>
46
+ <div class="form-group">
47
+ <%= label_tag :comment, 'Comment', :class => 'col-sm-3 control-label' %>
48
+ <div class="col-sm-9">
49
+ <%= text_area_tag :comment, nil, :rows => 3, :class => 'form-control' %>
72
50
  </div>
73
- <div class='form-actions'>
74
- <%= f.submit 'Create', :class => 'btn btn-primary' %>
51
+ </div>
52
+ <div class="form-group">
53
+ <div class="col-sm-offset-3 col-sm-9">
54
+ <%= submit_tag 'Save', :class => 'btn btn-default' %>
75
55
  </div>
76
- </fieldset>
56
+ </div>
77
57
  <% end %>
@@ -1,3 +1,10 @@
1
- <h1>New transaction</h1>
1
+ <div class="register">
2
+ <div class="col-md-8 col-md-offset-2">
2
3
 
3
- <%= render 'form' %>
4
+ <div class="column-block">
5
+ <h1>Process transaction</h1>
6
+ <%= render 'form' %>
7
+ </div>
8
+
9
+ </div>
10
+ </div>