kablam 0.0.4 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/app/assets/javascripts/kablam/ajax.js +531 -0
  4. data/app/assets/javascripts/kablam/forms.js +167 -0
  5. data/app/assets/javascripts/kablam/messaging.js +95 -0
  6. data/app/assets/stylesheets/kablam.scss +25 -0
  7. data/app/channels/chat_channel.rb +12 -0
  8. data/app/controllers/concerns/api_settings.rb +41 -0
  9. data/app/controllers/data_controller.rb +133 -0
  10. data/app/views/data/create.js.erb +10 -0
  11. data/app/views/data/destroy.js.erb +12 -0
  12. data/app/views/data/form.html.erb +1 -0
  13. data/app/views/data/undo.js.erb +2 -0
  14. data/app/views/data/update.js.erb +9 -0
  15. data/app/views/kablam_forms/_form_generator.html.erb +1 -1
  16. data/app/views/kablam_forms/fields/_checkbox_array.html.erb +3 -3
  17. data/app/views/kablam_forms/fields/_checkbox_boolean.html.erb +3 -3
  18. data/app/views/kablam_forms/fields/_file_upload.html.erb +2 -2
  19. data/app/views/kablam_forms/fields/_input.html.erb +2 -2
  20. data/app/views/kablam_forms/fields/_multi_inputs.html.erb +2 -2
  21. data/app/views/kablam_forms/fields/_pretext.html.erb +1 -1
  22. data/app/views/kablam_forms/fields/_select.html.erb +3 -3
  23. data/app/views/kablam_forms/fields/_text.html.erb +3 -3
  24. data/kablam.gemspec +2 -1
  25. data/lib/generators/kablam/USAGE +5 -2
  26. data/lib/generators/kablam/install_generator.rb +37 -0
  27. data/lib/generators/kablam/messaging_generator.rb +40 -0
  28. data/lib/generators/kablam/templates/chat.rb +44 -0
  29. data/lib/generators/kablam/templates/kablam.rb +45 -0
  30. data/lib/generators/kablam/templates/message.rb +53 -0
  31. data/lib/kablam.rb +35 -0
  32. data/lib/kablam/forms.rb +26 -21
  33. data/lib/kablam/kablam_record.rb +61 -0
  34. metadata +32 -2
  35. data/lib/generators/kablam/kablam_generator.rb +0 -12
@@ -0,0 +1,10 @@
1
+ var content = '<%= j render "data/models/#{@object.model_name.singular}", obj: @object %>'
2
+
3
+ document
4
+ .getElementById('<%= params[:target] || "target_index" %>')
5
+ .insertAdjacentHTML('beforeend', content)
6
+
7
+ document
8
+ .querySelector('[action$="/<%= params[:target] || "target_index" %>"]')
9
+ .reset()
10
+ <%= render_flash message: 'Created' %>
@@ -0,0 +1,12 @@
1
+ <%= hide @object %>
2
+ <% if @object.undoable? %>
3
+ <%= render_flash message: 'Deleted', partial: 'application/flash_undo',
4
+ link: button_to('Undo', data_undo_path(@object.class.table_name, @object,
5
+ @object.model_name.singular.to_sym => { destroyed_at: nil }),
6
+ {data: { disable_with: 'Restoring…' },
7
+ class: 'no-underline mt3 f4 tc pv2 ph4 white bg-black hover-bg-green shadow-5',
8
+ method: :put,
9
+ remote: true}) %>
10
+ <% else %>
11
+ <%= render_flash message: 'Deleted' %>
12
+ <% end %>
@@ -0,0 +1 @@
1
+ <%= render "kablam_forms/kablam_form", obj: @object, target: (params[:target] || nil), ajax_remove: true %>
@@ -0,0 +1,2 @@
1
+ <%= render_flash message: 'Undone!' %>
2
+ <%= show @object %>
@@ -0,0 +1,9 @@
1
+ <% if params[:target].present? %>
2
+
3
+ var objRow = byId('<%= @object.html_id %>')
4
+ var content = `<%= j render "data/models/#{@object.model_name.singular}", obj: @object %>`
5
+ var newRow = HTMLElement.From(content);
6
+
7
+ objRow.innerHTML = newRow.innerHTML
8
+ <% end %>
9
+ <%= render_flash message: 'Information has been updated 👍' %>
@@ -21,7 +21,7 @@
21
21
  <% kablam_scope = "kablam_forms.#{@table_name}.#{field}" %>
22
22
  <% classyy = @model.prep_form_field[field] %>
23
23
  <% next if classyy == :exclude %>
24
- <% input = {name: "#{@form_name}[#{field}]", value: obj.send(field), label: t(:label, scope: kablam_scope, default: ""), pretext: t(:pretext, scope: kablam_scope, default: ""), placeholder: t(:placeholder, scope: kablam_scope, default: ""), hint: raw(t(:hint, scope: kablam_scope, default: "")), choices: @model.choices(field, I18n.locale)} %>
24
+ <% input = obj.input(field) %>
25
25
  <%= (render "kablam_forms/fields/pretext", classes: classes, input: input) if input[:pretext].present? %>
26
26
  <%= render "kablam_forms/fields/#{classyy.to_s}", classes: classes, input: input, f: f %>
27
27
  <% end %>
@@ -1,12 +1,12 @@
1
1
  <div class="<%= classes[:form_group] %>">
2
2
  <fieldset id="<%= input[:id] %>" class="<%= classes[:checkbox_group_wrapper] %>">
3
- <legend class="<%= classes[:field_label] %>"><%= input[:label] %></legend>
4
- <small id="<%= input[:id] %>-desc" class="<%= classes[:field_hint] %>"><%= input[:hint] %></small>
3
+ <legend class="<%= classes[:field_label] %>"><%= raw input[:label] %></legend>
4
+ <small id="<%= input[:id] %>-desc" class="<%= classes[:field_hint] %>"><%= raw input[:hint] %></small>
5
5
 
6
6
  <% input[:choices].each_with_index do |choice, i| %>
7
7
  <div class="<%= classes[:checkbox_wrapper] %>">
8
8
  <input id="<%= input[:id] %>_<%= i %>" name="<%= input[:name] %>[]" class="<%= classes[:checkbox] %>" <%= "checked" if input[:value].include?(choice[:value]) %> type="checkbox" value="<%= choice[:value] %>">
9
- <label for="<%= input[:id] %>_<%= i %>" class="<%= classes[:checkbox_label] %>"><%= choice[:label] %></label>
9
+ <label for="<%= input[:id] %>_<%= i %>" class="<%= classes[:checkbox_label] %>"><%= raw choice[:label] %></label>
10
10
  </div>
11
11
  <% end %>
12
12
  </fieldset>
@@ -1,10 +1,10 @@
1
1
  <div class="<%= classes[:form_group] %>">
2
2
  <fieldset id="<%= input[:id] %>" class="<%= classes[:checkbox_group_wrapper] %>">
3
- <legend class="<%= classes[:field_label] %>"><%= input[:label] %></legend>
4
- <small id="<%= input[:id] %>-desc" class="<%= classes[:field_hint] %>"><%= input[:hint] %></small>
3
+ <legend class="<%= classes[:field_label] %>"><%= raw input[:label] %></legend>
4
+ <small id="<%= input[:id] %>-desc" class="<%= classes[:field_hint] %>"><%= raw input[:hint] %></small>
5
5
  <div class="<%= classes[:checkbox_wrapper] %>">
6
6
  <input id="<%= input[:id] %>" name="<%= input[:name] %>" class="<%= classes[:checkbox] %>" <%= "checked" if input[:value].present? %> type="checkbox">
7
- <label for="<%= input[:id] %>" class="<%= classes[:checkbox_label] %>"><%= input[:choices].first[:label] %></label>
7
+ <label for="<%= input[:id] %>" class="<%= classes[:checkbox_label] %>"><%= raw input[:choices].first[:label] %></label>
8
8
  </div>
9
9
  </fieldset>
10
10
  </div>
@@ -1,7 +1,7 @@
1
1
 
2
2
  <div class="<%= classes[:form_group] %>">
3
- <label class="<%= classes[:field_label] %>" for="<%= input[:id] %>"><%= input[:label] %></label>
4
- <small id="<%= input[:name] %>-desc" class="<%= classes[:field_hint] %>"><%= input[:hint] %></small>
3
+ <label class="<%= classes[:field_label] %>" for="<%= input[:id] %>"><%= raw input[:label] %></label>
4
+ <small id="<%= input[:name] %>-desc" class="<%= classes[:field_hint] %>"><%= raw input[:hint] %></small>
5
5
  <div class="kablam_fileinput_init">
6
6
  <input class="kablam_file <%= classes[:file_upload] %>" name="<%= input[:name] %>" type="file" id="<%= input[:id] %>">
