dhatu 0.3.8.pre.materialize → 0.3.9.pre.materialize
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/dhatu/promotions_controller.rb +7 -2
- data/app/models/dhatu/promotion.rb +1 -0
- data/app/views/dhatu/bookings/_index.html.erb +1 -1
- data/app/views/dhatu/offers/_row.html.erb +5 -4
- data/app/views/dhatu/promotions/_form.html.erb +13 -0
- data/app/views/dhatu/promotions/_show.html.erb +18 -1
- data/lib/dhatu/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14a97828aea901e835ee1b20a05f0e9af6d07403f0943e359ded44cf1d5c9115
|
4
|
+
data.tar.gz: 7a709e6a1507ada075b97ae0d3996fb6425fd67c887293237f7b288dd74b683b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
7
|
+
<td class="display-image">
|
8
8
|
<%= display_thumbnail(offer) %>
|
9
9
|
</td>
|
10
10
|
|
11
|
-
<td class="display-link"
|
12
|
-
|
13
|
-
|
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.
|
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
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.
|
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-
|
11
|
+
date: 2018-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|