dhatu 0.1.7 → 0.1.8
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/dhatu/blog_posts_controller.rb +24 -1
- data/app/controllers/dhatu/prices_controller.rb +1 -2
- data/app/views/dhatu/blog_posts/_form.html.erb +1 -1
- data/app/views/dhatu/blog_posts/_index.html.erb +5 -10
- data/app/views/dhatu/blog_posts/_row.html.erb +8 -10
- data/app/views/dhatu/blog_posts/_show.html.erb +8 -2
- data/app/views/dhatu/blog_posts/index.html.erb +45 -27
- data/app/views/dhatu/prices/_form.html.erb +1 -1
- data/app/views/dhatu/services/_form.html.erb +1 -1
- data/lib/dhatu/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '081c3b426eb7136d392844e905662d48468f3ca8'
|
4
|
+
data.tar.gz: d0d80ccbd33b16435c8c1091d799d9ce5acf3019
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9064518b345800624470acb3ca70383d3b18e337ab4ebf501bf1d3be8f724d747907c2314f01c76ff5b31aee91995a58b56473e01dbff9af1ee0a447122ae899
|
7
|
+
data.tar.gz: b4065b4b48cbc61e1d59eeb7d1ce9e7774fa9f86324ec3d7c1dd0197955288897abf151ac57d41f1833051483fbac98590505be46b29c1ac498c6fbb93c8b793
|
@@ -1,6 +1,12 @@
|
|
1
1
|
module Dhatu
|
2
2
|
class BlogPostsController < ResourceController
|
3
3
|
|
4
|
+
def new
|
5
|
+
get_category
|
6
|
+
@r_object = @blog_post = Dhatu::BlogPost.new(category: @category)
|
7
|
+
render_accordingly
|
8
|
+
end
|
9
|
+
|
4
10
|
private
|
5
11
|
|
6
12
|
def permitted_params
|
@@ -9,14 +15,31 @@ module Dhatu
|
|
9
15
|
|
10
16
|
def get_collections
|
11
17
|
@relation = Dhatu::BlogPost.includes(:cover_image).where("")
|
12
|
-
|
18
|
+
get_category
|
13
19
|
parse_filters
|
14
20
|
apply_filters
|
15
21
|
@blog_posts = @r_objects = @relation.page(@current_page).per(@per_page)
|
16
22
|
return true
|
17
23
|
end
|
18
24
|
|
25
|
+
def get_category
|
26
|
+
if params[:ct].to_s == "-1"
|
27
|
+
@category = Dhatu::Category.new(id: -1, name: "None")
|
28
|
+
elsif params[:ct]
|
29
|
+
@category = Dhatu::Category.find_by_id(params[:ct])
|
30
|
+
end
|
31
|
+
@categories = Dhatu::Category.where(category_type: "Dhatu::BlogPost").all
|
32
|
+
end
|
33
|
+
|
19
34
|
def apply_filters
|
35
|
+
if @category
|
36
|
+
if @category.id == -1
|
37
|
+
@relation = @relation.where("category_id is NULL")
|
38
|
+
else
|
39
|
+
@relation = @relation.where("category_id = ?", @category.id)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
20
43
|
@relation = @relation.search(@query) if @query
|
21
44
|
@relation = @relation.status(@status) if @status
|
22
45
|
|
@@ -8,8 +8,7 @@ module Dhatu
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def get_collections
|
11
|
-
|
12
|
-
@categories = Dhatu::Category.where(id: category_ids).to_a
|
11
|
+
@categories = Dhatu::Category.where(category_type: "Dhatu::Price").all
|
13
12
|
@categories.unshift(Dhatu::Category.new(id: -1, name: "All"))
|
14
13
|
|
15
14
|
@relation = Dhatu::Price.where("")
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
<div class="row">
|
16
16
|
<div class="col-md-6 pr-20">
|
17
|
-
<% options = {assoc_collection: Dhatu::Category.filter_by_category_type("
|
17
|
+
<% options = {assoc_collection: Dhatu::Category.filter_by_category_type("Dhatu::BlogPost").published.select("id, name").order("name ASC").all, editable: true, assoc_display_method: :name} %>
|
18
18
|
<%= theme_form_assoc_group(@blog_post, :category_id, label: "Choose Category", form_style: "top-bottom", **options) %>
|
19
19
|
</div>
|
20
20
|
<div class="col-md-6 pl-20">
|
@@ -5,9 +5,6 @@
|
|
5
5
|
<th style="text-align: center;width:5%">#</th>
|
6
6
|
<th style="text-align: center;width:100px"><i class="fa fa-photo"></i></th>
|
7
7
|
<th>Title</th>
|
8
|
-
<th class="hidden-md hidden-sm hidden-xs">Author</th>
|
9
|
-
<th style="width:100px;" class="hidden-sm hidden-xs">Featured</th>
|
10
|
-
<th style="width:100px;" class="hidden-sm hidden-xs">Status</th>
|
11
8
|
<% if display_manage_links? %>
|
12
9
|
<th style="text-align: center;" colspan="2" class="hidden-sm hidden-xs">Actions</th>
|
13
10
|
<% end %>
|
@@ -27,13 +24,11 @@
|
|
27
24
|
<%= display_thumbnail_small(blog_post) %>
|
28
25
|
</td>
|
29
26
|
|
30
|
-
<td class="display-link"
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
<td class="hidden-sm hidden-xs"><%= display_publishable_status(blog_post) %></td>
|
27
|
+
<td class="display-link">
|
28
|
+
<%= link_to blog_post.title, blog_post_path(blog_post), remote: true %><br>
|
29
|
+
<%= display_publishable_status(blog_post) %>
|
30
|
+
<%= display_featured(blog_post) %>
|
31
|
+
</td>
|
37
32
|
|
38
33
|
<% if display_manage_links? %>
|
39
34
|
<td class="action-links hidden-sm hidden-xs" style="width:10%"><%= display_publishable_links(blog_post) %></td>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<tr id="tr_blog_post_<%= blog_post.id %>">
|
2
|
-
|
2
|
+
|
3
3
|
<th scope="row" style="text-align: center;">
|
4
4
|
<%= serial_number(i) %>
|
5
5
|
</th>
|
@@ -8,21 +8,19 @@
|
|
8
8
|
<%= display_thumbnail_small(blog_post) %>
|
9
9
|
</td>
|
10
10
|
|
11
|
-
<td class="
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
<td class="hidden-sm hidden-xs"><%= display_publishable_status(blog_post) %></td>
|
11
|
+
<td class="display-link">
|
12
|
+
<%= link_to blog_post.title, blog_post_path(blog_post), remote: true %><br>
|
13
|
+
<%= display_publishable_status(blog_post) %>
|
14
|
+
<%= display_featured(blog_post) %>
|
15
|
+
</td>
|
18
16
|
|
19
17
|
<% if display_manage_links? %>
|
20
18
|
<td class="action-links hidden-sm hidden-xs" style="width:10%"><%= display_publishable_links(blog_post) %></td>
|
21
|
-
|
19
|
+
|
22
20
|
<td class="action-links hidden-sm hidden-xs" style="width:10%">
|
23
21
|
<%= display_featurable_links(blog_post) %>
|
24
22
|
<%= display_manage_links(blog_post, @current_user) %>
|
25
23
|
</td>
|
26
24
|
<% end %>
|
27
|
-
|
25
|
+
|
28
26
|
</tr>
|
@@ -26,7 +26,13 @@
|
|
26
26
|
|
27
27
|
<%= display_featured(@blog_post) %>
|
28
28
|
|
29
|
-
<%= clear_tag(
|
29
|
+
<%= clear_tag(10) %>
|
30
|
+
|
31
|
+
<div class="well">
|
32
|
+
<%= raw(@blog_post.meta_description) %>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<%= clear_tag(10) %>
|
30
36
|
|
31
37
|
<div class="table-responsive">
|
32
38
|
<table class="table table-striped table-condensed table-bordered">
|
@@ -63,7 +69,7 @@
|
|
63
69
|
<li class="active">
|
64
70
|
<a href="#blog_post_details" data-toggle="tab" aria-expanded="true">
|
65
71
|
<span class="visible-xs"><i class="fa-info"></i></span>
|
66
|
-
<span class="hidden-xs">
|
72
|
+
<span class="hidden-xs">Article</span>
|
67
73
|
</a>
|
68
74
|
</li>
|
69
75
|
<li class="">
|
@@ -1,42 +1,60 @@
|
|
1
1
|
<div class="row">
|
2
2
|
|
3
3
|
<div class="col-md-12">
|
4
|
+
|
5
|
+
<div class="tabs-vertical-env">
|
6
|
+
<ul id="div_category_types" class="nav tabs-vertical">
|
7
|
+
<li class="<%= @category.blank? ? 'active' : '' %>">
|
8
|
+
<%= link_to "All", blog_posts_path, style: "text-align:left;" %>
|
9
|
+
</li>
|
10
|
+
<% @categories.each do |ct| %>
|
11
|
+
<li class="<%= @category && @category == ct ? 'active' : '' %>">
|
12
|
+
<%= link_to ct.name, blog_posts_path(ct: ct.id), style: "text-align:left;" %>
|
13
|
+
</li>
|
14
|
+
<% end %>
|
15
|
+
<li class="<%= @category && @category.id == -1 ? 'active' : '' %>">
|
16
|
+
<%= link_to "None", blog_posts_path(ct: -1), style: "text-align:left;" %>
|
17
|
+
</li>
|
18
|
+
</ul>
|
4
19
|
|
5
|
-
<ul class="nav nav-tabs nav-tabs-justified">
|
6
|
-
|
7
|
-
<li class="
|
8
|
-
|
20
|
+
<!-- <ul class="nav nav-tabs nav-tabs-justified">
|
21
|
+
<%# Dhatu::BlogPost::STATUS.each do |key, value| %>
|
22
|
+
<li class="<%#= @status == value ? 'active' : '' %>">
|
23
|
+
<%#= link_to blog_posts_path(st: value), "aria-expanded" => "#{ @status == value ? 'true' : 'false' }" do %>
|
9
24
|
<span class="visible-xs"><i class="fa-gift"></i></span>
|
10
|
-
<span class="hidden-xs"
|
11
|
-
|
25
|
+
<span class="hidden-xs"><%#= key %></span>
|
26
|
+
<%# end %>
|
12
27
|
</li>
|
13
|
-
|
14
|
-
</ul>
|
15
|
-
|
16
|
-
<div class="tab-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
<div class="
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
+
<%# end %>
|
29
|
+
</ul> -->
|
30
|
+
|
31
|
+
<div class="tab-content">
|
32
|
+
<div class="tab-pane active">
|
33
|
+
|
34
|
+
<div id="div_blog_post_action_buttons">
|
35
|
+
|
36
|
+
<div class="row">
|
37
|
+
<div class="col-sm-6">
|
38
|
+
<%= theme_button('Add a Blog Post', 'plus', new_blog_post_path(ct: @category.try(:id)), classes: "pull-left", btn_type: "success") if @current_user.has_create_permission?(Dhatu::BlogPost) %>
|
39
|
+
|
40
|
+
<%= theme_button('Refresh', 'refresh', blog_posts_path(ct: @category.try(:id)), classes: "pull-left ml-10", btn_type: "white") %>
|
41
|
+
</div>
|
42
|
+
<div class="col-sm-6">
|
43
|
+
<%= search_form_kuppayam(Dhatu::BlogPost, blog_posts_path, text: @filters[:query]) %>
|
44
|
+
</div>
|
28
45
|
</div>
|
46
|
+
|
29
47
|
</div>
|
48
|
+
<%= clear_tag(10) %>
|
30
49
|
|
31
|
-
|
32
|
-
|
50
|
+
<div id="div_blog_post_index">
|
51
|
+
<%= render :partial=>"dhatu/blog_posts/index" %>
|
52
|
+
</div>
|
53
|
+
<%= clear_tag(10) %>
|
33
54
|
|
34
|
-
<div id="div_blog_post_index">
|
35
|
-
<%= render :partial=>"dhatu/blog_posts/index" %>
|
36
55
|
</div>
|
37
|
-
<%= clear_tag(10) %>
|
38
|
-
|
39
56
|
</div>
|
57
|
+
|
40
58
|
</div>
|
41
59
|
|
42
60
|
</div>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<%= theme_form_field(@price, :sub_title, required: false, form_style: "top-bottom", html_options: { placeholder: "" }) %>
|
18
18
|
</div>
|
19
19
|
<div class="col-md-6">
|
20
|
-
<% options = {assoc_collection: Dhatu::Category.filter_by_category_type("Price").published.select("id, name").order("name ASC").all, editable: true, assoc_display_method: :name} %>
|
20
|
+
<% options = {assoc_collection: Dhatu::Category.filter_by_category_type("Dhatu::Price").published.select("id, name").order("name ASC").all, editable: true, assoc_display_method: :name} %>
|
21
21
|
<%= theme_form_assoc_group(@price, :category_id, label: "Choose Category", form_style: "top-bottom", **options) %>
|
22
22
|
</div>
|
23
23
|
</div>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
<div class="row">
|
16
16
|
<div class="col-md-4 pr-20">
|
17
|
-
<% options = {assoc_collection: Dhatu::Category.filter_by_category_type("Service").published.select("id, name").order("name ASC").all, editable: true, assoc_display_method: :name} %>
|
17
|
+
<% options = {assoc_collection: Dhatu::Category.filter_by_category_type("Dhatu::Service").published.select("id, name").order("name ASC").all, editable: true, assoc_display_method: :name} %>
|
18
18
|
<%= theme_form_assoc_group(@service, :category_id, label: "Choose Category", form_style: "top-bottom", **options) %>
|
19
19
|
</div>
|
20
20
|
<div class="col-md-4 pl-20">
|
data/lib/dhatu/version.rb
CHANGED