zen 0.2.4.1 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/MANIFEST +42 -33
- data/README.md +14 -27
- data/ROADMAP.md +20 -2
- data/{Thorfile → Rakefile} +2 -3
- data/bin/zen +27 -5
- data/lib/zen.rb +70 -52
- data/lib/zen/asset.rb +258 -0
- data/lib/zen/bin/app.rb +42 -0
- data/lib/zen/controller/admin_controller.rb +53 -36
- data/lib/zen/controller/base_controller.rb +13 -8
- data/lib/zen/controller/frontend_controller.rb +4 -3
- data/lib/zen/controller/main_controller.rb +17 -33
- data/lib/zen/error/validation_error.rb +10 -0
- data/lib/zen/ext/string.rb +185 -0
- data/lib/zen/helper/acl.rb +120 -92
- data/lib/zen/helper/common.rb +1 -3
- data/lib/zen/helper/theme.rb +73 -0
- data/lib/zen/language.rb +66 -57
- data/lib/zen/layout/admin.xhtml +5 -48
- data/lib/zen/layout/login.xhtml +4 -44
- data/lib/zen/model/methods.rb +1 -1
- data/lib/zen/model/settings.rb +0 -3
- data/lib/zen/package.rb +101 -83
- data/lib/zen/package/base.rb +62 -0
- data/lib/zen/package/categories/lib/categories.rb +29 -10
- data/lib/zen/package/categories/lib/categories/controller/categories.rb +4 -5
- data/lib/zen/package/categories/lib/categories/controller/category_groups.rb +4 -5
- data/lib/zen/package/categories/lib/categories/language/en/category_groups.yml +4 -3
- data/lib/zen/package/categories/lib/categories/model/category.rb +2 -2
- data/lib/zen/package/categories/lib/categories/model/category_group.rb +3 -3
- data/lib/zen/package/categories/lib/categories/plugin/categories.rb +130 -0
- data/lib/zen/package/categories/lib/categories/view/admin/categories/form.xhtml +1 -1
- data/lib/zen/package/categories/lib/categories/view/admin/categories/index.xhtml +2 -2
- data/lib/zen/package/categories/lib/categories/view/admin/category-groups/index.xhtml +11 -6
- data/lib/zen/package/comments/lib/comments.rb +23 -13
- data/lib/zen/package/comments/lib/comments/controller/comments.rb +4 -5
- data/lib/zen/package/comments/lib/comments/controller/comments_form.rb +7 -8
- data/lib/zen/package/comments/lib/comments/model/comment.rb +4 -4
- data/lib/zen/package/comments/lib/comments/plugin/comments.rb +111 -0
- data/lib/zen/package/comments/lib/comments/view/admin/comments/form.xhtml +2 -2
- data/lib/zen/package/comments/lib/comments/view/admin/comments/index.xhtml +3 -3
- data/lib/zen/package/custom_fields/lib/custom_fields.rb +18 -11
- data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_field_groups.rb +4 -5
- data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_fields.rb +4 -5
- data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field.rb +2 -2
- data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_group.rb +3 -3
- data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_value.rb +3 -3
- data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-field-groups/index.xhtml +9 -5
- data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-fields/form.xhtml +1 -1
- data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-fields/index.xhtml +3 -3
- data/lib/zen/package/menus/lib/menus.rb +25 -43
- data/lib/zen/package/menus/lib/menus/controller/menu_items.rb +5 -6
- data/lib/zen/package/menus/lib/menus/controller/menus.rb +9 -5
- data/lib/zen/package/menus/lib/menus/helper/menu_item.rb +4 -4
- data/lib/zen/package/menus/lib/menus/model/menu.rb +2 -2
- data/lib/zen/package/menus/lib/menus/model/menu_item.rb +4 -1
- data/lib/zen/package/menus/lib/menus/plugin/menus.rb +152 -0
- data/lib/zen/package/menus/lib/menus/view/admin/menu-items/form.xhtml +1 -1
- data/lib/zen/package/menus/lib/menus/view/admin/menu-items/index.xhtml +3 -3
- data/lib/zen/package/menus/lib/menus/view/admin/menus/index.xhtml +7 -7
- data/lib/zen/package/sections/lib/sections.rb +32 -16
- data/lib/zen/package/sections/lib/sections/controller/section_entries.rb +9 -18
- data/lib/zen/package/sections/lib/sections/controller/sections.rb +8 -9
- data/lib/zen/package/sections/lib/sections/language/en/section_entries.yml +1 -1
- data/lib/zen/package/sections/lib/sections/model/section.rb +4 -4
- data/lib/zen/package/sections/lib/sections/model/section_entry.rb +9 -10
- data/lib/zen/package/sections/lib/sections/plugin/section_entries.rb +224 -0
- data/lib/zen/package/sections/lib/sections/plugin/sections.rb +85 -0
- data/lib/zen/package/sections/lib/sections/view/admin/form.xhtml +1 -1
- data/lib/zen/package/sections/lib/sections/view/admin/index.xhtml +9 -5
- data/lib/zen/package/sections/lib/sections/view/admin/section-entries/index.xhtml +2 -2
- data/lib/zen/package/settings/lib/settings.rb +145 -10
- data/lib/zen/package/settings/lib/settings/controller/settings.rb +28 -24
- data/lib/zen/package/settings/lib/settings/language/en/settings.yml +10 -0
- data/lib/zen/package/settings/lib/settings/model/setting.rb +3 -64
- data/lib/zen/package/settings/lib/settings/plugin/group_base.rb +40 -0
- data/lib/zen/package/settings/lib/settings/plugin/setting_base.rb +76 -0
- data/lib/zen/package/settings/lib/settings/plugin/settings.rb +236 -0
- data/lib/zen/package/settings/lib/settings/view/admin/settings/index.xhtml +20 -49
- data/lib/zen/package/settings/migrations/1295597111_create_schema.rb +0 -12
- data/lib/zen/package/settings/migrations/1303196915_settings_plugin.rb +31 -0
- data/lib/zen/package/users/lib/users.rb +18 -15
- data/lib/zen/package/users/lib/users/controller/access_rules.rb +44 -8
- data/lib/zen/package/users/lib/users/controller/user_groups.rb +4 -5
- data/lib/zen/package/users/lib/users/controller/users.rb +5 -6
- data/lib/zen/package/users/lib/users/language/en/access_rules.yml +11 -9
- data/lib/zen/package/users/lib/users/model/access_rule.rb +7 -6
- data/lib/zen/package/users/lib/users/model/user.rb +4 -4
- data/lib/zen/package/users/lib/users/model/user_group.rb +3 -3
- data/lib/zen/package/users/lib/users/public/admin/js/users/access_rules.js +50 -0
- data/lib/zen/package/users/lib/users/view/admin/access-rules/form.xhtml +32 -29
- data/lib/zen/package/users/lib/users/view/admin/access-rules/index.xhtml +8 -6
- data/lib/zen/package/users/lib/users/view/admin/user-groups/index.xhtml +3 -3
- data/lib/zen/package/users/lib/users/view/admin/users/index.xhtml +2 -2
- data/lib/zen/package/users/migrations/1303510943_class_rules.rb +13 -0
- data/lib/zen/plugin.rb +110 -104
- data/lib/zen/plugin/base.rb +46 -0
- data/lib/zen/{liquid/controller_behavior.rb → plugin/controller.rb} +9 -7
- data/lib/zen/plugin/helper.rb +47 -0
- data/lib/zen/plugin/markup/lib/markup.rb +14 -0
- data/lib/zen/plugin/markup/lib/markup/language/en/markup.yml +6 -0
- data/lib/zen/plugin/markup/lib/markup/markup.rb +154 -0
- data/lib/zen/public/admin/css/forms.css +4 -0
- data/lib/zen/public/admin/css/general.css +15 -15
- data/lib/zen/public/admin/css/layout.css +10 -10
- data/lib/zen/public/admin/css/reset.css +123 -0
- data/lib/zen/public/admin/images/icons/accept.png +0 -0
- data/lib/zen/public/admin/images/icons/add.png +0 -0
- data/lib/zen/public/admin/images/icons/back.png +0 -0
- data/lib/zen/public/admin/images/icons/bold.png +0 -0
- data/lib/zen/public/admin/images/icons/close.png +0 -0
- data/lib/zen/public/admin/images/icons/delete.png +0 -0
- data/lib/zen/public/admin/images/icons/edit.png +0 -0
- data/lib/zen/public/admin/images/icons/error.png +0 -0
- data/lib/zen/public/admin/images/icons/help.png +0 -0
- data/lib/zen/public/admin/images/icons/info.png +0 -0
- data/lib/zen/public/admin/images/icons/italic.png +0 -0
- data/lib/zen/public/admin/images/icons/large/error.png +0 -0
- data/lib/zen/public/admin/images/icons/large/notice.png +0 -0
- data/lib/zen/public/admin/images/icons/large/success.png +0 -0
- data/lib/zen/public/admin/images/icons/link.png +0 -0
- data/lib/zen/public/admin/images/icons/logout.png +0 -0
- data/lib/zen/public/admin/images/icons/ol.png +0 -0
- data/lib/zen/public/admin/images/icons/pdf.png +0 -0
- data/lib/zen/public/admin/images/icons/ul.png +0 -0
- data/lib/zen/public/admin/images/icons/user.png +0 -0
- data/lib/zen/public/admin/images/icons/view.png +0 -0
- data/lib/zen/public/admin/js/mootools/core.js +384 -333
- data/lib/zen/public/admin/js/mootools/more.js +256 -231
- data/lib/zen/public/admin/js/vendor/{datepicker/Picker.Date.js → datepicker.js} +447 -0
- data/lib/zen/public/admin/js/vendor/yepnope.js +1 -0
- data/lib/zen/public/admin/js/zen/editor/base.js +8 -1
- data/lib/zen/public/admin/js/zen/init.js +89 -26
- data/lib/zen/public/favicon.ico +0 -0
- data/lib/zen/task.rb +7 -0
- data/lib/zen/task/build.rake +60 -0
- data/lib/zen/task/clean.rake +27 -0
- data/lib/zen/task/db.rake +111 -0
- data/lib/zen/task/package.rake +67 -0
- data/lib/zen/task/plugin.rake +24 -0
- data/lib/zen/task/proto.rake +95 -0
- data/lib/zen/task/theme.rake +68 -0
- data/lib/zen/theme.rb +28 -55
- data/lib/zen/theme/base.rb +64 -0
- data/lib/zen/validation.rb +149 -0
- data/lib/zen/version.rb +1 -1
- data/lib/zen/view/bottom.xhtml +6 -0
- data/lib/zen/view/main.xhtml +32 -0
- data/proto/app/Rakefile +12 -0
- data/proto/app/app.rb +6 -6
- data/proto/app/config/config.rb +7 -14
- data/proto/app/config/database.rb +0 -20
- data/proto/app/start.rb +0 -1
- data/proto/app/{vendor/themes → task}/.gitkeep +0 -0
- data/proto/app/vendor/theme/.gitkeep +0 -0
- data/proto/package/lib/package.rb +8 -17
- data/proto/package/lib/package/controller/controllers.rb +4 -4
- data/proto/package/lib/package/language/en/languages.yml +3 -3
- data/proto/package/lib/package/model/model.rb +1 -1
- metadata +73 -73
- data/lib/zen/bin/base.rb +0 -109
- data/lib/zen/helper/asset.rb +0 -106
- data/lib/zen/liquid/general.rb +0 -94
- data/lib/zen/liquid/redirect.rb +0 -70
- data/lib/zen/liquid/strip.rb +0 -60
- data/lib/zen/package/categories/lib/categories/liquid/categories.rb +0 -16
- data/lib/zen/package/comments/lib/comments/liquid/comment_form.rb +0 -127
- data/lib/zen/package/comments/lib/comments/liquid/comments.rb +0 -115
- data/lib/zen/package/menus/lib/menus/liquid/menus.rb +0 -152
- data/lib/zen/package/sections/lib/sections/liquid/section_entries.rb +0 -228
- data/lib/zen/package/sections/lib/sections/liquid/sections.rb +0 -77
- data/lib/zen/package/settings/lib/settings/liquid/setting.rb +0 -58
- data/lib/zen/package/users/lib/users/liquid/user.rb +0 -77
- data/lib/zen/package/users/lib/users/liquid/users.rb +0 -82
- data/lib/zen/plugin/markup.rb +0 -30
- data/lib/zen/public/admin/css/boilerplate.css +0 -176
- data/lib/zen/public/admin/images/general/noise.jpg +0 -0
- data/lib/zen/public/admin/js/vendor/datepicker/Picker.Attach.js +0 -137
- data/lib/zen/public/admin/js/vendor/datepicker/Picker.js +0 -291
- data/lib/zen/public/admin/js/vendor/datepicker/README.md +0 -325
- data/lib/zen/public/admin/js/vendor/datepicker/locale.js +0 -16
- data/lib/zen/strict_struct.rb +0 -36
- data/lib/zen/task/build.rb +0 -123
- data/lib/zen/task/clean.rb +0 -46
- data/lib/zen/task/db.rb +0 -130
- data/lib/zen/task/package.rb +0 -87
- data/lib/zen/task/proto.rb +0 -116
- data/lib/zen/task/theme.rb +0 -88
- data/proto/app/Thorfile +0 -4
@@ -1,77 +0,0 @@
|
|
1
|
-
#:nodoc:
|
2
|
-
module Sections
|
3
|
-
#:nodoc:
|
4
|
-
module Liquid
|
5
|
-
##
|
6
|
-
# Tag that can be used to retrieve a number of sections. By default
|
7
|
-
# all sections will be retrieved but you can specify a specific section
|
8
|
-
# by setting the "section" key.
|
9
|
-
#
|
10
|
-
# @example Basic usage
|
11
|
-
# {% sections section="pages" %}
|
12
|
-
# {{description}}
|
13
|
-
# {% endsections %}
|
14
|
-
#
|
15
|
-
# The following arguments can be specified:
|
16
|
-
#
|
17
|
-
# * section
|
18
|
-
# * limit
|
19
|
-
# * offset
|
20
|
-
#
|
21
|
-
# @author Yorick Peterse
|
22
|
-
# @since 0.1
|
23
|
-
#
|
24
|
-
class Sections < ::Liquid::Block
|
25
|
-
include ::Zen::Liquid::General
|
26
|
-
|
27
|
-
##
|
28
|
-
# Creates a new instance of the block and passes the tag name,
|
29
|
-
# all additional arguments and the HTML to the constructor method.
|
30
|
-
#
|
31
|
-
# @author Yorick Peterse
|
32
|
-
# @param [String] tag_name The name of the tag that was called.
|
33
|
-
# @param [String] arguments All additional arguments passed as a string.
|
34
|
-
# @param [String] html The HTML inside the block.
|
35
|
-
# @since 0.1
|
36
|
-
#
|
37
|
-
def initialize(tag_name = 'sections', arguments = '', html = '')
|
38
|
-
super
|
39
|
-
|
40
|
-
@arguments = {
|
41
|
-
'limit' => nil,
|
42
|
-
'offset' => nil
|
43
|
-
}.merge(parse_key_values(arguments))
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
##
|
48
|
-
# Renders the tag.
|
49
|
-
#
|
50
|
-
# @author Yorick Peterse
|
51
|
-
# @param [Object] context The Liquid context for the current tag.
|
52
|
-
# @return [Array]
|
53
|
-
#
|
54
|
-
def render(context)
|
55
|
-
result = []
|
56
|
-
|
57
|
-
if !@arguments.key?('section')
|
58
|
-
sections = ::Sections::Models::Section.limit(@arguments['limit'], @arguments['offset'])
|
59
|
-
else
|
60
|
-
sections = ::Sections::Models::Section.filter(:slug => @arguments['section'])
|
61
|
-
.limit(@arguments['limit'], @arguments['offset'])
|
62
|
-
end
|
63
|
-
|
64
|
-
sections.each do |s|
|
65
|
-
s.values.each do |k, v|
|
66
|
-
context[k.to_s] =v
|
67
|
-
end
|
68
|
-
|
69
|
-
result.push(render_all(@nodelist, context))
|
70
|
-
end
|
71
|
-
|
72
|
-
result.push(render_all(@nodelist, context)) if result.empty?
|
73
|
-
return result
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
#:nodoc:
|
2
|
-
module Settings
|
3
|
-
#:nodoc:
|
4
|
-
module Liquid
|
5
|
-
##
|
6
|
-
# Tag that can be used to retrieve the values of the given setting.
|
7
|
-
# Using this tag couldn't be easier:
|
8
|
-
#
|
9
|
-
# {% settings "website_name" %}
|
10
|
-
#
|
11
|
-
# It's not required to specify quotes as setting keys don't contain
|
12
|
-
# spaces but it's generally considered a good practice to do so anyway.
|
13
|
-
#
|
14
|
-
# @author Yorick Peterse
|
15
|
-
# @since 0.1
|
16
|
-
#
|
17
|
-
class Setting < ::Liquid::Tag
|
18
|
-
include ::Zen::Liquid::General
|
19
|
-
|
20
|
-
##
|
21
|
-
# Constructor method is called when a new instance of this tag
|
22
|
-
# is created. The variable "key" is the key name of the setting
|
23
|
-
# who's value should be retrieved. This argument is always required.
|
24
|
-
#
|
25
|
-
# @author Yorick Peterse
|
26
|
-
# @param [String] tag_name The name of the tag that was called.
|
27
|
-
# @param [String] arguments All additional arguments passed as a string.
|
28
|
-
# @param [String] html The HTML inside the block.
|
29
|
-
# @since 0.1
|
30
|
-
#
|
31
|
-
def initialize(tag_name = 'setting', key = '', markup = '')
|
32
|
-
super
|
33
|
-
|
34
|
-
@key = key.gsub('"', '').gsub("'", '')
|
35
|
-
end
|
36
|
-
|
37
|
-
##
|
38
|
-
# Renders the tag.
|
39
|
-
#
|
40
|
-
# @author Yorick Peterse
|
41
|
-
# @since 0.1
|
42
|
-
#
|
43
|
-
def render(context)
|
44
|
-
setting = ::Settings::Models::Setting[:key => @key]
|
45
|
-
|
46
|
-
if !setting.nil?
|
47
|
-
if setting.value.nil? or setting.value.empty?
|
48
|
-
@setting_value = setting.default
|
49
|
-
else
|
50
|
-
@setting_value = setting.value
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
return @setting_value.to_s
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
@@ -1,77 +0,0 @@
|
|
1
|
-
#:nodoc:
|
2
|
-
module Users
|
3
|
-
#:nodoc:
|
4
|
-
module Liquid
|
5
|
-
##
|
6
|
-
# Tag that can be used to retrieve details about a single user. When using this
|
7
|
-
# tag you can use the database table's column names as the keys, multiple keys
|
8
|
-
# will result in multiple WHERE/AND clauses. In order to retrieve a user with
|
9
|
-
# the Email address "me@awesome.com" you'd do the following:
|
10
|
-
#
|
11
|
-
# {% user email="me@awesome.com" %}
|
12
|
-
# {{name}}
|
13
|
-
# {% enduser %}
|
14
|
-
#
|
15
|
-
# If you want to add an extra condition simply do the following:
|
16
|
-
#
|
17
|
-
# {% user email="me@awesome.com" status="open" %}
|
18
|
-
# {{name}}
|
19
|
-
# {% enduser %}
|
20
|
-
#
|
21
|
-
# Note that this class is a Liquid block, not a tag. This means that you'll have to
|
22
|
-
# specify the closing tag. The reason for this is that there are multiple columns
|
23
|
-
# for the user table and using a tag in combination of a variable would result in
|
24
|
-
# more code.
|
25
|
-
#
|
26
|
-
# @author Yorick Peterse
|
27
|
-
# @since 0.1
|
28
|
-
#
|
29
|
-
class User < ::Liquid::Block
|
30
|
-
include ::Zen::Liquid::General
|
31
|
-
|
32
|
-
##
|
33
|
-
# Initializes the class, parses the tag and retrieves the user for the specified tag.
|
34
|
-
#
|
35
|
-
# @author Yorick Peterse
|
36
|
-
# @param [String] tag_name The name of the tag that was called.
|
37
|
-
# @param [String] arguments All additional arguments passed as a string.
|
38
|
-
# @param [String] html The HTML inside the block.
|
39
|
-
# @since 0.1
|
40
|
-
#
|
41
|
-
def initialize tag_name, arguments, markup
|
42
|
-
super
|
43
|
-
|
44
|
-
@arguments = {}
|
45
|
-
arguments = parse_key_values(arguments)
|
46
|
-
|
47
|
-
arguments.each do |k, v|
|
48
|
-
@arguments[k.to_sym] = v
|
49
|
-
end
|
50
|
-
|
51
|
-
@user = {}
|
52
|
-
user = ::Users::Models::User[@arguments]
|
53
|
-
|
54
|
-
if !user.nil?
|
55
|
-
user.values.each do |k, v|
|
56
|
-
@user[k.to_s] = v
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
##
|
62
|
-
# Renders the tag
|
63
|
-
#
|
64
|
-
# @author Yorick Peterse
|
65
|
-
# @param [Object] context The Liquid context for the current tag.
|
66
|
-
# @return [Array]
|
67
|
-
#
|
68
|
-
def render context
|
69
|
-
@user.each do |k, v|
|
70
|
-
context[k] = v
|
71
|
-
end
|
72
|
-
|
73
|
-
render_all(@nodelist, context)
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
@@ -1,82 +0,0 @@
|
|
1
|
-
#:nodoc:
|
2
|
-
module Users
|
3
|
-
#:nodoc:
|
4
|
-
module Liquid
|
5
|
-
##
|
6
|
-
# Block that can be used to retrieve a number of users and show their details.
|
7
|
-
# Basic usage of this tag is as following:
|
8
|
-
#
|
9
|
-
# {% users limit="10" offset="5" %}
|
10
|
-
# {{email}}
|
11
|
-
# {% endusers %}
|
12
|
-
#
|
13
|
-
# Note that this tag will retrieve a list of users, if you want to only retrieve
|
14
|
-
# a single user it's best to use the tag "zen_user" defined under Users::Liquid::User.
|
15
|
-
#
|
16
|
-
# The following keys can be set:
|
17
|
-
#
|
18
|
-
# * limit
|
19
|
-
# * offset
|
20
|
-
#
|
21
|
-
# @author Yorick Peterse
|
22
|
-
# @since 0.1
|
23
|
-
#
|
24
|
-
class Users < ::Liquid::Block
|
25
|
-
include ::Zen::Liquid::General
|
26
|
-
|
27
|
-
##
|
28
|
-
# Initializes the class, parses the tag and retrieves the users for the specified tag.
|
29
|
-
#
|
30
|
-
# @author Yorick Peterse
|
31
|
-
# @param [String] tag_name The name of the tag that was called.
|
32
|
-
# @param [String] arguments All additional arguments passed as a string.
|
33
|
-
# @param [String] html The HTML inside the block.
|
34
|
-
# @since 0.1
|
35
|
-
#
|
36
|
-
def initialize tag_name, arguments, markup
|
37
|
-
super
|
38
|
-
|
39
|
-
@arguments = {
|
40
|
-
'limit' => nil,
|
41
|
-
'offset' => nil
|
42
|
-
}
|
43
|
-
|
44
|
-
@arguments = @arguments.merge(parse_key_values(arguments))
|
45
|
-
@users = []
|
46
|
-
users = ::Users::Models::User.limit(@arguments['limit'], @arguments['offset'])
|
47
|
-
|
48
|
-
users.each do |u|
|
49
|
-
hash = {}
|
50
|
-
|
51
|
-
u.values.each do |k, v|
|
52
|
-
hash[k.to_s] = v
|
53
|
-
end
|
54
|
-
|
55
|
-
@users.push(hash)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
##
|
60
|
-
# Renders the tag
|
61
|
-
#
|
62
|
-
# @author Yorick Peterse
|
63
|
-
# @param [Object] context The Liquid context for the current tag.
|
64
|
-
# @return [Array]
|
65
|
-
#
|
66
|
-
def render context
|
67
|
-
result = []
|
68
|
-
|
69
|
-
@users.each do |user|
|
70
|
-
user.each do |k, v|
|
71
|
-
context[k] = v
|
72
|
-
end
|
73
|
-
|
74
|
-
result << render_all(@nodelist, context)
|
75
|
-
end
|
76
|
-
|
77
|
-
result << render_all(@nodelist, context) if result.empty?
|
78
|
-
return result
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
data/lib/zen/plugin/markup.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
Zen::Plugin.add do |plugin|
|
2
|
-
plugin.name = 'Markup'
|
3
|
-
plugin.author = 'Yorick Peterse'
|
4
|
-
plugin.about = 'Plugin used for converting various markup formats to HTML.'
|
5
|
-
plugin.identifier = 'com.zen.plugin.markup'
|
6
|
-
plugin.actions = {
|
7
|
-
|
8
|
-
# Converts HTML to, well, HTML.
|
9
|
-
:html => lambda do |markup|
|
10
|
-
markup
|
11
|
-
end,
|
12
|
-
|
13
|
-
# Converts the given markup to plain text by escaping all HTML
|
14
|
-
:plain => lambda do |markup|
|
15
|
-
include Ramaze::Helper::CGI
|
16
|
-
h(markup)
|
17
|
-
end,
|
18
|
-
|
19
|
-
# Comvert Markdown documents to HTML
|
20
|
-
:markdown => lambda do |markup|
|
21
|
-
RDiscount.new(markup).to_html
|
22
|
-
end,
|
23
|
-
|
24
|
-
# Convert Textile documents to HTML
|
25
|
-
:textile => lambda do |markup|
|
26
|
-
RedCloth.new(markup).to_html
|
27
|
-
end
|
28
|
-
|
29
|
-
}
|
30
|
-
end
|
@@ -1,176 +0,0 @@
|
|
1
|
-
@charset "UTF-8";
|
2
|
-
|
3
|
-
/* HTML5 ✰ Boilerplate */
|
4
|
-
html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,
|
5
|
-
cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,
|
6
|
-
ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,
|
7
|
-
aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,
|
8
|
-
time,mark,audio,video
|
9
|
-
{
|
10
|
-
background: transparent;
|
11
|
-
border: 0;
|
12
|
-
font-size: 100%;
|
13
|
-
margin: 0;
|
14
|
-
padding: 0;
|
15
|
-
outline: 0;
|
16
|
-
vertical-align:baseline;
|
17
|
-
}
|
18
|
-
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section
|
19
|
-
{
|
20
|
-
display: block;
|
21
|
-
}
|
22
|
-
nav ul
|
23
|
-
{
|
24
|
-
list-style: none;
|
25
|
-
}
|
26
|
-
blockquote,q
|
27
|
-
{
|
28
|
-
quotes: none;
|
29
|
-
}
|
30
|
-
blockquote:before,blockquote:after,q:before,q:after
|
31
|
-
{
|
32
|
-
content: '';
|
33
|
-
content: none;
|
34
|
-
}
|
35
|
-
a
|
36
|
-
{
|
37
|
-
margin:0;
|
38
|
-
padding:0;
|
39
|
-
font-size:100%;
|
40
|
-
vertical-align:baseline;
|
41
|
-
background:transparent;
|
42
|
-
}
|
43
|
-
mark
|
44
|
-
{
|
45
|
-
background-color:#ff9;
|
46
|
-
color:#000;
|
47
|
-
font-style:italic;
|
48
|
-
font-weight:bold;
|
49
|
-
}
|
50
|
-
abbr[title],dfn[title]
|
51
|
-
{
|
52
|
-
border-bottom:1px dotted;
|
53
|
-
cursor:help;
|
54
|
-
}
|
55
|
-
table
|
56
|
-
{
|
57
|
-
border-collapse:collapse;
|
58
|
-
border-spacing:0;
|
59
|
-
}
|
60
|
-
hr
|
61
|
-
{
|
62
|
-
display:block;
|
63
|
-
height:1px;
|
64
|
-
border:0;
|
65
|
-
border-top:1px solid #ccc;
|
66
|
-
margin:1em 0;
|
67
|
-
padding:0;
|
68
|
-
}
|
69
|
-
input,select
|
70
|
-
{
|
71
|
-
vertical-align:middle;
|
72
|
-
}
|
73
|
-
body
|
74
|
-
{
|
75
|
-
font:13px/1.231 sans-serif;
|
76
|
-
font-size:small;
|
77
|
-
}
|
78
|
-
select,input,textarea,button
|
79
|
-
{
|
80
|
-
font:99% sans-serif;
|
81
|
-
}
|
82
|
-
pre,code,kbd,samp
|
83
|
-
{
|
84
|
-
font-family:monospace, sans-serif;
|
85
|
-
}
|
86
|
-
|
87
|
-
body,select,input,textarea
|
88
|
-
{
|
89
|
-
color:#444;
|
90
|
-
}
|
91
|
-
|
92
|
-
h1,h2,h3,h4,h5,h6
|
93
|
-
{
|
94
|
-
font-weight:bold;
|
95
|
-
}
|
96
|
-
|
97
|
-
a:hover,a:active
|
98
|
-
{
|
99
|
-
outline:none;
|
100
|
-
}
|
101
|
-
|
102
|
-
a,a:active,a:visited
|
103
|
-
{
|
104
|
-
color:#607890;
|
105
|
-
}
|
106
|
-
|
107
|
-
a:hover
|
108
|
-
{
|
109
|
-
color:#036;
|
110
|
-
}
|
111
|
-
|
112
|
-
ul,ol
|
113
|
-
{
|
114
|
-
margin-left:1.8em;
|
115
|
-
}
|
116
|
-
|
117
|
-
ol
|
118
|
-
{
|
119
|
-
list-style-type:decimal;
|
120
|
-
}
|
121
|
-
|
122
|
-
nav ul,nav li
|
123
|
-
{
|
124
|
-
margin:0;
|
125
|
-
}
|
126
|
-
|
127
|
-
small
|
128
|
-
{
|
129
|
-
font-size:85%;
|
130
|
-
}
|
131
|
-
|
132
|
-
strong,th
|
133
|
-
{
|
134
|
-
font-weight:bold;
|
135
|
-
}
|
136
|
-
|
137
|
-
td,td img
|
138
|
-
{
|
139
|
-
vertical-align:top;
|
140
|
-
}
|
141
|
-
|
142
|
-
sub
|
143
|
-
{
|
144
|
-
vertical-align:sub;
|
145
|
-
font-size:smaller;
|
146
|
-
}
|
147
|
-
|
148
|
-
sup
|
149
|
-
{
|
150
|
-
vertical-align:super;
|
151
|
-
font-size:smaller;
|
152
|
-
}
|
153
|
-
|
154
|
-
pre
|
155
|
-
{
|
156
|
-
padding: 15px;
|
157
|
-
white-space: pre;
|
158
|
-
white-space: pre-wrap;
|
159
|
-
white-space: pre-line;
|
160
|
-
word-wrap: break-word;
|
161
|
-
}
|
162
|
-
|
163
|
-
textarea
|
164
|
-
{
|
165
|
-
overflow:auto;
|
166
|
-
}
|
167
|
-
|
168
|
-
input[type="radio"], input[type="checkbox"]
|
169
|
-
{
|
170
|
-
vertical-align: baseline;
|
171
|
-
}
|
172
|
-
|
173
|
-
label,input[type=button],input[type=submit],button
|
174
|
-
{
|
175
|
-
cursor: pointer;
|
176
|
-
}
|