blogaze 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +20 -0
- data/Gemfile +4 -0
- data/LICENSE +24 -0
- data/README.md +33 -0
- data/Rakefile +1 -0
- data/bin/blogaze +11 -0
- data/blogaze.gemspec +24 -0
- data/lib/blogaze/bin/create.rb +55 -0
- data/lib/blogaze/bin/default.rb +47 -0
- data/lib/blogaze/controller/admin/comments.rb +32 -0
- data/lib/blogaze/controller/admin/init.rb +28 -0
- data/lib/blogaze/controller/admin/main.rb +20 -0
- data/lib/blogaze/controller/admin/pages.rb +75 -0
- data/lib/blogaze/controller/admin/posts.rb +103 -0
- data/lib/blogaze/controller/admin/settings.rb +33 -0
- data/lib/blogaze/controller/init.rb +51 -0
- data/lib/blogaze/controller/main.rb +30 -0
- data/lib/blogaze/controller/pages.rb +34 -0
- data/lib/blogaze/controller/posts.rb +43 -0
- data/lib/blogaze/controller/sessions.rb +39 -0
- data/lib/blogaze/controller/users.rb +39 -0
- data/lib/blogaze/db/migration/001_start.rb +40 -0
- data/lib/blogaze/db/migration/002_pages.rb +16 -0
- data/lib/blogaze/db/migration/003_pages_on_menu.rb +13 -0
- data/lib/blogaze/db/migration/004_comments.rb +17 -0
- data/lib/blogaze/db/migration/005_tags.rb +20 -0
- data/lib/blogaze/model/comment.rb +26 -0
- data/lib/blogaze/model/group.rb +13 -0
- data/lib/blogaze/model/init.rb +17 -0
- data/lib/blogaze/model/page.rb +27 -0
- data/lib/blogaze/model/post.rb +79 -0
- data/lib/blogaze/model/tag.rb +19 -0
- data/lib/blogaze/model/tags_relationship.rb +13 -0
- data/lib/blogaze/model/user.rb +41 -0
- data/lib/blogaze/routes.rb +26 -0
- data/lib/blogaze/tasks/db.rake +43 -0
- data/lib/blogaze/tasks.rb +1 -0
- data/lib/blogaze/theme.rb +46 -0
- data/lib/blogaze/version.rb +11 -0
- data/lib/blogaze.rb +46 -0
- data/proto/Rakefile +6 -0
- data/proto/app.rb +15 -0
- data/proto/config/config.default.rb +11 -0
- data/proto/config/database.default.rb +21 -0
- data/proto/config.ru +4 -0
- data/proto/public/css/ie.css +36 -0
- data/proto/public/css/master.less +188 -0
- data/proto/public/css/print.css +29 -0
- data/proto/public/css/screen.css +265 -0
- data/proto/public/js/jquery.js +18 -0
- data/proto/public/js/less.js +16 -0
- data/proto/start.rb +9 -0
- data/proto/themes/default/admin/comments/index.xhtml +23 -0
- data/proto/themes/default/admin/index.xhtml +12 -0
- data/proto/themes/default/admin/pages/edit.xhtml +30 -0
- data/proto/themes/default/admin/pages/index.xhtml +22 -0
- data/proto/themes/default/admin/pages/new.xhtml +26 -0
- data/proto/themes/default/admin/posts/edit.xhtml +22 -0
- data/proto/themes/default/admin/posts/index.xhtml +22 -0
- data/proto/themes/default/admin/posts/new.xhtml +22 -0
- data/proto/themes/default/admin/settings/index.xhtml +31 -0
- data/proto/themes/default/index.xhtml +35 -0
- data/proto/themes/default/layouts/admin.xhtml +44 -0
- data/proto/themes/default/layouts/default.xhtml +51 -0
- data/proto/themes/default/pages/notfound.xhtml +6 -0
- data/proto/themes/default/pages/page.xhtml +6 -0
- data/proto/themes/default/posts/view.xhtml +53 -0
- data/proto/themes/default/sessions/new.xhtml +25 -0
- data/proto/themes/default/users/new.xhtml +22 -0
- data/proto/themes/default.rb +4 -0
- metadata +180 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
<?r @posts.each do |post| ?>
|
2
|
+
<article class="post">
|
3
|
+
<header>
|
4
|
+
<h2 class="title">#{a post.title, '/' + Time.at(post.created_at).year.to_s + '/' + Time.at(post.created_at).month.to_s + '/' + post.slug}</h2>
|
5
|
+
</header>
|
6
|
+
<div class="post-body">
|
7
|
+
<?r if post.body == post.body_partial ?>
|
8
|
+
#{maruku post.body}
|
9
|
+
<?r else ?>
|
10
|
+
#{maruku post.body_partial}
|
11
|
+
#{a 'Continue reading...', post.href}
|
12
|
+
<?r end ?>
|
13
|
+
</div>
|
14
|
+
<footer class="meta">
|
15
|
+
<?r if post.tags.count > 0 ?>
|
16
|
+
<div class="tags">
|
17
|
+
<?r post.tags.each do |tag| ?>
|
18
|
+
#{a tag.name, tag.href}
|
19
|
+
<?r end ?>
|
20
|
+
</div>
|
21
|
+
<?r end ?>
|
22
|
+
By #{post.user.username}, <abbr title="#{Time.at(post.published_at)}">#{post.published_at.ago_in_words}</abbr>, <a href="#{post.href}#comments">#{post.comment.count} comments</a>
|
23
|
+
</footer>
|
24
|
+
</article>
|
25
|
+
<?r end ?>
|
26
|
+
<?r if @posts.page_count > 1 ?>
|
27
|
+
<div class="pager_nav">
|
28
|
+
<?r if @posts.prev_page ?>
|
29
|
+
<a href="/page/#{@posts.prev_page}" class="prev">< Previous</a>
|
30
|
+
<?r end ?>
|
31
|
+
<?r if @posts.next_page ?>
|
32
|
+
<a href="/page/#{@posts.next_page}" class="next">Next > </a>
|
33
|
+
<?r end ?>
|
34
|
+
</div>
|
35
|
+
<?r end ?>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>#{@title}</title>
|
5
|
+
<link href="#{Ramaze.options.prefix}css/master.less" rel="stylesheet/less" type="text/css">
|
6
|
+
<link href="/css/print.css" media="print" rel="stylesheet" type="text/css" />
|
7
|
+
<!--[if lt IE 8]>
|
8
|
+
#{css 'ie'}
|
9
|
+
<![endif]-->
|
10
|
+
#{js 'jquery'}
|
11
|
+
#{js 'less'}
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
<div id="wrapper">
|
15
|
+
<header id="header">
|
16
|
+
<h1>#{a 'AdminCP', Blogaze::Admin::Dashboard.r('/')}</h1>
|
17
|
+
<nav>
|
18
|
+
<ul>
|
19
|
+
<li>#{a 'View Site', Blogaze::MainController.r('/')}</li>
|
20
|
+
<li><a href="/logout">Logout</a></li>
|
21
|
+
</ul>
|
22
|
+
</nav>
|
23
|
+
</header>
|
24
|
+
<?r if flash[:error] ?>
|
25
|
+
<div class="message error">
|
26
|
+
#{flash[:error]}
|
27
|
+
</div>
|
28
|
+
<?r end ?>
|
29
|
+
<?r if flash[:success] ?>
|
30
|
+
<div class="message success">
|
31
|
+
#{flash[:success]}
|
32
|
+
</div>
|
33
|
+
<?r end ?>
|
34
|
+
<div id="page_wrapper">
|
35
|
+
<div id="page">
|
36
|
+
#@content
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
<footer id="footer">
|
40
|
+
Powered by <a href="http://blogaze.org">Blogaze</a>
|
41
|
+
</footer>
|
42
|
+
</div>
|
43
|
+
</body>
|
44
|
+
</html>
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>#{@title}</title>
|
5
|
+
<link href="#{Ramaze.options.prefix}css/master.less" rel="stylesheet/less" type="text/css">
|
6
|
+
<link href="/css/print.css" media="print" rel="stylesheet" type="text/css" />
|
7
|
+
<!--[if lt IE 8]>
|
8
|
+
#{css 'ie'}
|
9
|
+
<![endif]-->
|
10
|
+
#{js 'jquery'}
|
11
|
+
#{js 'less'}
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
<div id="wrapper">
|
15
|
+
<header id="header">
|
16
|
+
<h1><a href="/">#{@settings[:title]}</a></h1>
|
17
|
+
<nav>
|
18
|
+
<ul>
|
19
|
+
<?r ::Blogaze::Page.filter(:on_menu => 1).all.each do |page| ?>
|
20
|
+
<li><a href="/#{page.slug}">#{page.title}</a></li>
|
21
|
+
<?r end ?>
|
22
|
+
<?r if session[:logged_in] ?>
|
23
|
+
<?r if @userinfo.group.is_admin ?>
|
24
|
+
<li><a href="/admin">Admin</a></li>
|
25
|
+
<?r end ?>
|
26
|
+
<li><a href="/logout">Logout</a></li>
|
27
|
+
<?r end ?>
|
28
|
+
</ul>
|
29
|
+
</nav>
|
30
|
+
</header>
|
31
|
+
<?r if flash[:error] ?>
|
32
|
+
<div class="message error">
|
33
|
+
#{flash[:error]}
|
34
|
+
</div>
|
35
|
+
<?r end ?>
|
36
|
+
<?r if flash[:success] ?>
|
37
|
+
<div class="message success">
|
38
|
+
#{flash[:success]}
|
39
|
+
</div>
|
40
|
+
<?r end ?>
|
41
|
+
<div id="page_wrapper">
|
42
|
+
<div id="page">
|
43
|
+
#@content
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
<footer id="footer">
|
47
|
+
Powered by <a href="http://blogaze.org">Blogaze</a>
|
48
|
+
</footer>
|
49
|
+
</div>
|
50
|
+
</body>
|
51
|
+
</html>
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<article class="post">
|
2
|
+
<header>
|
3
|
+
<h2 class="title">#{@post.title}</h2>
|
4
|
+
</header>
|
5
|
+
<div class="post-body">
|
6
|
+
#{maruku @post.body}
|
7
|
+
</div>
|
8
|
+
<footer class="meta">
|
9
|
+
<?r if @post.tags.count > 0 ?>
|
10
|
+
<div class="tags">
|
11
|
+
<?r @post.tags.each do |tag| ?>
|
12
|
+
#{a tag.name, tag.href}
|
13
|
+
<?r end ?>
|
14
|
+
</div>
|
15
|
+
<?r end ?>
|
16
|
+
By #{@post.user.username}, <abbr title="#{Time.at(@post.published_at)}">#{@post.published_at.ago_in_words}</abbr>, #{@post.comment.count} comments
|
17
|
+
</footer>
|
18
|
+
</article>
|
19
|
+
|
20
|
+
<section id="comments">
|
21
|
+
<h3><a name="comments" class="no-href">Comments</a></h3>
|
22
|
+
<?r @post.comment.each do |comment| ?>
|
23
|
+
<div class="comment">
|
24
|
+
<h4>#{comment.author}, #{comment.created_at.ago_in_words}</h4>
|
25
|
+
<div class="content">
|
26
|
+
#{maruku CGI::escapeHTML(comment.body)}
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
<?r end ?>
|
30
|
+
</section>
|
31
|
+
|
32
|
+
<section id="new_comment">
|
33
|
+
<h3>New Comment</h3>
|
34
|
+
<div class="content">
|
35
|
+
<?r if @comment.errors.count > 0 ?>
|
36
|
+
<div class="message error">
|
37
|
+
<?r @comment.errors.each do |k, v| ?>
|
38
|
+
#{k} #{v.first}<br />
|
39
|
+
<?r end ?>
|
40
|
+
</div>
|
41
|
+
<?r end ?>
|
42
|
+
<div class="new-comment-form tabular">
|
43
|
+
#{
|
44
|
+
form_for(@comment, :method => :post, :action => @post.href) do |f|
|
45
|
+
f.hidden :new_comment, 1
|
46
|
+
f.input_text 'Name', :author
|
47
|
+
f.textarea 'Message', :body
|
48
|
+
f.submit 'Post'
|
49
|
+
end
|
50
|
+
}
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
</section>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<div id="page_content">
|
2
|
+
<h2 id="page-title">Login</h2>
|
3
|
+
<div class="content">
|
4
|
+
<?r if @login_error ?>
|
5
|
+
<div class="message error">
|
6
|
+
Invalid username and/or password.
|
7
|
+
</div>
|
8
|
+
<?r end ?>
|
9
|
+
<div class="login-form tabular">
|
10
|
+
<form action="#{Ramaze.options.prefix}sessions/create" method="post">
|
11
|
+
<p>
|
12
|
+
<label for="username">Username</label>
|
13
|
+
<input type="text" name="username" id="username" />
|
14
|
+
</p>
|
15
|
+
<p>
|
16
|
+
<label for="password">Password</label>
|
17
|
+
<input type="password" name="password" id="password" />
|
18
|
+
</p>
|
19
|
+
<p>
|
20
|
+
<input type="submit" value="Login" class="submit-btn" />
|
21
|
+
</p>
|
22
|
+
</form>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div id="page_content">
|
2
|
+
<h2 id="page-title">Register</h2>
|
3
|
+
<div class="content">
|
4
|
+
<?r if @user.errors.count > 0 ?>
|
5
|
+
<div class="message error">
|
6
|
+
<?r @user.errors.each do |k, v| ?>
|
7
|
+
#{k} #{v.first}<br />
|
8
|
+
<?r end ?>
|
9
|
+
</div>
|
10
|
+
<?r end ?>
|
11
|
+
<div class="register-form tabular">
|
12
|
+
#{
|
13
|
+
form_for(@user, :method => :post, :action => '/users/create') do |f|
|
14
|
+
f.input_text 'Username', :username
|
15
|
+
f.input_password 'Password', :password
|
16
|
+
f.input_text 'Email', :email
|
17
|
+
f.submit "Create Account", :class => "submit-btn"
|
18
|
+
end
|
19
|
+
}
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</div>
|
metadata
ADDED
@@ -0,0 +1,180 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: blogaze
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jack Polgar
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-01-25 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: ramaze
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2012.12.08
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2012.12.08
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: sequel
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 3.43.0
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 3.43.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: maruku
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.6.1
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.6.1
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: time-lord
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 0.2.5
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.2.5
|
78
|
+
description: Blogaze is a simple blog powered by Ramaze and Sequel.
|
79
|
+
email:
|
80
|
+
- nrx@nirix.net
|
81
|
+
executables:
|
82
|
+
- blogaze
|
83
|
+
extensions: []
|
84
|
+
extra_rdoc_files: []
|
85
|
+
files:
|
86
|
+
- .gitignore
|
87
|
+
- Gemfile
|
88
|
+
- LICENSE
|
89
|
+
- README.md
|
90
|
+
- Rakefile
|
91
|
+
- bin/blogaze
|
92
|
+
- blogaze.gemspec
|
93
|
+
- lib/blogaze.rb
|
94
|
+
- lib/blogaze/bin/create.rb
|
95
|
+
- lib/blogaze/bin/default.rb
|
96
|
+
- lib/blogaze/controller/admin/comments.rb
|
97
|
+
- lib/blogaze/controller/admin/init.rb
|
98
|
+
- lib/blogaze/controller/admin/main.rb
|
99
|
+
- lib/blogaze/controller/admin/pages.rb
|
100
|
+
- lib/blogaze/controller/admin/posts.rb
|
101
|
+
- lib/blogaze/controller/admin/settings.rb
|
102
|
+
- lib/blogaze/controller/init.rb
|
103
|
+
- lib/blogaze/controller/main.rb
|
104
|
+
- lib/blogaze/controller/pages.rb
|
105
|
+
- lib/blogaze/controller/posts.rb
|
106
|
+
- lib/blogaze/controller/sessions.rb
|
107
|
+
- lib/blogaze/controller/users.rb
|
108
|
+
- lib/blogaze/db/migration/001_start.rb
|
109
|
+
- lib/blogaze/db/migration/002_pages.rb
|
110
|
+
- lib/blogaze/db/migration/003_pages_on_menu.rb
|
111
|
+
- lib/blogaze/db/migration/004_comments.rb
|
112
|
+
- lib/blogaze/db/migration/005_tags.rb
|
113
|
+
- lib/blogaze/model/comment.rb
|
114
|
+
- lib/blogaze/model/group.rb
|
115
|
+
- lib/blogaze/model/init.rb
|
116
|
+
- lib/blogaze/model/page.rb
|
117
|
+
- lib/blogaze/model/post.rb
|
118
|
+
- lib/blogaze/model/tag.rb
|
119
|
+
- lib/blogaze/model/tags_relationship.rb
|
120
|
+
- lib/blogaze/model/user.rb
|
121
|
+
- lib/blogaze/routes.rb
|
122
|
+
- lib/blogaze/tasks.rb
|
123
|
+
- lib/blogaze/tasks/db.rake
|
124
|
+
- lib/blogaze/theme.rb
|
125
|
+
- lib/blogaze/version.rb
|
126
|
+
- proto/Rakefile
|
127
|
+
- proto/app.rb
|
128
|
+
- proto/config.ru
|
129
|
+
- proto/config/config.default.rb
|
130
|
+
- proto/config/database.default.rb
|
131
|
+
- proto/public/css/ie.css
|
132
|
+
- proto/public/css/master.less
|
133
|
+
- proto/public/css/print.css
|
134
|
+
- proto/public/css/screen.css
|
135
|
+
- proto/public/js/jquery.js
|
136
|
+
- proto/public/js/less.js
|
137
|
+
- proto/start.rb
|
138
|
+
- proto/themes/default.rb
|
139
|
+
- proto/themes/default/admin/comments/index.xhtml
|
140
|
+
- proto/themes/default/admin/index.xhtml
|
141
|
+
- proto/themes/default/admin/pages/edit.xhtml
|
142
|
+
- proto/themes/default/admin/pages/index.xhtml
|
143
|
+
- proto/themes/default/admin/pages/new.xhtml
|
144
|
+
- proto/themes/default/admin/posts/edit.xhtml
|
145
|
+
- proto/themes/default/admin/posts/index.xhtml
|
146
|
+
- proto/themes/default/admin/posts/new.xhtml
|
147
|
+
- proto/themes/default/admin/settings/index.xhtml
|
148
|
+
- proto/themes/default/index.xhtml
|
149
|
+
- proto/themes/default/layouts/admin.xhtml
|
150
|
+
- proto/themes/default/layouts/default.xhtml
|
151
|
+
- proto/themes/default/pages/notfound.xhtml
|
152
|
+
- proto/themes/default/pages/page.xhtml
|
153
|
+
- proto/themes/default/posts/view.xhtml
|
154
|
+
- proto/themes/default/sessions/new.xhtml
|
155
|
+
- proto/themes/default/users/new.xhtml
|
156
|
+
homepage: http://blogaze.org
|
157
|
+
licenses: []
|
158
|
+
post_install_message:
|
159
|
+
rdoc_options: []
|
160
|
+
require_paths:
|
161
|
+
- lib
|
162
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
163
|
+
none: false
|
164
|
+
requirements:
|
165
|
+
- - ! '>='
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
168
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ! '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
requirements: []
|
175
|
+
rubyforge_project:
|
176
|
+
rubygems_version: 1.8.24
|
177
|
+
signing_key:
|
178
|
+
specification_version: 3
|
179
|
+
summary: Blogaze is a simple blog.
|
180
|
+
test_files: []
|