cleanup
Hesham E
committed Aug 31, 2010
commit ec2afeb4c14efcea0cdd557c490bd94a0e42e3d0
Showing 7
changed files with
32 additions
and 28 deletions
.gitignore
+3
-1
| @@ | @@ -3,4 +3,6 @@ db/*.sqlite3 |
| log/*.log | |
| tmp/**/* | |
| .DS_Store | |
| - | db/schema.rb |
| \ No newline at end of file | |
| + | db/schema.rb |
| + | db/development_structure.sql |
| + | public/system/* |
| \ No newline at end of file | |
app/controllers/cms_admin/assets_controller.rb
+4
-3
| @@ | @@ -3,13 +3,14 @@ class CmsAdmin::AssetsController < CmsAdmin::BaseController |
| :only => :destroy | |
| def index | |
| + | render :update do |page| |
| + | page << "$('#assets_list').html(\"#{ escape_javascript(render(:partial => 'cms_admin/assets/index')) }\")" |
| + | end |
| end | |
| def create | |
| @cms_asset = CmsAsset.create!(:uploaded_file => params[:file]) | |
| - | render :update do |page| |
| - | page << "$('#assets_list').html(\"#{ escape_javascript(render(:partial => 'cms_admin/assets/index')) }\")" |
| - | end |
| + | render :nothing => true |
| end | |
| def destroy | |
app/views/cms_admin/assets/_index.html.erb
+1
-2
| @@ | @@ -9,5 +9,4 @@ |
| <% else %> | |
| <p>No assets found.</p> | |
| <% end %> | |
| - | </div> |
| - | <%= render :partial => 'cms_admin/assets/uploader' %> |
| \ No newline at end of file | |
| + | </div> |
| \ No newline at end of file | |
app/views/cms_admin/pages/_form.html.erb
+5
-1
| @@ | @@ -4,4 +4,8 @@ |
| <% @cms_page.cms_blocks.each do |block| %> | |
| <%= form.cms_block_field(block) %> | |
| - | <% end %> |
| \ No newline at end of file | |
| + | <% end %> |
| + | |
| + | <h2>Assets</h2> |
| + | <%= render :partial => 'cms_admin/assets/uploader' %> |
| + | <%= render :partial => 'cms_admin/assets/index' %> |
| \ No newline at end of file | |
development_structure.sql b/db/development_structure.sql
+0
-2
| @@ | @@ -1,2 +0,0 @@ |
| - | CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL); |
| - | CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version"); |
public/javascripts/cms/uploader.js
+2
-2
| @@ | @@ -12,7 +12,7 @@ $.CMS.Uploader = function(){ |
| browse_button: 'pickfiles', | |
| unique_names: true, | |
| multipart: true, | |
| - | multipart_params: { authenticity_token: auth_token }, |
| + | multipart_params: { authenticity_token: auth_token, format: 'json' }, |
| url: '/cms-admin/assets' | |
| }); | |
| @@ | @@ -35,7 +35,7 @@ $.CMS.Uploader = function(){ |
| }); | |
| uploader.bind('FileUploaded', function(up, file, response){ | |
| - | alert(response); |
| + | $.get('/cms-admin/assets') |
| $('#'+file.id).fadeOut(4000); | |
| }) | |
| } | |
public/stylesheets/cms/jquery-ui.css
+17
-17
| @@ | @@ -59,26 +59,26 @@ |
| .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } | |
| .ui-widget .ui-widget { font-size: 1em; } | |
| .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } | |
| - | .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } |
| + | .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(/images/cms/jquery-ui/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } |
| .ui-widget-content a { color: #222222; } | |
| - | .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } |
| + | .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(/images/cms/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } |
| .ui-widget-header a { color: #222222; } | |
| /* Interaction states | |
| ----------------------------------*/ | |
| - | .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } |
| + | .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(/images/cms/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } |
| .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } | |
| - | .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } |
| + | .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(/images/cms/jquery-ui/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } |
| .ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } | |
| - | .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } |
| + | .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(/images/cms/jquery-ui/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } |
| .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } | |
| .ui-widget :active { outline: none; } | |
| /* Interaction Cues | |
| ----------------------------------*/ | |
| - | .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } |
| + | .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(/images/cms/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } |
| .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } | |
| - | .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } |
| + | .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(/images/cms/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } |
| .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } | |
| .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } | |
| .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } | |
| @@ | @@ -89,14 +89,14 @@ |
| ----------------------------------*/ | |
| /* states and images */ | |
| - | .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } |
| - | .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } |
| - | .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } |
| - | .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } |
| - | .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } |
| - | .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } |
| - | .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } |
| - | .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } |
| + | .ui-icon { width: 16px; height: 16px; background-image: url(/images/cms/jquery-ui/ui-icons_222222_256x240.png); } |
| + | .ui-widget-content .ui-icon {background-image: url(/images/cms/jquery-ui/ui-icons_222222_256x240.png); } |
| + | .ui-widget-header .ui-icon {background-image: url(/images/cms/jquery-ui/ui-icons_222222_256x240.png); } |
| + | .ui-state-default .ui-icon { background-image: url(/images/cms/jquery-ui/ui-icons_888888_256x240.png); } |
| + | .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(/images/cms/jquery-ui/ui-icons_454545_256x240.png); } |
| + | .ui-state-active .ui-icon {background-image: url(/images/cms/jquery-ui/ui-icons_454545_256x240.png); } |
| + | .ui-state-highlight .ui-icon {background-image: url(/images/cms/jquery-ui/ui-icons_2e83ff_256x240.png); } |
| + | .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(/images/cms/jquery-ui/ui-icons_cd0a0a_256x240.png); } |
| /* positioning */ | |
| .ui-icon-carat-1-n { background-position: 0 0; } | |
| @@ | @@ -291,8 +291,8 @@ |
| .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } | |
| /* Overlays */ | |
| - | .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } |
| - | .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* |
| + | .ui-widget-overlay { background: #aaaaaa url(/images/cms/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } |
| + | .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(/images/cms/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* |
| * jQuery UI Progressbar @VERSION | |
| * | |
| * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) | |