zen 0.4 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.aspell.en.pws +31 -0
- data/.gems +1 -1
- data/.mailmap +1 -0
- data/.travis.yml +13 -7
- data/.yardopts +1 -1
- data/Rakefile +2 -2
- data/guide/changelog.md +23 -5
- data/guide/css/common.css +48 -0
- data/guide/javascript.md +1 -0
- data/guide/javascript/zen_form.md +46 -0
- data/guide/zen_compared.md +104 -0
- data/lib/zen.rb +21 -12
- data/lib/zen/helper/breadcrumb.rb +1 -1
- data/lib/zen/helper/message.rb +4 -5
- data/lib/zen/language.rb +75 -10
- data/lib/zen/markup.rb +20 -8
- data/lib/zen/model/init.rb +14 -9
- data/lib/zen/model/plugin/events.rb +1 -1
- data/lib/zen/package.rb +71 -14
- data/lib/zen/package/categories/lib/categories/controller/categories.rb +39 -12
- data/lib/zen/package/categories/lib/categories/controller/category_groups.rb +26 -5
- data/lib/zen/package/categories/lib/categories/helper/category.rb +37 -6
- data/lib/zen/package/categories/lib/categories/helper/category_frontend.rb +2 -2
- data/lib/zen/package/categories/lib/categories/view/admin/categories/form.xhtml +26 -29
- data/lib/zen/package/comments/lib/comments.rb +9 -1
- data/lib/zen/package/comments/lib/comments/anti_spam.rb +1 -1
- data/lib/zen/package/comments/lib/comments/controller/comments.rb +59 -14
- data/lib/zen/package/comments/lib/comments/controller/comments_form.rb +49 -11
- data/lib/zen/package/comments/lib/comments/helper/comment.rb +14 -2
- data/lib/zen/package/comments/lib/comments/view/admin/comments/form.xhtml +3 -3
- data/lib/zen/package/comments/migrations/1308774099_comment_status.rb +1 -1
- data/lib/zen/package/custom_fields/lib/custom_fields/blue_form_parameters.rb +12 -0
- data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_field_groups.rb +24 -6
- data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_field_types.rb +68 -20
- data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_fields.rb +106 -26
- data/lib/zen/package/custom_fields/lib/custom_fields/helper/custom_field.rb +50 -11
- data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-fields/form.xhtml +2 -2
- data/lib/zen/package/dashboard/lib/dashboard/controller/dashboard.rb +1 -1
- data/lib/zen/package/menu.rb +6 -1
- data/lib/zen/package/menus/lib/menus/controller/menu_items.rb +44 -9
- data/lib/zen/package/menus/lib/menus/controller/menus.rb +53 -13
- data/lib/zen/package/menus/lib/menus/helper/menu.rb +30 -4
- data/lib/zen/package/menus/lib/menus/model/menu.rb +4 -2
- data/lib/zen/package/sections/lib/sections/controller/section_entries.rb +48 -9
- data/lib/zen/package/sections/lib/sections/controller/sections.rb +77 -21
- data/lib/zen/package/sections/lib/sections/helper/section.rb +32 -4
- data/lib/zen/package/sections/lib/sections/model/section_entry.rb +1 -1
- data/lib/zen/package/sections/lib/sections/view/admin/section-entries/form.xhtml +5 -4
- data/lib/zen/package/sections/lib/sections/view/admin/sections/form.xhtml +3 -3
- data/lib/zen/package/sections/migrations/1308813320_section_entry_statuses.rb +1 -1
- data/lib/zen/package/settings/lib/settings/blue_form_parameters.rb +2 -2
- data/lib/zen/package/settings/lib/settings/controller/settings.rb +60 -15
- data/lib/zen/package/settings/lib/settings/view/admin/settings/index.xhtml +1 -1
- data/lib/zen/package/users/lib/users/controller/user_groups.rb +42 -7
- data/lib/zen/package/users/lib/users/controller/users.rb +78 -16
- data/lib/zen/package/users/lib/users/helper/users.rb +29 -4
- data/lib/zen/package/users/lib/users/view/admin/user-groups/form.xhtml +2 -2
- data/lib/zen/package/users/lib/users/view/admin/users/form.xhtml +2 -2
- data/lib/zen/public/admin/zen/css/general.css +5 -0
- data/lib/zen/public/admin/zen/css/messages.css +1 -0
- data/lib/zen/public/admin/zen/css/tables.css +33 -0
- data/lib/zen/public/admin/zen/css/tabs.css +8 -0
- data/lib/zen/public/admin/zen/js/index.js +21 -2
- data/lib/zen/public/admin/zen/js/lib/events.js +45 -0
- data/lib/zen/public/admin/zen/js/lib/form.js +229 -0
- data/lib/zen/public/admin/zen/js/lib/hash.js +0 -27
- data/lib/zen/task/spelling.rake +97 -0
- data/lib/zen/task/test.rake +21 -0
- data/lib/zen/theme.rb +80 -24
- data/lib/zen/validation.rb +1 -1
- data/lib/zen/version.rb +1 -1
- data/proto/app/config/config.rb.erb +9 -4
- data/proto/app/config/middlewares.rb +1 -2
- data/spec/README.md +56 -0
- data/spec/zen/controller/admin_controller.rb +0 -1
- data/spec/zen/controller/preview.rb +0 -1
- data/spec/zen/package.rb +32 -0
- data/spec/zen/package/categories/controller/categories.rb +7 -0
- data/spec/zen/package/categories/controller/category_groups.rb +7 -0
- data/spec/zen/package/comments/controller/comments.rb +7 -0
- data/spec/zen/package/custom_fields/controller/custom_field_groups.rb +7 -0
- data/spec/zen/package/custom_fields/controller/custom_field_types.rb +7 -0
- data/spec/zen/package/custom_fields/controller/custom_fields.rb +7 -0
- data/spec/zen/package/menus/controller/menu_items.rb +7 -0
- data/spec/zen/package/menus/controller/menus.rb +7 -0
- data/spec/zen/package/menus/helper/menu_frontend.rb +1 -1
- data/spec/zen/package/sections/controller/section_entries.rb +39 -0
- data/spec/zen/package/sections/controller/sections.rb +14 -0
- data/spec/zen/package/users/controller/user_groups.rb +7 -0
- data/spec/zen/package/users/controller/users.rb +7 -0
- data/zen.gemspec +6 -5
- metadata +142 -40
data/.aspell.en.pws
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
personal_ws-1.1 en 28 utf-8
|
2
|
+
stylesheet
|
3
|
+
getter
|
4
|
+
erb
|
5
|
+
timestamp
|
6
|
+
checkboxes
|
7
|
+
Capybara's
|
8
|
+
isset
|
9
|
+
xhtml
|
10
|
+
csrf
|
11
|
+
https
|
12
|
+
strftime
|
13
|
+
nodoc
|
14
|
+
todo
|
15
|
+
procs
|
16
|
+
readline
|
17
|
+
namespace
|
18
|
+
backend
|
19
|
+
rb
|
20
|
+
frontend
|
21
|
+
rtl
|
22
|
+
textarea
|
23
|
+
mutex
|
24
|
+
github
|
25
|
+
boolean
|
26
|
+
reloader
|
27
|
+
regex
|
28
|
+
checkbox
|
29
|
+
login
|
30
|
+
ramaze
|
31
|
+
ramaze's
|
data/.gems
CHANGED
data/.mailmap
CHANGED
@@ -1,3 +1,4 @@
|
|
1
1
|
Yorick Peterse <yorickpeterse@gmail.com> YorickPeterse <info@yorickpeterse.com>
|
2
2
|
Yorick Peterse <yorickpeterse@gmail.com> Yorick Peterse <info@yorickpeterse.com>
|
3
3
|
Yorick Peterse <yorickpeterse@gmail.com> YorickPeterse <yorickpeterse@gmail.com>
|
4
|
+
Yorick Peterse <yorickpeterse@gmail.com> Yorick Peterse <yorick@isset.nl>
|
data/.travis.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
script: "rake setup; rake test:
|
1
|
+
script: "rake setup; rake test:travis"
|
2
2
|
rvm:
|
3
3
|
- 1.9.2
|
4
4
|
- 1.9.3
|
@@ -13,15 +13,21 @@ branches:
|
|
13
13
|
- master
|
14
14
|
|
15
15
|
env:
|
16
|
-
- 'ADAPTER=sqlite'
|
16
|
+
- 'ADAPTER=sqlite DATABASE=database.db'
|
17
17
|
- 'ADAPTER=mysql2 DATABASE=zen_dev'
|
18
18
|
- 'ADAPTER=postgres DATABASE=zen_dev USERNAME=postgres'
|
19
|
-
- 'LRU=1 ADAPTER=sqlite'
|
20
|
-
- 'LRU=1 ADAPTER=mysql2 DATABASE=
|
21
|
-
- 'LRU=1 ADAPTER=postgres DATABASE=
|
19
|
+
- 'LRU=1 ADAPTER=sqlite DATABASE=database_lru.db'
|
20
|
+
- 'LRU=1 ADAPTER=mysql2 DATABASE=zen_dev_lru'
|
21
|
+
- 'LRU=1 ADAPTER=postgres DATABASE=zen_dev_lru USERNAME=postgres'
|
22
22
|
|
23
23
|
before_script:
|
24
|
-
- "mysql -e 'CREATE DATABASE
|
25
|
-
- "
|
24
|
+
- "mysql -e 'CREATE DATABASE zen_dev_1_9_2;'"
|
25
|
+
- "mysql -e 'CREATE DATABASE zen_dev_1_9_3;'"
|
26
|
+
- "mysql -e 'CREATE DATABASE zen_dev_lru_1_9_2;'"
|
27
|
+
- "mysql -e 'CREATE DATABASE zen_dev_lru_1_9_3;'"
|
28
|
+
- "psql -c 'CREATE DATABASE zen_dev_1_9_2;' -U postgres"
|
29
|
+
- "psql -c 'CREATE DATABASE zen_dev_lru_1_9_2;' -U postgres"
|
30
|
+
- "psql -c 'CREATE DATABASE zen_dev_1_9_3;' -U postgres"
|
31
|
+
- "psql -c 'CREATE DATABASE zen_dev_lru_1_9_3;' -U postgres"
|
26
32
|
- "export DISPLAY=:99.0"
|
27
33
|
- "sh -e /etc/init.d/xvfb start"
|
data/.yardopts
CHANGED
data/Rakefile
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
|
3
|
-
Zen::Gemspec = Gem::Specification
|
3
|
+
Zen::Gemspec = Gem::Specification.load(
|
4
4
|
File.expand_path('../zen.gemspec', __FILE__)
|
5
5
|
)
|
6
6
|
|
7
7
|
task_path = File.expand_path('../lib/zen/task', __FILE__)
|
8
|
-
tasks = ['build', 'clean', 'proto', 'setup', 'test']
|
8
|
+
tasks = ['build', 'clean', 'proto', 'setup', 'test', 'spelling']
|
9
9
|
|
10
10
|
tasks.each do |task|
|
11
11
|
import File.join(task_path, "#{task}.rake")
|
data/guide/changelog.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.4.1 - April 16th, 2012
|
4
|
+
|
5
|
+
* Updated various version requirements.
|
6
|
+
* Menu items are sorted properly, in some cases the sort order would be broken
|
7
|
+
due to the dataset being sorted after it was retrieved.
|
8
|
+
* Replaced RDiscount with Redcarpet.
|
9
|
+
* Show menu items without permissions.
|
10
|
+
* Documentation improvements and fixed various spelling errors.
|
11
|
+
* Removed the `post_start` event.
|
12
|
+
* Load core packages when connecting to a DB.
|
13
|
+
* Call `:post_start` before building assets.
|
14
|
+
* Hide messages by clicking on them.
|
15
|
+
* Basic set of styles for the pagination buttons.
|
16
|
+
* Preserve author IDs for section entries
|
17
|
+
* Handle forms using the Mootools class Zen.Form.
|
18
|
+
* Moved Mootools events into their own file.
|
19
|
+
* Set Ramaze.options.mode before Zen.root.
|
20
|
+
|
3
21
|
## 0.4 - March 7th, 2012
|
4
22
|
|
5
23
|
* Packages can contain multiple menus.
|
@@ -20,7 +38,7 @@
|
|
20
38
|
* Fixed an issue that would incorrectly generate application names when creating
|
21
39
|
a new application using ``zen create``.
|
22
40
|
* Full stack traces are logged in case of errors rather than just the message.
|
23
|
-
* Model related events (e.g. before_new_section_entry) have been moved into
|
41
|
+
* Model related events (e.g. `before_new_section_entry`) have been moved into
|
24
42
|
their corresponding models.
|
25
43
|
* Menu item manager has been re-written so that menu items can be organized
|
26
44
|
using a drop and drag interface.
|
@@ -63,7 +81,7 @@
|
|
63
81
|
* Core packages no longer include certain modules just to so that they don't
|
64
82
|
have to specify the full namespace to a class.
|
65
83
|
* Added an event system (Zen::Event) and a bucket load of events.
|
66
|
-
* Merged Zen.init and Zen.post_init into Zen.start.
|
84
|
+
* Merged Zen.init and `Zen.post_init` into Zen.start.
|
67
85
|
* Fixed various YARD formatting issues.
|
68
86
|
* Localized all of the Javascript.
|
69
87
|
* All specs now pass on Ruby 1.9.3.
|
@@ -103,7 +121,7 @@
|
|
103
121
|
section entries plugin.
|
104
122
|
* Statuses of comments and section entries are now stored in a separate table.
|
105
123
|
* Plugins can be called as a singleton using Zen::Plugin.plugin.
|
106
|
-
* The column menu_items.order has been renamed to menu_items.sort_order.
|
124
|
+
* The column `menu_items.order` has been renamed to menu_items.sort_order.
|
107
125
|
* The accessor method for settings that defines the possible values now accepts
|
108
126
|
a Proc, this makes it possible for conditional possible values and such.
|
109
127
|
* Various performance tweaks.
|
@@ -116,8 +134,8 @@
|
|
116
134
|
* Users can now create their own custom field types.
|
117
135
|
* Overview pages now paginate their results so they display a maximum of 20 rows
|
118
136
|
per page.
|
119
|
-
* All references to "
|
120
|
-
"
|
137
|
+
* All references to "css\_class" and "css\_id" have been replaced with
|
138
|
+
"html\_class" and "html\_id".
|
121
139
|
* Ramaze::Helper::Common has been removed.
|
122
140
|
* Tables can now be sorted by clicking on the headers.
|
123
141
|
* The required permissions for the #save() methods of all controllers have been
|
data/guide/css/common.css
CHANGED
@@ -18,3 +18,51 @@ pre.code
|
|
18
18
|
font-size: 13px;
|
19
19
|
line-height: 1.4;
|
20
20
|
}
|
21
|
+
|
22
|
+
/**
|
23
|
+
* YARD uses generic table styles, using a special class means those tables
|
24
|
+
* don't get messed up.
|
25
|
+
*/
|
26
|
+
.table
|
27
|
+
{
|
28
|
+
border: 1px solid #ccc;
|
29
|
+
border-right: none;
|
30
|
+
border-collapse: separate;
|
31
|
+
border-spacing: 0;
|
32
|
+
text-align: left;
|
33
|
+
}
|
34
|
+
|
35
|
+
.table.full
|
36
|
+
{
|
37
|
+
width: 100%;
|
38
|
+
}
|
39
|
+
|
40
|
+
.table .field_name
|
41
|
+
{
|
42
|
+
min-width: 160px;
|
43
|
+
}
|
44
|
+
|
45
|
+
.table thead tr th.no_sort:first-child
|
46
|
+
{
|
47
|
+
width: 25px;
|
48
|
+
}
|
49
|
+
|
50
|
+
.table thead tr th, .table tbody tr td
|
51
|
+
{
|
52
|
+
border-bottom: 1px solid #ccc;
|
53
|
+
border-right: 1px solid #ccc;
|
54
|
+
min-width: 20px;
|
55
|
+
padding: 8px 5px;
|
56
|
+
text-align: left;
|
57
|
+
vertical-align: top;
|
58
|
+
}
|
59
|
+
|
60
|
+
.table tbody tr:last-child td
|
61
|
+
{
|
62
|
+
border-bottom: none;
|
63
|
+
}
|
64
|
+
|
65
|
+
.table tr:nth-child(odd) td
|
66
|
+
{
|
67
|
+
background: #f9f9f9;
|
68
|
+
}
|
data/guide/javascript.md
CHANGED
@@ -62,6 +62,7 @@ Out of the box the following classes are available:
|
|
62
62
|
* {file:javascript/zen_editor Zen.Editor}
|
63
63
|
* {file:javascript/zen_htmltable Zen.HtmlTable}
|
64
64
|
* {file:javascript/zen_autosave Zen.Autosave}
|
65
|
+
* {file:javascript/zen_form Zen.Form}
|
65
66
|
|
66
67
|
The following third-party classes are also provided:
|
67
68
|
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Zen.Form
|
2
|
+
|
3
|
+
Zen.Form is a class used for adding various dynamic features to HTML forms
|
4
|
+
such as automatically saving the data and handling validation errors using
|
5
|
+
the HTML5 constraints API.
|
6
|
+
|
7
|
+
For the features related to the HTML5 constraints API to work properly users
|
8
|
+
should be using a modern browser. If this API is not implemented it will be
|
9
|
+
silently ignored. Automatically saving data is supported regardless of the
|
10
|
+
existence of this API and is handled by Zen.Autosave.
|
11
|
+
|
12
|
+
## Usage
|
13
|
+
|
14
|
+
In order to use this class you'll have to create a new instance of it and
|
15
|
+
pass an instance of Element to it (an instance for a ``<form>`` element):
|
16
|
+
|
17
|
+
new Zen.Form($('my_form'));
|
18
|
+
|
19
|
+
By passing and object to the second parameter you can customize various parts
|
20
|
+
of this class. The following options are available:
|
21
|
+
|
22
|
+
* autosave_attribute: name of the attribute that contains the URL to send
|
23
|
+
requests to when automatically saving form data. This option is set to
|
24
|
+
"data-autosave-url" by default.
|
25
|
+
* tabs_selector: a CSS selector used to determine the tabs for the form, set
|
26
|
+
to "div.tabs ul" by default.
|
27
|
+
* error_class: the primary class to use for error indicators in a tab, set to
|
28
|
+
"tab_error" by default.
|
29
|
+
|
30
|
+
An example of setting one of these options is the following:
|
31
|
+
|
32
|
+
new Zen.Form($('my_form'), {error_class: 'custom_tab_error'});
|
33
|
+
|
34
|
+
Keep in mind that out of the box there's no need to manually use this class,
|
35
|
+
Zen already does this for you.
|
36
|
+
|
37
|
+
## Tabs and Errors
|
38
|
+
|
39
|
+
This class makes it easier for users to nice form errors. This is achieved by
|
40
|
+
showing a small error icon in a tab of which the corresponding tab field
|
41
|
+
contains a number of invalid form elements. For this to work properly you
|
42
|
+
should add the class "tab_field" to each tab field:
|
43
|
+
|
44
|
+
<div id="general" class="tab_field">
|
45
|
+
<!-- Tab field's content -->
|
46
|
+
</div>
|
data/guide/zen_compared.md
CHANGED
@@ -7,6 +7,110 @@ things up a bit.
|
|
7
7
|
|
8
8
|
Do note that since I wrote Zen my opinion is more than likely biased.
|
9
9
|
|
10
|
+
## Quick Overview
|
11
|
+
|
12
|
+
<table class="table">
|
13
|
+
<thead>
|
14
|
+
<tr>
|
15
|
+
<th></th>
|
16
|
+
<th>Zen</th>
|
17
|
+
<th>Wordpress</th>
|
18
|
+
<th>Expression Engine</th>
|
19
|
+
<th>Radiant</th>
|
20
|
+
<th>Refinery</th>
|
21
|
+
<th>Locomotive</th>
|
22
|
+
</tr>
|
23
|
+
</thead>
|
24
|
+
<tbody>
|
25
|
+
<tr>
|
26
|
+
<td>
|
27
|
+
<strong>Language</strong>
|
28
|
+
</td>
|
29
|
+
<td>Ruby</td>
|
30
|
+
<td>PHP</td>
|
31
|
+
<td>PHP</td>
|
32
|
+
<td>Ruby</td>
|
33
|
+
<td>Ruby</td>
|
34
|
+
<td>Ruby</td>
|
35
|
+
</tr>
|
36
|
+
<tr>
|
37
|
+
<td>
|
38
|
+
<strong>Framework</strong>
|
39
|
+
</td>
|
40
|
+
<td>Ramaze</td>
|
41
|
+
<td>None</td>
|
42
|
+
<td>Codeigniter</td>
|
43
|
+
<td>Rails</td>
|
44
|
+
<td>Rails</td>
|
45
|
+
<td>Rails</td>
|
46
|
+
</tr>
|
47
|
+
<tr>
|
48
|
+
<td>
|
49
|
+
<strong>Storage Engines</strong>
|
50
|
+
</td>
|
51
|
+
<td>MySQL, PostgreSQL, SQLite3 <sup>1</sup></td>
|
52
|
+
<td>MySQL</td>
|
53
|
+
<td>MySQL</td>
|
54
|
+
<td>MySQL, SQLite3 and probably PostgreSQL</td>
|
55
|
+
<td>MySQL, PostgreSQL, SQLite3</td>
|
56
|
+
<td>MongoDB</td>
|
57
|
+
</tr>
|
58
|
+
<tr>
|
59
|
+
<td>
|
60
|
+
<strong>License</strong>
|
61
|
+
</td>
|
62
|
+
<td>MIT</td>
|
63
|
+
<td>GPLv2</td>
|
64
|
+
<td>Proprietary</td>
|
65
|
+
<td>MIT</td>
|
66
|
+
<td>MIT</td>
|
67
|
+
<td>MIT</td>
|
68
|
+
</tr>
|
69
|
+
<tr>
|
70
|
+
<td>
|
71
|
+
<strong>Flexible content management <sup>2</sup></strong>
|
72
|
+
</td>
|
73
|
+
<td>Yes</td>
|
74
|
+
<td>No</td>
|
75
|
+
<td>Yes</td>
|
76
|
+
<td>No</td>
|
77
|
+
<td>No</td>
|
78
|
+
<td>Limited</td>
|
79
|
+
</tr>
|
80
|
+
<tr>
|
81
|
+
<td>
|
82
|
+
<strong>Easy to install <sup>3</sup></strong>
|
83
|
+
</td>
|
84
|
+
<td>Yes</td>
|
85
|
+
<td>No</td>
|
86
|
+
<td>No</td>
|
87
|
+
<td>Yes</td>
|
88
|
+
<td>Yes</td>
|
89
|
+
<td>No</td>
|
90
|
+
</tr>
|
91
|
+
<tr>
|
92
|
+
<td>
|
93
|
+
<strong>Markup <sup>4</sup></strong>
|
94
|
+
</td>
|
95
|
+
<td>plain text, Markdown, Textile, HTML</td>
|
96
|
+
<td>plain text, HTML</td>
|
97
|
+
<td>plain text, HTML</td>
|
98
|
+
<td>plain text, Markdown, Textile, SmartyPants</td>
|
99
|
+
<td>plain text, HTML</td>
|
100
|
+
<td>Unknown, probably plain text and HTML</td>
|
101
|
+
</tr>
|
102
|
+
</tbody>
|
103
|
+
</table>
|
104
|
+
|
105
|
+
1. Zen in theory supports all databases supported by Sequel but only the ones
|
106
|
+
listed above have been officially tested.
|
107
|
+
2. Flexible content management without having to install various third-party
|
108
|
+
plugins.
|
109
|
+
3. Easy to install without the need of having to execute multiple shell commands
|
110
|
+
or manually extracting archives.
|
111
|
+
4. Support for different markup formats without installing third-party plugins
|
112
|
+
or writing them yourself.
|
113
|
+
|
10
114
|
## Zen vs Wordpress
|
11
115
|
|
12
116
|
There are quite a few differences between Zen and Wordpress besides the language
|
data/lib/zen.rb
CHANGED
@@ -2,9 +2,9 @@ require 'ramaze'
|
|
2
2
|
require 'json'
|
3
3
|
|
4
4
|
Ramaze.setup(:verbose => false) do
|
5
|
-
gem 'sequel' , ['~> 3.
|
5
|
+
gem 'sequel' , ['~> 3.34.1']
|
6
6
|
gem 'bcrypt-ruby' , ['~> 3.0.1'], :lib => 'bcrypt'
|
7
|
-
gem 'loofah' , ['~> 1.2.
|
7
|
+
gem 'loofah' , ['~> 1.2.1']
|
8
8
|
gem 'ramaze-asset', ['~> 0.2.3'], :lib => 'ramaze/asset'
|
9
9
|
end
|
10
10
|
|
@@ -41,7 +41,7 @@ module Zen
|
|
41
41
|
|
42
42
|
class << self
|
43
43
|
# The database connection to use for Sequel.
|
44
|
-
|
44
|
+
attr_reader :database
|
45
45
|
|
46
46
|
# Instance of Ramaze::Asset::Environment to use for all backend assets.
|
47
47
|
attr_accessor :asset
|
@@ -70,10 +70,23 @@ module Zen
|
|
70
70
|
end
|
71
71
|
|
72
72
|
##
|
73
|
-
#
|
73
|
+
# Sets the database connection to use and loads the core packages provided
|
74
|
+
# by Zen.
|
75
|
+
#
|
76
|
+
# @since 27-03-2012
|
77
|
+
#
|
78
|
+
def database=(database)
|
79
|
+
@database = database
|
80
|
+
|
81
|
+
require 'zen/model/init'
|
82
|
+
require 'zen/model/methods'
|
83
|
+
require 'zen/package/all'
|
84
|
+
end
|
85
|
+
|
86
|
+
##
|
87
|
+
# Prepares Zen for the party of its life.
|
74
88
|
#
|
75
89
|
# @since 0.3
|
76
|
-
# @event pre_start Event that is fired before starting Zen.
|
77
90
|
# @event post_start Event that is fired after all packages have been loaded,
|
78
91
|
# the cache has been set up, etc. This event is called at the very end of
|
79
92
|
# the method.
|
@@ -81,22 +94,16 @@ module Zen
|
|
81
94
|
def start
|
82
95
|
raise('No valid root directory specified in Zen.root') if root.nil?
|
83
96
|
|
84
|
-
Zen::Event.call(:pre_start)
|
85
|
-
|
86
97
|
# Set up Ramaze::Cache manually. This makes it possible for the language
|
87
98
|
# files to cache their data in the custom cache without having to wait for
|
88
99
|
# Ramaze to set it up.
|
89
100
|
Ramaze::Cache.setup
|
90
101
|
Ramaze.options.setup.delete(Ramaze::Cache)
|
91
102
|
|
92
|
-
|
93
|
-
require 'zen/model/methods'
|
94
|
-
require 'zen/package/all'
|
103
|
+
Zen::Event.call(:post_start)
|
95
104
|
|
96
105
|
Zen.asset.build(:javascript)
|
97
106
|
Zen.asset.build(:css)
|
98
|
-
|
99
|
-
Zen::Event.call(:post_start)
|
100
107
|
end
|
101
108
|
|
102
109
|
private
|
@@ -138,8 +145,10 @@ module Zen
|
|
138
145
|
'admin/mootools/js/core',
|
139
146
|
'admin/mootools/js/more',
|
140
147
|
'admin/zen/js/lib/base',
|
148
|
+
'admin/zen/js/lib/events',
|
141
149
|
'admin/zen/js/lib/html_table',
|
142
150
|
'admin/zen/js/lib/autosave',
|
151
|
+
'admin/zen/js/lib/form',
|
143
152
|
'admin/zen/js/index'
|
144
153
|
],
|
145
154
|
:name => 'zen_core'
|