locomotive_cms 0.0.4.beta12 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +13 -15
- data/README.textile +4 -5
- data/app/controllers/admin/api_contents_controller.rb +1 -10
- data/app/controllers/admin/base_controller.rb +2 -2
- data/app/controllers/admin/cross_domain_sessions_controller.rb +4 -7
- data/app/controllers/admin/current_sites_controller.rb +0 -2
- data/app/controllers/admin/imports_controller.rb +19 -13
- data/app/controllers/admin/pages_controller.rb +1 -1
- data/app/controllers/admin/passwords_controller.rb +2 -2
- data/app/controllers/admin/sessions_controller.rb +2 -2
- data/app/controllers/admin/sites_controller.rb +0 -2
- data/app/controllers/admin/theme_assets_controller.rb +1 -1
- data/app/controllers/application_controller.rb +1 -1
- data/app/controllers/home_controller.rb +7 -0
- data/app/helpers/admin/assets_helper.rb +6 -0
- data/app/helpers/admin/custom_fields_helper.rb +2 -2
- data/app/helpers/admin/{box_helper.rb → login_helper.rb} +3 -7
- data/app/models/asset_collection.rb +3 -15
- data/app/models/content_instance.rb +0 -19
- data/app/models/content_type.rb +3 -21
- data/app/models/extensions/page/tree.rb +7 -63
- data/app/models/page.rb +0 -2
- data/app/models/site.rb +3 -15
- data/app/uploaders/asset_uploader.rb +1 -1
- data/app/uploaders/theme_asset_uploader.rb +1 -12
- data/app/views/admin/asset_collections/edit.html.haml +2 -2
- data/app/views/admin/asset_collections/new.html.haml +1 -1
- data/app/views/admin/assets/_form.html.haml +2 -2
- data/app/views/admin/content_types/_form.html.haml +2 -2
- data/app/views/admin/content_types/new.html.haml +1 -1
- data/app/views/admin/contents/_form.html.haml +2 -2
- data/app/views/admin/contents/index.html.haml +1 -1
- data/app/views/admin/cross_domain_sessions/new.html.haml +1 -1
- data/app/views/admin/current_sites/_form.html.haml +3 -3
- data/app/views/admin/current_sites/edit.html.haml +1 -1
- data/app/views/admin/imports/new.html.haml +0 -11
- data/app/views/admin/imports/show.html.haml +1 -1
- data/app/views/admin/my_accounts/edit.html.haml +1 -1
- data/app/views/admin/pages/_form.html.haml +3 -2
- data/app/views/admin/pages/_page.html.haml +2 -4
- data/app/views/admin/pages/index.html.haml +1 -1
- data/app/views/admin/passwords/edit.html.haml +2 -2
- data/app/views/admin/passwords/new.html.haml +2 -2
- data/app/views/admin/sessions/new.html.haml +2 -2
- data/app/views/admin/shared/_head.html.haml +5 -4
- data/app/views/admin/shared/menu/_contents.html.haml +1 -1
- data/app/views/admin/sites/_form.html.haml +3 -3
- data/app/views/admin/snippets/_form.html.haml +2 -2
- data/app/views/admin/snippets/index.html.haml +15 -0
- data/app/views/admin/theme_assets/_form.html.haml +2 -2
- data/app/views/admin/theme_assets/index.html.haml +1 -1
- data/app/views/home/show.html.haml +4 -0
- data/app/views/{admin/layouts → layouts/admin}/application.html.haml +0 -0
- data/app/views/layouts/admin/box.html.haml +19 -0
- data/app/views/layouts/application.html.haml +7 -0
- data/config/application.rb +3 -1
- data/config/environments/development.rb +6 -1
- data/config/environments/production.rb +1 -1
- data/config/environments/test.rb +5 -1
- data/config/initializers/locomotive.rb +0 -14
- data/config/locales/admin_ui_en.yml +1 -33
- data/config/locales/admin_ui_fr.yml +1 -34
- data/config/locales/default_en.yml +0 -1
- data/config/locales/default_fr.yml +0 -1
- data/config/locales/flash.en.yml +0 -1
- data/config/locales/flash.fr.yml +0 -1
- data/config/mongoid.yml +5 -13
- data/config/routes.rb +1 -6
- data/lib/generators/locomotive/copy_assets/copy_assets_generator.rb +14 -0
- data/lib/generators/locomotive/install/install_generator.rb +10 -18
- data/lib/generators/locomotive/install/templates/README +13 -23
- data/lib/generators/locomotive/install/templates/locomotive.rb +1 -15
- data/lib/locomotive/carrierwave.rb +0 -1
- data/lib/locomotive/configuration.rb +1 -3
- data/lib/locomotive/custom_fields.rb +1 -0
- data/lib/locomotive/delayed_job.rb +2 -1
- data/lib/locomotive/engine.rb +7 -24
- data/lib/locomotive/heroku.rb +0 -1
- data/lib/locomotive/httparty/webservice.rb +1 -12
- data/lib/locomotive/import.rb +0 -2
- data/lib/locomotive/import/asset_collections.rb +8 -40
- data/lib/locomotive/import/assets.rb +12 -20
- data/lib/locomotive/import/content_types.rb +15 -51
- data/lib/locomotive/import/job.rb +11 -106
- data/lib/locomotive/import/pages.rb +26 -79
- data/lib/locomotive/import/site.rb +5 -3
- data/lib/locomotive/import/snippets.rb +8 -6
- data/lib/locomotive/inherited_resources.rb +0 -1
- data/lib/locomotive/liquid/drops/asset_collections.rb +4 -4
- data/lib/locomotive/liquid/drops/contents.rb +16 -21
- data/lib/locomotive/liquid/drops/page.rb +0 -4
- data/lib/locomotive/liquid/filters/html.rb +29 -15
- data/lib/locomotive/liquid/tags/consume.rb +1 -1
- data/lib/locomotive/liquid/tags/nav.rb +17 -48
- data/lib/locomotive/liquid/tags/paginate.rb +3 -3
- data/lib/locomotive/middlewares/fonts.rb +11 -3
- data/lib/locomotive/misc_form_builder.rb +7 -2
- data/lib/locomotive/regexps.rb +1 -1
- data/lib/locomotive/render.rb +3 -9
- data/lib/locomotive/routing/site_dispatcher.rb +6 -10
- data/lib/locomotive/version.rb +1 -2
- data/public/images/admin/box/buttons/right_bg.png +0 -0
- data/public/javascripts/admin/aloha/VERSION.txt +1 -1
- data/public/javascripts/admin/aloha/aloha-nodeps.js +101 -140
- data/public/javascripts/admin/aloha/aloha.js +105 -193
- data/public/javascripts/admin/aloha/css/aloha.css +4 -65
- data/public/javascripts/admin/aloha/deps/prettyPhoto/resources/css/prettyPhoto.css +2 -2
- data/public/javascripts/admin/aloha/i18n/de.dict +0 -2
- data/public/javascripts/admin/aloha/i18n/en.dict +0 -2
- data/public/javascripts/admin/aloha/images/base.png +0 -0
- data/public/javascripts/admin/aloha/images/base_multi.png +0 -0
- data/public/javascripts/admin/aloha/images/fade_in.png +0 -0
- data/public/javascripts/admin/aloha/images/fade_out.png +0 -0
- data/public/javascripts/admin/aloha/images/gentics_logo.png +0 -0
- data/public/javascripts/admin/aloha/images/grabhandle.png +0 -0
- data/public/javascripts/admin/aloha/images/maximize.png +0 -0
- data/public/javascripts/admin/aloha/images/pin.png +0 -0
- data/public/javascripts/admin/aloha/images/removeformat.png +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/de.dict +2 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/en.dict +2 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/eo.dict +2 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/fi.dict +2 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/fr.dict +2 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/it.dict +2 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/plugin.js +7 -0
- data/public/javascripts/admin/aloha/plugins/{com.example.aloha.plugins.Save → com.example.aloha.DummySave}/i18n/de.dict +0 -0
- data/public/javascripts/admin/aloha/plugins/{com.example.aloha.plugins.Save → com.example.aloha.DummySave}/i18n/en.dict +0 -0
- data/public/javascripts/admin/aloha/plugins/{com.example.aloha.plugins.Save → com.example.aloha.DummySave}/i18n/fi.dict +0 -0
- data/public/javascripts/admin/aloha/plugins/{com.example.aloha.plugins.Save → com.example.aloha.DummySave}/i18n/fr.dict +0 -0
- data/public/javascripts/admin/aloha/plugins/{com.example.aloha.plugins.Save → com.example.aloha.DummySave}/i18n/it.dict +0 -0
- data/public/javascripts/admin/aloha/plugins/{com.example.aloha.plugins.Save → com.example.aloha.DummySave}/plugin.js +0 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Format/plugin.js +1 -1
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/de.dict +20 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/en.dict +20 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/eo.dict +16 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/fi.dict +20 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/fr.dict +16 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/it.dict +20 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/plugin.js +7 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.HighlightEditables/plugin.js +1 -1
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/css/jquery.autocomplete.css +48 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/deps/jquery.autocomplete.js +1 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/plugin.js +1 -1
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/ressource.js +7 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/ressourcedummy.js +7 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/ressourceregistry.js +7 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.List/plugin.js +1 -1
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.TOC/plugin.js +1 -1
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/i18n/de.dict +0 -2
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/i18n/en.dict +0 -2
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/plugin.js +1 -1
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/resources/table.css +110 -28
- data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Loader/plugin.js +1 -0
- data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Person/i18n/en.dict +2 -0
- data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Person/i18n/fi.dict +2 -0
- data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Person/i18n/fr.dict +2 -0
- data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Person/person.css +3 -0
- data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Person/plugin.js +1 -0
- data/public/javascripts/admin/aloha/plugins/simpletable/plugin.js.deactivated +2330 -0
- data/public/javascripts/admin/asset_collections.js +7 -11
- data/public/javascripts/admin/contents.js +1 -3
- data/public/javascripts/admin/site.js +3 -9
- data/public/javascripts/admin/snippets.js +1 -1
- data/public/javascripts/admin/utils.js +3 -5
- data/public/stylesheets/admin/application.css +1 -1
- data/public/stylesheets/admin/box.css +5 -5
- data/public/stylesheets/admin/buttons.css +5 -0
- data/public/stylesheets/admin/formtastic_changes.css +12 -5
- data/public/stylesheets/admin/inline_editor.css +5 -22
- data/public/stylesheets/admin/layout.css +4 -9
- metadata +130 -187
- data/app/controllers/admin/installation_controller.rb +0 -79
- data/app/uploaders/theme_uploader.rb +0 -19
- data/app/views/admin/errors/no_page.html.haml +0 -1
- data/app/views/admin/errors/no_site.html.haml +0 -1
- data/app/views/admin/installation/step_1.html.haml +0 -24
- data/app/views/admin/installation/step_2.html.haml +0 -26
- data/app/views/admin/installation/step_3.html.haml +0 -23
- data/app/views/admin/layouts/box.html.haml +0 -21
- data/app/views/admin/layouts/error.html.haml +0 -1
- data/config/assets.yml +0 -96
- data/config/initializers/carrierwave.rb +0 -17
- data/lib/locomotive/import/base.rb +0 -46
- data/lib/locomotive/import/logger.rb +0 -13
- data/lib/locomotive/railties/tasks.rake +0 -16
- data/public/javascripts/admin/aloha/i18n/pl.dict +0 -5
- data/public/javascripts/admin/aloha/images/base_big.png +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/examples/triSports.css +0 -86
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/examples/triSports.html +0 -44
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/i18n/de.dict +0 -4
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/i18n/en.dict +0 -4
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/i18n/fr.dict +0 -4
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/plugin.js +0 -1
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/product.js +0 -1
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/2xu-wetsuit.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/asics-noosa.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/fivefingers-kso.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/kuota-kueen-k.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/mizuno-wave-musha2.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/product.css +0 -69
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/product_button.gif +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/simplon-mrt.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/trek-fuel-ex.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/trisports.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/zoggs-predator.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Abbr/examples/AlohaAbbr.css +0 -48
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Abbr/examples/AlohaAbbr.html +0 -69
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Abbr/i18n/de.dict +0 -4
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Abbr/i18n/en.dict +0 -4
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Abbr/plugin.js +0 -7
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Format/i18n/pl.dict +0 -30
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/LinkList.js +0 -7
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/delicious.js +0 -7
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/i18n/pl.dict +0 -4
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/css/LinkChecker.css +0 -14
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/examples/AlohaLinkChecker.css +0 -49
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/examples/AlohaLinkChecker.html +0 -82
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/i18n/en.dict +0 -27
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/plugin.js +0 -7
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/proxy.php +0 -235
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Paste/plugin.js +0 -7
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Paste/wordpastehandler.js +0 -7
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.TOC/i18n/de.dict +0 -1
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.TOC/i18n/en.dict +0 -1
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/i18n/pl.dict +0 -12
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/resources/wai_green.png +0 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/resources/wai_red.png +0 -0
- data/public/stylesheets/admin/installation.css +0 -50
- data/public/stylesheets/admin/safari.css +0 -15
@@ -27,65 +27,11 @@ module Models
|
|
27
27
|
alias :descendants :hacked_descendants
|
28
28
|
end
|
29
29
|
|
30
|
-
module ClassMethods
|
31
|
-
|
32
|
-
# Warning: used only in read-only
|
33
|
-
def quick_tree(site)
|
34
|
-
pages = site.pages.minimal_attributes.order_by([[:depth, :asc], [:position, :asc]]).to_a
|
35
|
-
|
36
|
-
tmp = []
|
37
|
-
|
38
|
-
while !pages.empty?
|
39
|
-
tmp << _quick_tree(pages.delete_at(0), pages)
|
40
|
-
end
|
41
|
-
|
42
|
-
tmp
|
43
|
-
end
|
44
|
-
|
45
|
-
def _quick_tree(current_page, pages)
|
46
|
-
i, children = 0, []
|
47
|
-
|
48
|
-
while !pages.empty?
|
49
|
-
page = pages[i]
|
50
|
-
|
51
|
-
break if page.nil?
|
52
|
-
|
53
|
-
if page.parent_id == current_page.id
|
54
|
-
page = pages.delete_at(i)
|
55
|
-
|
56
|
-
children << _quick_tree(page, pages)
|
57
|
-
else
|
58
|
-
i += 1
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
current_page.instance_eval do
|
63
|
-
def children=(list); @children = list; end
|
64
|
-
def children; @children || []; end
|
65
|
-
end
|
66
|
-
|
67
|
-
current_page.children = children
|
68
|
-
|
69
|
-
current_page
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
73
|
-
|
74
30
|
module InstanceMethods
|
75
31
|
|
76
|
-
def children?
|
77
|
-
self.class.where(self.parent_id_field => self.id).count
|
78
|
-
end
|
79
|
-
|
80
|
-
def children_with_minimal_attributes
|
81
|
-
self.class.where(self.parent_id_field => self.id).
|
82
|
-
order_by(self.tree_order).
|
83
|
-
minimal_attributes
|
84
|
-
end
|
85
|
-
|
86
32
|
def sort_children!(ids)
|
87
33
|
ids.each_with_index do |id, position|
|
88
|
-
child = self.children.detect { |p| p._id ==
|
34
|
+
child = self.children.detect { |p| p._id == id }
|
89
35
|
child.position = position
|
90
36
|
child.save
|
91
37
|
end
|
@@ -98,7 +44,10 @@ module Models
|
|
98
44
|
end
|
99
45
|
|
100
46
|
def hacked_descendants
|
101
|
-
|
47
|
+
# workorund for mongoid unexpected behavior
|
48
|
+
_new_record_var = self.instance_variable_get(:@new_record)
|
49
|
+
_new_record = _new_record_var != false
|
50
|
+
return [] if _new_record
|
102
51
|
self.class.all_in(path_field => [self._id]).order_by tree_order
|
103
52
|
end
|
104
53
|
|
@@ -107,12 +56,7 @@ module Models
|
|
107
56
|
def change_parent
|
108
57
|
if self.parent_id_changed?
|
109
58
|
self.fix_position(false)
|
110
|
-
|
111
|
-
unless self.parent_id_was.nil?
|
112
|
-
self.position = nil # make it move to bottom
|
113
|
-
self.add_to_list_bottom
|
114
|
-
end
|
115
|
-
|
59
|
+
self.add_to_list_bottom
|
116
60
|
self.instance_variable_set :@_will_move, true
|
117
61
|
end
|
118
62
|
end
|
@@ -137,7 +81,7 @@ module Models
|
|
137
81
|
end
|
138
82
|
|
139
83
|
def add_to_list_bottom
|
140
|
-
self.position
|
84
|
+
self.position = (::Page.where(:_id.ne => self._id).and(:parent_id => self.parent_id).max(:position) || 0) + 1
|
141
85
|
end
|
142
86
|
|
143
87
|
def remove_from_list
|
data/app/models/page.rb
CHANGED
@@ -40,8 +40,6 @@ class Page
|
|
40
40
|
scope :index, :where => { :slug => 'index', :depth => 0 }
|
41
41
|
scope :not_found, :where => { :slug => '404', :depth => 0 }
|
42
42
|
scope :published, :where => { :published => true }
|
43
|
-
scope :fullpath, lambda { |fullpath| { :where => { :fullpath => fullpath } } }
|
44
|
-
scope :minimal_attributes, :only => %w(title slug fullpath position depth published templatized parent_id created_at updated_at)
|
45
43
|
|
46
44
|
## methods ##
|
47
45
|
|
data/app/models/site.rb
CHANGED
@@ -40,14 +40,6 @@ class Site
|
|
40
40
|
|
41
41
|
## methods ##
|
42
42
|
|
43
|
-
def all_pages_in_once
|
44
|
-
Page.quick_tree(self)
|
45
|
-
end
|
46
|
-
|
47
|
-
def domains=(array)
|
48
|
-
array = [] if array.blank?; super(array)
|
49
|
-
end
|
50
|
-
|
51
43
|
def accounts
|
52
44
|
Account.criteria.in(:_id => self.memberships.collect(&:account_id))
|
53
45
|
end
|
@@ -58,19 +50,15 @@ class Site
|
|
58
50
|
|
59
51
|
def add_subdomain_to_domains
|
60
52
|
self.domains ||= []
|
61
|
-
(self.domains << self.
|
53
|
+
(self.domains << "#{self.subdomain}.#{Locomotive.config.default_domain}").uniq!
|
62
54
|
end
|
63
55
|
|
64
56
|
def domains_without_subdomain
|
65
|
-
(self.domains || []) - [self.
|
57
|
+
(self.domains || []) - ["#{self.subdomain}.#{Locomotive.config.default_domain}"]
|
66
58
|
end
|
67
59
|
|
68
60
|
def domains_with_subdomain
|
69
|
-
((self.domains || []) + [self.
|
70
|
-
end
|
71
|
-
|
72
|
-
def full_subdomain
|
73
|
-
"#{self.subdomain}.#{Locomotive.config.default_domain}"
|
61
|
+
((self.domains || []) + ["#{self.subdomain}.#{Locomotive.config.default_domain}"]).uniq
|
74
62
|
end
|
75
63
|
|
76
64
|
def to_liquid
|
@@ -60,7 +60,7 @@ class AssetUploader < CarrierWave::Uploader::Base
|
|
60
60
|
|
61
61
|
def self.content_types
|
62
62
|
{
|
63
|
-
:image => ['image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png', 'image/jpg'
|
63
|
+
:image => ['image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png', 'image/jpg'],
|
64
64
|
:video => [/^video/, 'application/x-shockwave-flash', 'application/x-swf'],
|
65
65
|
:audio => [/^audio/, 'application/ogg', 'application/x-mp3'],
|
66
66
|
:pdf => ['application/pdf', 'application/x-pdf'],
|
@@ -15,18 +15,7 @@ class ThemeAssetUploader < AssetUploader
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def extension_white_list
|
18
|
-
%w(jpg jpeg gif png css js swf flv eot svg ttf woff
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.url_for(site, path)
|
22
|
-
build(site, path).url
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.build(site, path)
|
26
|
-
asset = ThemeAsset.new(:site => site, :folder => File.dirname(path))
|
27
|
-
uploader = ThemeAssetUploader.new(asset)
|
28
|
-
uploader.retrieve_from_store!(File.basename(path))
|
29
|
-
uploader
|
18
|
+
%w(jpg jpeg gif png css js swf flv eot svg ttf woff)
|
30
19
|
end
|
31
20
|
|
32
21
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
- title link_to(@asset_collection.name.blank? ? @asset_collection.name_was : @asset_collection.name, '#', :rel => 'asset_collection_name', :title => t('.ask_for_name'), :class => 'editable')
|
2
2
|
|
3
3
|
- content_for :head do
|
4
|
-
=
|
5
|
-
=
|
4
|
+
= javascript_include_tag 'admin/plugins/fancybox', 'admin/asset_collections', 'admin/custom_fields'
|
5
|
+
= stylesheet_link_tag 'admin/plugins/fancybox', 'admin/fancybox_changes'
|
6
6
|
|
7
7
|
- content_for :submenu do
|
8
8
|
= render 'admin/shared/menu/assets'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
- content_for :head do
|
2
|
-
=
|
3
|
-
=
|
2
|
+
= javascript_include_tag 'admin/plugins/tiny_mce/tinymce', 'admin/plugins/json2', 'admin/plugins/fancybox', 'admin/custom_fields/category', 'admin/assets'
|
3
|
+
= stylesheet_link_tag 'admin/plugins/fancybox', 'admin/box'
|
4
4
|
|
5
5
|
= f.inputs :name => :information do
|
6
6
|
= f.input :name
|
@@ -1,6 +1,6 @@
|
|
1
1
|
- content_for :head do
|
2
|
-
=
|
3
|
-
=
|
2
|
+
= javascript_include_tag 'admin/plugins/fancybox', 'admin/custom_fields'
|
3
|
+
= stylesheet_link_tag 'admin/plugins/fancybox', 'admin/fancybox_changes'
|
4
4
|
|
5
5
|
= f.inputs :name => :information do
|
6
6
|
= f.input :name
|
@@ -1,5 +1,5 @@
|
|
1
1
|
- content_for :head do
|
2
|
-
=
|
3
|
-
=
|
2
|
+
= javascript_include_tag 'admin/plugins/tiny_mce/tinymce', 'admin/plugins/json2', 'admin/plugins/fancybox', 'admin/custom_fields/category', 'admin/contents'
|
3
|
+
= stylesheet_link_tag 'admin/plugins/fancybox', 'admin/fancybox_changes'
|
4
4
|
|
5
5
|
= render 'admin/custom_fields/custom_form', :form => f, :title => :attributes, :parent => @content_type
|
@@ -1,5 +1,5 @@
|
|
1
1
|
- content_for :head do
|
2
|
-
=
|
2
|
+
= javascript_include_tag 'admin/site'
|
3
3
|
|
4
4
|
= f.foldable_inputs :name => :information, :style => "#{'display: none' unless @site.new_record?}" do
|
5
5
|
= f.input :name, :required => false
|
@@ -23,7 +23,7 @@
|
|
23
23
|
%li{ :class => "item added #{'last' if index == @site.domains.size - 1}"}
|
24
24
|
%em
|
25
25
|
http://
|
26
|
-
= text_field_tag '
|
26
|
+
= text_field_tag 'current_site[domains][]', name
|
27
27
|
|
28
28
|
= error_on_domain(@site, name)
|
29
29
|
%span.actions
|
@@ -32,7 +32,7 @@
|
|
32
32
|
%li.item.template
|
33
33
|
%em
|
34
34
|
http://
|
35
|
-
= text_field_tag 'label', t('formtastic.hints.site.domain_name'), :class => 'string label void
|
35
|
+
= text_field_tag 'label', t('formtastic.hints.site.domain_name'), :class => 'string label void'
|
36
36
|
|
37
37
|
%span.actions
|
38
38
|
= link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove first', :confirm => t('admin.messages.confirm')
|
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
%p!= t('.help')
|
11
11
|
|
12
|
-
= semantic_form_for @site, :url => admin_current_site_url, :html => { :class => 'save-with-shortcut' } do |f|
|
12
|
+
= semantic_form_for @site, :as => :current_site, :url => admin_current_site_url, :html => { :class => 'save-with-shortcut' } do |f|
|
13
13
|
|
14
14
|
= render 'form', :f => f
|
15
15
|
|
@@ -18,15 +18,4 @@
|
|
18
18
|
%p.inline-errors= @error
|
19
19
|
%p.inline-hints= t('formtastic.hints.import.source')
|
20
20
|
|
21
|
-
%li.input.toggle
|
22
|
-
= label_tag 'samples', t('formtastic.labels.import.new.samples')
|
23
|
-
= check_box_tag 'samples'
|
24
|
-
%p.inline-hints= t('formtastic.hints.import.samples')
|
25
|
-
|
26
|
-
%li.input.toggle
|
27
|
-
= label_tag 'reset', t('formtastic.labels.import.new.reset')
|
28
|
-
= check_box_tag 'reset'
|
29
|
-
%p.inline-hints= t('formtastic.hints.import.reset')
|
30
|
-
|
31
|
-
|
32
21
|
= render 'admin/shared/form_actions', :button_label => :send
|
@@ -1,7 +1,7 @@
|
|
1
1
|
- title link_to(@account.name.blank? ? @account.name_was : @account.name, '#', :rel => 'my_account_name', :title => t('.ask_for_name'), :class => 'editable')
|
2
2
|
|
3
3
|
- content_for :head do
|
4
|
-
=
|
4
|
+
= javascript_include_tag 'admin/account'
|
5
5
|
|
6
6
|
- content_for :submenu do
|
7
7
|
= render 'admin/shared/menu/settings'
|
@@ -1,6 +1,7 @@
|
|
1
1
|
- content_for :head do
|
2
|
-
=
|
3
|
-
=
|
2
|
+
= javascript_include_tag 'admin/plugins/tiny_mce/tinymce', 'admin/plugins/codemirror/codemirror', 'admin/pages', 'admin/editable_elements'
|
3
|
+
= stylesheet_link_tag 'admin/editable_elements'
|
4
|
+
= image_picker_include_tags
|
4
5
|
|
5
6
|
= f.foldable_inputs :name => :information do
|
6
7
|
|
@@ -1,7 +1,5 @@
|
|
1
1
|
%li{ :id => "item-#{page.id}", :class => "#{'not-found' if page.not_found? } #{'templatized' if page.templatized?}"}
|
2
|
-
-
|
3
|
-
|
4
|
-
- if not page.index? and with_children
|
2
|
+
- if not page.index? and not page.children.empty?
|
5
3
|
= image_tag 'admin/list/icons/node_closed.png', :class => 'toggler'
|
6
4
|
%em
|
7
5
|
%strong= link_to truncate(page.title, :length => 80), edit_admin_page_url(page)
|
@@ -13,6 +11,6 @@
|
|
13
11
|
- if not page.index? and not page.not_found?
|
14
12
|
= link_to image_tag('admin/list/icons/trash.png'), admin_page_url(page), :class => 'remove', :confirm => t('admin.messages.confirm'), :method => :delete
|
15
13
|
|
16
|
-
- if
|
14
|
+
- if not page.children.empty?
|
17
15
|
%ul{ :id => "folder-#{page._id}", :class => "folder depth-#{(page.depth || 0) + 1}", :data_url => sort_admin_page_url(page), :style => "display: #{cookies["folder-#{page._id}"] || 'block'}" }
|
18
16
|
= render page.children
|
@@ -5,7 +5,7 @@
|
|
5
5
|
= f.hidden_field :reset_password_token
|
6
6
|
|
7
7
|
.inner
|
8
|
-
=
|
8
|
+
= login_flash_message
|
9
9
|
|
10
10
|
= f.inputs do
|
11
11
|
= f.input :password, :label => t('.password'), :required => false
|
@@ -15,4 +15,4 @@
|
|
15
15
|
= link_to preserve(t('.link')), new_admin_session_path
|
16
16
|
|
17
17
|
.footer
|
18
|
-
=
|
18
|
+
= login_button_tag t('admin.buttons.change_password')
|
@@ -5,7 +5,7 @@
|
|
5
5
|
= f.hidden_field :reset_password_token
|
6
6
|
|
7
7
|
.inner
|
8
|
-
=
|
8
|
+
= login_flash_message
|
9
9
|
|
10
10
|
= f.inputs do
|
11
11
|
= f.input :email, :label => t('.email'), :required => false
|
@@ -14,4 +14,4 @@
|
|
14
14
|
= link_to preserve(t('.link')), new_admin_session_path
|
15
15
|
|
16
16
|
.footer
|
17
|
-
=
|
17
|
+
= login_button_tag t('admin.buttons.send_password')
|
@@ -4,7 +4,7 @@
|
|
4
4
|
= f.hidden_field :remember_me, :value => 'true'
|
5
5
|
|
6
6
|
.inner
|
7
|
-
=
|
7
|
+
= login_flash_message
|
8
8
|
|
9
9
|
= f.inputs do
|
10
10
|
= f.input :email, :label => t('.email'), :required => false
|
@@ -14,4 +14,4 @@
|
|
14
14
|
= link_to t('.link'), new_admin_password_path
|
15
15
|
|
16
16
|
.footer
|
17
|
-
=
|
17
|
+
= login_button_tag t('admin.buttons.login')
|
@@ -4,12 +4,13 @@
|
|
4
4
|
|
5
5
|
%meta{ :name => 'locale', :content => I18n.locale }
|
6
6
|
|
7
|
-
=
|
7
|
+
= stylesheet_link_tag 'admin/blueprint/screen', :media => 'screen'
|
8
|
+
/ [if IE]
|
9
|
+
= stylesheet_link_tag 'admin/blueprint/ie', :media => 'screen'
|
8
10
|
|
9
|
-
=
|
11
|
+
= stylesheet_link_tag 'admin/layout', 'admin/jquery/ui', 'admin/plugins/toggle', 'admin/plugins/selectmenu', 'admin/menu', 'admin/plugins/toggle','admin/buttons', 'admin/formtastic', 'admin/formtastic_changes', 'admin/application', :media => 'screen', :cache => Rails.env.production? && !Locomotive.heroku?
|
10
12
|
|
11
|
-
/
|
12
|
-
= include_stylesheets :ie, :media => 'screen'
|
13
|
+
= javascript_include_tag 'admin/jquery', 'admin/jquery.ui', 'admin/rails', 'admin/utils', 'admin/plugins/subscribe', 'admin/plugins/shortcut', 'admin/plugins/toggle', 'admin/plugins/growl', 'admin/plugins/cookie', 'admin/plugins/selectmenu', 'admin/application', 'admin/locales/datepicker_fr', :cache => Rails.env.production? && !Locomotive.heroku?
|
13
14
|
|
14
15
|
%script{ :type => 'text/javascript' }
|
15
16
|
= find_and_preserve(growl_message)
|
@@ -5,7 +5,7 @@
|
|
5
5
|
.inner
|
6
6
|
%h2!= t('admin.pages.index.lastest_items')
|
7
7
|
%ul
|
8
|
-
- current_site.pages.latest_updated.
|
8
|
+
- current_site.pages.latest_updated.each do |page|
|
9
9
|
%li
|
10
10
|
= link_to truncate(page.title, :length => 25), edit_admin_page_url(page)
|
11
11
|
%span= time_ago_in_words(page.updated_at)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
- content_for :head do
|
2
|
-
=
|
2
|
+
= javascript_include_tag 'admin/site'
|
3
3
|
|
4
4
|
= f.foldable_inputs :name => :information, :style => "#{'display: none' unless @site.new_record?}" do
|
5
5
|
= f.input :name, :required => false
|
@@ -18,7 +18,7 @@
|
|
18
18
|
%li{ :class => "item added #{'last' if index == @site.domains.size - 1}"}
|
19
19
|
%em
|
20
20
|
http://
|
21
|
-
= text_field_tag 'site[domains][]', name
|
21
|
+
= text_field_tag 'site[domains][]', name
|
22
22
|
|
23
23
|
= error_on_domain(@site, name)
|
24
24
|
%span.actions
|
@@ -27,7 +27,7 @@
|
|
27
27
|
%li.item.template
|
28
28
|
%em
|
29
29
|
http://
|
30
|
-
= text_field_tag 'label', t('formtastic.hints.site.domain_name'), :class => 'string label void
|
30
|
+
= text_field_tag 'label', t('formtastic.hints.site.domain_name'), :class => 'string label void'
|
31
31
|
|
32
32
|
%span.actions
|
33
33
|
= link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove first', :confirm => t('admin.messages.confirm')
|