usman 0.3.15 → 0.3.16

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: a80f17bd4fd7f791c314b69f53db8d81e8170bb6
4
- data.tar.gz: 453011e1f47a69b26225bb571eaae8bcb81d9e3c
3
+ metadata.gz: 2fcb08b50e5aac2d8a62c1a061964395c71374ac
4
+ data.tar.gz: 0cebc15bf191aa323cd08a521b1c4562f2b60c3b
5
5
  SHA512:
6
- metadata.gz: a2671eadf4f58e47489246ea20ce127a1c0513db468f8d6a8e1b27df92057086dc88b5180c57f32b46323357d8847bf711db32b5567c507b30bc13d5c439214d
7
- data.tar.gz: 7d73126487782bc3e770562e6da062336bd6cfd4b84dd4820bdcb23a671fab907f6897538b9643e7b2969e7559a8615a0707663a2168e3ce9c2c72aec098d04a
6
+ metadata.gz: e5f8bcf10af040d0eed3f78fe66e68d827147ff6f4e82ec08bef2f5c0bc02afffa3fd275973835c332d340691aca060dc121b943f94053b1db1091415ae111f4
7
+ data.tar.gz: 0aa4637f4fba44a2b238b4286d26dca60f0d1c78d7f5c5f823a7337ce357f187625a75b8f945e88d0528b081caafa060113b0be0dbd399f28d1d7d8bab5a7258
@@ -74,7 +74,7 @@ module Usman
74
74
  end
75
75
 
76
76
  def permitted_params
77
- params.require(:feature).permit(:name)
77
+ params.require(:feature).permit(:name, :categorisable)
78
78
  end
79
79
 
80
80
  def set_navs
@@ -40,6 +40,8 @@ class Feature < Usman::ApplicationRecord
40
40
 
41
41
  scope :status, lambda { |status| where("LOWER(status)='#{status}'") }
42
42
 
43
+ scope :categorisable, -> { where(categorisable: true) }
44
+
43
45
  scope :unpublished, -> { where(status: UNPUBLISHED) }
44
46
  scope :published, -> { where(status: PUBLISHED) }
45
47
  scope :disabled, -> { where(status: DISABLED) }
@@ -163,6 +165,10 @@ class Feature < Usman::ApplicationRecord
163
165
  "#{name.to_s.demodulize.pluralize.titleize}"
164
166
  end
165
167
 
168
+ def display_categorisable
169
+ self.categorisable ? "Yes" : "No"
170
+ end
171
+
166
172
  # Image Configuration
167
173
  # -------------------
168
174
  def image_configuration
@@ -6,14 +6,12 @@
6
6
 
7
7
  <div class="form-inputs mb-30 mt-30">
8
8
  <%= theme_form_field(@feature, :name, label: "Class Name") %>
9
+ <%= theme_form_field(@feature, :categorisable, required: false, html_options: {type: :checkbox}) %>
9
10
  </div>
10
11
 
11
12
  <div>
12
-
13
13
  <%= submit_tag("Save", :class=>"btn btn-primary pull-right ml-10") %>
14
-
15
14
  <%= link_to raw("<i class='fa fa-close mr-5'></i><span>Cancel</span>"), "#", onclick: "closeGenericModal();", class: "pull-right ml-10 btn btn-white" %>
16
-
17
15
  </div>
18
16
  <%= clear_tag(10) %>
19
17
  </div>
@@ -3,9 +3,10 @@
3
3
  <thead>
4
4
  <tr>
5
5
  <th style="text-align: center;width:60px">#</th>
6
- <th style="text-align: center;width:100px"><i class="fa fa-photo"></i></th>
6
+ <!-- <th style="text-align: center;width:100px"><i class="fa fa-photo"></i></th> -->
7
7
  <th>Name</th>
8
8
  <th>Class Name</th>
9
+ <th>Categorisable</th>
9
10
  <th style="width:100px;">Status</th>
10
11
  <% if display_manage_links? %>
11
12
  <th style="text-align: center;" colspan="2">Actions</th>
@@ -25,15 +26,18 @@
25
26
  <% end %>
26
27
  </th>
27
28
 
