dhatu 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c25f8018bef9276cfb153a87554a1d79b91574a
4
- data.tar.gz: eb525b3bcba7b0cb4ed2b7f258ae5b6c648e5592
3
+ metadata.gz: b343ae3a364c66dccd4cb74148f2dd318f6077f9
4
+ data.tar.gz: ce7df95e60a1065a6974f3d343600a24f892d0aa
5
5
  SHA512:
6
- metadata.gz: fcd07dd19aeeff0b0a6915238ca957a8be7b714d239e5c6a0a75f41516f17a240114213a11dec9c927bf6ecb40a72e133e6a3028760e3d9fe0d2debc274d92af
7
- data.tar.gz: 470e2d222f441ec7847ec6c8846a13ad57676b5e22dabf29eb7a7f63159726b8f9b30f8b8d62e41bd89e054d7115869ba1dbf1c01975d96f3e2094dcfedf476a
6
+ metadata.gz: cc6449056ddd66781a63ced43d5ead0327b4f9084e7ecccdee7b2319c2a57f5705887c19c275ebfb09a1ccc597136976355d15c2b9b7bea9871e007327db4950
7
+ data.tar.gz: 8a01fad3e7d9218a7c7c77bd07f1250c710bc62464b1aaefc014b962c8893fcb96eda248ccab82c77676be57d83794ab2f0a2ae3d147f509ec0203d1697a99a8
@@ -15,6 +15,7 @@ module Dhatu
15
15
  def get_collections
16
16
  @new_bookings_count = Dhatu::Booking.new_ones.count
17
17
  @unread_bookings_count = Dhatu::Booking.unread.count
18
+ @read_bookings_count = Dhatu::Booking.read.count
18
19
  @relation = Dhatu::Booking.where("")
19
20
  params[:st] = "new" if params[:st].nil? && params[:q].nil?
20
21
  parse_filters
@@ -0,0 +1,77 @@
1
+ module Dhatu
2
+ class PromotionEnquiriesController < ResourceController
3
+
4
+ def show
5
+ @promotion_enquiry = @r_object = Dhatu::PromotionEnquiry.find_by_id(params[:id])
6
+ if @promotion_enquiry
7
+ @promotion_enquiry.read! if @promotion_enquiry.new? || @promotion_enquiry.unread?
8
+ else
9
+ set_notification(false, I18n.t('status.error'), I18n.t('status.not_found', item: default_item_name.titleize))
10
+ end
11
+ end
12
+
13
+ private
14
+
15
+ def get_collections
16
+ @new_promotion_enquiries_count = Dhatu::PromotionEnquiry.new_ones.count
17
+ @unread_promotion_enquiries_count = Dhatu::PromotionEnquiry.unread.count
18
+ @read_promotion_enquiries_count = Dhatu::PromotionEnquiry.read.count
19
+ @relation = Dhatu::PromotionEnquiry.where("")
20
+ params[:st] = "new" if params[:st].nil? && params[:q].nil?
21
+ parse_filters
22
+ apply_filters
23
+ @promotion_enquiries = @r_objects = @relation.page(@current_page).per(@per_page)
24
+ return true
25
+ end
26
+
27
+ def apply_filters
28
+ @relation = @relation.search(@query) if @query
29
+ @relation = @relation.status(@status) if @status
30
+ @relation = @relation.order("created_at DESC")
31
+ end
32
+
33
+ def configure_filter_settings
34
+ @filter_settings = {
35
+ string_filters: [
36
+ { filter_name: :query },
37
+ { filter_name: :status }
38
+ ],
39
+
40
+ boolean_filters: [],
41
+
42
+ reference_filters: [],
43
+ variable_filters: [],
44
+ }
45
+ end
46
+
47
+ def configure_filter_ui_settings
48
+ @filter_ui_settings = {}
49
+ end
50
+
51
+ def resource_controller_configuration
52
+ {
53
+ page_title: "Promotional Enquiries",
54
+ js_view_path: "/kuppayam/workflows/parrot",
55
+ view_path: "dhatu/promotion_enquiries",
56
+ collection_name: :promotion_enquiries,
57
+ item_name: :promotion_enquiry,
58
+ class: Dhatu::PromotionEnquiry
59
+ }
60
+ end
61
+
62
+ def breadcrumbs_configuration
63
+ {
64
+ heading: "Manage Promotional Enquiries",
65
+ icon: "fa-calendar",
66
+ description: "Listing all Promotional Enquiries",
67
+ links: [{name: "Dashboard", link: breadcrumb_home_path, icon: 'fa-dashboard'},
68
+ {name: "Manage Promotional Enquiries", link: dhatu.promotion_enquiries_path, icon: 'fa-email', active: true}]
69
+ }
70
+ end
71
+
72
+ def set_navs
73
+ set_nav("dhatu/promotion_enquiries")
74
+ end
75
+
76
+ end
77
+ end
@@ -5,21 +5,17 @@
5
5
  <div class="tabs-vertical-env">