7
7
  </div>
@@ -1,6 +1,6 @@
1
1
  <div class="<%= classes[:form_group] %>">
2
- <label for="<%= input[:name] %>" class="<%= classes[:field_label] %>"><%= input[:label] %></label>
3
- <small id="<%= input[:name] %>-desc" class="<%= classes[:field_hint] %>"><%= input[:hint] %></small>
2
+ <label for="<%= input[:name] %>" class="<%= classes[:field_label] %>"><%= raw input[:label] %></label>
3
+ <small id="<%= input[:name] %>-desc" class="<%= classes[:field_hint] %>"><%= raw input[:hint] %></small>
4
4
  <input id="<%= input[:id] if input[:id].present? %>" name="<%= input[:name] %>" class="<%= classes[:input] %>" type="text" aria-describedby="<%= input[:name] %>-desc" value="<%= input[:value] %>" placeholder="<%= input[:placeholder] %>">
5
5
  </div>
6
6
 
@@ -6,8 +6,8 @@
6
6
  EX of FORMAT: input = {label: "choices", name: "assessment[choices]", value: ["value", "from", "existing", "DB_ENTRY"], id: "1" (if input_id is used)}
7
7
  %>
8
8
  <div id="multi_input_<%= unique_id %>" class="<%= classes[:form_group] %>">
9
- <label class="<%= classes[:field_label] %>"><%= input[:label] %></label>
10
- <small class="<%= classes[:field_hint] %>"><%= input[:hint] %></small>
9
+ <label class="<%= classes[:field_label] %>"><%= raw input[:label] %></label>
10
+ <small class="<%= classes[:field_hint] %>"><%= raw input[:hint] %></small>
11
11
  <a href="#!" class="<%= classes[:multi_add_button] %>" onclick='event.preventDefault();addInput("multi_input_<%= unique_id %>", "<%= input[:name] %>[]", { "input": "<%= classes[:input] %>", "btn": "<%= classes[:multi_remove_button] %>", "icon": "<%= classes[:multi_remove_icon] %>", "group": "<%= classes[:multi_input_group] %>"});'><i class="<%= classes[:multi_add_icon] %>"></i></a>
12
12
  <% if input[:value].present? %>
13
13
  <% input[:value].each_with_index do |val, i| %>
@@ -1,3 +1,3 @@
1
1
  <div class="<%= classes[:pretext_wrapper] %>">
2
- <h3 class="<%= classes[:pretext] %>"><%= input[:pretext] %></h3>
2
+ <h3 class="<%= classes[:pretext] %>"><%= raw input[:pretext] %></h3>
3
3
  </div>
@@ -1,8 +1,8 @@
1
1
  <div class="<%= classes[:form_group] %>">
2
- <label for="<%= input[:id] %>" class="<%= classes[:field_label] %>"><%= input[:label] %></label>
3
- <small id="select_<%= input[:id] %>-desc" class="<%= classes[:field_hint] %>"><%= input[:hint] %></small>
2
+ <label for="<%= input[:id] %>" class="<%= classes[:field_label] %>"><%= raw input[:label] %></label>
3
+ <small id="select_<%= input[:id] %>-desc" class="<%= classes[:field_hint] %>"><%= raw input[:hint] %></small>
4
4
  <select id="<%= input[:id] if input[:id].present? %>" class="select_basic <%= classes[:select] %>" name="<%= input[:name] %>" aria-describedby="select_<%= input[:id] %>-desc">
5
- <option value=""><%= input[:placeholder] %></option>
5
+ <option value=""><%= raw input[:placeholder] %></option>
6
6
  <% input[:choices].each do |choice| %>
7
7
  <option label="<%= choice[:label] %>" value="<%= choice[:value] %>"<%= input[:value].present? ? (" selected=\"selected\"" if input[:value] == choice[:value] ) : "" %>></option>
8
8
  <% end %>
@@ -1,6 +1,6 @@
1
1
  <div class="<%= classes[:form_group] %>">
2
- <label for="<%= input[:name] %>" class="<%= classes[:field_label] %>"><%= input[:label] %></label>
3
- <small id="<%= input[:name] %>-desc" class="<%= classes[:field_hint] %>"><%= input[:hint] %></small>
4
- <textarea id="<%= input[:id] if input[:id].present? %>" name="<%= input[:name] %>" class="<%= classes[:textarea] %>" aria-describedby="<%= input[:name] %>-desc" placeholder="<%= input[:placeholder] %>"><%= input[:value] if input[:value].present? %></textarea>
2
+ <label for="<%= input[:name] %>" class="<%= classes[:field_label] %>"><%= raw input[:label] %></label>
3
+ <small id="<%= input[:name] %>-desc" class="<%= classes[:field_hint] %>"><%= raw input[:hint] %></small>
4
+ <textarea id="<%= input[:id] if input[:id].present? %>" name="<%= input[:name] %>" class="<%= classes[:textarea] %>" aria-describedby="<%= input[:name] %>-desc" placeholder="<%= input[:placeholder] %>"><%= raw input[:value] if input[:value].present? %></textarea>
5
5
  </div>
6
6
 
data/kablam.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'kablam'
3
- s.version = '0.0.4'
3
+ s.version = '0.0.8'
4
4
  s.date = '2018-09-14'
5
5
  s.summary = "Empty Initialization of Gem"
6
6
  s.description = "Gem to make development of everything in rails even faster."
@@ -13,4 +13,5 @@ Gem::Specification.new do |s|
13
13
 
14
14
  s.add_dependency("rails", ">= 5.1.6")
15
15
  s.add_dependency('rails-i18n', ">= 5.1.1")
16
+ s.add_dependency('puma')
16
17
  end
@@ -1,7 +1,10 @@
1
+ rails generate kablam:install
2
+ ---> This sets up all the basic kablam backend dependencies for auto-forms
3
+
1
4
  rails generate kablam:forms LOCALE
2
5
 
3
- ---> This will generate a template file for use with i18n at '/config/locales/kablam-forms.<LOCALE>.yml'
6
+ ---> This will generate an empty template file for use with i18n at '/config/locales/kablam-forms.<LOCALE>.yml'
4
7
 
5
- rails generate kablam:form_views
8
+ rails generate kablam:form_views (Not Available Yet)
6
9
 
7
10
  ---> This will generate all the form-components used with kablam_forms. You can change them to fit any HTML based template you have!
