cleaning things up
Oleg
committed Dec 13, 2011
commit 5237e995e169a05b3efd31babbcff624ea3f687e
Showing 9
changed files with
55 additions
and 11 deletions
app/assets/stylesheets/comfortable_mexican_sofa/files.css
+15
-3
| @@ | @@ -111,9 +111,21 @@ |
| cursor: pointer; | |
| border-color: #252525; | |
| } | |
| - | #cms_body .file_uploads .file a.delete { |
| + | #cms_body #cms_dialog .uploaded_files .file a.delete { |
| background-position: 0px 11px; | |
| } | |
| - | #cms_body .file_uploads .file a.delete:hover { |
| + | #cms_body #cms_dialog .uploaded_files .file a.delete:hover { |
| background-position: 0px 0px; | |
| - | } |
| \ No newline at end of file | |
| + | } |
| + | #cms_body #cms_dialog form.image_url { |
| + | position: absolute; |
| + | z-index: 9999; |
| + | width: 650px; |
| + | } |
| + | #cms_body #cms_dialog form.image_url label { |
| + | font: 13px/19px 'Lucida Grande', Tahoma, sans-serif; |
| + | padding: 0px 10px; |
| + | } |
| + | #cms_body #cms_dialog form.image_url input[type=text] { |
| + | width: 300px; |
| + | } |
app/assets/stylesheets/comfortable_mexican_sofa/form.css
+1
-1
| @@ | @@ -7,7 +7,7 @@ |
| width: 117px; | |
| float: left; | |
| text-align: right; | |
| - | font: 13px/19px 'Lucida Grande', 'Tahoma', serif; |
| + | font: 13px/19px 'Lucida Grande', 'Tahoma', sans-serif; |
| text-shadow: #fff 1px 1px; | |
| padding: 0px 10px; | |
| background-color: #f1f1f1; | |
app/assets/stylesheets/comfortable_mexican_sofa/widgets.css
+6
-1
| @@ | @@ -6,4 +6,9 @@ |
| .ui-timepicker-div dl{ text-align: left; } | |
| .ui-timepicker-div dl dt{ height: 25px; } | |
| .ui-timepicker-div dl dd{ margin: -25px 10px 10px 65px; } | |
| - | .ui-timepicker-div td { font-size: 90%; } |
| \ No newline at end of file | |
| + | .ui-timepicker-div td { font-size: 90%; } |
| + | |
| + | /* -- elrte -------------------------------------------------------------- */ |
| + | .el-rte .toolbar ul li.sofa_image { |
| + | background-position: -384px -2px |
| + | } |
| \ No newline at end of file | |
app/controllers/cms_admin/files_controller.rb
+4
-1
| @@ | @@ -32,7 +32,10 @@ class CmsAdmin::FilesController < CmsAdmin::BaseController |
| redirect_to :action => :edit, :id => @file | |
| end | |
| format.js do | |
| - | io = request.env['rack.input'].clone |
| + | # FIX: No idea why this cannot be simulated in the test |
| + | io = Rails.env.test?? |
| + | request.env['RAW_POST_DATA'].clone : |
| + | request.env['rack.input'].clone |
| io.class.class_eval { attr_accessor :original_filename, :content_type } | |
| io.original_filename = request.env['HTTP_X_FILE_NAME'] | |
| io.content_type = request.env['CONTENT_TYPE'] | |
app/views/cms_admin/dialogs/image.html.erb
+3
-4
| @@ | @@ -1,8 +1,7 @@ |
| <form class='image_url'> | |
| - | <label> URL: |
| - | <input type='text' name='image_url'/> |
| - | </label> |
| - | <input type='submit' value='Insert Image'/> |
| + | <label for='image_url'> URL </label> |
| + | <input type='text' name='image_url' id='image_url'/> |
| + | <input type='submit' value='<%= t('.insert') %>'/> |
| </form> | |
| <%= render :partial => 'cms_admin/files/index' %> | |
| \ No newline at end of file | |
config/locales/en.yml
+4
-0
| @@ | @@ -216,4 +216,8 @@ en: |
| save: Save | |
| form: | |
| label: Categories | |
| + | |
| + | dialogs: |
| + | image: |
| + | insert: Insert Image |
| \ No newline at end of file | |
config/locales/es.yml
+4
-0
| @@ | @@ -216,3 +216,7 @@ es: |
| save: Guardar | |
| form: | |
| label: Categorias | |
| + | |
| + | dialogs: |
| + | image: |
| + | insert: Insertar Imagen |
test/functional/cms_admin/dialogs_controller_test.rb
+17
-0
| @@ | @@ -0,0 +1,17 @@ |
| + | require File.expand_path('../../test_helper', File.dirname(__FILE__)) |
| + | |
| + | class CmsAdmin::DialogsControllerTest < ActionController::TestCase |
| + | |
| + | def test_get_image_dialog |
| + | get :show, :site_id => cms_sites(:default), :type => 'image' |
| + | assert_response :success |
| + | assert_select "input[name=image_url]" |
| + | end |
| + | |
| + | def test_get_invalid |
| + | get :show, :site_id => cms_sites(:default), :type => 'invalid' |
| + | assert_response :success |
| + | assert_blank response.body |
| + | end |
| + | |
| + | end |
| \ No newline at end of file | |
test/functional/cms_admin/files_controller_test.rb
+1
-1
| @@ | @@ -113,7 +113,7 @@ class CmsAdmin::FilesControllerTest < ActionController::TestCase |
| def test_create_as_xhr | |
| request.env['HTTP_X_FILE_NAME'] = 'image.jpg' | |
| request.env['CONTENT_TYPE'] = 'image/jpeg' | |
| - | request.env['RAW_POST_DATA'] = File.open(File.expand_path('../../fixtures/files/image.jpg', File.dirname(__FILE__))).read |
| + | request.env['RAW_POST_DATA'] = File.open(File.expand_path('../../fixtures/files/image.jpg', File.dirname(__FILE__))) |
| assert_difference 'Cms::File.count' do | |
| xhr :post, :create, :site_id => cms_sites(:default) | |