28
- <td class="feature-image" style="text-align: center;">
29
- <%= link_to(feature_path(feature), remote: true) do %>
30
- <%= display_image(feature, "feature_image.image.small.url", width: "32", height: "auto", class: "img-rectangle", alt: feature.display_name) %>
31
- <% end %>
32
- </td>
29
+ <!-- <td class="feature-image" style="text-align: center;">
30
+ <%#= link_to(feature_path(feature), remote: true) do %>
31
+ <%#= display_image(feature, "feature_image.image.small.url", width: "32", height: "auto", class: "img-rectangle", alt: feature.display_name) %>
32
+ <% #end %>
33
+ </td> -->
33
34
 
34
35
  <td class="feature-name"><%= link_to feature.display_name, feature_path(feature), remote: true %></td>
36
+
35
37
  <td class="feature-name"><%= link_to feature.name, feature_path(feature), remote: true %></td>
36
38
 
39
+ <td><%= feature.display_categorisable %></td>
40
+
37
41
  <td>
38
42
  <% if feature.unpublished? %>
39
43
  <span class="ml-5 mt-5 label label-default">Un-Published</span>
@@ -8,15 +8,18 @@
8
8
  <% end %>
9
9
  </th>
10
10
 
11
- <td class="feature-image" style="text-align: center;">
12
- <%= link_to(feature_path(feature), remote: true) do %>
13
- <%= display_image(feature, "feature_image.image.small.url", width: "32", height: "auto", class: "img-rectangle", alt: feature.display_name) %>
14
- <% end %>
15
- </td>
11
+ <!-- <td class="feature-image" style="text-align: center;">
12
+ <%#= link_to(feature_path(feature), remote: true) do %>
13
+ <%#= display_image(feature, "feature_image.image.small.url", width: "32", height: "auto", class: "img-rectangle", alt: feature.display_name) %>
14
+ <%# end %>
15
+ </td> -->
16
16
 
17
17
  <td class="feature-name"><%= link_to feature.display_name, feature_path(feature), remote: true %></td>
18
+
18
19
  <td class="feature-name"><%= link_to feature.name, feature_path(feature), remote: true %></td>
19
20
 
21
+ <td><%= feature.display_categorisable %></td>
22
+
20
23
  <td>
21
24
  <% if feature.unpublished? %>
22
25
  <span class="ml-5 mt-5 label label-default">Un-Published</span>
@@ -0,0 +1,5 @@
1
+ class AddCategorisableToFeatures < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :features, :categorisable, :boolean, default: false
4
+ end
5
+ end
data/lib/usman/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Usman
2
- VERSION = '0.3.15'
2
+ VERSION = '0.3.16'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.15
4
+ version: 0.3.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - kpvarma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-10 00:00:00.000000000 Z
11
+ date: 2017-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -107,7 +107,7 @@ dependencies:
107
107
  version: '0.1'
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 0.1.21
110
+ version: 0.1.22
111
111
  type: :runtime
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
@@ -117,7 +117,7 @@ dependencies:
117
117
  version: '0.1'
118
118
  - - ">="
119
119
  - !ruby/object:Gem::Version
120
- version: 0.1.21
120
+ version: 0.1.22
121
121
  - !ruby/object:Gem::Dependency
122
122
  name: pattana
123
123
  requirement: !ruby/object:Gem::Requirement
@@ -127,7 +127,7 @@ dependencies:
127
127
  version: '0.1'
128
128
  - - ">="
129
129
  - !ruby/object:Gem::Version
130
- version: 0.1.17
130
+ version: 0.1.18
131
131
  type: :runtime
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
@@ -137,7 +137,7 @@ dependencies:
137
137
  version: '0.1'
138
138
  - - ">="
139
139
  - !ruby/object:Gem::Version
140
- version: 0.1.17
140
+ version: 0.1.18
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: bcrypt
143
143
  requirement: !ruby/object:Gem::Requirement
@@ -546,6 +546,7 @@ files:
546
546
  - db/migrate/20170904080436_add_tac_accepted_at_to_devices.rb
547
547
  - db/migrate/20170905041104_add_gender_to_users.rb
548
548
  - db/migrate/20170929083233_add_dummy_to_users.rb
549
+ - db/migrate/20170929083234_add_categorisable_to_features.rb
549
550
  - lib/tasks/usman/data.rake
550
551
  - lib/tasks/usman/master_data.rake
551
552
  - lib/temp/features.rake