6
6
 
7
7
  <ul id="div_category_types" class="nav tabs-vertical">
8
- <!-- <li class="<%= @status.blank? ? 'active' : '' %>">
9
- <%#= link_to "All", bookings_path, style: "text-align:left;" %>
10
- </li> -->
11
8
  <% Readable::STATUS_REVERSE.keys.each do |st| %>
12
- <%
13
- if st == "new" && @new_bookings_count > 0
14
- text = raw("#{st.titleize} <span class='badge badge-success ml-5'>#{@new_bookings_count}</span>")
15
- elsif st == "unread" && @unread_bookings_count > 0
16
- text = raw("#{st.titleize} <span class='badge badge-info ml-5'>#{@unread_bookings_count}</span>")
17
- else
18
- text = st.titleize
19
- end
9
+ <% count_hsh = { "new" => @new_bookings_count, "unread" => @unread_bookings_count, "read" => @read_bookings_count, "removed" => 0, "archived" => 0 } %>
10
+ <% badge_hsh = { "new" => "success", "unread" => "info", "read" => "default", "removed" => "", "archived" => "" } %>
11
+ <% icon_hsh = { "new" => "fa-envelope-square", "unread" => "fa-envelope-o", "read" => "fa-envelope", "removed" => "fa-trash", "archived" => "fa-archive" } %>
12
+ <%
13
+ icon = "<i class='fa #{icon_hsh[st]} mr-5'></i>"
14
+ text = st.titleize
15
+ text = raw("#{text} <span class='badge badge-#{badge_hsh[st]} ml-5'>#{count_hsh[st]}</span>") if count_hsh[st] > 0
20
16
  %>
21
17
  <li class="<%= st == @status ? 'active' : '' %>">
22
- <%= link_to text, bookings_path(st: st), style: "text-align:left;" %>
18
+ <%= link_to raw(icon + text), bookings_path(st: st), style: "text-align:left;" %>
23
19
  </li>
24
20
  <% end %>
25
21
  </ul>
@@ -83,12 +83,6 @@
83
83
  icon_class: "fa-reorder",
84
84
  url: dhatu.section_types_url,
85
85
  has_permission: @current_user.has_read_permission?(Dhatu::SectionType)
86
- },
87
- promotion_attributes: {
88
- text: "Promotion Attributes",
89
- icon_class: "fa-list",
90
- url: dhatu.promotion_attributes_url,
91
- has_permission: @current_user.has_read_permission?(Dhatu::PromotionAttribute)
92
86
  }
93
87
  }
94
88
  %>
@@ -16,7 +16,6 @@
16
16
  <tbody>
17
17
  <tr id="tr_offer_0"></tr>
18
18
  <% @offers.each_with_index do |offer, i| %>
19
-
20
19
  <tr id="tr_offer_<%= offer.id %>">
21
20
 
22
21
  <th scope="row" style="text-align: center;">
