custom_attributes_scaffold 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98a26dfe77e52e5f1a730d9982b56cc810306962
4
- data.tar.gz: 7c106f5c947d730388f74830951f81406f361d3f
3
+ metadata.gz: 7d6f98a98b18922016fdb46f39d38cc3ce4b5f25
4
+ data.tar.gz: b3f3c0ac909e7dc389492f6ee5cc17bc725c6629
5
5
  SHA512:
6
- metadata.gz: a7c566e5684e35b8f66898eba661d427311366c63ebaa27167b1336f0ba856762745e3cdf49d51a29dcb0a14aa9740260a127f00cc7f8c55992e19dcbfbaf790
7
- data.tar.gz: b96c49af1c211725ba7c8cb6716f1579754438966085fe82a4942b2bb5f93f2363726b25cf43e2edb056883d5d5c3dc8839144eb1ed0a830ad653833b1214662
6
+ metadata.gz: 8e4f76b79a12ee8d689307a66040fb078e5df6d795dd3c026c3d03dcb10ec5d468928a3d7ee4e52a02292bb20b4ac1eb595eff0790c4b172ad4b06efe729b074
7
+ data.tar.gz: d7746fa85ff62239d80c03645f8c33f5896f4ab1afd586cf9a8266c8a498a30be091df28a40c6d7772500c325053747a7a3f92663a5f3acfc110a63b6f7ede1e
@@ -4,7 +4,7 @@ module CustomAttributes
4
4
  if (newVal && newVal.present?)
5
5
  self.double_value = newVal.to_f
6
6
  else
7
- self.integer_value = nil
7
+ self.double_value = nil
8
8
  end
9
9
  end
10
10
 
@@ -1,12 +1,16 @@
1
+ <% titleClass ||= nil %>
2
+ <% fieldClass ||= nil %>
3
+
1
4
  <% new_record ||= false %>
2
- <div class="custom-attribute-definition title">Name:</div>
3
- <div class="custom-attribute-definition field">
5
+ <div class="custom-attribute-definition title <%=titleClass%>">Name:</div>
6
+ <div class="custom-attribute-definition field <%=fieldClass%>">
4
7
  <%= f.text_field :attr_name, pattern:"^[a-zA-Z0-9\_\s]+$", title: "Name can only contain alphanumeric characters and spaces." %></div>
5
8
 
6
- <div class="custom-attribute-definition title">Type:</div>
7
- <div class="custom-attribute-definition field">
9
+ <div class="custom-attribute-definition title <%=titleClass%>">Type:</div>
10
+ <div class="custom-attribute-definition field <%=fieldClass%>">
8
11
  <%= f.select :attr_type, custom_attribute_types.invert, {}, {disabled: !new_record}%>
9
12
  </div>
10
13
 
11
- <div class="custom-attribute-definition title">Sort Order:</div>
12
- <div class="custom-attribute-definition field"><%= f.text_field :sort_order, readonly: true%></div>
14
+ <% if new_record %>
15
+ <%= f.hidden_field :sort_order %>
16
+ <% end %>
@@ -1,6 +1,23 @@
1
+ <% link_to_edit ||= nil %>
2
+ <% link_to_delete ||= nil %>
3
+ <% remote_links ||= false %>
4
+
1
5
  <% cssClasses ||= {} %>
2
6
 
3
7
  <div class="custom-attributes row">
8
+ <div class="actions_links pull-right">
9
+ <% if link_to_edit %>
10
+ <%= link_to link_to_edit, remote: remote_links, class: "edit text_style" do %>
11
+ <i class="icon-pencil"></i>Edit
12
+ <% end %>
13
+ <% end %>
14
+ <% if link_to_delete %>
15
+ <%= link_to link_to_delete, remote: remote_links, method: :delete, class: "edit text_style" do %>
16
+ <i class="icon-trash"></i>Delete
17
+ <% end %>
18
+ <% end %>
19
+ </div>
20
+
4
21
  <div class="custom-attributes definition title <%=cssClasses[:title]%>">
5
22
  <%= custom_attribute_definition.attr_name %>
6
23
  </div>
@@ -1,3 +1,3 @@
1
1
  module CustomAttributes
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: custom_attributes_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tariq Hussain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-11 00:00:00.000000000 Z
11
+ date: 2015-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails