dhatu 0.3.8.pre.materialize → 0.3.9.pre.materialize

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
  SHA256:
3
- metadata.gz: c50e82ba159c036a18a8f743d46269e6f84c4d59a0566688cb40b4e0dc8a4fc5
4
- data.tar.gz: c6ac9decad26ff0f0b85470bd90e77d93e1643fbbb93e6dd3f854269eb7b120b
3
+ metadata.gz: 14a97828aea901e835ee1b20a05f0e9af6d07403f0943e359ded44cf1d5c9115
4
+ data.tar.gz: 7a709e6a1507ada075b97ae0d3996fb6425fd67c887293237f7b288dd74b683b
5
5
  SHA512:
6
- metadata.gz: be3bed96f12b862ba7b37b1f0eefefbe35892376f6197c9467ce3a269232d2ee12998270a86ad340847b4ea03b878808ad6d642b9a12f9a48b49499cdc21242d
7
- data.tar.gz: 2a21d5dd957df3f9f7da300b6f61aaf735ff20339f1355e3b302e971c3fd042a532322974d47fade42bd7f03a087d7ef26a1da61a92ae9c40f0ede17672bcbe4
6
+ metadata.gz: 28ffbc4721182c6478cc8aedae7f6a2cc12ae644eed6b38d299e9f7f61bde8d8e6b8e9732741efb1f807c6b87fe76fca72e30bdbda4a76465fc32647a8729af1
7
+ data.tar.gz: 86dc245eba87553360f906150edd9eb704f3c2e84c6420d16d67b69e582c40bb575eb9ad2681321e8fb60bbcc7b1c199d2cee436bfeb4264c16b12e7383af4c0
@@ -4,12 +4,13 @@ module Dhatu
4
4
  private
5
5
 
6
6
  def permitted_params
7
- params.require("dhatu/promotion").permit(:title, :short_description, :display_name, :display_email, :display_phone, :name_mandatory, :email_mandatory, :phone_mandatory, :show_popup, :show_only_on_homepage, :popup_lifespan_in_minutes)
7
+ params.require("dhatu/promotion").permit(:title, :short_description, :display_name, :display_email, :display_phone, :name_mandatory, :email_mandatory, :phone_mandatory, :show_popup, :show_only_on_homepage, :popup_lifespan_in_minutes, :has_redirection, :offer_id)
8
8
  end
9
9
 
10
10
  def get_resource
11
11
  @promotion = @r_object = @resource_options[:class].find_by_id(params[:id])
12
12
  @promotion_attributes = @promotion.promotion_attributes.page(@current_page).per(@per_page)
13
+ @offers = @promotion.promotion_attributes.page(@current_page).per(@per_page)
13
14
  end
14
15
 
15
16
  def get_collections
@@ -102,7 +103,7 @@ module Dhatu
102
103
  # Both Peacock and Parrot expect table based layout and will reload a single row after create / update
103
104
 
104
105
  #
105
- checkbox_fields: [:name_mandatory, :email_mandatory, :phone_mandatory, :show_popup, :show_only_on_homepage],
106
+ checkbox_fields: [:name_mandatory, :email_mandatory, :phone_mandatory, :show_popup, :show_only_on_homepage, :has_redirection],
106
107
 
107
108
  # Rendering Paths
108
109
  view_path: "dhatu/promotions",
@@ -128,5 +129,9 @@ module Dhatu
128
129
  set_nav("dhatu/promotions")
129
130
  end
130
131
 
132
+ def before_resource_validation
133
+
134
+ end
135
+
131
136
  end
132
137
  end
@@ -16,6 +16,7 @@ class Dhatu::Promotion < Dhatu::ApplicationRecord
16
16
  has_many :promotion_attributes
17
17
  has_many :promotion_enquiries
18
18
  has_one :cover_image, :as => :imageable, :dependent => :destroy, :class_name => "Image::CoverImage"
19
+ belongs_to :offer, optional: true
19
20
 
20
21
  # Callbacks
21
22
  after_create :generate_and_save_code
@@ -26,7 +26,7 @@
26
26
  <% if booking.new? || booking.unread? %>
27
27
  <%= link_to booking.name, booking_path(booking), remote: true, style: "font-weight:800;" %>
28
28
  <% else %>
29
- <%= link_to booking.name, booking_path(booking), remote: true %></td>
29
+ <%= link_to booking.name, booking_path(booking), remote: true %>
30
30
  <% end %>
31
31
  <br><%= link_to booking.email, booking_path(booking), remote: true %>
32
32
  <br><%= link_to booking.mobile, booking_path(booking), remote: true %>
@@ -4,13 +4,14 @@
4
4
  <%= serial_number(i) %>
5
5
  </th>
6
6
 
7
- <td class="display-image hidden-sm hidden-xs">
7
+ <td class="display-image">
8
8
  <%= display_thumbnail(offer) %>
9
9
  </td>
10
10
 
11
- <td class="display-link"><%= link_to offer.title, offer_path(offer), remote: true %></td>
12
-
13
- <td class="display-link hidden-sm hidden-xs"><%= link_to offer.offer_text, offer_path(offer), remote: true %></td>
11
+ <td class="display-link">
12
+ <%= link_to offer.title, offer_path(offer), remote: true, style: "font-weight:bold;color:#4b4b4b;" %><br>
13
+ <%= link_to offer.offer_text, offer_path(offer), remote: true %>
14
+ </td>
14
15
 
15
16
  <td class="hidden-sm hidden-xs"><%= display_featured(offer) %></td>
16
17
 
@@ -49,6 +49,19 @@
49
49
  <%= theme_form_field(@promotion, :popup_lifespan_in_minutes, required: false, html_options: {type: :number, style: "width:80px"}, form_style: "top-bottom") %>
50
50
  </div>
51
51
  </div>
52
+
53
+ <div class="row">
54
+ <div class="col-md-4 pl-20">
55
+ <%= theme_form_field(@promotion, :has_redirection, required: false, html_options: {type: :checkbox}, form_style: "top-bottom") %>
56
+ </div>
57
+
58
+ <div class="col-md-4 pl-20">
59
+ <% @offers = Dhatu::Offer.published %>
60
+ <% options_list = Array[*@offers.collect {|f| [f.title, f.id] }].sort %>
61
+ <%= theme_form_select_group(@promotion, :offer_id, options_list, param_name: "dhatu/promotion[offer_id]", label: "Choose Type", prompt: "Select Offer", form_style: "top-bottom") %>
62
+ </div>
63
+ </div>
64
+
52
65
  </div>
53
66
 
54
67
  <div>
@@ -4,7 +4,8 @@
4
4
 
5
5
  <div class="col-md-9 col-sm-12 col-xs-12">
6
6
  <%= theme_panel_heading(@promotion.title) %>
7
- <%= theme_panel_sub_heading(@promotion.short_description, "#") if @promotion.short_description %>
7
+ <%= theme_panel_sub_heading(@promotion.offer.title, "#") if @promotion.offer %>
8
+ <%= theme_panel_description(@promotion.short_description) %>
8
9
  <%= clear_tag(10) %>
9
10
  <%= display_publishable_status(@promotion) %>
10
11
  <%= display_featured(@promotion) %>
@@ -166,6 +167,22 @@
166
167
  <% end %>
167
168
  </tr>
168
169
 
170
+ <tr>
171
+ <th colspan="4"></th>
172
+ </tr>
173
+
174
+ <tr>
175
+ <th>Redirect to Offer Page</th>
176
+ <td colspan="3">
177
+ <%= @promotion.has_redirection ? "Yes" : "No" %>
178
+ (<%= @promotion.offer.try(:title) %>)
179
+ </td>
180
+ </tr>
181
+
182
+ <tr>
183
+ <th colspan="4"></th>
184
+ </tr>
185
+
169
186
  <tr>
170
187
  <th>Show Popup</th>
171
188
  <td><%= @promotion.show_popup ? "Yes" : "No" %></td>
data/lib/dhatu/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Dhatu
2
- VERSION = '0.3.8.pre.materialize'
2
+ VERSION = '0.3.9.pre.materialize'
3
3
  # The old version to migrate existing applications
4
4
  # VERSION = '0.1.25'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dhatu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8.pre.materialize
4
+ version: 0.3.9.pre.materialize
5
5
  platform: ruby
6
6
  authors:
7
7
  - kpvarma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-01 00:00:00.000000000 Z
11
+ date: 2018-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails