From 50a2453995148b65ec61cd555e1473110f37f0e7 Mon Sep 17 00:00:00 2001 From: did Date: Sat, 14 Jan 2012 13:12:44 +0100 Subject: [PATCH] polish again the content_locale picker --- .../locomotive/views/content_types/_form_view.js.coffee | 2 ++ app/assets/stylesheets/locomotive/_picker.css.scss | 4 ---- .../stylesheets/locomotive/content_locale_picker.css.scss | 3 --- app/cells/locomotive/content_locale_picker_cell.rb | 2 -- doc/TODO | 2 ++ lib/locomotive/action_controller/helpers.rb | 2 -- spec/dummy/config/routes.rb | 2 +- 7 files changed, 5 insertions(+), 12 deletions(-) diff --git a/app/assets/javascripts/locomotive/views/content_types/_form_view.js.coffee b/app/assets/javascripts/locomotive/views/content_types/_form_view.js.coffee index 9ec68e18..a660ce54 100644 --- a/app/assets/javascripts/locomotive/views/content_types/_form_view.js.coffee +++ b/app/assets/javascripts/locomotive/views/content_types/_form_view.js.coffee @@ -12,6 +12,8 @@ class Locomotive.Views.ContentTypes.FormView extends Locomotive.Views.Shared.For initialize: -> @model = new Locomotive.Models.ContentType(@options.content_type) + window.foo = @model + Backbone.ModelBinding.bind @ render: -> diff --git a/app/assets/stylesheets/locomotive/_picker.css.scss b/app/assets/stylesheets/locomotive/_picker.css.scss index 7c508299..9fb63552 100644 --- a/app/assets/stylesheets/locomotive/_picker.css.scss +++ b/app/assets/stylesheets/locomotive/_picker.css.scss @@ -5,12 +5,8 @@ @mixin picker { position: absolute; - // top: 97px; - // margin: 5px 0 0 0; padding: 0 0 0 0; - // min-width: 160px; - // z-index: 999; @include border-radius(4px); border: 1px solid #000; diff --git a/app/assets/stylesheets/locomotive/content_locale_picker.css.scss b/app/assets/stylesheets/locomotive/content_locale_picker.css.scss index 4b7239e3..92e7621c 100644 --- a/app/assets/stylesheets/locomotive/content_locale_picker.css.scss +++ b/app/assets/stylesheets/locomotive/content_locale_picker.css.scss @@ -35,9 +35,6 @@ span.text { position: relative; - // position: relative; - // top: -6px; - color: #fff; font-size: 11px; text-shadow: 1px 1px 1px #000; diff --git a/app/cells/locomotive/content_locale_picker_cell.rb b/app/cells/locomotive/content_locale_picker_cell.rb index 1df3265a..26c687fe 100644 --- a/app/cells/locomotive/content_locale_picker_cell.rb +++ b/app/cells/locomotive/content_locale_picker_cell.rb @@ -4,8 +4,6 @@ class Locomotive::ContentLocalePickerCell < Cell::Base site = args[:site] locale = args[:locale].to_s - logger.debug "site.locales = #{site.locales.inspect} / #{site.locales.size}" - if site.locales.empty? || site.locales.size < 2 '' else diff --git a/doc/TODO b/doc/TODO index cb19100b..071ae13a 100644 --- a/doc/TODO +++ b/doc/TODO @@ -75,6 +75,8 @@ x edit my site - remove inline-editor tag - rack - iframe +- bugs: + - unable to toggle the "required" check_boxes for content types - disallow to click twice on the submit form button (spinner ?) - message to notify people if their browser is too old diff --git a/lib/locomotive/action_controller/helpers.rb b/lib/locomotive/action_controller/helpers.rb index bf9055de..dcac44a5 100644 --- a/lib/locomotive/action_controller/helpers.rb +++ b/lib/locomotive/action_controller/helpers.rb @@ -17,8 +17,6 @@ module Locomotive end def set_current_content_locale - # I18n.default_site_locale = current_site.default_locale - if params[:content_locale].present? session[:content_locale] = params[:content_locale] end diff --git a/spec/dummy/config/routes.rb b/spec/dummy/config/routes.rb index db0dd253..fa6694ae 100644 --- a/spec/dummy/config/routes.rb +++ b/spec/dummy/config/routes.rb @@ -1,6 +1,6 @@ Rails.application.routes.draw do - mount Locomotive::Engine => '/locomotive' + mount Locomotive::Engine => '/locomotive', :as => 'locomotive' match '/foo' => 'foo#index', :as => 'foo'