@@ -0,0 +1,37 @@
1
+ require 'yaml'
2
+
3
+ module Kablam
4
+ module Generators
5
+ class InstallGenerator < Rails::Generators::NamedBase
6
+ include Rails::Generators::ResourceHelpers
7
+ namespace "kablam:install"
8
+ source_root File.expand_path('../templates', __FILE__)
9
+ # argument :name, :type => :string, :default => "en"
10
+
11
+ # Change ApplicationRecord's inheritence
12
+ gsub_file 'app/models/application_record.rb', 'class ApplicationRecord < ActiveRecord::Base', 'class ApplicationRecord < Kablam::KablamRecord'
13
+
14
+ # Setup Initializer
15
+ template "kablam.rb", "config/initializers/kablam.rb"
16
+
17
+ def setup_routes
18
+ route "# form/create/update/destroy/undo for all models"
19
+ route "get 'd/:name/form' => 'data#form', as: 'data_form'"
20
+ route "post 'd/:name' => 'data#create', as: 'data_create'"
21
+ route "patch 'd/:name/:id' => 'data#update', as: 'data_update'"
22
+ route "delete 'd/:name/:id' => 'data#destroy', as: 'data_destroy'"
23
+ route "put 'd/:name/:id' => 'data#undo', as: 'data_undo'"
24
+ end
25
+
26
+ def setup_assets
27
+ inject_into_file 'app/assets/javascripts/application.js', before: "//=require_tree ." do
28
+ "//=require kablam/ajax"
29
+ "//=require kablam/forms\n"
30
+ end
31
+ prepend_file 'app/assets/stylesheets/application.css.scss', "@import 'kablam';"
32
+ end
33
+
34
+ readme "README"
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,40 @@
1
+ require 'yaml'
2
+
3
+ module Kablam
4
+ module Generators
5
+ class MessagingGenerator < Rails::Generators::NamedBase
6
+ include Rails::Generators::ResourceHelpers
7
+ namespace "kablam:messaging"
8
+ source_root File.expand_path('../templates', __FILE__)
9
+ # argument :name, :type => :string, :default => "en"
10
+
11
+
12
+ def setup_action_cable
13
+ inject_into_file 'app/assets/javascripts/application.js', after: "//=require_tree .\n" do
14
+ "//=require cable"
15
+ end
16
+ route "mount ActionCable.server => '/cable'"
17
+ inject_into_file "app/views/layouts/application.html.erb", before: "</head>" do
18
+ " <%= action_cable_meta_tag %>\n "
19
+ end
20
+ end
21
+
22
+ def setup_models
23
+ generate "model", "chat user:references subject:string "
24
+ generate "model", "message chat:references content:text sender_id:integer attachment:string"
25
+ generate "model", "message_status user:references message references read:boolean"
26
+ copy_file "chat.rb", "app/models/chat.rb", force: true
27
+ copy_file "message.rb", "app/models/message.rb", force: true
28
+ status_migration = Dir.glob(Rails.root.to_s+"/db/migrate/**").last
29
+ gsub_file status_migration, "t.boolean :read", "t.boolean :read, default: false"
30
+
31
+ rake "db:migrate"
32
+ end
33
+ def setup_assets
34
+ inject_into_file 'app/assets/javascripts/application.js', before: "//=require_tree .\n" do
35
+ "//=require kablam/messaging"
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,44 @@
1
+ class Chat < ApplicationRecord
2
+ belongs_to :user
3
+ has_many :messages, dependent: :destroy
4
+ has_many :message_statuses, through: :messages
5
+ after_update_commit :broadcast_self
6
+
7
+ def messages_array
8
+ y = messages.map do |x|
9
+ u = User.find(x.sender_id)
10
+ h = x.serializable_hash
11
+ # h["status"] = x.status(user_id)
12
+ h["chat_id"] = id.to_s
13
+ h["image"] = u.name? ? u.avatar_url(50) : "/assets/default.png"
14
+ h['username'] = u.name || "An Amazing Person~"
15
+ h["user_time"] = x.user_time
16
+ h
17
+ end
18
+ y.sort_by{|x|x["created_at"]}
19
+ end
20
+
21
+ def latest_message
22
+ messages_array.last
23
+ end
24
+
25
+ def unread_messages(user_id)
26
+ message_statuses.where(user_id: user_id.to_i, read: false).count
27
+ end
28
+
29
+ def broadcast_self
30
+ ActionCable.server.broadcast "ChatChannel_#{self.id}", {chat: messages_array.last }
31
+ end
32
+
33
+ def users
34
+ messages.map{ |m| m.sender_id}.uniq
35
+ end
36
+
37
+ def not_answered(user_id)
38
+ if !messages.blank?
39
+ return messages.last.sender_id != user_id
40
+ else
41
+ return false
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,45 @@
1
+ # Here's the configuration setup for Kablam!
2
+ # You can change all the defaults to fit the css in your project.
3
+ # Just for fun, all the defaults used here are based on the awesome Tachyons css library.
4
+
5
+ Kablam.setup do |config|
6
+ # ===========================================================
7
+ # _ _ ____ ___ _ ____ _ _
8
+ # |_/ |__| |__] | |__| |\/|
9
+ # | \_ | | |__] |___ | | | |
10
+ # .___ __ .
11
+ # [__ _ ._.._ _ / `| _. __ __ _ __
12
+ # | (_)[ [ | ) \__.|(_]_) _) (/,_)
13
+ # ===========================================================
14
+
15
+ # These classes are used for the labels/group-wrappers, etc.
16
+ config.form_wrapper = "pa4 black-80"
17
+ config.submit_button = "relative no-underline mt3 f4 tc db w-75 pv3 mb3 bg-red hover-bg-green white br2 shadow-5 btn-3d bn outline-0"
18
+ config.form_group = "measure mb4 relative"
19
+ config.field_label = "f6 b db mb2"
20
+ config.field_hint = "f6 black-60 db mb2"
21
+ config.pretext_wrapper = "measure ph3 pv1 mb3 b ba b--dashed bw1 b--red"
22
+ config.pretext = "fw5 i f5"
23
+
24
+ # Classes for the acutal from field input/select html items =
25
+ config.input = "input-reset ba b--black-20 pa2 db w-100"
26
+ config.textarea = "db border-box hover-black w-100 measure ba b--black-20 pa2 br2 mb2"
27
+ config.dropdown_select = "ba bg-white b--black-20 pa2 mb2 db w-100"
28
+ config.file_upload = "ba b--black-20 pa5 mb2 db w-100 b--dashed b--red"
29
+ config.file_upload_icon = "fa fa-upload absolute left-0 right-0 ml-auto mr-auto top-2 mt3 f1 black-05"
30
+
31
+ # Checkbox Classes
32
+ config.checkbox_group_wrapper = "" # Wrapper around all checkboxes
33
+ config.checkbox_wrapper = "flex items-center mb2" # Wrapper for individual checkbox
34
+ config.checkbox_label = "f6 b db"
35
+ config.checkbox = "mr2"
36
+
37
+ # Classes for Muli-Input form_type
38
+ # i.e. a normal input w/ +/- button to add/remove entries.
39
+ # result is an array []
40
+ config.multi_input_group = "flex mb2" #wrapper with input + delete button
41
+ config.multi_add_button = "absolute bg-green hover-bg-red no-underline pv2 pl3 pr3 right-0 top-0 white btn-3d br2"
42
+ config.multi_remove_button = "relative no-underline bg-red hover-bg-green white pa2 pl3 pr3 ml1 btn-3d br2"
43
+ config.multi_add_icon = "fa fa-plus"
44
+ config.multi_remove_icon = "fa fa-trash"
45
+ end
@@ -0,0 +1,53 @@
1
+ # require 'rest-client'
2
+ class Message < ApplicationRecord
3
+ belongs_to :chat
4
+ has_many :message_statuses, dependent: :destroy
5
+ after_commit :setup_status, :set_updated_at
6
+ after_commit :broadcast_self, on: :create
7
+
8
+ def self.slack_hook
9
+ # "http://insert-slack-hook-here"
10
+ nil
11
+ end
12
+
13
+ def self.slack_message
14
+ {create: {
15
+ pretext: "New Message from #{user.name}",
16
+ author: "#{user.name}",
17
+ title: "chat.subject",
18
+ text: "#{content}"
19
+ }
20
+ }
21
+ end
22
+
23
+ def setup_status
24
+ MessageStatus.create(user_id: self.chat.user_id, message_id: self.id)
25
+ end
26
+
27
+ def set_updated_at
28
+ @chat = self.chat
29
+ @chat.update(updated_at: self.created_at)
30
+ # @chat.save
31
+ end
32
+
33
+ def status(user_id)
34
+ MessageStatus.find_by(user_id: user_id, message_id: self.id).read
35
+ end
36
+
37
+ def user
38
+ User.find(self.sender_id.to_i)
39
+ end
40
+
41
+ def broadcast_self
42
+ ActionCable.server.broadcast "AdminChannel", {chat_id: "#{chat.id}_#{sender_id}" }
43
+
44
+ chat.users.each do |u|
45
+ ActionCable.server.broadcast "DotChannel_#{u}", {dot: "#{sender_id}" }
46
+ end
47
+ end
48
+
49
+ def user_time
50
+ u = User.find(self.sender_id.to_i)
51
+ ActiveSupport::TimeZone[u.timezone].now if !u.timezone.nil?
52
+ end
53
+ end
data/lib/kablam.rb CHANGED
@@ -1,4 +1,33 @@
1
1
  module Kablam