@@ -0,0 +1,50 @@
1
+ <div class="table-responsive">
2
+ <table class="table table-hover members-table middle-align">
3
+ <thead>
4
+ <tr>
5
+ <th style="text-align: center;width:8%">#</th>
6
+ <th>Name</th>
7
+ <th>Email</th>
8
+ <th>Phone</th>
9
+ <!-- <th style="width:100px;" class="hidden-sm hidden-xs">Status</th> -->
10
+ <% if display_manage_links? %>
11
+ <th style="text-align: center;" class="" >Actions</th>
12
+ <% end %>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <tr id="tr_promotion_enquiry_0"></tr>
17
+ <% @promotion_enquiries.each_with_index do |promotion_enquiry, i| %>
18
+ <tr id="tr_promotion_enquiry_<%= promotion_enquiry.id %>">
19
+
20
+ <th scope="row" style="text-align: center;">
21
+ <%= serial_number(i) %>
22
+ </th>
23
+
24
+ <td class="display-link">
25
+ <% if promotion_enquiry.new? || promotion_enquiry.unread? %>
26
+ <%= link_to promotion_enquiry.name, promotion_enquiry_path(promotion_enquiry), remote: true, style: "font-weight:800;" %><br>
27
+ <% else %>
28
+ <%= link_to promotion_enquiry.name, promotion_enquiry_path(promotion_enquiry), remote: true %>
29
+ <% end %>
30
+ &nbsp;<%= display_readable_status(promotion_enquiry) %><br>
31
+ <%= link_to time_ago_in_words(promotion_enquiry.created_at) + " ago", promotion_enquiry_path(promotion_enquiry), remote: true, style: "color:darkred;font-size:10px;" %>
32
+ </td>
33
+
34
+ <td class=""><%= promotion_enquiry.email %></td>
35
+ <td class=""><%= promotion_enquiry.phone %></td>
36
+
37
+ <% if display_manage_links? %>
38
+ <td class="action-links" style="width:15%"><%= display_readable_links(promotion_enquiry) %></td>
39
+ <% end %>
40
+ </tr>
41
+ <% end %>
42
+ </tbody>
43
+ </table>
44
+ </div>
45
+
46
+ <div class="row">
47
+ <div class="col-sm-12">
48
+ <%= paginate_kuppayam(@promotion_enquiries) %>
49
+ </div>
50
+ </div>
@@ -0,0 +1,23 @@
1
+ <tr id="tr_promotion_enquiry_<%= promotion_enquiry.id %>">
2
+
3
+ <th scope="row" style="text-align: center;">
4
+ <%= serial_number(i) %>
5
+ </th>
6
+
7
+ <td class="display-link">
8
+ <% if promotion_enquiry.new? || promotion_enquiry.unread? %>
9
+ <%= link_to promotion_enquiry.name, promotion_enquiry_path(promotion_enquiry), remote: true, style: "font-weight:800;" %><br>
10
+ <% else %>
11
+ <%= link_to promotion_enquiry.name, promotion_enquiry_path(promotion_enquiry), remote: true %>
12
+ <% end %>
13
+ &nbsp;<%= display_readable_status(promotion_enquiry) %><br>
14
+ <%= link_to time_ago_in_words(promotion_enquiry.created_at) + " ago", promotion_enquiry_path(promotion_enquiry), remote: true, style: "color:darkred;font-size:10px;" %>
15
+ </td>
16
+
17
+ <td class=""><%= promotion_enquiry.email %></td>
18
+ <td class=""><%= promotion_enquiry.phone %></td>
19
+
20
+ <% if display_manage_links? %>
21
+ <td class="action-links" style="width:15%"><%= display_readable_links(promotion_enquiry) %></td>
22
+ <% end %>
23
+ </tr>
@@ -0,0 +1,65 @@
1
+ <div id="div_promotion_enquiry_show">
2
+
3
+ <div class="row">
4
+
5
+ <div class="col-md-8 col-sm-12 col-xs-12" style="border-right:1px solid #f1f1f1;">
6
+
7
+ <%= theme_panel_heading(@promotion_enquiry.name) %>
8
+ <%= theme_panel_description(@promotion_enquiry.email) %>
9
+ <%= theme_panel_description(@promotion_enquiry.phone) %>
10
+ <%= display_readable_status(@promotion_enquiry) %>
11
+ <%= clear_tag(10) %>
12
+
13
+ <div class="well">
14
+ <% @promotion_enquiry.additional_attributes.each do |k, v| %>
15
+ <div><strong><%= k %></strong>: <%= v %></div>
16
+ <% end %>
17
+ </div>
18
+ <%= clear_tag(10) %>
19
+
20
+ <% if @current_user.super_admin? %>
21
+ <div class="table-responsive">
22
+ <table class="table table-striped table-condensed table-bordered mb-60">
23
+ <tbody>
24
+
25
+ <tr>
26
+ <th>ID</th><td><%= @promotion_enquiry.id %></td>
27
+ </tr>
28
+
29
+ <tr>
30
+ <th></th><td></td>
31
+ </tr>
32
+
33
+ <tr>
34
+ <th>Status</th><td><%= @promotion_enquiry.status %></td>
35
+ </tr>
36
+
37
+ <tr>
38
+ <th>Created At</th><td><%= @promotion_enquiry.created_at.strftime("%m/%d/%Y - %H:%M:%S") if @promotion_enquiry.created_at %></td>
39
+ </tr>
40
+
41
+ <tr>
42
+ <th>Updated At</th><td><%= @promotion_enquiry.updated_at.strftime("%m/%d/%Y - %H:%M:%S") if @promotion_enquiry.updated_at %></td>
43
+ </tr>
44
+
45
+ </tbody>
46
+ </table>
47
+ </div>
48
+ <% end %>
49
+
50
+ <%= clear_tag(20) %>
51
+ </div>
52
+
53
+ <% if display_manage_links? %>
54
+ <div class="col-md-4 col-sm-12 col-xs-12">
55
+ <%= display_readable_buttons(@promotion_enquiry) %>
56
+ </div>
57
+ <% end %>
58
+
59
+ </div>
60
+
61
+ <%= link_to "Close", "#", onclick: "closeGenericModal();", class: "btn btn-primary pull-right" %>
62
+
63
+ <%= clear_tag %>
64
+
65
+ </div>
@@ -0,0 +1,75 @@
1
+ <div class="row">
2
+
3
+ <div class="col-md-12">
4
+
5
+ <div class="tabs-vertical-env">
6
+
7
+ <ul id="div_category_types" class="nav tabs-vertical">
8
+ <% Readable::STATUS_REVERSE.keys.each do |st| %>
9
+ <% count_hsh = { "new" => @new_promotion_enquiries_count, "unread" => @unread_promotion_enquiries_count, "read" => @read_promotion_enquiries_count, "removed" => 0, "archived" => 0 } %>
10
+ <% badge_hsh = { "new" => "success", "unread" => "info", "read" => "default", "removed" => "", "archived" => "" } %>
11
+ <% icon_hsh = { "new" => "fa-envelope-square", "unread" => "fa-envelope-o", "read" => "fa-envelope", "removed" => "fa-trash", "archived" => "fa-archive" } %>
12
+ <%
13
+ icon = "<i class='fa #{icon_hsh[st]} mr-5'></i>"
14
+ text = st.titleize
15
+ text = raw("#{text} <span class='badge badge-#{badge_hsh[st]} ml-5'>#{count_hsh[st]}</span>") if count_hsh[st] > 0
16
+ %>
17
+ <li class="<%= st == @status ? 'active' : '' %>">
18
+ <%= link_to raw(icon + text), promotion_enquiries_path(st: st), style: "text-align:left;" %>
19
+ </li>
20
+ <% end %>
21
+ </ul>
22
+
23
+ <!-- <ul class="nav nav-tabs nav-tabs-justified">
24
+ <%# Dhatu::PromotionEnquiry::STATUS.each do |key, value| %>
25
+ <li class="<%#= @status == value ? 'active' : '' %>">
26
+ <%#= link_to dhatu.promotion_enquiries_path(st: value), "aria-expanded" => "#{ @status == value ? 'true' : 'false' }" do %>
27
+ <span class="visible-xs"><i class="fa-gift"></i></span>
28
+ <span class="hidden-xs"><%#= key %></span>
29
+ <%# end %>
30
+ </li>
31
+ <%# end %>
32
+ </ul> -->
33
+
34
+ <div class="tab-content">
35
+ <div class="tab-pane active">
36
+
37
+ <div id="div_promotion_enquiry_action_buttons">
38
+ <div class="row">
39
+ <div class="col-sm-6">
40
+ <%= theme_button('Refresh', 'refresh', dhatu.promotion_enquiries_path(st: @status), classes: "pull-left mr-10", btn_type: "white") %>
41
+ </div>
42
+ <div class="col-sm-6">
43
+ <%= search_form_kuppayam(Dhatu::PromotionEnquiry, dhatu.promotion_enquiries_path, text: @filters[:query]) %>
44
+ </div>
45
+ </div>
46
+
47
+ </div>
48
+ <%= clear_tag(10) %>
49
+
50
+ <div id="div_promotion_enquiry_index">
51
+ <%= render :partial=>"dhatu/promotion_enquiries/index" %>
52
+ </div>
53
+ <%= clear_tag(10) %>
54
+
55
+ </div>
56
+ </div>
57
+
58
+ </div>
59
+
60
+ </div>
61
+
62
+ </div>
63
+
64
+ <script type="text/javascript">
65
+ $('body').on('change', '#inp_name', function() {
66
+ var promotion_enquiryId = $('#inp_permalink').data("id");
67
+ if(promotion_enquiryId){
68
+ } else {
69
+ var permalink = convertToSlug($(this).val()).slice(0, 63);
70
+ $('#inp_permalink').val(permalink);
71
+ }
72
+ });
73
+ </script>
74
+
75
+
@@ -0,0 +1,17 @@
1
+ <% if @r_object %>
2
+
3
+ // Show the details in the large modal
4
+ var heading = "<%= raw @r_object.try(:display_name) %>";
5
+ var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/show")) %>";
6
+ showGenericModal(heading, bodyContent, false);
7
+
8
+ // Updating the edited row and highlighting it
9
+ $('#tr_<%= @resource_options[:item_name] %>_<%= @r_object.id %>').replaceWith("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/row", locals: { @resource_options[:item_name].to_sym => @r_object, i: -1})) %>");
10
+ $("#tr_<%= @resource_options[:item_name] %>_<%= @r_object.id %>").css("background-color", "#fffddd");
11
+
12
+ <% else %>
13
+
14
+ // Showing Growl Like Message
15
+ notifyError("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(raw(@notification[:message])) %>");
16
+
17
+ <% end %>
@@ -121,12 +121,6 @@
121
121
  icon_class: "fa-reorder",
