kaui 0.1.17 → 0.1.18

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.
Files changed (54) hide show
  1. data/app/controllers/kaui/tags_controller.rb +85 -0
  2. data/app/helpers/kaui/killbill_helper.rb +7 -0
  3. data/app/models/kaui/custom_field.rb +6 -0
  4. data/app/views/kaui/account_emails/edit.html.erb +6 -0
  5. data/app/views/kaui/analytics/payments_over_time.html.erb +9 -0
  6. data/app/views/kaui/tags/_form.html.erb +25 -0
  7. data/app/views/kaui/tags/edit.html.erb +6 -0
  8. data/app/views/kaui/tags/index.html.erb +25 -0
  9. data/app/views/kaui/tags/new.html.erb +5 -0
  10. data/app/views/kaui/tags/show.html.erb +15 -0
  11. data/lib/kaui/version.rb +1 -1
  12. data/test/dummy/log/development.log +98969 -10
  13. data/test/dummy/log/test.log +124543 -19730
  14. data/test/dummy/tmp/cache/assets/{C9C/870/sprockets%2F0402b03b507fa5960706b72da0d690f6 → C8D/080/sprockets%2F4556c595251e3b8d4f688467e330da26} +0 -0
  15. data/test/dummy/tmp/cache/assets/C94/4E0/sprockets%2Fea1476dc10a3348303f74d111f70441a +0 -0
  16. data/test/dummy/tmp/cache/assets/{D27/040/sprockets%2F94720e86301d9fdc78e0c291ce997fe5 → C95/690/sprockets%2Fc4b083702793f7599f4a3069c50f89a8} +0 -0
  17. data/test/dummy/tmp/cache/assets/{D46/610/sprockets%2F570cb35b90cf9cfd735673ebfb149326 → CAA/680/sprockets%2F3824d037523f650518fb22acab75559d} +0 -0
  18. data/test/dummy/tmp/cache/assets/{DBC/150/sprockets%2Fca62a9ed25e5faa10eb00524dcf72f09 → CC2/520/sprockets%2F9637f46d37325381f96d96d94ae0bc50} +0 -0
  19. data/test/dummy/tmp/cache/assets/CD0/9D0/sprockets%2F5c9508c21501c73fbe00473a09b1f5f4 +0 -0
  20. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  21. data/test/dummy/tmp/cache/assets/CDF/1F0/sprockets%2F76ac5628a0c4d1b976cb622ec4493751 +381 -0
  22. data/test/dummy/tmp/cache/assets/{D76/190/sprockets%2F477d2af6fe05c48f45ea721df3334be9 → CE0/8A0/sprockets%2Fc18dc7330236e7db17d280973d617b9a} +0 -0
  23. data/test/dummy/tmp/cache/assets/CEA/300/sprockets%2Fdf2ad5c9d0990441c2bf59883383d652 +0 -0
  24. data/test/dummy/tmp/cache/assets/CEC/5B0/sprockets%2F1695e8510891108e3950e2a3e4fdf9df +0 -0
  25. data/test/dummy/tmp/cache/assets/{D38/920/sprockets%2F1c247930427b0d25cdf6e18b8ace607d → CF7/710/sprockets%2F86d43448e1fc383cb6f3d752ef288882} +0 -0
  26. data/test/dummy/tmp/cache/assets/{DCC/380/sprockets%2F5155cbf5f547ab9dfd05ad7f243b9da0 → CFF/A00/sprockets%2F642f58fb154eff788f45c881b294e818} +0 -0
  27. data/test/dummy/tmp/cache/assets/D04/1D0/sprockets%2F3baf64d90ead2434455d2296227ba8a2 +7038 -0
  28. data/test/dummy/tmp/cache/assets/D05/510/sprockets%2F1c14866e2401c27b0ff5e33d1b92c4e8 +0 -0
  29. data/test/dummy/tmp/cache/assets/{C97/AF0/sprockets%2F26f7a8493d749271945a322974eee4e5 → D07/DA0/sprockets%2Ffaad9b18203975dbf0c60f3234a51874} +0 -0
  30. data/test/dummy/tmp/cache/assets/D17/DD0/sprockets%2F665455ecdc7609b23f4ecb366d86055a +9409 -0
  31. data/test/dummy/tmp/cache/assets/D32/200/sprockets%2Ffa467106e01bda5d6246baea72159d64 +0 -0
  32. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  33. data/test/dummy/tmp/cache/assets/D39/5E0/sprockets%2F59fd338be48a81a17a2a785cbd1612b4 +0 -0
  34. data/test/dummy/tmp/cache/assets/D44/170/sprockets%2Fac15571bce3f926a498da7cd09322d97 +0 -0
  35. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  36. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  37. data/test/dummy/tmp/cache/assets/D6C/710/sprockets%2F1765773caead06c0a6a19ea9de2453f7 +0 -0
  38. data/test/dummy/tmp/cache/assets/D76/910/sprockets%2Ff99b4bdc434e11e8634e6af62fe805e0 +0 -0
  39. data/test/dummy/tmp/cache/assets/D79/1E0/sprockets%2F97b08ebe07a73d8195ba124ffb45f98b +7038 -0
  40. data/test/dummy/tmp/cache/assets/D9F/{550/sprockets%2Ff62dc25db0a8b19d619890ef1b94ea0f → 160/sprockets%2F510462e1ebd5dbb7ae20888b77f9bed2} +0 -0
  41. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  42. data/test/dummy/tmp/cache/assets/{D99/170/sprockets%2Fedd15cb243afc9888e2ae132be19d270 → DDF/650/sprockets%2Fbe16f0bf3d2b7af18010acbd53ba22f5} +0 -0
  43. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  44. data/test/dummy/tmp/cache/assets/E07/1E0/sprockets%2F5a3fe6e98fdf72bbe75c605e54ebc5b0 +9409 -0
  45. data/test/dummy/tmp/cache/assets/{D29/500/sprockets%2F8ca0512b5c1a8cedb3ea5009152976b0 → E10/BE0/sprockets%2F9c06f8f8da4e736ccf6de8360cd39bfa} +0 -0
  46. data/test/dummy/tmp/cache/assets/E20/230/sprockets%2F7d3b1348fdf74cf1b6ba2107fbbac5af +0 -0
  47. data/test/dummy/tmp/cache/assets/{DEA/1E0/sprockets%2Fcceef1ff985f87dc5a3a279337f18d8e → E22/F40/sprockets%2Faffacf2e6be325520bd3bfd2096b6dd4} +0 -0
  48. data/test/dummy/tmp/cache/assets/E24/9D0/sprockets%2Fb966ab0a50fda3c156fbad4d8ab73ef6 +381 -0
  49. data/test/functional/kaui/account_emails_controller_test.rb +51 -0
  50. data/test/functional/kaui/tags_controller_test.rb +51 -0
  51. metadata +56 -33
  52. data/test/dummy/kaui_xna.sh +0 -3
  53. data/test/dummy/tmp/cache/assets/CD6/8E0/sprockets%2Fda1d0827029118e54fe463a0c0ff1568 +0 -0
  54. data/test/dummy/tmp/cache/assets/E23/0C0/sprockets%2F6fea9cc1fe74102feb0015cecf63b5fb +0 -0
@@ -0,0 +1,85 @@
1
+ module Kaui
2
+ class TagsController < ApplicationController
3
+ # GET /tags
4
+ # GET /tags.json
5
+ def index
6
+ @tags = Tag.all
7
+
8
+ respond_to do |format|
9
+ format.html # index.html.erb
10
+ format.json { render :json => @tags }
11
+ end
12
+ end
13
+
14
+ # GET /tags/1
15
+ # GET /tags/1.json
16
+ def show
17
+ @tag = Tag.find(params[:id])
18
+
19
+ respond_to do |format|
20
+ format.html # show.html.erb
21
+ format.json { render :json => @tag }
22
+ end
23
+ end
24
+
25
+ # GET /tags/new
26
+ # GET /tags/new.json
27
+ def new
28
+ @tag = Tag.new
29
+
30
+ respond_to do |format|
31
+ format.html # new.html.erb
32
+ format.json { render :json => @tag }
33
+ end
34
+ end
35
+
36
+ # GET /tags/1/edit
37
+ def edit
38
+ @tag = Tag.find(params[:id])
39
+ end
40
+
41
+ # POST /tags
42
+ # POST /tags.json
43
+ def create
44
+ @tag = Tag.new(params[:tag])
45
+
46
+ respond_to do |format|
47
+ if @tag.save
48
+ format.html { redirect_to @tag, :notice => 'Tag was successfully created.' }
49
+ format.json { render :json => @tag, :status => :created, :location => @tag }
50
+ else
51
+ format.html { render :action => "new" }
52
+ format.json { render :json => @tag.errors, :status => :unprocessable_entity }
53
+ end
54
+ end
55
+ end
56
+
57
+ # PUT /tags/1
58
+ # PUT /tags/1.json
59
+ def update
60
+ @tag = Tag.find(params[:id])
61
+
62
+ respond_to do |format|
63
+ if @tag.update_attributes(params[:tag])
64
+ format.html { redirect_to @tag, :notice => 'Tag was successfully updated.' }
65
+ format.json { head :no_content }
66
+ else
67
+ format.html { render :action => "edit" }
68
+ format.json { render :json => @tag.errors, :status => :unprocessable_entity }
69
+ end
70
+ end
71
+ end
72
+
73
+ # DELETE /tags/1
74
+ # DELETE /tags/1.json
75
+ def destroy
76
+ @tag = Tag.find(params[:id])
77
+ @tag.destroy
78
+
79
+ respond_to do |format|
80
+ format.html { redirect_to tags_url }
81
+ format.json { head :no_content }
82
+ end
83
+ end
84
+ end
85
+ end
@@ -539,6 +539,13 @@ module Kaui
539
539
  end
