lolita 3.1.18 → 3.2.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +5 -2
- data/History.rdoc +24 -0
- data/README.md +113 -0
- data/VERSION +1 -1
- data/{public → app/assets}/images/lolita/plus.png +0 -0
- data/{public → app/assets}/javascripts/lolita/application.js +0 -0
- data/{public → app/assets}/javascripts/lolita/base64.js +0 -0
- data/{public → app/assets}/javascripts/lolita/main.js +1 -0
- data/{public → app/assets}/javascripts/lolita/tab.js +0 -0
- data/{public → app/assets}/stylesheets/lolita/PIE-custom.htc +0 -0
- data/{public → app/assets}/stylesheets/lolita/PIE.htc +0 -0
- data/{public → app/assets}/stylesheets/lolita/default.css +0 -0
- data/{public → app/assets}/stylesheets/lolita/style.css +0 -21
- data/app/controllers/lolita/info_controller.rb +1 -12
- data/app/controllers/lolita/rest_controller.rb +2 -7
- data/app/helpers/lolita_helper.rb +1 -12
- data/app/views/components/lolita/configuration/column/_header.html.erb +1 -1
- data/app/views/components/lolita/configuration/column/_sort.html.erb +4 -7
- data/app/views/components/lolita/configuration/field/array/habtm/_display.html.haml +1 -1
- data/app/views/components/lolita/configuration/field/array/select/_display.html.erb +1 -1
- data/app/views/components/lolita/configuration/field/string/disabled/_display.html.erb +1 -1
- data/app/views/components/lolita/configuration/field/string/text/_display.html.erb +1 -1
- data/app/views/components/lolita/configuration/list/_paginator.html.erb +1 -1
- data/app/views/components/lolita/configuration/list/_title.html.erb +1 -6
- data/app/views/components/lolita/configuration/nested_form/_display.html.erb +6 -8
- data/app/views/components/lolita/navigation/_tree.html.erb +25 -18
- data/app/views/components/lolita/shared/_header.html.erb +1 -1
- data/app/views/components/lolita/shared/_right_sidebar.html.erb +6 -1
- data/app/views/layouts/lolita/application.html.erb +3 -3
- data/config/locales/en.yml +24 -1
- data/config/locales/lv.yml +0 -1
- data/config/routes.rb +1 -3
- data/lib/generators/lolita/install_generator.rb +1 -5
- data/lib/lolita.rb +23 -38
- data/lib/lolita/adapter/abstract_adapter.rb +0 -1
- data/lib/lolita/adapter/active_record.rb +4 -42
- data/lib/lolita/adapter/mongoid.rb +4 -76
- data/lib/lolita/configuration/base.rb +2 -15
- data/lib/lolita/configuration/column.rb +2 -25
- data/lib/lolita/configuration/factory/field.rb +2 -10
- data/lib/lolita/configuration/field.rb +1 -6
- data/lib/lolita/configuration/field/array.rb +31 -124
- data/lib/lolita/configuration/field/integer.rb +1 -0
- data/lib/lolita/configuration/list.rb +2 -23
- data/lib/lolita/configuration/tabs.rb +0 -6
- data/lib/lolita/controllers/component_helpers.rb +1 -1
- data/lib/lolita/controllers/internal_helpers.rb +4 -18
- data/lib/lolita/controllers/user_helpers.rb +11 -23
- data/lib/lolita/hooks.rb +120 -163
- data/lib/lolita/lazy_loader.rb +0 -3
- data/lib/lolita/mapping.rb +0 -23
- data/lib/lolita/modules/rest.rb +1 -1
- data/lib/lolita/navigation/branch.rb +1 -52
- data/lib/lolita/navigation/tree.rb +0 -10
- data/lib/lolita/rails.rb +2 -1
- data/lib/lolita/rails/routes.rb +5 -4
- data/lib/lolita/system_configuration/application.rb +1 -7
- data/lolita.gemspec +83 -100
- data/spec/configuration/field_spec.rb +1 -1
- data/spec/configuration/list_spec.rb +14 -19
- data/spec/rails_app/app/mongoid/post.rb +0 -4
- data/spec/rails_app/config/application.rb +1 -12
- data/spec/rails_app/config/environments/development.rb +2 -6
- data/spec/rails_app/config/environments/production.rb +1 -5
- data/spec/rails_app/config/environments/test.rb +1 -5
- data/vendor/assets/javascripts/jquery-1.6.2.min.js +18 -0
- data/{public → vendor/assets}/javascripts/jquery-ui-1.8.13.min.js +0 -0
- data/{public → vendor/assets}/javascripts/modernizr-1.7.min.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/jquery.tinymce.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/langs/en.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/license.txt +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/about.htm +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/anchor.htm +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/charmap.htm +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/color_picker.htm +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/editor_template.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/editor_template_src.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/image.htm +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/img/colorpicker.jpg +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/img/flash.gif +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/img/icons.gif +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/img/iframe.gif +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/img/pagebreak.gif +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/img/quicktime.gif +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/img/realmedia.gif +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/img/shockwave.gif +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/img/trans.gif +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/img/video.gif +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/img/windowsmedia.gif +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/js/about.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/js/anchor.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/js/charmap.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/js/color_picker.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/js/image.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/js/link.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/js/source_editor.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/langs/en.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/langs/en_dlg.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/link.htm +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/shortcuts.htm +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/skins/cirkuit/content.css +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/skins/cirkuit/dialog.css +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/skins/cirkuit/img/butt2.png +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/skins/cirkuit/img/button-bg.png +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/skins/cirkuit/img/buttons.png +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/skins/cirkuit/img/down_arrow.gif +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/skins/cirkuit/img/fade-butt.png +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/skins/cirkuit/img/icons.png +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/skins/cirkuit/img/items.gif +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/skins/cirkuit/img/menu-arrow.png +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/skins/cirkuit/img/menu-check.png +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/skins/cirkuit/img/progress.gif +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/skins/cirkuit/img/tabs.gif +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/skins/cirkuit/img/toolbarbg.png +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/skins/cirkuit/ui.css +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/themes/advanced/source_editor.htm +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/tiny_mce.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/tiny_mce_popup.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/utils/editable_selects.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/utils/form_utils.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/utils/mctabs.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce/utils/validate.js +0 -0
- data/{public → vendor/assets}/javascripts/tinymce_config.js +1 -1
- metadata +121 -127
- data/README.rdoc +0 -100
- data/app/controllers/lolita/field_data_controller.rb +0 -36
- data/app/views/components/lolita/configuration/field/array/autocomplete/_display.html.haml +0 -11
- data/app/views/components/lolita/configuration/field/array/checkbox/_display.html.haml +0 -8
- data/app/views/components/lolita/configuration/field/array/polymorphic/_display.html.haml +0 -6
- data/app/views/components/lolita/configuration/field/array/polymorphic/_options_for_select.html.haml +0 -1
- data/app/views/components/lolita/configuration/search/_display.html.haml +0 -2
- data/app/views/components/lolita/shared/_save_button.html.erb +0 -6
- data/lib/generators/lolita/assets_generator.rb +0 -19
- data/lib/lolita/configuration/factory.rb +0 -56
- data/lib/lolita/configuration/helper.rb +0 -24
- data/lib/lolita/configuration/page.rb +0 -126
- data/lib/lolita/configuration/search.rb +0 -91
- data/lib/lolita/controller_additions.rb +0 -15
- data/lib/lolita/controllers/authorization_helpers.rb +0 -56
- data/lib/lolita/search/simple.rb +0 -76
- data/public/javascripts/jquery-1.6.min.js +0 -16
- data/public/javascripts/rails.js +0 -137
- data/spec/configuration/search_spec.rb +0 -44
- data/spec/search/simple_spec.rb +0 -48
data/Gemfile
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
3
|
# Thing how to seperate gems for Rails Engine from those that are only for lolita
|
4
|
-
gem "rails", "~>3.0
|
4
|
+
gem "rails", "~>3.1.0"
|
5
5
|
gem "kaminari", "~>0.12.4"
|
6
6
|
gem "abstract"
|
7
|
-
|
7
|
+
|
8
|
+
gem "builder", "~> 3.0"
|
9
|
+
|
8
10
|
gem "haml", "~> 3.1.2"
|
11
|
+
gem 'jquery-rails'
|
9
12
|
|
10
13
|
group :mongoid do
|
11
14
|
gem "mongo", "~> 1.3.0"
|
data/History.rdoc
CHANGED
@@ -1,3 +1,27 @@
|
|
1
|
+
=== Version 3.2.0
|
2
|
+
* Enhancements
|
3
|
+
* Created adapter Field and Association classes. Field and association access methods convert data to thoes class objects
|
4
|
+
* Factory module created where factory classes are located
|
5
|
+
* Removed specific pagination methods from adapters
|
6
|
+
* Removed Lolita::Configuration::Factory and Lolita::Configuration::Page
|
7
|
+
* Range, Float, Symbol, Hash fields are added to support Mongoid ORM
|
8
|
+
|
9
|
+
* Changes
|
10
|
+
* #value, #value=, #record_value removed from Lolita::Configuration::Field
|
11
|
+
* Created pagination in list and in adapters; its possible to customize it for model.
|
12
|
+
* All fields must have name as well as tabs must have type
|
13
|
+
|
14
|
+
* Bug fixes
|
15
|
+
* All classes fixed to work with both mongoid and AR
|
16
|
+
|
17
|
+
|
18
|
+
=== Version 3.1.18 /
|
19
|
+
* Enhancements
|
20
|
+
*
|
21
|
+
* Bug fixes
|
22
|
+
* Polymorphic bug fixed
|
23
|
+
* habtm field fixed
|
24
|
+
|
1
25
|
=== Version 3.1.17 / 2011-09-01
|
2
26
|
* Bug fixes
|
3
27
|
* Error explanation updated with nested errors
|
data/README.md
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
#Lolita
|
2
|
+
|
3
|
+
Great Rails CMS, that turns your business logic into good-looking, fully functional workspace.
|
4
|
+
##Demo
|
5
|
+
See the demo page at [Demo](http://lolita-demo.ithouse.lv)
|
6
|
+
|
7
|
+
##Installation
|
8
|
+
|
9
|
+
First install Lolita gem
|
10
|
+
|
11
|
+
sudo gem install lolita
|
12
|
+
|
13
|
+
Then go to your rails project and
|
14
|
+
|
15
|
+
rails g lolita:install
|
16
|
+
|
17
|
+
That will create initializer and copy all assets.
|
18
|
+
Also it will call *install* on all added modules to lolita.
|
19
|
+
So if you in Gemfile have following
|
20
|
+
|
21
|
+
gem "lolita"
|
22
|
+
gem "lolita-file-upload"
|
23
|
+
It will also call *lolita_file_upload:install*.
|
24
|
+
##Usage
|
25
|
+
|
26
|
+
To make your model use Lolita do like this
|
27
|
+
|
28
|
+
class Post < ActiveRecord::Base
|
29
|
+
include Lolita::Configuration
|
30
|
+
lolita
|
31
|
+
end
|
32
|
+
Then in routes.rb file make resources accessable for lolita with
|
33
|
+
|
34
|
+
lolita_for :posts
|
35
|
+
This will make routes like
|
36
|
+
`/lolita/posts`
|
37
|
+
`/lolita/posts/1/edit`
|
38
|
+
`/lolita/posts/new`
|
39
|
+
or open `/lolita` and it will redirect to first available resource list view.
|
40
|
+
|
41
|
+
For more detailed usage read [Usage](https://github.com/ithouse/lolita/wiki/Usage) at wiki.
|
42
|
+
|
43
|
+
###Add authorization to Lolita
|
44
|
+
|
45
|
+
Easiest way to add authentication is with Devise. First install Devise as gem, than add it to your project.
|
46
|
+
Make Devise model, lets say, *User*. After that add these lines in */config/initializers/lolita.rb*
|
47
|
+
|
48
|
+
config.user_classes << User
|
49
|
+
config.authentication = :authenticate_user!
|
50
|
+
This will make before each Lolita requests call before filter, that than will call *authenticate_user!*
|
51
|
+
that is Devise method for authenticating user. Without it Lolita will be acessable for everyone.
|
52
|
+
You can also add any other authentication method like
|
53
|
+
|
54
|
+
config.authentication = :authenticate_admin
|
55
|
+
And than put this method for common use in *ApplicationController* or in some other place that is accessable
|
56
|
+
to all controllers.
|
57
|
+
###Using newer version of Lolita
|
58
|
+
|
59
|
+
If you decide to use some newer version, you most likely should copy new assets to your project.
|
60
|
+
This can be done with
|
61
|
+
|
62
|
+
rails g lolita:assets
|
63
|
+
###Using hooks
|
64
|
+
|
65
|
+
Lolita define hooks for RestController and for components.
|
66
|
+
####RestController hooks
|
67
|
+
|
68
|
+
There are two kind of hooks for all actions - *before_[action name]* and *after_[action name]*.
|
69
|
+
Define callbacks for those hooks outside of controller. This will call User#log_action each time when #destroy
|
70
|
+
action is requested.
|
71
|
+
|
72
|
+
Lolita::RestController.before_destroy do
|
73
|
+
User.log_action("Going to delete #{params[:id]}")
|
74
|
+
end
|
75
|
+
Also you can define callbacks in your controllers that extend Lolita::RestController. This will call #set\_default\_params
|
76
|
+
each time #new action is requested.
|
77
|
+
|
78
|
+
class PostController < Lolita::RestController
|
79
|
+
before_new :set_default_params
|
80
|
+
|
81
|
+
private
|
82
|
+
|
83
|
+
def set_default_params
|
84
|
+
params[:post][:title]="-Your title goes here-"
|
85
|
+
end
|
86
|
+
end
|
87
|
+
####Component hooks
|
88
|
+
|
89
|
+
Components have three hooks - *before*, *after* and *around*.
|
90
|
+
Component hooks are different from controller hooks with names. Each component has it's own name, that is used to
|
91
|
+
call component, like
|
92
|
+
|
93
|
+
render_component :"lolita/configuration/list/display"
|
94
|
+
#same as
|
95
|
+
render_component :"lolita/configuration/list", :display
|
96
|
+
and this name is used to add callback for component. As components is not related to specific class, then there
|
97
|
+
are only one way to define callback for them.
|
98
|
+
|
99
|
+
Lolita::Hooks.component(:"/lolita/configuration/list/display").before do
|
100
|
+
"<div>My Custom text</div>"
|
101
|
+
end
|
102
|
+
That what are inside of blocks depends on place where you define callback if it is in _.rb_ file, than you
|
103
|
+
should put HTML in quotes, if in _.erb_ and similar files then there is no need for that. Also blocks with
|
104
|
+
Ruby code only return last line, so you should probably define HTML as shown in previous example.
|
105
|
+
For _around_ callback if you pass block, then original content will be replaced with that, but if you want
|
106
|
+
to let original content inside of your block content than it is done like this with #let_content method.
|
107
|
+
|
108
|
+
Lolita::Hooks.component(:"/lolita/configuration/list/display").around do
|
109
|
+
"<div style='color:red'>#{let_content}</div>"
|
110
|
+
end
|
111
|
+
##License
|
112
|
+
|
113
|
+
Lolita is under MIT license. See [LICENSE.txt](https://github.com/ithouse/lolita/blob/master/LICENSE.txt)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.2.0.rc1
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -315,27 +315,6 @@ a.create {
|
|
315
315
|
|
316
316
|
.list table td a:active {position: relative; top: 1px;}
|
317
317
|
|
318
|
-
/* search in list view */
|
319
|
-
|
320
|
-
#main .boxtitle .black .search {
|
321
|
-
position: absolute;
|
322
|
-
right: 15px;
|
323
|
-
top: 25px;
|
324
|
-
background: none;
|
325
|
-
padding: 0;
|
326
|
-
}
|
327
|
-
#main .boxtitle .black .search input {
|
328
|
-
font-size: 13px;
|
329
|
-
background: #fff url(<%= asset_data_uri "lolita/search_icon.png" %>) no-repeat 5px center;
|
330
|
-
padding: 0 10px 0 18px;
|
331
|
-
border: 1px solid #ccc;
|
332
|
-
border-radius: 10px;
|
333
|
-
-moz-border-radius: 10px;
|
334
|
-
-webkit-border-radius: 10px;
|
335
|
-
height: 20px;
|
336
|
-
line-height: 20px\9;
|
337
|
-
}
|
338
|
-
|
339
318
|
/* filter */
|
340
319
|
#main form.filter {
|
341
320
|
background: #F3F3F3;
|
@@ -1,16 +1,9 @@
|
|
1
1
|
class Lolita::InfoController < ApplicationController
|
2
2
|
@@properties = []
|
3
|
-
include Lolita::Controllers::UserHelpers
|
4
|
-
include Lolita::Controllers::AuthorizationHelpers
|
5
|
-
before_filter :authenticate_lolita_user!, :only => [:index]
|
6
3
|
|
7
4
|
def index
|
8
5
|
if Lolita.mappings.any?
|
9
|
-
|
10
|
-
can?(:read,mapping.to)
|
11
|
-
}
|
12
|
-
available_mapping &&= available_mapping.last
|
13
|
-
return redirect_to(lolita_resources_path(available_mapping)) if available_mapping
|
6
|
+
return redirect_to(lolita_resources_path(Lolita.mappings.values.first))
|
14
7
|
end
|
15
8
|
render :layout => false
|
16
9
|
end
|
@@ -23,10 +16,6 @@ class Lolita::InfoController < ApplicationController
|
|
23
16
|
end
|
24
17
|
end
|
25
18
|
|
26
|
-
def is_lolita_resource?
|
27
|
-
true
|
28
|
-
end
|
29
|
-
|
30
19
|
private
|
31
20
|
|
32
21
|
def self.property(name, value = nil)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
class Lolita::RestController < ApplicationController
|
2
|
-
include Lolita::
|
2
|
+
include Lolita::Controllers::UserHelpers
|
3
|
+
include Lolita::Controllers::InternalHelpers
|
3
4
|
|
4
5
|
include Lolita::Hooks
|
5
6
|
add_hook :before_new, :after_new, :before_create,:after_create,:before_edit,:after_edit
|
@@ -11,14 +12,12 @@ class Lolita::RestController < ApplicationController
|
|
11
12
|
|
12
13
|
def new
|
13
14
|
self.run(:before_new)
|
14
|
-
authorize!(:create,self.resource_class)
|
15
15
|
build_resource
|
16
16
|
show_form
|
17
17
|
end
|
18
18
|
|
19
19
|
def create
|
20
20
|
self.run(:before_create)
|
21
|
-
authorize!(:create,self.resource_class)
|
22
21
|
build_resource
|
23
22
|
save_and_redirect
|
24
23
|
end
|
@@ -26,14 +25,12 @@ class Lolita::RestController < ApplicationController
|
|
26
25
|
def edit
|
27
26
|
self.run(:before_edit)
|
28
27
|
get_resource
|
29
|
-
authorize!(:update,self.resource)
|
30
28
|
show_form
|
31
29
|
end
|
32
30
|
|
33
31
|
def update
|
34
32
|
self.run(:before_update)
|
35
33
|
get_resource
|
36
|
-
authorize!(:update,self.resource)
|
37
34
|
if self.resource
|
38
35
|
self.resource=resource_with_attributes(self.resource,resource_attributes)
|
39
36
|
save_and_redirect
|
@@ -44,7 +41,6 @@ class Lolita::RestController < ApplicationController
|
|
44
41
|
def destroy
|
45
42
|
self.run(:before_destroy)
|
46
43
|
get_resource
|
47
|
-
authorize!(:destroy, self.resource)
|
48
44
|
if self.resource && self.resource.destroy
|
49
45
|
flash[:notice] = ::I18n.t "lolita.shared.destroy_notice"
|
50
46
|
else
|
@@ -56,7 +52,6 @@ class Lolita::RestController < ApplicationController
|
|
56
52
|
|
57
53
|
def index
|
58
54
|
self.run(:before_index)
|
59
|
-
authorize!(:read,self.resource_class)
|
60
55
|
respond_to do |format|
|
61
56
|
format.html do
|
62
57
|
build_response_for(:list,:page=>page)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
module LolitaHelper
|
2
|
+
|
2
3
|
# Classes for div block that is located to the right of menu
|
3
4
|
# This is helpful because different positionings within it exist depending on action
|
4
5
|
def content_classes
|
@@ -8,16 +9,4 @@ module LolitaHelper
|
|
8
9
|
end
|
9
10
|
classes.join(" ")
|
10
11
|
end
|
11
|
-
|
12
|
-
def include_application_assets
|
13
|
-
result = ""
|
14
|
-
Lolita.application.assets.each do |asset_name|
|
15
|
-
if attr_name.match(/\.js(\.|$)/)
|
16
|
-
result << javascript_include_tag(asset_name)
|
17
|
-
elsif attr_name.match(/\.css(\.|$)/)
|
18
|
-
result << stylesheet_link_tag(asset_name)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
raw(result)
|
22
|
-
end
|
23
12
|
end
|
@@ -1,7 +1,4 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
new_params[:s] = column.sort_params(new_params)
|
6
|
-
%>
|
7
|
-
<%= link_to raw("#{column.title.to_s.capitalize} #{direction_indicator}"), lolita_resources_path(new_params) %>
|
1
|
+
<% param_options=params.reject{|k,v| [:controller,:action].include?(k)} %>
|
2
|
+
<% options=param_options.merge(column.sort_options(params)) %>
|
3
|
+
<% direction_indicator=column.currently_sorting?(params) && options[:sd].to_s=="desc" ? raw('⇑') : raw('⇓') %>
|
4
|
+
<%= link_to raw("#{column.title.to_s.capitalize } #{direction_indicator}"), lolita_resources_path(options) %>
|
@@ -3,5 +3,5 @@
|
|
3
3
|
- editors = resource.send(:"#{field.name.to_s.singularize}_ids")
|
4
4
|
.habtm-container
|
5
5
|
= label_tag "#{resource_name}_#{field.name}_#{value.last}",value.first, :class => "habtm-label"
|
6
|
-
= check_box_tag "#{resource_name}[#{field.name.to_s.singularize}_ids][]", value.last, resource.send(field.name).include?(value.last), :id => "#{resource_name}_#{field.name}_#{value.last}", :class => "habtm-checkbox"
|
6
|
+
= check_box_tag "#{resource_name}[#{field.name.to_s.singularize}_ids][]", value.last, resource.send("#{field.name.to_s.singularize}_ids").include?(value.last), :id => "#{resource_name}_#{field.name}_#{value.last}", :class => "habtm-checkbox"
|
7
7
|
.clear
|
@@ -1 +1 @@
|
|
1
|
-
<div class="disabled-field"><%= raw(
|
1
|
+
<div class="disabled-field"><%= raw(resource.send(field.name)) %></div>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<% end %>
|
6
6
|
<% end %>
|
7
7
|
|
8
|
-
<%= text_area
|
8
|
+
<%= tab_form.text_area field.name, :rows=>(field.rows || 20), :"data-simple"=>field.simple %>
|
9
9
|
<% if @textarea_component_include_tinymce_once.nil? %>
|
10
10
|
<script type="text/javascript">
|
11
11
|
$(document).ready(
|
@@ -1 +1 @@
|
|
1
|
-
<%= paginate page, :theme => "lolita"
|
1
|
+
<%= paginate page, :theme => "lolita" %>
|
@@ -1,10 +1,5 @@
|
|
1
1
|
<div class="boxtitle">
|
2
|
-
<h1 class="black">
|
3
|
-
<%= resource_class.model_name.human(:count=>2) %>
|
4
|
-
<% if list.search %>
|
5
|
-
<%= render_component list.search, :display %>
|
6
|
-
<% end %>
|
7
|
-
</h1>
|
2
|
+
<h1 class="black"><%= resource_class.model_name.human(:count=>2) %></h1>
|
8
3
|
<div class="arrow">
|
9
4
|
</div>
|
10
5
|
</div>
|
@@ -1,14 +1,12 @@
|
|
1
|
-
<div class="nested_form
|
1
|
+
<div class="nested_form" id=<%= "nested_form_#{nested_form.__id__}" %>>
|
2
2
|
<% unless nested_form.field_style == :normal %>
|
3
3
|
<%= render_component *nested_form.as_field.build(:name=>"/lolita/configuration/field", :state => :"label") %>
|
4
4
|
<% end %>
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
<% end %>
|
11
|
-
</div>
|
5
|
+
<%= tab_form.fields_for nested_form.name, resource.send(nested_form.build_method) do |form| %>
|
6
|
+
<% tab_form(form) do %>
|
7
|
+
<%= render_component nested_form, :fields %>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
12
10
|
<% if nested_form.expandable? && !nested_form.update_only? %>
|
13
11
|
<p><%= link_to_add_fields ::I18n.t("lolita.nested_form.add", :resource_name => nested_form.klass.model_name.human.downcase), tab_form, nested_form %> </p>
|
14
12
|
<% end %>
|
@@ -11,22 +11,29 @@
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end %>
|
14
|
-
|
15
|
-
<%
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
14
|
+
<ul <%=!tree.root? ? "class='subtree'" : ""%> >
|
15
|
+
<% last_branch=tree.branches.last %>
|
16
|
+
<%tree.branches.each do |branch|
|
17
|
+
if branch.object.is_a?(Lolita::Mapping)
|
18
|
+
active=if self.respond_to?(:resource_class)
|
19
|
+
branch.object ? branch.object.to==resource_class : false
|
20
|
+
end
|
21
|
+
end
|
22
|
+
unless active
|
23
|
+
active=branch.self_with_children.detect{|b|
|
24
|
+
if b.options[:active].respond_to?(:call)
|
25
|
+
b.options[:active].call(self,branch,b)
|
26
|
+
else
|
27
|
+
b.options[:url]==request.path
|
28
|
+
end
|
29
|
+
}
|
30
|
+
end
|
31
|
+
%>
|
32
|
+
<li class="<%=active ? "active" : ""%> <%=branch.children.branches.any? ? "with-subtree" : ""%> <%=!tree.root? && branch==last_branch ? "last-in-subtree" : ""%>">
|
33
|
+
<%= link_to branch.title, branch.options[:url] || "#" %>
|
34
|
+
<% if branch.children.branches.any? %>
|
35
|
+
<%= render_component(:"lolita/navigation",:tree,:tree=>branch.children) %>
|
29
36
|
<% end %>
|
30
|
-
|
31
|
-
|
32
|
-
|
37
|
+
</li>
|
38
|
+
<% end %>
|
39
|
+
</ul>
|