122
122
  url: dhatu.section_types_url,
123
123
  has_permission: @current_user.has_read_permission?(Dhatu::SectionType)
124
- },
125
- promotion_attributes: {
126
- text: "Promotion Attributes",
127
- icon_class: "fa-list",
128
- url: dhatu.promotion_attributes_url,
129
- has_permission: @current_user.has_read_permission?(Dhatu::PromotionAttribute)
130
124
  }
131
125
  }
132
126
  %>
@@ -1,3 +1,3 @@
1
1
  module Dhatu
2
- VERSION = '0.1.12'
2
+ VERSION = '0.1.13'
3
3
  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.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - kpvarma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-02 00:00:00.000000000 Z
11
+ date: 2017-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -419,6 +419,7 @@ files:
419
419
  - app/controllers/dhatu/offers_controller.rb
420
420
  - app/controllers/dhatu/prices_controller.rb
421
421
  - app/controllers/dhatu/promotion_attributes_controller.rb
422
+ - app/controllers/dhatu/promotion_enquiries_controller.rb
422
423
  - app/controllers/dhatu/promotions_controller.rb
423
424
  - app/controllers/dhatu/resource_controller.rb
424
425
  - app/controllers/dhatu/section_types_controller.rb
@@ -489,6 +490,11 @@ files:
489
490
  - app/views/dhatu/promotion_attributes/_row.html.erb
490
491
  - app/views/dhatu/promotion_attributes/_show.html.erb
491
492
  - app/views/dhatu/promotion_attributes/index.html.erb
493
+ - app/views/dhatu/promotion_enquiries/_index.html.erb
494
+ - app/views/dhatu/promotion_enquiries/_row.html.erb
495
+ - app/views/dhatu/promotion_enquiries/_show.html.erb
496
+ - app/views/dhatu/promotion_enquiries/index.html.erb
497
+ - app/views/dhatu/promotion_enquiries/show.js.erb
492
498
  - app/views/dhatu/promotions/_form.html.erb
493
499
  - app/views/dhatu/promotions/_index.html.erb
494
500
  - app/views/dhatu/promotions/_row.html.erb