540
540
  end
541
541
 
542
+ ############## CUSTOM FIELDS ##############
543
+
544
+ def self.get_custom_fields_for_account(account_id)
545
+ data = call_killbill :get, "/1.0/kb/accounts/#{account_id}/customFields"
546
+ process_response(data, :multiple) { |json| Kaui::CustomField.new(json) }
547
+ end
548
+
542
549
  ############## OVERDUE ##############
543
550
 
544
551
  def self.get_overdue_state_for_bundle(bundle_id)
@@ -0,0 +1,6 @@
1
+ class Kaui::CustomField < Kaui::Base
2
+
3
+ define_attr :name
4
+ define_attr :value
5
+
6
+ end
@@ -0,0 +1,6 @@
1
+ <h1>Editing account_email</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @account_email %> |
6
+ <%= link_to 'Back', kaui_engine.account_emails_path %>
@@ -0,0 +1,9 @@
1
+ <h2>Number of payments created over time</h2>
2
+
3
+ <div id="chart"></div>
4
+
5
+ <%= javascript_tag do %>
6
+ $(document).ready(function() {
7
+ drawGraph(<%=raw @payments.dates.to_json %>, <%=raw @payments.values.to_json %>, "chart");
8
+ });
9
+ <% end %>
@@ -0,0 +1,25 @@
1
+ <%= form_for(@tag) do |f| %>
2
+ <% if @tag.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@tag.errors.count, "error") %> prohibited this tag from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @tag.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :tagDefinitionId %><br />
16
+ <%= f.text_field :tagDefinitionId %>
17
+ </div>
18
+ <div class="field">
19
+ <%= f.label :tagDefinitionName %><br />
20
+ <%= f.text_field :tagDefinitionName %>
21
+ </div>
22
+ <div class="actions">
23
+ <%= f.submit %>
24
+ </div>
25
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing tag</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @tag %> |
6
+ <%= link_to 'Back', tags_path %>
@@ -0,0 +1,25 @@
1
+ <h1>Listing tags</h1>
2
+
3
+ <table>
4
+ <tr>
5
+ <th>Tagdefinitionid</th>
6
+ <th>Tagdefinitionname</th>
7
+ <th></th>
8
+ <th></th>
9
+ <th></th>
10
+ </tr>
11
+
12
+ <% @tags.each do |tag| %>
13
+ <tr>
14
+ <td><%= tag.tagDefinitionId %></td>
15
+ <td><%= tag.tagDefinitionName %></td>
16
+ <td><%= link_to 'Show', tag %></td>
17
+ <td><%= link_to 'Edit', edit_tag_path(tag) %></td>
18
+ <td><%= link_to 'Destroy', tag, confirm: 'Are you sure?', method: :delete %></td>
19
+ </tr>
20
+ <% end %>
21
+ </table>
22
+
23
+ <br />
24
+
25
+ <%= link_to 'New Tag', new_tag_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New tag</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', tags_path %>
@@ -0,0 +1,15 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <b>Tagdefinitionid:</b>
5
+ <%= @tag.tagDefinitionId %>
6
+ </p>
7
+
8
+ <p>
9
+ <b>Tagdefinitionname:</b>
10
+ <%= @tag.tagDefinitionName %>
11
+ </p>
12
+
13
+
14
+ <%= link_to 'Edit', edit_tag_path(@tag) %> |
15
+ <%= link_to 'Back', tags_path %>
data/lib/kaui/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kaui
2
- VERSION = "0.1.17"
2
+ VERSION = "0.1.18"
3
3
  end