forge-cli 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/forge-cli/version.rb +1 -1
- data/lib/forge/app/controllers/forge/pages_controller.rb +3 -2
- data/lib/forge/app/controllers/forge/posts_controller.rb +2 -1
- data/lib/forge/app/controllers/posts_controller.rb +2 -1
- data/lib/forge/app/helpers/forge/tree_helper.rb +3 -3
- data/lib/forge/app/models/post.rb +4 -0
- data/lib/forge/app/views/forge/pages/index.html.haml +2 -7
- data/lib/forge/app/views/pages/_page_list.html.haml +6 -0
- data/lib/forge/vendor/assets/javascripts/jquery.quickSearch.js.erb +2 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b3d1320e7a05a69b6ece89788ed2e3482339a41
|
4
|
+
data.tar.gz: 3cff55052ce0d38c2fcff392b91f4f2e5a200f67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7500f26b32b9112a8e86dafe52f6d9e4df8b3a596db8fe820306f2bd1d0d53e9f61ed4b84bdd151dc136272e8d4562f060363011e676578cf7dd4480b4c0d3ee
|
7
|
+
data.tar.gz: c8b04edd0fe995318206e7e02c4937a9275418811f610d2006cdf11819da358fa4e5d93ef7f37fff47a45171357b1d4166d72c39e7930a93798e34c7372c4e81
|
data/lib/forge-cli/version.rb
CHANGED
@@ -9,9 +9,10 @@ class Forge::PagesController < ForgeController
|
|
9
9
|
@pages = @pages.order(:lft)
|
10
10
|
}
|
11
11
|
format.js {
|
12
|
-
|
12
|
+
params[:q] ||= ''
|
13
|
+
ids = Page.where("LOWER(title) LIKE :q OR LOWER(content) LIKE :q", {:q => "%#{params[:q].downcase}%"}).collect {|p| p.top_parent.id}
|
13
14
|
@pages = Page.top.where("id IN (?)", ids)
|
14
|
-
render :partial => "
|
15
|
+
render :partial => "page_list", :locals => { :pages => @pages }
|
15
16
|
}
|
16
17
|
end
|
17
18
|
end
|
@@ -7,7 +7,8 @@ class Forge::PostsController < ForgeController
|
|
7
7
|
respond_to do |format|
|
8
8
|
format.html { @posts = Post.paginate(:per_page => 10, :page => params[:page]) }
|
9
9
|
format.js {
|
10
|
-
|
10
|
+
params[:q] ||= ''
|
11
|
+
@posts = Post.where("LOWER(title) LIKE :q OR LOWER(content) LIKE :q", {:q => "%#{params[:q].downcase}%"})
|
11
12
|
render :partial => "post", :collection => @posts
|
12
13
|
}
|
13
14
|
end
|
@@ -30,6 +30,7 @@ class PostsController < ApplicationController
|
|
30
30
|
|
31
31
|
def show
|
32
32
|
@post, @page_title = get_post
|
33
|
+
flash.now[:notice] = "This post is not yet posted and will not appear on your live website." unless @post.posted?
|
33
34
|
@comment = Comment.create_comment(@post, session[:comment]) if @post.allow_comments?
|
34
35
|
respond_to do |format|
|
35
36
|
format.html {}
|
@@ -51,7 +52,7 @@ class PostsController < ApplicationController
|
|
51
52
|
|
52
53
|
private
|
53
54
|
def get_post
|
54
|
-
post = Post.posted.find(params[:id])
|
55
|
+
post = current_user.blank? ? Post.posted.find(params[:id]) : Post.find(params[:id])
|
55
56
|
page_title = post.seo_title.blank? ? post.title : post.seo_title
|
56
57
|
return post, page_title
|
57
58
|
end
|
@@ -5,7 +5,7 @@ module Forge::TreeHelper
|
|
5
5
|
|
6
6
|
return '' if objects.size == 0
|
7
7
|
|
8
|
-
output = %{<
|
8
|
+
output = %{<li class="top">\n<div class="item-content">\n}
|
9
9
|
path = [nil]
|
10
10
|
|
11
11
|
objects.each_with_index do |o, i|
|
@@ -41,7 +41,7 @@ module Forge::TreeHelper
|
|
41
41
|
if p
|
42
42
|
output << %{\n</li>\n</ul>}
|
43
43
|
else
|
44
|
-
output << %{\n</div>\n</li
|
44
|
+
output << %{\n</div>\n</li>}
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -84,4 +84,4 @@ module Forge::TreeHelper
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|
87
|
-
end
|
87
|
+
end
|
@@ -54,6 +54,10 @@ class Post < ActiveRecord::Base
|
|
54
54
|
Post.where("created_at < ?", created_at)[0]
|
55
55
|
end
|
56
56
|
|
57
|
+
def posted?
|
58
|
+
self.published && self.created_at <= Time.now
|
59
|
+
end
|
60
|
+
|
57
61
|
private
|
58
62
|
def set_created_at
|
59
63
|
created_at_date && created_at_time && self.created_at = "#{created_at_date} #{created_at_time}"
|
@@ -17,10 +17,5 @@
|
|
17
17
|
%p.info These are all of the regular pages in your site. You can drag & drop pages and subpages to change their order.
|
18
18
|
|
19
19
|
= render :partial => "forge/shared/section_header", :locals => {:item => Page}
|
20
|
-
=
|
21
|
-
|
22
|
-
- if page.parent_id
|
23
|
-
= render "subpage", :subpage => page
|
24
|
-
- else
|
25
|
-
= render "page", :page => page
|
26
|
-
#item-list-bottom
|
20
|
+
%ul#item-list= render :partial => "page_list", :locals => { :pages => @pages }
|
21
|
+
#item-list-bottom
|
@@ -17,8 +17,8 @@
|
|
17
17
|
});
|
18
18
|
|
19
19
|
function runUpdate() {
|
20
|
-
var currentValue = $(this).
|
21
|
-
|
20
|
+
var currentValue = $(this).val();
|
21
|
+
|
22
22
|
// Do nothing if the search hasn't changed
|
23
23
|
if (currentValue == previousValue) {
|
24
24
|
return;
|
@@ -73,7 +73,5 @@
|
|
73
73
|
$('#item-list-bottom div.regular').fadeIn('fast');
|
74
74
|
});
|
75
75
|
}
|
76
|
-
|
77
|
-
|
78
76
|
}
|
79
77
|
})(jQuery);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forge-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- factor[e] design initiative
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -539,6 +539,7 @@ files:
|
|
539
539
|
- lib/forge/app/views/orders/checkout.html.haml
|
540
540
|
- lib/forge/app/views/orders/edit_cart.html.haml
|
541
541
|
- lib/forge/app/views/orders/paid.html.haml
|
542
|
+
- lib/forge/app/views/pages/_page_list.html.haml
|
542
543
|
- lib/forge/app/views/pages/show.html.haml
|
543
544
|
- lib/forge/app/views/posts/_archive_months.html.haml
|
544
545
|
- lib/forge/app/views/posts/_categories.html.haml
|