dhatu 0.1.1 → 0.1.2
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/branches_controller.rb +116 -0
- data/app/models/dhatu/{contact_information.rb → branch.rb} +3 -2
- data/app/views/dhatu/branches/_form.html.erb +104 -0
- data/app/views/dhatu/branches/_index.html.erb +64 -0
- data/app/views/dhatu/branches/_row.html.erb +35 -0
- data/app/views/dhatu/branches/_show.html.erb +150 -0
- data/app/views/dhatu/branches/index.html.erb +46 -0
- data/app/views/dhatu/dashboard/_index.html.erb +5 -5
- data/app/views/layouts/kuppayam/_sidebar.html.erb +5 -5
- data/config/routes.rb +3 -1
- data/db/master_data/features.csv +1 -1
- data/lib/dhatu/version.rb +1 -1
- data/spec/dummy/spec/factories/{contact_information.rb → branch.rb} +5 -5
- metadata +10 -10
- data/app/controllers/dhatu/contact_informations_controller.rb +0 -84
- data/app/views/dhatu/contact_informations/_form.html.erb +0 -104
- data/app/views/dhatu/contact_informations/_index.html.erb +0 -51
- data/app/views/dhatu/contact_informations/_row.html.erb +0 -26
- data/app/views/dhatu/contact_informations/_show.html.erb +0 -150
- data/app/views/dhatu/contact_informations/index.html.erb +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1fd11f5b29e613b8230921745d5a3cf44a765e8
|
4
|
+
data.tar.gz: f9ac26b4e06d1a7824103400c49a0c67d09b22f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7bc2a925e128847a641417eb16be7669d37d981d7e0e6f31a854ef4769d33e5fdbd6e1e8c29caffa32e4537c194b6968edcad0dd64dde22d7da6337b3d7067b
|
7
|
+
data.tar.gz: 93db27b763708e855f46074f7869959a1f4ea232ff38885f60592d84770fbf3aa57b2fc632886aff5b2817513ebd35b80dbbd31a991bb1ebabfedf4b8b9e5580
|
@@ -0,0 +1,116 @@
|
|
1
|
+
module Dhatu
|
2
|
+
class BranchesController < ResourceController
|
3
|
+
|
4
|
+
before_action :require_update_permission, only: [:update, :update_status, :mark_as_featured, :remove_from_featured, :make_main, :remove_main]
|
5
|
+
|
6
|
+
def make_main
|
7
|
+
@branch = @r_object = Dhatu::Branch.find_by_id(params[:id])
|
8
|
+
if @branch
|
9
|
+
@r_object.update_attribute(:main_branch, true)
|
10
|
+
if @r_object.errors.blank?
|
11
|
+
set_notification(true, I18n.t('status.success'), I18n.t('state.changed', item: default_item_name.titleize, new_state: @r_object.main_branch))
|
12
|
+
else
|
13
|
+
set_notification(false, I18n.t('status.error'), @r_object.errors.full_messages.join("<br>"))
|
14
|
+
end
|
15
|
+
else
|
16
|
+
set_notification(false, I18n.t('status.not_found'), I18n.t('status.not_found', item: default_item_name.titleize))
|
17
|
+
end
|
18
|
+
render_row
|
19
|
+
end
|
20
|
+
|
21
|
+
def remove_main
|
22
|
+
@branch = @r_object = Dhatu::Branch.find_by_id(params[:id])
|
23
|
+
if @branch
|
24
|
+
@r_object.update_attribute(:main_branch, false)
|
25
|
+
if @r_object.errors.blank?
|
26
|
+
set_notification(true, I18n.t('status.success'), I18n.t('state.changed', item: default_item_name.titleize, new_state: @r_object.main_branch))
|
27
|
+
else
|
28
|
+
set_notification(false, I18n.t('status.error'), @r_object.errors.full_messages.join("<br>"))
|
29
|
+
end
|
30
|
+
else
|
31
|
+
set_notification(false, I18n.t('status.not_found'), I18n.t('status.not_found', item: default_item_name.titleize))
|
32
|
+
end
|
33
|
+
render_row
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def permitted_params
|
39
|
+
params.require("dhatu/branch").permit(:main_branch, :title, :address_1, :address_2, :address_3, :email, :landline, :fax, :mobile, :facebook, :twitter, :google_plus, :linked_in, :youtube, :instagram, :tumblr, :pinterest, :blog)
|
40
|
+
end
|
41
|
+
|
42
|
+
def get_collections
|
43
|
+
@relation = Dhatu::Branch.where("")
|
44
|
+
params[:st] = "published" if params[:st].nil?
|
45
|
+
parse_filters
|
46
|
+
apply_filters
|
47
|
+
@branches = @r_objects = @relation.page(@current_page).per(@per_page)
|
48
|
+
return true
|
49
|
+
end
|
50
|
+
|
51
|
+
def apply_filters
|
52
|
+
@relation = @relation.search(@query) if @query
|
53
|
+
@relation = @relation.status(@status) if @status
|
54
|
+
|
55
|
+
@order_by = "created_at desc" unless @order_by
|
56
|
+
@relation = @relation.order(@order_by)
|
57
|
+
end
|
58
|
+
|
59
|
+
def configure_filter_settings
|
60
|
+
@filter_settings = {
|
61
|
+
string_filters: [
|
62
|
+
{ filter_name: :query },
|
63
|
+
{ filter_name: :status }
|
64
|
+
],
|
65
|
+
|
66
|
+
boolean_filters: [],
|
67
|
+
|
68
|
+
reference_filters: [],
|
69
|
+
variable_filters: [],
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
def configure_filter_ui_settings
|
74
|
+
@filter_ui_settings = {
|
75
|
+
status: {
|
76
|
+
object_filter: false,
|
77
|
+
select_label: "Select Status",
|
78
|
+
display_hash: Dhatu::Branch::STATUS,
|
79
|
+
current_value: @status,
|
80
|
+
values: Dhatu::Branch::STATUS_REVERSE,
|
81
|
+
current_filters: @filters,
|
82
|
+
filters_to_remove: [],
|
83
|
+
filters_to_add: {},
|
84
|
+
url_method_name: 'branches_url',
|
85
|
+
show_all_filter_on_top: true
|
86
|
+
}
|
87
|
+
}
|
88
|
+
end
|
89
|
+
|
90
|
+
def resource_controller_configuration
|
91
|
+
{
|
92
|
+
page_title: "Branch",
|
93
|
+
js_view_path: "/kuppayam/workflows/peacock",
|
94
|
+
view_path: "dhatu/branches",
|
95
|
+
collection_name: :branches,
|
96
|
+
item_name: :branch,
|
97
|
+
class: Dhatu::Branch
|
98
|
+
}
|
99
|
+
end
|
100
|
+
|
101
|
+
def breadcrumbs_configuration
|
102
|
+
{
|
103
|
+
heading: "Manage Branches",
|
104
|
+
icon: "fa-phone-square",
|
105
|
+
description: "Listing all Branches",
|
106
|
+
links: [{name: "Dashboard", link: dashboard_path, icon: 'fa-dashboard'},
|
107
|
+
{name: "Manage Branches", link: dhatu.branches_path, icon: 'fa-phone-square', active: true}]
|
108
|
+
}
|
109
|
+
end
|
110
|
+
|
111
|
+
def set_navs
|
112
|
+
set_nav("dhatu/branches")
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|
116
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
class Dhatu::
|
1
|
+
class Dhatu::Branch < Dhatu::ApplicationRecord
|
2
2
|
|
3
3
|
# Set Table Name
|
4
|
-
self.table_name = "
|
4
|
+
self.table_name = "branches"
|
5
5
|
|
6
6
|
# Including the State Machine Methods
|
7
7
|
include Publishable
|
@@ -55,6 +55,7 @@ class Dhatu::ContactInformation < Dhatu::ApplicationRecord
|
|
55
55
|
|
56
56
|
scope :upcoming, lambda { where("created_at >= ?", Time.now) }
|
57
57
|
scope :past, lambda { where("created_at < ?", Time.now) }
|
58
|
+
scope :main_branch, lambda { where("main_branch is TRUE")}
|
58
59
|
|
59
60
|
# ------------------
|
60
61
|
# Instance variables
|
@@ -0,0 +1,104 @@
|
|
1
|
+
<%= form_for(@branch,
|
2
|
+
:url => (@branch.new_record? ? dhatu.branches_path : branch_path),
|
3
|
+
:method => (@branch.new_record? ? :post : :put),
|
4
|
+
:remote => true,
|
5
|
+
:html => {:id=>"form_contact_info", :class=>"mb-0 form-horizontal"}) do |f| %>
|
6
|
+
|
7
|
+
<div id="branch_form_error">
|
8
|
+
<%= @branch.errors[:base].to_sentence %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="form-inputs m-15">
|
12
|
+
|
13
|
+
<!-- Title (string) -->
|
14
|
+
<%= theme_form_field(@branch, :title, form_style: "top-bottom", html_options: { placeholder: ""}) -%>
|
15
|
+
|
16
|
+
<div class="row">
|
17
|
+
<div class="col-md-4 pr-20">
|
18
|
+
<!-- Address 1 (string) -->
|
19
|
+
<%= theme_form_field(@branch, :address_1, form_style: "top-bottom", required: false, html_options: { placeholder: ""}) -%>
|
20
|
+
</div>
|
21
|
+
<div class="col-md-4 pr-20">
|
22
|
+
<!-- Address 1 (string) -->
|
23
|
+
<%= theme_form_field(@branch, :address_2, form_style: "top-bottom", required: false, html_options: { placeholder: ""}) -%>
|
24
|
+
</div>
|
25
|
+
<div class="col-md-4 pr-20">
|
26
|
+
<!-- Address 1 (string) -->
|
27
|
+
<%= theme_form_field(@branch, :address_3, form_style: "top-bottom", required: false, html_options: { placeholder: ""}) -%>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div class="row">
|
32
|
+
<div class="col-md-3 pr-20">
|
33
|
+
<!-- Email (string) -->
|
34
|
+
<%= theme_form_field(@branch, :email, form_style: "top-bottom", required: false, html_options: { type: :email, placeholder: "name@domain.com"}) -%>
|
35
|
+
</div>
|
36
|
+
<div class="col-md-3 pr-20">
|
37
|
+
<!-- Landline (string) -->
|
38
|
+
<%= theme_form_field(@branch, :landline, form_style: "top-bottom", required: false, html_options: { type: :tel, placeholder: ""}) -%>
|
39
|
+
</div>
|
40
|
+
<div class="col-md-3 pr-20">
|
41
|
+
<!-- Fax (string) -->
|
42
|
+
<%= theme_form_field(@branch, :fax, form_style: "top-bottom", required: false, html_options: { placeholder: ""}) -%>
|
43
|
+
</div>
|
44
|
+
<div class="col-md-3 pr-20">
|
45
|
+
<!-- Mobile (string) -->
|
46
|
+
<%= theme_form_field(@branch, :mobile, form_style: "top-bottom", required: false, html_options: { type: :tel, placeholder: ""}) -%>
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<div class="row">
|
51
|
+
<div class="col-md-4 pr-20">
|
52
|
+
<!-- Facebook (string) -->
|
53
|
+
<%= theme_form_field(@branch, :facebook, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
54
|
+
</div>
|
55
|
+
<div class="col-md-4 pr-20">
|
56
|
+
<!-- Twitter (string) -->
|
57
|
+
<%= theme_form_field(@branch, :twitter, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
58
|
+
</div>
|
59
|
+
<div class="col-md-4 pr-20">
|
60
|
+
<!-- Google Plus (string) -->
|
61
|
+
<%= theme_form_field(@branch, :google_plus, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
62
|
+
</div>
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<div class="row">
|
66
|
+
<div class="col-md-4 pr-20">
|
67
|
+
<!-- Linked In (string) -->
|
68
|
+
<%= theme_form_field(@branch, :linked_in, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
69
|
+
</div>
|
70
|
+
<div class="col-md-4 pr-20">
|
71
|
+
<!-- Youtube (string) -->
|
72
|
+
<%= theme_form_field(@branch, :youtube, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
73
|
+
</div>
|
74
|
+
<div class="col-md-4 pr-20">
|
75
|
+
<!-- Instagram (string) -->
|
76
|
+
<%= theme_form_field(@branch, :instagram, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
77
|
+
</div>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
<div class="row">
|
81
|
+
<div class="col-md-4 pr-20">
|
82
|
+
<!-- Tumblr (string) -->
|
83
|
+
<%= theme_form_field(@branch, :tumblr, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
84
|
+
</div>
|
85
|
+
<div class="col-md-4 pr-20">
|
86
|
+
<!-- Pinterest (string) -->
|
87
|
+
<%= theme_form_field(@branch, :pinterest, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
88
|
+
</div>
|
89
|
+
<div class="col-md-4 pr-20">
|
90
|
+
<!-- Blog (string) -->
|
91
|
+
<%= theme_form_field(@branch, :blog, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
<div class="row">
|
96
|
+
<%= submit_tag("Save", :class=>"btn btn-primary pull-right ml-10") %>
|
97
|
+
|
98
|
+
<%= link_to raw("<i class='fa fa-close'></i><span>Cancel</span>"), "#", onclick: "closeLargeModal();", class: "pull-right btn btn-white" %>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
<%= clear_tag %>
|
102
|
+
|
103
|
+
<% end %>
|
104
|
+
|
@@ -0,0 +1,64 @@
|
|
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:5%">#</th>
|
6
|
+
<th>Title</th>
|
7
|
+
<th style="width:100px;" class="hidden-sm hidden-xs">Featured</th>
|
8
|
+
<th style="width:100px;" class="hidden-sm hidden-xs">Status</th>
|
9
|
+
<% if display_manage_links? %>
|
10
|
+
<th style="text-align: center;" colspan="2" class="hidden-sm hidden-xs">Actions</th>
|
11
|
+
<% end %>
|
12
|
+
</tr>
|
13
|
+
</thead>
|
14
|
+
<tbody>
|
15
|
+
<tr id="tr_branch_0"></tr>
|
16
|
+
<% @branches.each_with_index do |branch, i| %>
|
17
|
+
|
18
|
+
<tr id="tr_branch_<%= branch.id %>">
|
19
|
+
|
20
|
+
<th scope="row" style="text-align: center;">
|
21
|
+
<%= serial_number(i) %>
|
22
|
+
</th>
|
23
|
+
|
24
|
+
<td class="display-link">
|
25
|
+
<%= link_to branch.title, branch_path(branch), remote: true %><br>
|
26
|
+
<%= content_tag(:span, "Main Branch", class: "label label-success") if branch.main_branch? %><br>
|
27
|
+
<%= branch.display_address %>
|
28
|
+
</td>
|
29
|
+
|
30
|
+
<td class="hidden-sm hidden-xs"><%= display_featured(branch) %></td>
|
31
|
+
|
32
|
+
<td class="hidden-sm hidden-xs"><%= display_publishable_status(branch) %></td>
|
33
|
+
|
34
|
+
<td class="action-links hidden-sm hidden-xs" style="width:10%">
|
35
|
+
<%= display_publishable_links(branch) %>
|
36
|
+
</td>
|
37
|
+
|
38
|
+
<% if display_manage_links? %>
|
39
|
+
<td class="action-links hidden-sm hidden-xs" style="width:10%">
|
40
|
+
<% if display_edit_links? %>
|
41
|
+
<% if branch.main_branch? %>
|
42
|
+
<!-- Remove Branch -->
|
43
|
+
<%= link_to raw("<i class=\"fa fa-check mr-5\"></i> Remove Main Branch"), remove_main_branch_path(:id =>branch.id), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"" %>
|
44
|
+
<% else %>
|
45
|
+
<!-- Main Branch -->
|
46
|
+
<%= link_to raw("<i class=\"fa fa-check mr-5\"></i> Make this Main Branch"), make_main_branch_path(:id =>branch.id), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"" %>
|
47
|
+
<% end %>
|
48
|
+
<% end %>
|
49
|
+
<%= display_featurable_links(branch) %>
|
50
|
+
<%= display_manage_links(branch, @current_user) %>
|
51
|
+
</td>
|
52
|
+
<% end %>
|
53
|
+
|
54
|
+
</tr>
|
55
|
+
<% end %>
|
56
|
+
</tbody>
|
57
|
+
</table>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div class="row">
|
61
|
+
<div class="col-sm-12">
|
62
|
+
<%= paginate_kuppayam(@branches) %>
|
63
|
+
</div>
|
64
|
+
</div>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<tr id="tr_branch_<%= branch.id %>">
|
2
|
+
|
3
|
+
<th scope="row" style="text-align: center;">
|
4
|
+
<%= serial_number(i) %>
|
5
|
+
</th>
|
6
|
+
|
7
|
+
<td class="display-link">
|
8
|
+
<%= link_to branch.title, branch_path(branch), remote: true %><br>
|
9
|
+
<%= content_tag(:span, "Main Branch", class: "label label-success") if branch.main_branch? %><br>
|
10
|
+
<%= branch.display_address %>
|
11
|
+
</td>
|
12
|
+
|
13
|
+
<td class="hidden-sm hidden-xs"><%= display_featured(branch) %></td>
|
14
|
+
|
15
|
+
<td class="hidden-sm hidden-xs"><%= display_publishable_status(branch) %></td>
|
16
|
+
|
17
|
+
<td class="action-links hidden-sm hidden-xs" style="width:10%"><%= display_publishable_links(branch) %></td>
|
18
|
+
|
19
|
+
<% if display_manage_links? %>
|
20
|
+
<td class="action-links hidden-sm hidden-xs" style="width:10%">
|
21
|
+
<% if display_edit_links? %>
|
22
|
+
<% if branch.main_branch? %>
|
23
|
+
<!-- Remove Branch -->
|
24
|
+
<%= link_to raw("<i class=\"fa fa-check mr-5\"></i> Remove Main Branch"), remove_main_branch_path(:id =>branch.id), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"" %>
|
25
|
+
<% else %>
|
26
|
+
<!-- Main Branch -->
|
27
|
+
<%= link_to raw("<i class=\"fa fa-check mr-5\"></i> Make this Main Branch"), make_main_branch_path(:id =>branch.id), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"" %>
|
28
|
+
<% end %>
|
29
|
+
<% end %>
|
30
|
+
<%= display_featurable_links(branch) %>
|
31
|
+
<%= display_manage_links(branch, @current_user) %>
|
32
|
+
</td>
|
33
|
+
<% end %>
|
34
|
+
|
35
|
+
</tr>
|
@@ -0,0 +1,150 @@
|
|
1
|
+
<div id="div_branch_show">
|
2
|
+
|
3
|
+
<div class="row">
|
4
|
+
|
5
|
+
<div class="col-md-9 col-sm-12 col-xs-12" style="border-right:1px solid #f1f1f1;">
|
6
|
+
|
7
|
+
<%= theme_panel_heading(@branch.title) %>
|
8
|
+
|
9
|
+
<%= clear_tag(10) %>
|
10
|
+
<%= display_publishable_status(@branch) %>
|
11
|
+
<%= display_featured(@branch) %>
|
12
|
+
<%= clear_tag(20) %>
|
13
|
+
|
14
|
+
<div class="table-responsive">
|
15
|
+
<table class="table table-striped table-condensed table-bordered">
|
16
|
+
<tbody>
|
17
|
+
<tr>
|
18
|
+
<th style="width:25%">Main Branch?</th>
|
19
|
+
<td style="width:25%"><%= @branch.main_branch? ? "Yes" : "No" %></td>
|
20
|
+
|
21
|
+
<th style="width:25%">Address 1</th>
|
22
|
+
<td style="width:25%"><%= @branch.address_1 if @branch.address_1 %></td>
|
23
|
+
</tr>
|
24
|
+
|
25
|
+
<tr>
|
26
|
+
<th style="width:25%">Address 2</th>
|
27
|
+
<td style="width:25%"><%= @branch.address_2 if @branch.address_2 %></td>
|
28
|
+
|
29
|
+
<th style="width:25%">Address 3</th>
|
30
|
+
<td style="width:25%"><%= @branch.address_3 if @branch.address_3 %></td>
|
31
|
+
</tr>
|
32
|
+
|
33
|
+
<tr>
|
34
|
+
<th style="width:25%">Email</th>
|
35
|
+
<td style="width:25%"><%= @branch.email if @branch.email %></td>
|
36
|
+
|
37
|
+
<th style="width:25%">Landline</th>
|
38
|
+
<td style="width:25%"><%= @branch.landline if @branch.landline %></td>
|
39
|
+
</tr>
|
40
|
+
|
41
|
+
<tr>
|
42
|
+
<th style="width:25%">Fax</th>
|
43
|
+
<td style="width:25%"><%= @branch.fax if @branch.fax %></td>
|
44
|
+
|
45
|
+
<th style="width:25%">Mobile</th>
|
46
|
+
<td style="width:25%"><%= @branch.mobile if @branch.mobile %></td>
|
47
|
+
</tr>
|
48
|
+
|
49
|
+
<tr>
|
50
|
+
<th style="width:25%">Facebook</th>
|
51
|
+
<td style="width:25%"><%= @branch.facebook if @branch.facebook %></td>
|
52
|
+
|
53
|
+
<th style="width:25%">Twitter</th>
|
54
|
+
<td style="width:25%"><%= @branch.twitter if @branch.twitter %></td>
|
55
|
+
</tr>
|
56
|
+
|
57
|
+
<tr>
|
58
|
+
<th style="width:25%">Google +</th>
|
59
|
+
<td style="width:25%"><%= @branch.google_plus if @branch.google_plus %></td>
|
60
|
+
|
61
|
+
<th style="width:25%">LinkedIn</th>
|
62
|
+
<td style="width:25%"><%= @branch.linked_in if @branch.linked_in %></td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr>
|
66
|
+
<th style="width:25%">Youtube</th>
|
67
|
+
<td style="width:25%"><%= @branch.youtube if @branch.youtube %></td>
|
68
|
+
|
69
|
+
<th style="width:25%">Instagram</th>
|
70
|
+
<td style="width:25%"><%= @branch.instagram if @branch.instagram %></td>
|
71
|
+
</tr>
|
72
|
+
|
73
|
+
<tr>
|
74
|
+
<th style="width:25%">Tumblr</th>
|
75
|
+
<td style="width:25%"><%= @branch.tumblr if @branch.tumblr %></td>
|
76
|
+
|
77
|
+
<th style="width:25%">Instagram</th>
|
78
|
+
<td style="width:25%"><%= @branch.pinterest if @branch.pinterest %></td>
|
79
|
+
</tr>
|
80
|
+
|
81
|
+
<tr>
|
82
|
+
<th style="width:25%">Blog</th>
|
83
|
+
<td style="width:25%"><%= @branch.blog if @branch.blog %></td>
|
84
|
+
|
85
|
+
<th style="width:25%"></th>
|
86
|
+
<td style="width:25%"></td>
|
87
|
+
</tr>
|
88
|
+
</tbody>
|
89
|
+
</table>
|
90
|
+
</div>
|
91
|
+
|
92
|
+
<%= clear_tag(20) %>
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
<% if display_manage_links? %>
|
97
|
+
<div class="col-md-3 col-sm-12 col-xs-12">
|
98
|
+
<%= display_manage_buttons(@branch) %>
|
99
|
+
<%= display_publishable_buttons(@branch) %>
|
100
|
+
<%= display_featurable_buttons(@branch) %>
|
101
|
+
</div>
|
102
|
+
<% end %>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<%= clear_tag(10) %>
|
107
|
+
|
108
|
+
<ul class="nav nav-pills">
|
109
|
+
<li class="active">
|
110
|
+
<a href="#technical_details" data-toggle="tab" aria-expanded="false">
|
111
|
+
<span class="visible-xs"><i class="fa-database"></i></span>
|
112
|
+
<span class="hidden-xs">Technical Details</span>
|
113
|
+
</a>
|
114
|
+
</li>
|
115
|
+
</ul>
|
116
|
+
|
117
|
+
<div class="tab-content">
|
118
|
+
<div class="tab-pane active" id="technical_details" style="border: 1px solid #000;min-height:200px;padding:20px;margin-bottom:20px;max-height: 400px;overflow-y: auto;">
|
119
|
+
|
120
|
+
<%= clear_tag(20) %>
|
121
|
+
|
122
|
+
<div class="table-responsive">
|
123
|
+
<table class="table table-striped table-condensed table-bordered mb-60">
|
124
|
+
<tbody>
|
125
|
+
|
126
|
+
<tr>
|
127
|
+
<th>ID</th><td><%= @branch.id %></td>
|
128
|
+
<th>Permalink</th><td><%#= @branch.to_param %></td>
|
129
|
+
</tr>
|
130
|
+
<tr>
|
131
|
+
<th>Featured</th><td><%#= @branch.featured %></td>
|
132
|
+
<th>Status</th><td><%= @branch.status %></td>
|
133
|
+
</tr>
|
134
|
+
<tr>
|
135
|
+
<th>Created At</th><td><%= @branch.created_at.strftime("%m/%d/%Y - %H:%M:%S") if @branch.created_at %></td>
|
136
|
+
<th>Updated At</th><td><%= @branch.updated_at.strftime("%m/%d/%Y - %H:%M:%S") if @branch.updated_at %></td>
|
137
|
+
</tr>
|
138
|
+
|
139
|
+
</tbody>
|
140
|
+
</table>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
</div>
|
144
|
+
</div>
|
145
|
+
|
146
|
+
<%= link_to "Close", "#", onclick: "closeLargeModal();", class: "btn btn-primary pull-right" %>
|
147
|
+
|
148
|
+
<%= clear_tag %>
|
149
|
+
|
150
|
+
</div>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<div class="row">
|
2
|
+
|
3
|
+
<div class="col-md-12">
|
4
|
+
|
5
|
+
<ul class="nav nav-tabs nav-tabs-justified">
|
6
|
+
<% Dhatu::Branch::STATUS.each do |key, value| %>
|
7
|
+
<li class="<%= @status == value ? 'active' : '' %>">
|
8
|
+
<%= link_to branches_path(st: value), "aria-expanded" => "#{ @status == value ? 'true' : 'false' }" do %>
|
9
|
+
<span class="visible-xs"><i class="fa-gift"></i></span>
|
10
|
+
<span class="hidden-xs"><%= key %></span>
|
11
|
+
<% end %>
|
12
|
+
</li>
|
13
|
+
<% end %>
|
14
|
+
</ul>
|
15
|
+
|
16
|
+
<div class="tab-content">
|
17
|
+
<div class="tab-pane active">
|
18
|
+
|
19
|
+
<div id="div_branch_action_buttons">
|
20
|
+
|
21
|
+
<div class="row">
|
22
|
+
<div class="col-sm-6">
|
23
|
+
<%= theme_button('Add a Branch', 'plus', new_branch_path(), classes: "pull-left mr-10", btn_type: "success") if @current_user.has_create_permission?(Dhatu::Branch) %>
|
24
|
+
|
25
|
+
<%= theme_button('Refresh', 'refresh', branches_path(st: @status), classes: "pull-left mr-10", btn_type: "white") %>
|
26
|
+
</div>
|
27
|
+
<div class="col-sm-6">
|
28
|
+
<%= search_form_kuppayam(Dhatu::Offer, branches_path(st: @status), text: @filters[:query]) %>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
</div>
|
33
|
+
<%= clear_tag(10) %>
|
34
|
+
|
35
|
+
<div id="div_branch_index">
|
36
|
+
<%= render :partial=>"dhatu/branches/index" %>
|
37
|
+
</div>
|
38
|
+
<%= clear_tag(10) %>
|
39
|
+
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
</div>
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
@@ -12,11 +12,11 @@
|
|
12
12
|
url: dhatu.blog_posts_url,
|
13
13
|
has_permission: @current_user.has_read_permission?(Dhatu::BlogPost)
|
14
14
|
},
|
15
|
-
|
16
|
-
text: "
|
17
|
-
icon_class: "fa-
|
18
|
-
url: dhatu.
|
19
|
-
has_permission: @current_user.has_read_permission?(Dhatu::
|
15
|
+
branches: {
|
16
|
+
text: "Branches",
|
17
|
+
icon_class: "fa-location-arrow",
|
18
|
+
url: dhatu.branches_url,
|
19
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Branch)
|
20
20
|
},
|
21
21
|
offers: {
|
22
22
|
text: "Offers",
|
@@ -12,11 +12,11 @@
|
|
12
12
|
url: dhatu.blog_posts_url,
|
13
13
|
has_permission: @current_user.has_read_permission?(Dhatu::BlogPost)
|
14
14
|
},
|
15
|
-
|
16
|
-
text: "
|
17
|
-
icon_class: "fa-
|
18
|
-
url: dhatu.
|
19
|
-
has_permission: @current_user.has_read_permission?(Dhatu::
|
15
|
+
branches: {
|
16
|
+
text: "Branches",
|
17
|
+
icon_class: "fa-location-arrow",
|
18
|
+
url: dhatu.branches_url,
|
19
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Branch)
|
20
20
|
},
|
21
21
|
offers: {
|
22
22
|
text: "Offers",
|
data/config/routes.rb
CHANGED
@@ -4,8 +4,10 @@ Dhatu::Engine.routes.draw do
|
|
4
4
|
|
5
5
|
scope :admin do
|
6
6
|
|
7
|
-
resources :
|
7
|
+
resources :branches do
|
8
8
|
member do
|
9
|
+
put :make_main, as: :make_main
|
10
|
+
put :remove_main, as: :remove_main
|
9
11
|
put :update_status, as: :update_status
|
10
12
|
put :mark_as_featured
|
11
13
|
put :remove_from_featured
|
data/db/master_data/features.csv
CHANGED
data/lib/dhatu/version.rb
CHANGED
@@ -2,7 +2,7 @@ require 'usman/factories.rb'
|
|
2
2
|
|
3
3
|
FactoryGirl.define do
|
4
4
|
|
5
|
-
factory :
|
5
|
+
factory :unpublished_branch, class: Dhatu::Branch do
|
6
6
|
|
7
7
|
title "Some Title"
|
8
8
|
|
@@ -29,25 +29,25 @@ FactoryGirl.define do
|
|
29
29
|
|
30
30
|
end
|
31
31
|
|
32
|
-
factory :
|
32
|
+
factory :published_branch, parent: :unpublished_branch do
|
33
33
|
after :build do |e|
|
34
34
|
e.publish
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
factory :
|
38
|
+
factory :removed_branch, parent: :unpublished_branch do
|
39
39
|
after :build do |e|
|
40
40
|
e.remove
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
factory :
|
44
|
+
factory :archived_branch, parent: :unpublished_branch do
|
45
45
|
after :build do |e|
|
46
46
|
e.archive
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
factory :
|
50
|
+
factory :featured_branch, parent: :published_branch do
|
51
51
|
after :build do |e|
|
52
52
|
e.mark_as_featured
|
53
53
|
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.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kpvarma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -407,7 +407,7 @@ files:
|
|
407
407
|
- app/assets/stylesheets/dhatu/application.css
|
408
408
|
- app/controllers/dhatu/application_controller.rb
|
409
409
|
- app/controllers/dhatu/blog_posts_controller.rb
|
410
|
-
- app/controllers/dhatu/
|
410
|
+
- app/controllers/dhatu/branches_controller.rb
|
411
411
|
- app/controllers/dhatu/dashboard_controller.rb
|
412
412
|
- app/controllers/dhatu/events_controller.rb
|
413
413
|
- app/controllers/dhatu/offers_controller.rb
|
@@ -420,7 +420,7 @@ files:
|
|
420
420
|
- app/mailers/dhatu/application_mailer.rb
|
421
421
|
- app/models/dhatu/application_record.rb
|
422
422
|
- app/models/dhatu/blog_post.rb
|
423
|
-
- app/models/dhatu/
|
423
|
+
- app/models/dhatu/branch.rb
|
424
424
|
- app/models/dhatu/event.rb
|
425
425
|
- app/models/dhatu/offer.rb
|
426
426
|
- app/models/dhatu/section.rb
|
@@ -431,11 +431,11 @@ files:
|
|
431
431
|
- app/views/dhatu/blog_posts/_row.html.erb
|
432
432
|
- app/views/dhatu/blog_posts/_show.html.erb
|
433
433
|
- app/views/dhatu/blog_posts/index.html.erb
|
434
|
-
- app/views/dhatu/
|
435
|
-
- app/views/dhatu/
|
436
|
-
- app/views/dhatu/
|
437
|
-
- app/views/dhatu/
|
438
|
-
- app/views/dhatu/
|
434
|
+
- app/views/dhatu/branches/_form.html.erb
|
435
|
+
- app/views/dhatu/branches/_index.html.erb
|
436
|
+
- app/views/dhatu/branches/_row.html.erb
|
437
|
+
- app/views/dhatu/branches/_show.html.erb
|
438
|
+
- app/views/dhatu/branches/index.html.erb
|
439
439
|
- app/views/dhatu/dashboard/_index.html.erb
|
440
440
|
- app/views/dhatu/dashboard/index.html.erb
|
441
441
|
- app/views/dhatu/events/_form.html.erb
|
@@ -480,7 +480,7 @@ files:
|
|
480
480
|
- spec/dummy/spec/factories/blog_post.rb
|
481
481
|
- spec/dummy/spec/factories/blog_post_cover_image.rb
|
482
482
|
- spec/dummy/spec/factories/blog_post_gallery_image.rb
|
483
|
-
- spec/dummy/spec/factories/
|
483
|
+
- spec/dummy/spec/factories/branch.rb
|
484
484
|
- spec/dummy/spec/factories/event.rb
|
485
485
|
- spec/dummy/spec/factories/event_cover_image.rb
|
486
486
|
- spec/dummy/spec/factories/event_gallery_image.rb
|
@@ -1,84 +0,0 @@
|
|
1
|
-
module Dhatu
|
2
|
-
class ContactInformationsController < ResourceController
|
3
|
-
|
4
|
-
private
|
5
|
-
|
6
|
-
def permitted_params
|
7
|
-
params.require("dhatu/contact_information").permit(:title, :address_1, :address_2, :address_3, :email, :landline, :fax, :mobile, :facebook, :twitter, :google_plus, :linked_in, :youtube, :instagram, :tumblr, :pinterest, :blog)
|
8
|
-
end
|
9
|
-
|
10
|
-
def get_collections
|
11
|
-
@relation = Dhatu::ContactInformation.where("")
|
12
|
-
params[:st] = "published" if params[:st].nil?
|
13
|
-
parse_filters
|
14
|
-
apply_filters
|
15
|
-
@contact_informations = @r_objects = @relation.page(@current_page).per(@per_page)
|
16
|
-
return true
|
17
|
-
end
|
18
|
-
|
19
|
-
def apply_filters
|
20
|
-
@relation = @relation.search(@query) if @query
|
21
|
-
@relation = @relation.status(@status) if @status
|
22
|
-
|
23
|
-
@order_by = "created_at desc" unless @order_by
|
24
|
-
@relation = @relation.order(@order_by)
|
25
|
-
end
|
26
|
-
|
27
|
-
def configure_filter_settings
|
28
|
-
@filter_settings = {
|
29
|
-
string_filters: [
|
30
|
-
{ filter_name: :query },
|
31
|
-
{ filter_name: :status }
|
32
|
-
],
|
33
|
-
|
34
|
-
boolean_filters: [],
|
35
|
-
|
36
|
-
reference_filters: [],
|
37
|
-
variable_filters: [],
|
38
|
-
}
|
39
|
-
end
|
40
|
-
|
41
|
-
def configure_filter_ui_settings
|
42
|
-
@filter_ui_settings = {
|
43
|
-
status: {
|
44
|
-
object_filter: false,
|
45
|
-
select_label: "Select Status",
|
46
|
-
display_hash: Dhatu::ContactInformation::STATUS,
|
47
|
-
current_value: @status,
|
48
|
-
values: Dhatu::ContactInformation::STATUS_REVERSE,
|
49
|
-
current_filters: @filters,
|
50
|
-
filters_to_remove: [],
|
51
|
-
filters_to_add: {},
|
52
|
-
url_method_name: 'contact_informations_url',
|
53
|
-
show_all_filter_on_top: true
|
54
|
-
}
|
55
|
-
}
|
56
|
-
end
|
57
|
-
|
58
|
-
def resource_controller_configuration
|
59
|
-
{
|
60
|
-
page_title: "Contact Information",
|
61
|
-
js_view_path: "/kuppayam/workflows/peacock",
|
62
|
-
view_path: "dhatu/contact_informations",
|
63
|
-
collection_name: :contact_informations,
|
64
|
-
item_name: :contact_information,
|
65
|
-
class: Dhatu::ContactInformation
|
66
|
-
}
|
67
|
-
end
|
68
|
-
|
69
|
-
def breadcrumbs_configuration
|
70
|
-
{
|
71
|
-
heading: "Manage Contact Informations",
|
72
|
-
icon: "fa-phone-square",
|
73
|
-
description: "Listing all Contact Informations",
|
74
|
-
links: [{name: "Dashboard", link: dashboard_path, icon: 'fa-dashboard'},
|
75
|
-
{name: "Manage Contact Informations", link: dhatu.contact_informations_path, icon: 'fa-phone-square', active: true}]
|
76
|
-
}
|
77
|
-
end
|
78
|
-
|
79
|
-
def set_navs
|
80
|
-
set_nav("dhatu/contact_informations")
|
81
|
-
end
|
82
|
-
|
83
|
-
end
|
84
|
-
end
|
@@ -1,104 +0,0 @@
|
|
1
|
-
<%= form_for(@contact_information,
|
2
|
-
:url => (@contact_information.new_record? ? dhatu.contact_informations_path : contact_information_path),
|
3
|
-
:method => (@contact_information.new_record? ? :post : :put),
|
4
|
-
:remote => true,
|
5
|
-
:html => {:id=>"form_contact_info", :class=>"mb-0 form-horizontal"}) do |f| %>
|
6
|
-
|
7
|
-
<div id="contact_information_form_error">
|
8
|
-
<%= @contact_information.errors[:base].to_sentence %>
|
9
|
-
</div>
|
10
|
-
|
11
|
-
<div class="form-inputs m-15">
|
12
|
-
|
13
|
-
<!-- Title (string) -->
|
14
|
-
<%= theme_form_field(@contact_information, :title, form_style: "top-bottom", html_options: { placeholder: ""}) -%>
|
15
|
-
|
16
|
-
<div class="row">
|
17
|
-
<div class="col-md-4 pr-20">
|
18
|
-
<!-- Address 1 (string) -->
|
19
|
-
<%= theme_form_field(@contact_information, :address_1, form_style: "top-bottom", required: false, html_options: { placeholder: ""}) -%>
|
20
|
-
</div>
|
21
|
-
<div class="col-md-4 pr-20">
|
22
|
-
<!-- Address 1 (string) -->
|
23
|
-
<%= theme_form_field(@contact_information, :address_2, form_style: "top-bottom", required: false, html_options: { placeholder: ""}) -%>
|
24
|
-
</div>
|
25
|
-
<div class="col-md-4 pr-20">
|
26
|
-
<!-- Address 1 (string) -->
|
27
|
-
<%= theme_form_field(@contact_information, :address_3, form_style: "top-bottom", required: false, html_options: { placeholder: ""}) -%>
|
28
|
-
</div>
|
29
|
-
</div>
|
30
|
-
|
31
|
-
<div class="row">
|
32
|
-
<div class="col-md-3 pr-20">
|
33
|
-
<!-- Email (string) -->
|
34
|
-
<%= theme_form_field(@contact_information, :email, form_style: "top-bottom", required: false, html_options: { type: :email, placeholder: "name@domain.com"}) -%>
|
35
|
-
</div>
|
36
|
-
<div class="col-md-3 pr-20">
|
37
|
-
<!-- Landline (string) -->
|
38
|
-
<%= theme_form_field(@contact_information, :landline, form_style: "top-bottom", required: false, html_options: { type: :tel, placeholder: ""}) -%>
|
39
|
-
</div>
|
40
|
-
<div class="col-md-3 pr-20">
|
41
|
-
<!-- Fax (string) -->
|
42
|
-
<%= theme_form_field(@contact_information, :fax, form_style: "top-bottom", required: false, html_options: { placeholder: ""}) -%>
|
43
|
-
</div>
|
44
|
-
<div class="col-md-3 pr-20">
|
45
|
-
<!-- Mobile (string) -->
|
46
|
-
<%= theme_form_field(@contact_information, :mobile, form_style: "top-bottom", required: false, html_options: { type: :tel, placeholder: ""}) -%>
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
|
50
|
-
<div class="row">
|
51
|
-
<div class="col-md-4 pr-20">
|
52
|
-
<!-- Facebook (string) -->
|
53
|
-
<%= theme_form_field(@contact_information, :facebook, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
54
|
-
</div>
|
55
|
-
<div class="col-md-4 pr-20">
|
56
|
-
<!-- Twitter (string) -->
|
57
|
-
<%= theme_form_field(@contact_information, :twitter, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
58
|
-
</div>
|
59
|
-
<div class="col-md-4 pr-20">
|
60
|
-
<!-- Google Plus (string) -->
|
61
|
-
<%= theme_form_field(@contact_information, :google_plus, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
62
|
-
</div>
|
63
|
-
</div>
|
64
|
-
|
65
|
-
<div class="row">
|
66
|
-
<div class="col-md-4 pr-20">
|
67
|
-
<!-- Linked In (string) -->
|
68
|
-
<%= theme_form_field(@contact_information, :linked_in, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
69
|
-
</div>
|
70
|
-
<div class="col-md-4 pr-20">
|
71
|
-
<!-- Youtube (string) -->
|
72
|
-
<%= theme_form_field(@contact_information, :youtube, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
73
|
-
</div>
|
74
|
-
<div class="col-md-4 pr-20">
|
75
|
-
<!-- Instagram (string) -->
|
76
|
-
<%= theme_form_field(@contact_information, :instagram, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
77
|
-
</div>
|
78
|
-
</div>
|
79
|
-
|
80
|
-
<div class="row">
|
81
|
-
<div class="col-md-4 pr-20">
|
82
|
-
<!-- Tumblr (string) -->
|
83
|
-
<%= theme_form_field(@contact_information, :tumblr, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
84
|
-
</div>
|
85
|
-
<div class="col-md-4 pr-20">
|
86
|
-
<!-- Pinterest (string) -->
|
87
|
-
<%= theme_form_field(@contact_information, :pinterest, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
88
|
-
</div>
|
89
|
-
<div class="col-md-4 pr-20">
|
90
|
-
<!-- Blog (string) -->
|
91
|
-
<%= theme_form_field(@contact_information, :blog, form_style: "top-bottom", required: false, html_options: { placeholder: "https://"}) -%>
|
92
|
-
</div>
|
93
|
-
</div>
|
94
|
-
|
95
|
-
<div class="row">
|
96
|
-
<%= submit_tag("Save", :class=>"btn btn-primary pull-right ml-10") %>
|
97
|
-
|
98
|
-
<%= link_to raw("<i class='fa fa-close'></i><span>Cancel</span>"), "#", onclick: "closeLargeModal();", class: "pull-right btn btn-white" %>
|
99
|
-
</div>
|
100
|
-
|
101
|
-
<%= clear_tag %>
|
102
|
-
|
103
|
-
<% end %>
|
104
|
-
|
@@ -1,51 +0,0 @@
|
|
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:5%">#</th>
|
6
|
-
<th>Title</th>
|
7
|
-
<th style="width:100px;" class="hidden-sm hidden-xs">Featured</th>
|
8
|
-
<th style="width:100px;" class="hidden-sm hidden-xs">Status</th>
|
9
|
-
<th style="text-align: center;" colspan="2" class="hidden-sm hidden-xs">Actions</th>
|
10
|
-
</tr>
|
11
|
-
</thead>
|
12
|
-
<tbody>
|
13
|
-
<tr id="tr_contact_information_0"></tr>
|
14
|
-
<% @contact_informations.each_with_index do |contact_information, i| %>
|
15
|
-
|
16
|
-
<tr id="tr_contact_information_<%= contact_information.id %>">
|
17
|
-
|
18
|
-
<th scope="row" style="text-align: center;">
|
19
|
-
<%= serial_number(i) %>
|
20
|
-
</th>
|
21
|
-
|
22
|
-
<td class="display-link">
|
23
|
-
<%= link_to contact_information.title, contact_information_path(contact_information), remote: true %>
|
24
|
-
<br>
|
25
|
-
<%= contact_information.display_address %>
|
26
|
-
</td>
|
27
|
-
|
28
|
-
<td class="hidden-sm hidden-xs"><%= display_featured(contact_information) %></td>
|
29
|
-
|
30
|
-
<td class="hidden-sm hidden-xs"><%= display_publishable_status(contact_information) %></td>
|
31
|
-
|
32
|
-
<td class="action-links hidden-sm hidden-xs" style="width:10%"><%= display_publishable_links(contact_information) %></td>
|
33
|
-
|
34
|
-
<% if display_manage_links? %>
|
35
|
-
<td class="action-links hidden-sm hidden-xs" style="width:10%">
|
36
|
-
<%= display_featurable_links(contact_information) %>
|
37
|
-
<%= display_manage_links(contact_information, @current_user) %>
|
38
|
-
</td>
|
39
|
-
<% end %>
|
40
|
-
|
41
|
-
</tr>
|
42
|
-
<% end %>
|
43
|
-
</tbody>
|
44
|
-
</table>
|
45
|
-
</div>
|
46
|
-
|
47
|
-
<div class="row">
|
48
|
-
<div class="col-sm-12">
|
49
|
-
<%= paginate_kuppayam(@contact_informations) %>
|
50
|
-
</div>
|
51
|
-
</div>
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<tr id="tr_contact_information_<%= contact_information.id %>">
|
2
|
-
|
3
|
-
<th scope="row" style="text-align: center;">
|
4
|
-
<%= serial_number(i) %>
|
5
|
-
</th>
|
6
|
-
|
7
|
-
<td class="display-link">
|
8
|
-
<%= link_to contact_information.title, contact_information_path(contact_information), remote: true %>
|
9
|
-
<br>
|
10
|
-
<%= contact_information.display_address %>
|
11
|
-
</td>
|
12
|
-
|
13
|
-
<td class="hidden-sm hidden-xs"><%= display_featured(contact_information) %></td>
|
14
|
-
|
15
|
-
<td class="hidden-sm hidden-xs"><%= display_publishable_status(contact_information) %></td>
|
16
|
-
|
17
|
-
<td class="action-links hidden-sm hidden-xs" style="width:10%"><%= display_publishable_links(contact_information) %></td>
|
18
|
-
|
19
|
-
<% if display_manage_links? %>
|
20
|
-
<td class="action-links hidden-sm hidden-xs" style="width:10%">
|
21
|
-
<%= display_featurable_links(contact_information) %>
|
22
|
-
<%= display_manage_links(contact_information, @current_user) %>
|
23
|
-
</td>
|
24
|
-
<% end %>
|
25
|
-
|
26
|
-
</tr>
|
@@ -1,150 +0,0 @@
|
|
1
|
-
<div id="div_contact_information_show">
|
2
|
-
|
3
|
-
<div class="row">
|
4
|
-
|
5
|
-
<div class="col-md-9 col-sm-12 col-xs-12" style="border-right:1px solid #f1f1f1;">
|
6
|
-
|
7
|
-
<%= theme_panel_heading(@contact_information.title) %>
|
8
|
-
|
9
|
-
<%= clear_tag(10) %>
|
10
|
-
<%= display_publishable_status(@contact_information) %>
|
11
|
-
<%= display_featured(@contact_information) %>
|
12
|
-
<%= clear_tag(20) %>
|
13
|
-
|
14
|
-
<div class="table-responsive">
|
15
|
-
<table class="table table-striped table-condensed table-bordered">
|
16
|
-
<tbody>
|
17
|
-
<tr>
|
18
|
-
<th style="width:25%">Address 1</th>
|
19
|
-
<td style="width:25%"><%= @contact_information.address_1 if @contact_information.address_1 %></td>
|
20
|
-
|
21
|
-
<th style="width:25%">Address 2</th>
|
22
|
-
<td style="width:25%"><%= @contact_information.address_2 if @contact_information.address_2 %></td>
|
23
|
-
</tr>
|
24
|
-
|
25
|
-
<tr>
|
26
|
-
<th style="width:25%">Address 3</th>
|
27
|
-
<td style="width:25%"><%= @contact_information.address_3 if @contact_information.address_3 %></td>
|
28
|
-
|
29
|
-
<th style="width:25%"></th>
|
30
|
-
<td style="width:25%"></td>
|
31
|
-
</tr>
|
32
|
-
|
33
|
-
<tr>
|
34
|
-
<th style="width:25%">Email</th>
|
35
|
-
<td style="width:25%"><%= @contact_information.email if @contact_information.email %></td>
|
36
|
-
|
37
|
-
<th style="width:25%">Landline</th>
|
38
|
-
<td style="width:25%"><%= @contact_information.landline if @contact_information.landline %></td>
|
39
|
-
</tr>
|
40
|
-
|
41
|
-
<tr>
|
42
|
-
<th style="width:25%">Fax</th>
|
43
|
-
<td style="width:25%"><%= @contact_information.fax if @contact_information.fax %></td>
|
44
|
-
|
45
|
-
<th style="width:25%">Mobile</th>
|
46
|
-
<td style="width:25%"><%= @contact_information.mobile if @contact_information.mobile %></td>
|
47
|
-
</tr>
|
48
|
-
|
49
|
-
<tr>
|
50
|
-
<th style="width:25%">Facebook</th>
|
51
|
-
<td style="width:25%"><%= @contact_information.facebook if @contact_information.facebook %></td>
|
52
|
-
|
53
|
-
<th style="width:25%">Twitter</th>
|
54
|
-
<td style="width:25%"><%= @contact_information.twitter if @contact_information.twitter %></td>
|
55
|
-
</tr>
|
56
|
-
|
57
|
-
<tr>
|
58
|
-
<th style="width:25%">Google +</th>
|
59
|
-
<td style="width:25%"><%= @contact_information.google_plus if @contact_information.google_plus %></td>
|
60
|
-
|
61
|
-
<th style="width:25%">LinkedIn</th>
|
62
|
-
<td style="width:25%"><%= @contact_information.linked_in if @contact_information.linked_in %></td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr>
|
66
|
-
<th style="width:25%">Youtube</th>
|
67
|
-
<td style="width:25%"><%= @contact_information.youtube if @contact_information.youtube %></td>
|
68
|
-
|
69
|
-
<th style="width:25%">Instagram</th>
|
70
|
-
<td style="width:25%"><%= @contact_information.instagram if @contact_information.instagram %></td>
|
71
|
-
</tr>
|
72
|
-
|
73
|
-
<tr>
|
74
|
-
<th style="width:25%">Tumblr</th>
|
75
|
-
<td style="width:25%"><%= @contact_information.tumblr if @contact_information.tumblr %></td>
|
76
|
-
|
77
|
-
<th style="width:25%">Instagram</th>
|
78
|
-
<td style="width:25%"><%= @contact_information.pinterest if @contact_information.pinterest %></td>
|
79
|
-
</tr>
|
80
|
-
|
81
|
-
<tr>
|
82
|
-
<th style="width:25%">Blog</th>
|
83
|
-
<td style="width:25%"><%= @contact_information.blog if @contact_information.blog %></td>
|
84
|
-
|
85
|
-
<th style="width:25%"></th>
|
86
|
-
<td style="width:25%"></td>
|
87
|
-
</tr>
|
88
|
-
</tbody>
|
89
|
-
</table>
|
90
|
-
</div>
|
91
|
-
|
92
|
-
<%= clear_tag(20) %>
|
93
|
-
|
94
|
-
</div>
|
95
|
-
|
96
|
-
<% if display_manage_links? %>
|
97
|
-
<div class="col-md-3 col-sm-12 col-xs-12">
|
98
|
-
<%= display_manage_buttons(@contact_information) %>
|
99
|
-
<%= display_publishable_buttons(@contact_information) %>
|
100
|
-
<%= display_featurable_buttons(@contact_information) %>
|
101
|
-
</div>
|
102
|
-
<% end %>
|
103
|
-
|
104
|
-
</div>
|
105
|
-
|
106
|
-
<%= clear_tag(10) %>
|
107
|
-
|
108
|
-
<ul class="nav nav-pills">
|
109
|
-
<li class="active">
|
110
|
-
<a href="#technical_details" data-toggle="tab" aria-expanded="false">
|
111
|
-
<span class="visible-xs"><i class="fa-database"></i></span>
|
112
|
-
<span class="hidden-xs">Technical Details</span>
|
113
|
-
</a>
|
114
|
-
</li>
|
115
|
-
</ul>
|
116
|
-
|
117
|
-
<div class="tab-content">
|
118
|
-
<div class="tab-pane active" id="technical_details" style="border: 1px solid #000;min-height:200px;padding:20px;margin-bottom:20px;max-height: 400px;overflow-y: auto;">
|
119
|
-
|
120
|
-
<%= clear_tag(20) %>
|
121
|
-
|
122
|
-
<div class="table-responsive">
|
123
|
-
<table class="table table-striped table-condensed table-bordered mb-60">
|
124
|
-
<tbody>
|
125
|
-
|
126
|
-
<tr>
|
127
|
-
<th>ID</th><td><%= @contact_information.id %></td>
|
128
|
-
<th>Permalink</th><td><%#= @contact_information.to_param %></td>
|
129
|
-
</tr>
|
130
|
-
<tr>
|
131
|
-
<th>Featured</th><td><%#= @contact_information.featured %></td>
|
132
|
-
<th>Status</th><td><%= @contact_information.status %></td>
|
133
|
-
</tr>
|
134
|
-
<tr>
|
135
|
-
<th>Created At</th><td><%= @contact_information.created_at.strftime("%m/%d/%Y - %H:%M:%S") if @contact_information.created_at %></td>
|
136
|
-
<th>Updated At</th><td><%= @contact_information.updated_at.strftime("%m/%d/%Y - %H:%M:%S") if @contact_information.updated_at %></td>
|
137
|
-
</tr>
|
138
|
-
|
139
|
-
</tbody>
|
140
|
-
</table>
|
141
|
-
</div>
|
142
|
-
|
143
|
-
</div>
|
144
|
-
</div>
|
145
|
-
|
146
|
-
<%= link_to "Close", "#", onclick: "closeLargeModal();", class: "btn btn-primary pull-right" %>
|
147
|
-
|
148
|
-
<%= clear_tag %>
|
149
|
-
|
150
|
-
</div>
|
@@ -1,46 +0,0 @@
|
|
1
|
-
<div class="row">
|
2
|
-
|
3
|
-
<div class="col-md-12">
|
4
|
-
|
5
|
-
<ul class="nav nav-tabs nav-tabs-justified">
|
6
|
-
<% Dhatu::ContactInformation::STATUS.each do |key, value| %>
|
7
|
-
<li class="<%= @status == value ? 'active' : '' %>">
|
8
|
-
<%= link_to contact_informations_path(st: value), "aria-expanded" => "#{ @status == value ? 'true' : 'false' }" do %>
|
9
|
-
<span class="visible-xs"><i class="fa-gift"></i></span>
|
10
|
-
<span class="hidden-xs"><%= key %></span>
|
11
|
-
<% end %>
|
12
|
-
</li>
|
13
|
-
<% end %>
|
14
|
-
</ul>
|
15
|
-
|
16
|
-
<div class="tab-content">
|
17
|
-
<div class="tab-pane active">
|
18
|
-
|
19
|
-
<div id="div_contact_information_action_buttons">
|
20
|
-
|
21
|
-
<div class="row">
|
22
|
-
<div class="col-sm-6">
|
23
|
-
<%= theme_button('Add a Contact Information', 'plus', new_contact_information_path(), classes: "pull-left", btn_type: "success") if @current_user.has_create_permission?(Dhatu::ContactInformation) %>
|
24
|
-
|
25
|
-
<%= theme_button('Refresh', 'refresh', contact_informations_path(st: @status), classes: "pull-left ml-10", btn_type: "white") %>
|
26
|
-
</div>
|
27
|
-
<div class="col-sm-6">
|
28
|
-
<%= search_form_kuppayam(Dhatu::Offer, contact_informations_path(st: @status), text: @filters[:query]) %>
|
29
|
-
</div>
|
30
|
-
</div>
|
31
|
-
|
32
|
-
</div>
|
33
|
-
<%= clear_tag(10) %>
|
34
|
-
|
35
|
-
<div id="div_contact_information_index">
|
36
|
-
<%= render :partial=>"dhatu/contact_informations/index" %>
|
37
|
-
</div>
|
38
|
-
<%= clear_tag(10) %>
|
39
|
-
|
40
|
-
</div>
|
41
|
-
</div>
|
42
|
-
|
43
|
-
</div>
|
44
|
-
|
45
|
-
</div>
|
46
|
-
|