pattana 0.1.12 → 0.1.13
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 +4 -4
- data/app/controllers/pattana/api/v1/docs_controller.rb +37 -5
- data/app/controllers/pattana/application_controller.rb +2 -0
- data/app/models/city.rb +0 -14
- data/app/models/country.rb +0 -13
- data/app/models/region.rb +0 -13
- data/app/views/layouts/kuppayam/_sidebar.html.erb +52 -45
- data/app/views/pattana/cities/_index.html.erb +18 -11
- data/app/views/pattana/dashboard/_index.html.erb +35 -0
- data/app/views/pattana/dashboard/index.html.erb +1 -62
- data/config/routes.rb +5 -5
- data/lib/pattana/version.rb +1 -1
- metadata +5 -6
- data/app/controllers/pattana/api/v1/docs_base_controller.rb +0 -21
- data/app/views/kuppayam/api/docs/_navigation.html.erb +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb45c6403c3eb3cdd5b91ab30f725db24336ce83
|
4
|
+
data.tar.gz: da18c0ed96104ad393f57bd5b9bbb15a2f945277
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18ffdc7b7b48b68903cd427c1119b004ac8d9b28b5827aaa9d1dd01e5fba4842f87ad94bba561f212a2621c9cfbda5a5162f48fae04fc52795d0349af70d59d6
|
7
|
+
data.tar.gz: 4d37d6f52b57540607f287c0e5106935e12968b337652ad6e94fefe943e8c44ca91885ef4b1ccf44c68dd69e6299606715bca7faed31990311bfe00e5c281e8f
|
@@ -1,10 +1,13 @@
|
|
1
1
|
module Pattana
|
2
2
|
module Api
|
3
3
|
module V1
|
4
|
-
class DocsController < Pattana::
|
4
|
+
class DocsController < Pattana::ApplicationController
|
5
5
|
|
6
6
|
layout 'kuppayam/docs'
|
7
7
|
|
8
|
+
before_action :set_nav_items, :set_tab_items
|
9
|
+
helper_method :breadcrumb_home_path
|
10
|
+
|
8
11
|
def countries
|
9
12
|
set_title("Countries API")
|
10
13
|
@request_type = "GET"
|
@@ -23,7 +26,7 @@ module Pattana
|
|
23
26
|
@example_path = "pattana/api/v1/docs/"
|
24
27
|
@examples = ["pos_case_1", "pos_case_2", "pos_case_3", "pos_case_4"]
|
25
28
|
|
26
|
-
set_nav("docs/countries")
|
29
|
+
set_nav("docs/pattana/countries")
|
27
30
|
|
28
31
|
render 'kuppayam/api/docs/show'
|
29
32
|
end
|
@@ -51,7 +54,7 @@ module Pattana
|
|
51
54
|
@example_path = "pattana/api/v1/docs/"
|
52
55
|
@examples = ["pos_case_1", "pos_case_2", "pos_case_3", "pos_case_4", "neg_case_1"]
|
53
56
|
|
54
|
-
set_nav("docs/regions")
|
57
|
+
set_nav("docs/pattana/regions")
|
55
58
|
|
56
59
|
render 'kuppayam/api/docs/show'
|
57
60
|
end
|
@@ -80,7 +83,7 @@ module Pattana
|
|
80
83
|
@example_path = "pattana/api/v1/docs/"
|
81
84
|
@examples = ["pos_case_1", "pos_case_2", "pos_case_3", "pos_case_4", "neg_case_1"]
|
82
85
|
|
83
|
-
set_nav("docs/cities_in_a_country")
|
86
|
+
set_nav("docs/pattana/cities_in_a_country")
|
84
87
|
|
85
88
|
render 'kuppayam/api/docs/show'
|
86
89
|
end
|
@@ -109,11 +112,40 @@ module Pattana
|
|
109
112
|
@example_path = "pattana/api/v1/docs/"
|
110
113
|
@examples = ["pos_case_1", "pos_case_2", "pos_case_3", "pos_case_4", "neg_case_1"]
|
111
114
|
|
112
|
-
set_nav("docs/cities_in_a_region")
|
115
|
+
set_nav("docs/pattana/cities_in_a_region")
|
113
116
|
|
114
117
|
render 'kuppayam/api/docs/show'
|
115
118
|
end
|
116
119
|
|
120
|
+
private
|
121
|
+
|
122
|
+
def set_nav_items
|
123
|
+
@nav_items = {
|
124
|
+
countries: { nav_class: "docs/pattana/countries", icon_class: "fa-flag-checkered", url: pattana.docs_api_v1_countries_path, text: "Countries API"},
|
125
|
+
regions: { nav_class: "docs/pattana/regions", icon_class: "fa-globe", url: pattana.docs_api_v1_regions_path, text: "Countries API"},
|
126
|
+
cities_in_a_country: { nav_class: "docs/pattana/cities_in_a_country", icon_class: "fa-map-marker", url: pattana.docs_api_v1_cities_in_a_country_path, text: "Cities (in a Country)"},
|
127
|
+
cities_in_a_region: { nav_class: "docs/pattana/cities_in_a_region", icon_class: "fa-map-marker", url: pattana.docs_api_v1_cities_in_a_region_path, text: "Cities (in a Region)"}
|
128
|
+
}
|
129
|
+
end
|
130
|
+
|
131
|
+
def set_tab_items
|
132
|
+
@tab_items = {
|
133
|
+
pattana: { nav_class: "docs/pattana", icon_class: "fa-globe", url: pattana.docs_api_v1_countries_path, text: "Location APIs"}
|
134
|
+
}
|
135
|
+
end
|
136
|
+
|
137
|
+
def breadcrumb_home_path
|
138
|
+
pattana.dashboard_path
|
139
|
+
end
|
140
|
+
|
141
|
+
def breadcrumbs_configuration
|
142
|
+
{
|
143
|
+
heading: "Pattana - API Documentation",
|
144
|
+
description: "A brief documentation of all APIs implemented in the gem Pattana with input and output details and examples",
|
145
|
+
links: []
|
146
|
+
}
|
147
|
+
end
|
148
|
+
|
117
149
|
end
|
118
150
|
end
|
119
151
|
end
|
data/app/models/city.rb
CHANGED
@@ -2,9 +2,6 @@ class City < Pattana::ApplicationRecord
|
|
2
2
|
|
3
3
|
include ActiveModel::Serializers::JSON
|
4
4
|
|
5
|
-
# Constants
|
6
|
-
EXCLUDED_JSON_ATTRIBUTES = [:created_at, :updated_at, :show_in_api]
|
7
|
-
|
8
5
|
# Associations
|
9
6
|
belongs_to :country
|
10
7
|
belongs_to :region, optional: true
|
@@ -19,17 +16,6 @@ class City < Pattana::ApplicationRecord
|
|
19
16
|
# Class Methods
|
20
17
|
# ------------------
|
21
18
|
|
22
|
-
# BACKUP - TODO - REMOVE - TBR
|
23
|
-
# Exclude some attributes info from json output.
|
24
|
-
# def as_json(options={})
|
25
|
-
# options[:except] ||= EXCLUDED_JSON_ATTRIBUTES
|
26
|
-
# #options[:include] ||= []
|
27
|
-
# #options[:methods] = []
|
28
|
-
# #options[:methods] << :profile_image
|
29
|
-
# json = super(options)
|
30
|
-
# Hash[*json.map{|k, v| [k, v || ""]}.flatten]
|
31
|
-
# end
|
32
|
-
|
33
19
|
# Scopes Methods
|
34
20
|
|
35
21
|
# return an active record relation object with the search query in its where clause
|
data/app/models/country.rb
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
class Country < Pattana::ApplicationRecord
|
2
2
|
|
3
|
-
# Constants
|
4
|
-
EXCLUDED_JSON_ATTRIBUTES = [:created_at, :updated_at, :show_in_api]
|
5
|
-
|
6
3
|
# Associations
|
7
4
|
has_many :regions
|
8
5
|
has_many :cities
|
@@ -14,16 +11,6 @@ class Country < Pattana::ApplicationRecord
|
|
14
11
|
# Class Methods
|
15
12
|
# ------------------
|
16
13
|
|
17
|
-
# Exclude some attributes info from json output.
|
18
|
-
def as_json(options={})
|
19
|
-
options[:except] ||= EXCLUDED_JSON_ATTRIBUTES
|
20
|
-
#options[:include] ||= []
|
21
|
-
#options[:methods] = []
|
22
|
-
#options[:methods] << :profile_image
|
23
|
-
json = super(options)
|
24
|
-
Hash[*json.map{|k, v| [k, v || ""]}.flatten]
|
25
|
-
end
|
26
|
-
|
27
14
|
# Scopes Methods
|
28
15
|
|
29
16
|
# return an active record relation object with the search query in its where clause
|
data/app/models/region.rb
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
class Region < Pattana::ApplicationRecord
|
2
2
|
|
3
|
-
# Constants
|
4
|
-
EXCLUDED_JSON_ATTRIBUTES = [:created_at, :updated_at, :show_in_api]
|
5
|
-
|
6
3
|
# Associations
|
7
4
|
belongs_to :country
|
8
5
|
has_many :cities
|
@@ -14,16 +11,6 @@ class Region < Pattana::ApplicationRecord
|
|
14
11
|
# Class Methods
|
15
12
|
# ------------------
|
16
13
|
|
17
|
-
# Exclude some attributes info from json output.
|
18
|
-
def as_json(options={})
|
19
|
-
options[:except] ||= EXCLUDED_JSON_ATTRIBUTES
|
20
|
-
#options[:include] ||= []
|
21
|
-
#options[:methods] = []
|
22
|
-
#options[:methods] << :profile_image
|
23
|
-
json = super(options)
|
24
|
-
Hash[*json.map{|k, v| [k, v || ""]}.flatten]
|
25
|
-
end
|
26
|
-
|
27
14
|
# Scopes Methods
|
28
15
|
|
29
16
|
# return an active record relation object with the search query in its where clause
|
@@ -1,75 +1,82 @@
|
|
1
|
+
<%
|
2
|
+
pattana_items = {
|
3
|
+
countries: {
|
4
|
+
text: "Manage Countries",
|
5
|
+
icon_class: "fa-flag-checkered",
|
6
|
+
url: pattana.countries_url,
|
7
|
+
has_permission: true
|
8
|
+
},
|
9
|
+
regions: {
|
10
|
+
text: "Manage Regions",
|
11
|
+
icon_class: "fa-globe",
|
12
|
+
url: pattana.regions_url,
|
13
|
+
has_permission: true
|
14
|
+
},
|
15
|
+
cities: {
|
16
|
+
text: "Manage Cities",
|
17
|
+
icon_class: "fa-map-marker",
|
18
|
+
url: pattana.cities_url,
|
19
|
+
has_permission: true
|
20
|
+
}
|
21
|
+
}
|
22
|
+
%>
|
23
|
+
|
1
24
|
<div class="sidebar-menu toggle-others fixed collapsed">
|
2
25
|
|
3
26
|
<div class="sidebar-menu-inner">
|
4
27
|
|
5
28
|
<header class="logo-env">
|
6
|
-
|
7
29
|
<!-- logo -->
|
8
30
|
<div class="logo">
|
9
|
-
<a href="/" class="logo-expanded">
|
10
|
-
|
11
|
-
</a>
|
12
|
-
|
13
|
-
<a href="/" class="logo-collapsed">
|
14
|
-
<img src="/assets/logo-small.png" width="40" alt="" />
|
15
|
-
</a>
|
31
|
+
<a href="/" class="logo-expanded"><img src="/assets/logo.png" width="180" alt="" /></a>
|
32
|
+
<a href="/" class="logo-collapsed"><img src="/assets/logo-small.png" width="40" alt="" /></a>
|
16
33
|
</div>
|
17
34
|
|
18
35
|
<!-- This will toggle the mobile menu and will be visible only on mobile devices -->
|
19
36
|
<div class="mobile-menu-toggle visible-xs">
|
37
|
+
<!-- <a href="#" data-toggle="notifications-menu">
|
38
|
+
<i class="fa-bell-o"></i><span class="badge badge-success">7</span>
|
39
|
+
</a> -->
|
20
40
|
<a href="#" data-toggle="user-info-menu">
|
21
|
-
<i class="fa-bell-o"></i>
|
22
|
-
<span class="badge badge-success">7</span>
|
23
|
-
</a>
|
24
|
-
|
25
|
-
<a href="#" data-toggle="mobile-menu">
|
26
|
-
<i class="fa-bars"></i>
|
27
41
|
</a>
|
42
|
+
<a href="#" data-toggle="mobile-menu"><i class="fa-bars"></i></a>
|
28
43
|
</div>
|
29
|
-
|
30
44
|
</header>
|
31
45
|
|
32
|
-
|
33
|
-
|
34
|
-
<ul id="main-menu" class="main-menu">
|
35
|
-
|
36
|
-
<!-- add class "multiple-expanded" to allow multiple submenus to open -->
|
37
|
-
|
38
|
-
<!-- class "auto-inherit-active-class" will automatically add "active" class for parent elements who are marked already with class "active" -->
|
39
|
-
|
46
|
+
<!-- add class "multiple-expanded" to allow multiple submenus to open -->
|
47
|
+
<!-- class "auto-inherit-active-class" will automatically add "active" class for parent elements who are marked already with class "active" -->
|
48
|
+
<ul id="main-menu" class="main-menu multiple-expanded auto-inherit-active-class">
|
40
49
|
<!-- Admin Dashboard -->
|
41
|
-
<li class="<%= nav_active?('
|
42
|
-
<%= link_to raw("<i class=\"linecons-desktop\"></i> <span class='title'>Dashboard</span>"),
|
50
|
+
<li class="<%= nav_active?('profile/dashboard') ? 'active' : '' %>">
|
51
|
+
<%= link_to raw("<i class=\"linecons-desktop\"></i> <span class='title'>Dashboard</span>"), breadcrumb_home_path %>
|
43
52
|
</li>
|
44
53
|
|
45
54
|
<li class="">
|
46
55
|
<a href="#">
|
47
|
-
<i class="
|
48
|
-
<span class="title">
|
56
|
+
<i class="fa-globe"></i>
|
57
|
+
<span class="title">Manage Location</span>
|
49
58
|
</a>
|
50
|
-
|
51
59
|
<ul>
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
<li class="<%= nav_class("pattana/regions") %>">
|
57
|
-
<%= link_to raw("<i class=\"fa-globe\"></i> <span class='title'>Manage Regions</span>"), pattana.regions_url %>
|
58
|
-
</li>
|
59
|
-
|
60
|
-
<li class="<%= nav_class("pattana/cities") %>">
|
61
|
-
<%= link_to raw("<i class=\"fa-map-marker\"></i> <span class='title'>Manage Cities</span>"), pattana.cities_url %>
|
60
|
+
<% pattana_items.each do |key, values| %>
|
61
|
+
<% next unless values[:has_permission] %>
|
62
|
+
<li class="">
|
63
|
+
<%= link_to raw("<i class=\"#{values[:icon_class]}\"></i> <span class='title'>#{values[:text]}</span>"), values[:url] %>
|
62
64
|
</li>
|
65
|
+
<% end %>
|
63
66
|
</ul>
|
64
|
-
|
65
67
|
</li>
|
66
68
|
|
67
|
-
<!-- Documentation -->
|
68
|
-
<li class="<%=
|
69
|
-
<a href="
|
70
|
-
|
71
|
-
|
72
|
-
|
69
|
+
<!-- API Documentation -->
|
70
|
+
<li class="<%= nav_include?('docs/pattana') ? 'active' : '' %>">
|
71
|
+
<a href="#"><i class="fa-file-code-o"></i><span class="title">API Documentation</span></a>
|
72
|
+
<ul>
|
73
|
+
<li class="">
|
74
|
+
<a href="/docs/api/v1/countries">
|
75
|
+
<i class="fa-file-code-o"></i>
|
76
|
+
<span class="title">Location APIs</span>
|
77
|
+
</a>
|
78
|
+
</li>
|
79
|
+
</ul>
|
73
80
|
</li>
|
74
81
|
|
75
82
|
</ul>
|
@@ -2,13 +2,15 @@
|
|
2
2
|
<table class="table table-hover members-table middle-align">
|
3
3
|
<thead>
|
4
4
|
<tr>
|
5
|
-
<th style="text-align:center;width:
|
6
|
-
<th style="text-align:left;width:
|
5
|
+
<th style="text-align:center;width:5%;">#</th>
|
6
|
+
<th style="text-align:left;width:20%;">Name</th>
|
7
7
|
<th style="text-align:center;width:15%;">Region</th>
|
8
|
-
<th style="text-align:center;width:
|
8
|
+
<th style="text-align:center;width:10%;">Country</th>
|
9
9
|
<th style="text-align:center;width:10%;">Priority</th>
|
10
|
-
<th style="text-align:center;width:
|
11
|
-
|
10
|
+
<th style="text-align:center;width:12%;">Show in API</th>
|
11
|
+
<% if display_manage_links? %>
|
12
|
+
<th style="text-align:center;" colspan="2">Actions</th>
|
13
|
+
<% end %>
|
12
14
|
</tr>
|
13
15
|
</thead>
|
14
16
|
<tbody>
|
@@ -27,24 +29,29 @@
|
|
27
29
|
<td class="text-align-center"><%= city.priority %></td>
|
28
30
|
<td class="text-align-center"><%= city.display_show_in_api %></td>
|
29
31
|
|
32
|
+
<% if display_manage_links? %>
|
33
|
+
|
30
34
|
<td class="action-links text-align-center" style="width:10%">
|
31
35
|
<% if city.show_in_api? %>
|
32
|
-
<%= link_to raw("<i class=\"fa fa-square mr-5\"></i> Hide in API"), hide_in_api_city_path(:id =>city.id), :remote=>true, role: "menuitem", tabindex: "-1", style: "text-align:left;", class: "delete" %>
|
36
|
+
<%= link_to raw("<i class=\"fa fa-square mr-5\"></i> Hide in API"), hide_in_api_city_path(:id =>city.id), :remote=>true, role: "menuitem", tabindex: "-1", style: "text-align:left;", class: "delete" if display_edit_links? %>
|
33
37
|
<% else %>
|
34
|
-
<%= link_to raw("<i class=\"fa fa-square mr-5\"></i> Show in API"), show_in_api_city_path(:id =>city.id), :remote=>true, role: "menuitem", tabindex: "-1", style: "text-align:left;", class: "edit" %>
|
38
|
+
<%= link_to raw("<i class=\"fa fa-square mr-5\"></i> Show in API"), show_in_api_city_path(:id =>city.id), :remote=>true, role: "menuitem", tabindex: "-1", style: "text-align:left;", class: "edit" if display_edit_links? %>
|
35
39
|
<% end %>
|
36
40
|
|
37
41
|
<% if city.operational? %>
|
38
|
-
<%= link_to raw("<i class=\"fa fa-square mr-5\"></i> Remove Operational"), remove_operational_city_path(:id =>city.id), :remote=>true, role: "menuitem", tabindex: "-1", style: "text-align:left;", class: "delete" %>
|
42
|
+
<%= link_to raw("<i class=\"fa fa-square mr-5\"></i> Remove Operational"), remove_operational_city_path(:id =>city.id), :remote=>true, role: "menuitem", tabindex: "-1", style: "text-align:left;", class: "delete" if display_edit_links? %>
|
39
43
|
<% else %>
|
40
|
-
<%= link_to raw("<i class=\"fa fa-square mr-5\"></i> Mark as Operational"), mark_as_operational_city_path(:id =>city.id), :remote=>true, role: "menuitem", tabindex: "-1", style: "text-align:left;", class: "edit" %>
|
44
|
+
<%= link_to raw("<i class=\"fa fa-square mr-5\"></i> Mark as Operational"), mark_as_operational_city_path(:id =>city.id), :remote=>true, role: "menuitem", tabindex: "-1", style: "text-align:left;", class: "edit" if display_edit_links? %>
|
41
45
|
<% end %>
|
42
46
|
</td>
|
43
47
|
|
44
48
|
<td class="action-links text-align-center" style="width:10%">
|
45
|
-
<%= link_to raw("<i class=\"linecons-pencil\"></i> Edit City"), edit_link, :remote=>true, class: "edit" %>
|
49
|
+
<%= link_to raw("<i class=\"linecons-pencil\"></i> Edit City"), edit_link, :remote=>true, class: "edit" if display_edit_links? %>
|
50
|
+
|
51
|
+
<%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, role: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "delete" if display_delete_links? %>
|
52
|
+
</td>
|
46
53
|
|
47
|
-
|
54
|
+
<% end %>
|
48
55
|
</tr>
|
49
56
|
<% end %>
|
50
57
|
</tbody>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<%
|
2
|
+
pattana_items = {
|
3
|
+
countries: {
|
4
|
+
text: "Countries",
|
5
|
+
icon_class: "fa-flag-checkered",
|
6
|
+
url: pattana.countries_url,
|
7
|
+
has_permission: true
|
8
|
+
},
|
9
|
+
regions: {
|
10
|
+
text: "Regions",
|
11
|
+
icon_class: "fa-globe",
|
12
|
+
url: pattana.regions_url,
|
13
|
+
has_permission: true
|
14
|
+
},
|
15
|
+
cities: {
|
16
|
+
text: "Cities",
|
17
|
+
icon_class: "fa-map-marker",
|
18
|
+
url: pattana.cities_url,
|
19
|
+
has_permission: true
|
20
|
+
},
|
21
|
+
|
22
|
+
}
|
23
|
+
%>
|
24
|
+
|
25
|
+
<% if (pattana_items.map{|x, y| y[:has_permission] }).compact.uniq.any? %>
|
26
|
+
|
27
|
+
<h3 class="text-gray mt-50 mb-10">
|
28
|
+
Manage Locations <br>
|
29
|
+
<small class="text-muted">Configure Countries, Regions, Cities & Locality</small>
|
30
|
+
</h3>
|
31
|
+
<hr class="mb-30" style="border-top:1px solid #ddd;">
|
32
|
+
|
33
|
+
<%= render partial: "/layouts/dashboard/items", locals: { items: pattana_items } %>
|
34
|
+
|
35
|
+
<% end %>
|
@@ -1,68 +1,7 @@
|
|
1
|
-
|
2
|
-
items = {
|
3
|
-
countries: {
|
4
|
-
counts: {
|
5
|
-
total: Country.count,
|
6
|
-
show_in_api: Country.show_in_api(true).count
|
7
|
-
},
|
8
|
-
text: "Countries",
|
9
|
-
icon_class: "fa-flag-checkered",
|
10
|
-
url: countries_url
|
11
|
-
},
|
12
|
-
regions: {
|
13
|
-
counts: {
|
14
|
-
total: Region.count,
|
15
|
-
show_in_api: Region.show_in_api(true).count
|
16
|
-
},
|
17
|
-
text: "Regions",
|
18
|
-
icon_class: "fa-globe",
|
19
|
-
url: regions_url
|
20
|
-
},
|
21
|
-
cities: {
|
22
|
-
counts: {
|
23
|
-
total: City.count,
|
24
|
-
show_in_api: City.show_in_api(true).count
|
25
|
-
},
|
26
|
-
text: "Cities",
|
27
|
-
icon_class: "fa-map-marker",
|
28
|
-
url: cities_url
|
29
|
-
},
|
30
|
-
|
31
|
-
}
|
32
|
-
%>
|
33
|
-
<div class="row">
|
34
|
-
|
35
|
-
<% items.each do |key, values| %>
|
36
|
-
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
|
37
|
-
|
38
|
-
<div class="xe-widget xe-vertical-counter xe-vertical-counter-white" data-count=".num" data-from="0" data-to="128" data-duration="4">
|
39
|
-
<div class="xe-icon">
|
40
|
-
<i class="<%= values[:icon_class] %>"></i>
|
41
|
-
</div>
|
42
|
-
|
43
|
-
<div class="xe-label">
|
44
|
-
<strong class="num"><%= values[:text] %></strong>
|
45
|
-
</div>
|
46
|
-
|
47
|
-
<div class="xe-label" style="margin-top:10px; margin-bottom: 10px;height: 100px; overflow-y: auto;">
|
48
|
-
<% values[:counts].each do |count_text, count_value| %>
|
49
|
-
<span><%= count_text.to_s.titleize %>: <strong><%= count_value %></strong></span>
|
50
|
-
<% end %>
|
51
|
-
</div>
|
52
|
-
|
53
|
-
<div class="xe-label">
|
54
|
-
<span><%= link_to("Manage", values[:url], class: "btn btn-sm btn-primary btn-block") %></span>
|
55
|
-
</div>
|
56
|
-
</div>
|
57
|
-
|
58
|
-
</div>
|
59
|
-
<% end %>
|
60
|
-
|
61
|
-
</div>
|
1
|
+
<%= render partial: "index" %>
|
62
2
|
|
63
3
|
<div style="border-top:1px solid #FFF;margin-top:50px;margin-bottom:70px;"></div>
|
64
4
|
|
65
|
-
|
66
5
|
<div class="dx-warning">
|
67
6
|
<div>
|
68
7
|
<h2>Pattana - API Documentation</h2>
|
data/config/routes.rb
CHANGED
@@ -36,14 +36,14 @@ Pattana::Engine.routes.draw do
|
|
36
36
|
|
37
37
|
namespace :api do
|
38
38
|
namespace :v1 do
|
39
|
-
get 'countries', :controller => "countries", action: :index
|
40
|
-
get ':country_id/regions', :controller => "regions", action: :index
|
41
|
-
get 'countries/:country_id/cities', :controller => "cities", action: :cities_in_a_country
|
42
|
-
get 'regions/:region_id/cities', :controller => "cities", action: :cities_in_a_region
|
39
|
+
get 'countries', :controller => "countries", action: :index, as: :countries
|
40
|
+
get ':country_id/regions', :controller => "regions", action: :index, as: :regions
|
41
|
+
get 'countries/:country_id/cities', :controller => "cities", action: :cities_in_a_country, as: :cities_in_a_country
|
42
|
+
get 'regions/:region_id/cities', :controller => "cities", action: :cities_in_a_region, as: :cities_in_a_region
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
scope :docs do
|
46
|
+
scope :docs, as: 'docs' do
|
47
47
|
namespace :api do
|
48
48
|
namespace :v1 do
|
49
49
|
get 'countries', :controller => "docs"
|
data/lib/pattana/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pattana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
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-10-
|
11
|
+
date: 2017-10-25 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.
|
110
|
+
version: 0.1.16
|
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.
|
120
|
+
version: 0.1.16
|
121
121
|
- !ruby/object:Gem::Dependency
|
122
122
|
name: bcrypt
|
123
123
|
requirement: !ruby/object:Gem::Requirement
|
@@ -370,7 +370,6 @@ files:
|
|
370
370
|
- app/controllers/pattana/api/v1/base_controller.rb
|
371
371
|
- app/controllers/pattana/api/v1/cities_controller.rb
|
372
372
|
- app/controllers/pattana/api/v1/countries_controller.rb
|
373
|
-
- app/controllers/pattana/api/v1/docs_base_controller.rb
|
374
373
|
- app/controllers/pattana/api/v1/docs_controller.rb
|
375
374
|
- app/controllers/pattana/api/v1/regions_controller.rb
|
376
375
|
- app/controllers/pattana/application_controller.rb
|
@@ -389,7 +388,6 @@ files:
|
|
389
388
|
- app/serializers/city_preview_serializer.rb
|
390
389
|
- app/serializers/country_preview_serializer.rb
|
391
390
|
- app/serializers/region_preview_serializer.rb
|
392
|
-
- app/views/kuppayam/api/docs/_navigation.html.erb
|
393
391
|
- app/views/layouts/kuppayam/_footer.html.erb
|
394
392
|
- app/views/layouts/kuppayam/_header.html.erb
|
395
393
|
- app/views/layouts/kuppayam/_navbar.html.erb
|
@@ -433,6 +431,7 @@ files:
|
|
433
431
|
- app/views/pattana/country_regions/_form.html.erb
|
434
432
|
- app/views/pattana/country_regions/_index.html.erb
|
435
433
|
- app/views/pattana/country_regions/_row.html.erb
|
434
|
+
- app/views/pattana/dashboard/_index.html.erb
|
436
435
|
- app/views/pattana/dashboard/index.html.erb
|
437
436
|
- app/views/pattana/region_cities/_action_buttons.html.erb
|
438
437
|
- app/views/pattana/region_cities/_index.html.erb
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Pattana
|
2
|
-
module Api
|
3
|
-
module V1
|
4
|
-
class DocsBaseController < Kuppayam::BaseController
|
5
|
-
|
6
|
-
layout 'kuppayam/docs'
|
7
|
-
|
8
|
-
private
|
9
|
-
|
10
|
-
def breadcrumbs_configuration
|
11
|
-
{
|
12
|
-
heading: "Pattana - API Documentation",
|
13
|
-
description: "A brief documentation of all APIs implemented in the gem Pattana with input and output details and examples",
|
14
|
-
links: []
|
15
|
-
}
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
<ul class="nav tabs-vertical">
|
2
|
-
<li class="<%= nav_active?('docs/countries') ? 'active' : '' %>">
|
3
|
-
<a href="/docs/api/v1/countries">
|
4
|
-
<i class="fa-globe visible-xs"></i>
|
5
|
-
<span class="hidden-xs">Countries</span>
|
6
|
-
</a>
|
7
|
-
</li>
|
8
|
-
<li class="<%= nav_active?('docs/regions') ? 'active' : '' %>">
|
9
|
-
<a href="/docs/api/v1/regions">
|
10
|
-
<i class="fa-globe visible-xs"></i>
|
11
|
-
<span class="hidden-xs">Regions</span>
|
12
|
-
</a>
|
13
|
-
</li>
|
14
|
-
<li class="<%= nav_active?('docs/cities_in_a_country') ? 'active' : '' %>">
|
15
|
-
<a href="/docs/api/v1/cities_in_a_country">
|
16
|
-
<i class="fa-globe visible-xs"></i>
|
17
|
-
<span class="hidden-xs">Cities (in a Country)</span>
|
18
|
-
</a>
|
19
|
-
</li>
|
20
|
-
<li class="<%= nav_active?('docs/cities_in_a_region') ? 'active' : '' %>">
|
21
|
-
<a href="/docs/api/v1/cities_in_a_region">
|
22
|
-
<i class="fa-globe visible-xs"></i>
|
23
|
-
<span class="hidden-xs">Cities (in a Region)</span>
|
24
|
-
</a>
|
25
|
-
</li>
|
26
|
-
</ul>
|
27
|
-
|
28
|
-
<style type="text/css">
|
29
|
-
.panel-positive h4.panel-title a { color: #68b828 !important; }
|
30
|
-
.panel-negative h4.panel-title a { color: #cc3f44 !important; }
|
31
|
-
</style>
|