rebuilding the editing page for the site (wip)
This commit is contained in:
parent
2a5861e8a7
commit
cffe64f6be
2
.gitignore
vendored
2
.gitignore
vendored
@ -37,3 +37,5 @@ doc/bushido
|
|||||||
.sass-cache/
|
.sass-cache/
|
||||||
spec/dummy/tmp/
|
spec/dummy/tmp/
|
||||||
spec/dummy/log/*.log
|
spec/dummy/log/*.log
|
||||||
|
app/assets/javascripts/old/
|
||||||
|
app/assets/stylesheets/old/
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
#= require ../shared/form_view
|
||||||
|
|
||||||
|
Locomotive.Views.CurrentSite ||= {}
|
||||||
|
|
||||||
|
class Locomotive.Views.CurrentSite.EditView extends Locomotive.Views.Shared.FormView
|
@ -18,8 +18,6 @@ class Locomotive.Views.Pages.FormView extends Locomotive.Views.Shared.FormView
|
|||||||
|
|
||||||
@model = new Locomotive.Models.Page(@options.page)
|
@model = new Locomotive.Models.Page(@options.page)
|
||||||
|
|
||||||
window.foo = @model
|
|
||||||
|
|
||||||
@filled_slug = @touched_url = false
|
@filled_slug = @touched_url = false
|
||||||
@image_picker_view = new Locomotive.Views.ThemeAssets.ImagePickerView
|
@image_picker_view = new Locomotive.Views.ThemeAssets.ImagePickerView
|
||||||
collection: new Locomotive.Models.ThemeAssetsCollection()
|
collection: new Locomotive.Models.ThemeAssetsCollection()
|
||||||
|
@ -193,10 +193,10 @@ body {
|
|||||||
} // #content
|
} // #content
|
||||||
|
|
||||||
#footer {
|
#footer {
|
||||||
padding-top: 10px;
|
padding-top: 0;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
padding: 15px 8px 0 0;
|
padding: 10px 8px 0 0;
|
||||||
|
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color: #E6E6E6;
|
color: #E6E6E6;
|
||||||
|
29
app/inputs/locomotive/empty_input.rb
Normal file
29
app/inputs/locomotive/empty_input.rb
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
module Locomotive
|
||||||
|
class EmptyInput # < Formtastic::Inputs::HiddenInput
|
||||||
|
include Formtastic::Inputs::Base
|
||||||
|
|
||||||
|
def to_html
|
||||||
|
input_wrapping do
|
||||||
|
label_html
|
||||||
|
# render nothing
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def error_html
|
||||||
|
""
|
||||||
|
end
|
||||||
|
|
||||||
|
def errors?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
|
# def hint_html
|
||||||
|
# ""
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# def hint?
|
||||||
|
# false
|
||||||
|
# end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
21
app/inputs/locomotive/subdomain_input.rb
Normal file
21
app/inputs/locomotive/subdomain_input.rb
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
module Locomotive
|
||||||
|
class SubdomainInput < Formtastic::Inputs::TextInput
|
||||||
|
|
||||||
|
def wrapper_html_options
|
||||||
|
super.tap do |opts|
|
||||||
|
opts[:class] += ' path'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def to_html
|
||||||
|
domain = options.delete(:domain)
|
||||||
|
|
||||||
|
input_wrapping do
|
||||||
|
label_html <<
|
||||||
|
builder.text_field(method, input_html_options) <<
|
||||||
|
template.content_tag(:em, ".#{domain}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
@ -1,10 +1,6 @@
|
|||||||
module Locomotive
|
module Locomotive
|
||||||
class ToggleInput < Formtastic::Inputs::BooleanInput
|
class ToggleInput < Formtastic::Inputs::BooleanInput
|
||||||
|
|
||||||
# def label_text_with_embedded_checkbox
|
|
||||||
# label_text #<< "" << check_box_html
|
|
||||||
# end
|
|
||||||
|
|
||||||
def to_html
|
def to_html
|
||||||
input_wrapping do
|
input_wrapping do
|
||||||
hidden_field_html <<
|
hidden_field_html <<
|
||||||
|
@ -49,6 +49,10 @@ module Locomotive
|
|||||||
Locomotive::Liquid::Drops::Site.new(self)
|
Locomotive::Liquid::Drops::Site.new(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def to_json
|
||||||
|
Locomotive::SitePresenter.new(self).as_json
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def create_default_pages!
|
def create_default_pages!
|
||||||
|
11
app/presenters/locomotive/site_presenter.rb
Normal file
11
app/presenters/locomotive/site_presenter.rb
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
module Locomotive
|
||||||
|
class SitePresenter < BasePresenter
|
||||||
|
|
||||||
|
delegate :name, :subdomain, :domains, :robots_txt, :seo_title, :meta_keywords, :meta_description, :domains_without_subdomain, :to => :source
|
||||||
|
|
||||||
|
def included_methods
|
||||||
|
super + %w(name subdomain domains robots_txt seo_title meta_keywords meta_description domains_without_subdomain)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
11
app/views/locomotive/current_site/_domain.html.haml
Normal file
11
app/views/locomotive/current_site/_domain.html.haml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
%script{ :type => 'text/html', :id => 'domain_entry' }
|
||||||
|
|
||||||
|
%em
|
||||||
|
http://
|
||||||
|
= text_field_tag 'site[domains][]', '{{name}}', :class => 'string label void domain'
|
||||||
|
|
||||||
|
{{#if error}}
|
||||||
|
%span.inline-errors {{error}}
|
||||||
|
{{/if}}
|
||||||
|
%span.actions
|
||||||
|
= link_to 'x', '#', :class => 'remove'
|
@ -1,3 +1,10 @@
|
|||||||
|
- content_for :head do
|
||||||
|
= render 'domain'
|
||||||
|
|
||||||
|
- content_for :backbone_view_data do
|
||||||
|
:plain
|
||||||
|
{ site: #{@site.to_json}, errors: #{@site.errors.to_json} }
|
||||||
|
|
||||||
= f.inputs :name => :information, :style => "#{'display: none' unless @site.new_record?}" do
|
= f.inputs :name => :information, :style => "#{'display: none' unless @site.new_record?}" do
|
||||||
= f.input :name, :required => false
|
= f.input :name, :required => false
|
||||||
|
|
||||||
@ -9,35 +16,39 @@
|
|||||||
- if can?(:point, Locomotive::Site)
|
- if can?(:point, Locomotive::Site)
|
||||||
- if manage_subdomain_or_domains?
|
- if manage_subdomain_or_domains?
|
||||||
= f.inputs :name => :access_points do
|
= f.inputs :name => :access_points do
|
||||||
|
= f.input :subdomain, :as => :'Locomotive::Subdomain', :domain => application_domain, :input_html => { :readonly => !manage_subdomain? }
|
||||||
|
|
||||||
|
- if manage_domains?
|
||||||
|
= f.input :domains, :as => :'Locomotive::Empty'
|
||||||
|
|
||||||
/ = f.custom_input :subdomain, :css => 'path' do
|
/ = f.custom_input :subdomain, :css => 'path' do
|
||||||
/ %em
|
/ %em
|
||||||
/ http://
|
/ http://
|
||||||
/ = f.text_field :subdomain, :readonly => !manage_subdomain?
|
/ = f.text_field :subdomain, :readonly =>
|
||||||
/ \.
|
/ \.
|
||||||
/ %em
|
/ %em
|
||||||
/ = application_domain
|
/ = application_domain
|
||||||
|
|
||||||
- if manage_domains?
|
/ - if manage_domains?
|
||||||
- @site.domains_without_subdomain.each_with_index do |name, index|
|
/ - @site.domains_without_subdomain.each_with_index do |name, index|
|
||||||
%li{ :class => "item added #{'last' if index == @site.domains.size - 1}"}
|
/ %li{ :class => "item added #{'last' if index == @site.domains.size - 1}"}
|
||||||
%em
|
/ %em
|
||||||
http://
|
/ http://
|
||||||
= text_field_tag 'site[domains][]', name, :class => 'string label void domain'
|
/ = text_field_tag 'site[domains][]', name, :class => 'string label void domain'
|
||||||
|
/
|
||||||
= error_on_domain(@site, name)
|
/ = error_on_domain(@site, name)
|
||||||
%span.actions
|
/ %span.actions
|
||||||
= link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove first', :confirm => t('locomotive.messages.confirm')
|
/ = link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove first', :confirm => t('locomotive.messages.confirm')
|
||||||
|
/
|
||||||
%li.item.template
|
/ %li.item.template
|
||||||
%em
|
/ %em
|
||||||
http://
|
/ http://
|
||||||
= text_field_tag 'label', t('formtastic.hints.site.domain_name'), :class => 'string label void domain'
|
/ = text_field_tag 'label', t('formtastic.hints.site.domain_name'), :class => 'string label void domain'
|
||||||
|
/
|
||||||
%span.actions
|
/ %span.actions
|
||||||
= link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove first', :confirm => t('locomotive.messages.confirm')
|
/ = link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove first', :confirm => t('locomotive.messages.confirm')
|
||||||
%button{ :class => 'button light add', :type => 'button' }
|
/ %button{ :class => 'button light add', :type => 'button' }
|
||||||
%span!= t('locomotive.buttons.new_item')
|
/ %span!= t('locomotive.buttons.new_item')
|
||||||
|
|
||||||
- if can?(:index, Locomotive::Membership)
|
- if can?(:index, Locomotive::Membership)
|
||||||
|
|
||||||
|
7
doc/changelogs/version_2.txt
Normal file
7
doc/changelogs/version_2.txt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
- rake locomotive:upgrade:rename_collections
|
||||||
|
|
||||||
|
- locales updates (en / fr)
|
||||||
|
|
||||||
|
- theme_assets.images => theme_assets.image_picker
|
||||||
|
- assets => content_assets
|
||||||
|
- EditableXXX => Locomotive::EditableXXX (en mongodb)
|
@ -5,16 +5,16 @@ Locomotive.configure do |config|
|
|||||||
# your own domain name (ex: locomotivehosting.com).
|
# your own domain name (ex: locomotivehosting.com).
|
||||||
#
|
#
|
||||||
# Ex:
|
# Ex:
|
||||||
# config.multi_sites do |multi_sites|
|
config.multi_sites do |multi_sites|
|
||||||
# # each new website you add will have a default entry based on a subdomain
|
# each new website you add will have a default entry based on a subdomain
|
||||||
# # and the multi_site_domain value (ex: website_1.locomotivehosting.com).
|
# and the multi_site_domain value (ex: website_1.locomotivehosting.com).
|
||||||
# multi_sites.domain = 'example.com' #'myhostingplatform.com'
|
multi_sites.domain = 'engine.dev' #'myhostingplatform.com'
|
||||||
#
|
|
||||||
# # define the reserved subdomains
|
# define the reserved subdomains
|
||||||
# # Ex:
|
# Ex:
|
||||||
# multi_sites.reserved_subdomains = %w(www admin email blog webmail mail support help site sites)
|
multi_sites.reserved_subdomains = %w(www admin email blog webmail mail support help site sites)
|
||||||
# end
|
end
|
||||||
config.multi_sites = false
|
# config.multi_sites = false
|
||||||
|
|
||||||
# configure the hosting target for the production environment. Locomotive can be installed in:
|
# configure the hosting target for the production environment. Locomotive can be installed in:
|
||||||
# - your own server
|
# - your own server
|
||||||
|
Loading…
Reference in New Issue
Block a user