2
+ # Basic form classes (in initialize)
3
+ mattr_accessor :form_wrapper
4
+ mattr_accessor :submit_button
5
+ mattr_accessor :form_group
6
+ mattr_accessor :field_label
7
+ mattr_accessor :field_hint
8
+ mattr_accessor :pretext_wrapper
9
+ mattr_accessor :pretext
10
+
11
+ # Classes for the acutal from field input/select html items:
12
+ mattr_accessor :input
13
+ mattr_accessor :textarea
14
+ mattr_accessor :dropdown_select
15
+ mattr_accessor :file_upload
16
+ mattr_accessor :file_upload_icon
17
+
18
+ # Checkbox classes
19
+ mattr_accessor :checkbox_group_wrapper
20
+ mattr_accessor :checkbox_wrapper
21
+ mattr_accessor :checkbox_label
22
+ mattr_accessor :checkbox
23
+
24
+ # Multi-Inputs classes (i.e. add string arrays)
25
+ mattr_accessor :multi_input_group
26
+ mattr_accessor :multi_add_button
27
+ mattr_accessor :multi_remove_button
28
+ mattr_accessor :multi_add_icon
29
+ mattr_accessor :multi_remove_icon
30
+
2
31
  module ClassMethods
3
32
 
4
33
  end
@@ -11,6 +40,12 @@ module Kablam
11
40
  receiver.extend ClassMethods
12
41
  receiver.send :include, InstanceMethods
13
42
  end
43
+
44
+ def self.setup
45
+ yield self
46
+ end
47
+
48
+
14
49
  end
15
50
 
16
51
  require 'kablam/engine'