From 0edad4f8c0fc8f545366cdd94de041de23ca6430 Mon Sep 17 00:00:00 2001 From: chris2tof Date: Thu, 29 Dec 2011 19:45:21 +0800 Subject: [PATCH 1/8] New rss.js from Harry and fix html form for assets --- app/assets/javascripts/rss.js | 4 ++-- app/views/admin/assets/_edit.html.erb | 10 +++++++--- app/views/admin/assets/_new.html.erb | 10 +++++++--- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/rss.js b/app/assets/javascripts/rss.js index e993df79..5822fa84 100644 --- a/app/assets/javascripts/rss.js +++ b/app/assets/javascripts/rss.js @@ -430,7 +430,7 @@ modalWindow : function(settings,callbackFn){ tempwidth=maxwidth; rgWLeft=(rgmaskWidth-tempwidth)/2; } - tempwidth+=25; + tempwidth=parseInt(tempwidth)+25; $rss("#rgWindow").empty().show(); var closebtn = ""; if(closeBtn) @@ -509,7 +509,7 @@ modalWindowUpdate : function(settings,callbackFn){ tempwidth=maxwidth; rgWLeft=(rgmaskWidth-tempwidth)/2; } - tempwidth+=25; + tempwidth=parseInt(tempwidth)+25; $rss("#rgContent").empty(); $rss("#rgWindow").animate({"width":tempwidth+"px","height":tempheight+"px",top:rgWTop+"px", left:rgWLeft+"px"},500,function(){$rss("#rgContent").css("height",tempheight+"px").html(dhtml)}); $rss("#rgwindow_temp_div").remove(); diff --git a/app/views/admin/assets/_edit.html.erb b/app/views/admin/assets/_edit.html.erb index cc0a5c52..33f8131c 100644 --- a/app/views/admin/assets/_edit.html.erb +++ b/app/views/admin/assets/_edit.html.erb @@ -1,12 +1,16 @@

<%= t('editing_asset') %>

- <%= form_for @asset, :url => admin_asset_path(@asset), :html => {:id => 'ajaxForm', :multipart => true } do |f| %> + <%= form_for @asset, :url => admin_asset_path(@asset), :html => {:id => (is_html ? nil : 'ajaxForm'), :multipart => true } do |f| %> <%= f.error_messages %> <%= render :partial => "form", :locals => { :f => f } %>
- <%= link_back if is_html %> - <%= t(:update) %> + <% if is_html %> + <%= link_back %> + <%= f.submit t(:edit) %> + <% else %> + <%= t(:edit) %> + <% end %>
<% end %>
\ No newline at end of file diff --git a/app/views/admin/assets/_new.html.erb b/app/views/admin/assets/_new.html.erb index 2f997a11..9653af6f 100644 --- a/app/views/admin/assets/_new.html.erb +++ b/app/views/admin/assets/_new.html.erb @@ -1,12 +1,16 @@

<%= t('admin.new_asset') %>

- <%= form_for :asset, :url => admin_assets_path, :html => {:id => 'ajaxForm', :multipart => true }, :remote => true do |f| %> + <%= form_for :asset, :url => admin_assets_path, :html => {:id => (is_html ? nil : 'ajaxForm'), :multipart => true }, :remote => true do |f| %> <%= f.error_messages %> <%= render :partial => "form", :locals => { :f => f } %>
- <%= link_back if is_html %> - <%= t(:create) %> + <% if is_html %> + <%= link_back %> + <%= f.submit t(:create) %> + <% else %> + <%= t(:create) %> + <% end %>
<% end %>
From 1dd85d6ff1e4d3386ab7adadd403ba1150907126 Mon Sep 17 00:00:00 2001 From: chris2tof Date: Fri, 30 Dec 2011 02:34:13 +0800 Subject: [PATCH 2/8] Forgot to remove ":remote => true" for asset new --- app/views/admin/assets/_new.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/assets/_new.html.erb b/app/views/admin/assets/_new.html.erb index 9653af6f..4f15fafc 100644 --- a/app/views/admin/assets/_new.html.erb +++ b/app/views/admin/assets/_new.html.erb @@ -1,7 +1,7 @@

<%= t('admin.new_asset') %>

- <%= form_for :asset, :url => admin_assets_path, :html => {:id => (is_html ? nil : 'ajaxForm'), :multipart => true }, :remote => true do |f| %> + <%= form_for :asset, :url => admin_assets_path, :html => {:id => (is_html ? nil : 'ajaxForm'), :multipart => true } do |f| %> <%= f.error_messages %> <%= render :partial => "form", :locals => { :f => f } %>
From 4cdef7655083c5036946f591fd5cce909045c09d Mon Sep 17 00:00:00 2001 From: chris2tof Date: Fri, 13 Jan 2012 12:35:46 +0800 Subject: [PATCH 3/8] Update carrierwave #{column}_identifier must be used to get the name of the file --- Gemfile | 5 +++-- Gemfile.lock | 24 +++++++++++------------- config/initializers/carrierwave.rb | 6 +++--- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Gemfile b/Gemfile index 4fe1340a..995de255 100644 --- a/Gemfile +++ b/Gemfile @@ -3,14 +3,15 @@ gem 'rails' gem 'yajl-ruby', :require => 'yajl' gem 'bson_ext' -gem 'carrierwave', '0.5.4' +gem 'carrierwave' +gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid' gem 'ckeditor' gem 'devise' gem 'mini_magick' gem 'rubyzip' gem 'sinatra' gem 'execjs' -gem 'mongoid', :git => 'git://github.com/mongoid/mongoid.git', :ref => '7a915395db50e2bc6071a503a11530e644879e49' +gem 'mongoid' gem 'rake' gem 'jquery-rails' diff --git a/Gemfile.lock b/Gemfile.lock index fcf8f0b9..f733511e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,13 +1,3 @@ -GIT - remote: git://github.com/mongoid/mongoid.git - revision: 7a915395db50e2bc6071a503a11530e644879e49 - ref: 7a915395db50e2bc6071a503a11530e644879e49 - specs: - mongoid (2.4.0) - activemodel (~> 3.1) - mongo (~> 1.3) - tzinfo (~> 0.3.22) - GEM remote: http://rubygems.org/ specs: @@ -46,8 +36,11 @@ GEM bson_ext (1.5.2) bson (= 1.5.2) builder (3.0.0) - carrierwave (0.5.4) + carrierwave (0.5.8) activesupport (~> 3.0) + carrierwave-mongoid (0.1.3) + carrierwave (>= 0.5.6) + mongoid (~> 2.1) chronic (0.6.6) ckeditor (3.6.3) mime-types (~> 1.16) @@ -94,6 +87,10 @@ GEM subexec (~> 0.1.0) mongo (1.5.2) bson (= 1.5.2) + mongoid (2.4.0) + activemodel (~> 3.1) + mongo (~> 1.3) + tzinfo (~> 0.3.22) multi_json (1.0.4) orm_adapter (0.0.5) polyglot (0.3.3) @@ -190,7 +187,8 @@ PLATFORMS DEPENDENCIES bson_ext - carrierwave (= 0.5.4) + carrierwave + carrierwave-mongoid ckeditor coffee-rails database_cleaner @@ -200,7 +198,7 @@ DEPENDENCIES factory_girl_rails jquery-rails mini_magick - mongoid! + mongoid radius rails rake diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index 1c7f73c1..2c46dd11 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -1,5 +1,3 @@ -require 'carrierwave/orm/mongoid' - begin db_config = YAML::load(File.read(File.join(Rails.root, "/config/mongoid.yml"))) rescue @@ -12,4 +10,6 @@ CarrierWave.configure do |config| config.grid_fs_port = db_config[Rails.env]['port'] config.storage = :grid_fs config.grid_fs_access_url = "/gridfs" -end \ No newline at end of file +end + +CarrierWave::SanitizedFile.sanitize_regexp = /[^[:word:]\.\-\+]/ From f86777b617cf53c411aa961963e6e00752192bd8 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Mon, 16 Jan 2012 08:14:05 +0800 Subject: [PATCH 4/8] Embed attribute_fields and sub_roles --- app/models/user/attribute.rb | 2 +- app/models/user/attribute_field.rb | 2 +- app/models/user/role.rb | 2 +- app/models/user/sub_role.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/user/attribute.rb b/app/models/user/attribute.rb index af8a1106..84650421 100644 --- a/app/models/user/attribute.rb +++ b/app/models/user/attribute.rb @@ -7,7 +7,7 @@ class Attribute field :built_in, :type => Boolean, :default => false field :disabled, :type => Boolean, :default => false - has_many :attribute_fields, :autosave => true, :dependent => :destroy + embeds_many :attribute_fields, :cascade_callbacks => true has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy accepts_nested_attributes_for :attribute_fields, :allow_destroy => true diff --git a/app/models/user/attribute_field.rb b/app/models/user/attribute_field.rb index 42bbf910..2d909b3e 100644 --- a/app/models/user/attribute_field.rb +++ b/app/models/user/attribute_field.rb @@ -10,7 +10,7 @@ class AttributeField field :built_in, :type => Boolean, :default => false field :disabled, :type => Boolean, :default => false - belongs_to :attribute + embedded_in :attribute has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy has_many :attribute_values diff --git a/app/models/user/role.rb b/app/models/user/role.rb index 86f7266f..788d281d 100644 --- a/app/models/user/role.rb +++ b/app/models/user/role.rb @@ -7,7 +7,7 @@ class Role field :built_in, :type => Boolean, :default => false field :disabled, :type => Boolean, :default => false - has_many :sub_roles, :autosave => true, :dependent => :destroy + embeds_many :sub_roles, :cascade_callbacks => true has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy has_many :users accepts_nested_attributes_for :i18n_variable, :allow_destroy => true diff --git a/app/models/user/sub_role.rb b/app/models/user/sub_role.rb index cdefb5f5..47f3e2de 100644 --- a/app/models/user/sub_role.rb +++ b/app/models/user/sub_role.rb @@ -1,6 +1,6 @@ class SubRole < Attribute - belongs_to :role + embedded_in :role has_and_belongs_to_many :users # Get an sub_role from key From 6ee1d71c6417b944f913f7b6c15fd2bfad7aafe4 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 24 Jan 2012 11:38:53 +0800 Subject: [PATCH 5/8] Ray's modification before redesign --- app/assets/images/PIE.htc | 96 ++ app/assets/images/bar_orbit.png | Bin 4619 -> 6475 bytes app/assets/images/service_btn.png | Bin 5037 -> 3307 bytes app/assets/javascripts/rc.js | 120 +++ app/assets/javascripts/rss.js | 8 +- app/assets/javascripts/site_editor.js | 3 +- app/assets/stylesheets/admin_back_end.css.erb | 145 ++- app/assets/stylesheets/reset.css | 4 + app/assets/stylesheets/site_items.css.erb | 925 +++++++++--------- app/controllers/application_controller.rb | 2 +- app/controllers/pages_controller.rb | 8 +- app/views/admin/assets/_asset.html.erb | 2 +- app/views/admin/assets/_form.html.erb | 2 +- app/views/admin/assets/_new.html.erb | 2 +- .../admin/users/_sub_role_selector.html.erb | 4 +- app/views/layouts/admin.html.erb | 68 +- app/views/layouts/site_editor.html.erb | 70 +- config/environments/development.rb | 2 +- lib/parsers/parser_back_end.rb | 2 +- lib/parsers/parser_common.rb | 47 +- lib/parsers/parser_front_end.rb | 4 +- lib/tasks/pages.rake | 66 ++ 22 files changed, 1001 insertions(+), 579 deletions(-) create mode 100644 app/assets/images/PIE.htc create mode 100644 app/assets/javascripts/rc.js create mode 100644 lib/tasks/pages.rake diff --git a/app/assets/images/PIE.htc b/app/assets/images/PIE.htc new file mode 100644 index 00000000..00b63838 --- /dev/null +++ b/app/assets/images/PIE.htc @@ -0,0 +1,96 @@ + + + + + + + + + diff --git a/app/assets/images/bar_orbit.png b/app/assets/images/bar_orbit.png index feaca6b838d4de02fa3342e964663236fc40498c..eb0c95ee0ce7368e019c83542c9ee8fe9b2f1814 100644 GIT binary patch literal 6475 zcmYjUbyU>f)BYgcNOw!Ov~)KTE8VelNQ25JDTtPDq zlA-CTPlm;)ukZmvn##t-giWLo$5gsVrq}yiSs9IHq$CbCDG8EDrpJSqfU|(P#Z;CQ z`6(`8>~16Elj~f^)y~hyZ}T#{b!UYwlbAhNcv)&M^+X_e)e7{_*CU4qhBmhN+-3j^4-n9ci{=E-LICR#7M4ID zDi|x;cg(>V2g{}TU!en0}5s~V@9Em;6AG! zqX)N}Fsb{ii}kKe)^H(>4&A{01cetx0jvgZFSMb(BgO?k{^^!MtShlKfw9 zzfwylik9yFs&yhrOm&}Z4>sm>Qxqh?7TU9xv= z#+1n5VdNf(-YVSc-+H-4v&D33hEr%O=l%KGV3R|C%teE0n`m2j8^a+-NFMYlPk*JV z)bP1TvZ+FSDOA5vFSd$A*e_4wXC%40W_f*C<_xtHh0~RD;~(F)=PQ}?I@!OBrpNbG z|78C`JrBUck0Fa3jstU0*Ho8ED8AHqY1E>Bmf?zV=a` zzBa6av*MN3E3M(5KYo_|oXZu-mlm8C+Rfk1pU+=wwKfej<$+c~zdNWmZ<$t@96>ug zqD>`C%8fy$7A-3Eh4nAy+UwgZpI5?k(sgQ!=D_`5PN1XE>Q<^R+Y1=*2Bnr5 zHy()|IUmI?7yl40<}5OK>GP|9L~&hjdrB6!I8(rNtu9PgQ8yg?ZI^}Ljz86?e*Q~q zc|gsT%`t_{rOex6gbYG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r9B>}^TuNO=a6e&$!icj|GqiNTBx83m5VDkgKf{$RF zIBbNWnH!Xpf%7vgiPllS7PqLaS1RnM$EI~0EMgryk5H@;`83gDvLLkp>t!if$ZJ^% z^I`hT!y;k?d9$Bh^hy>0R+d#?BWw{)4`}A5{VKw2rR{EgO3uKE(adtUl+P`Yb(~ZN z$~=N6HdLSM?yTb1}n1r(5`pnm$118P)9z&&O=?GMBo3w8l<|#jF8ejMe(dmGiTn>Xrx( z9=331Ip67S-juDf3eNX&B(Og4M>;ZcpV^0!kB!4>+X2`O>%VMgGwO?beNWHtMM1UC z4ezRVzAvhHomsf@c|g7SWhZBdiP$bU|AjCnuneU%q{jT-YQ~PV z-5K1y^>NmkPNfu5)WmTcvh=VML;q1&2x3*yj{ z6%uSbb@Q3ws{8|}^xCcNp7(KEbmA{Qv%xTOi)E@HBRfS_&55F$>NA|5E8}fGZP$YW zBw#kyely_Iw_+f`ye!|n&mJ;PT-21Gfh$E?9H#No3aJQN4yN(W4G0QHK$?gP^n@6ZwHldYqI5LTc?h1UaM|21)uEjLsOv3G0-*DsnK$c|3A0'+t+''); + $(this).find('.td').show().css('display','inline-block'); + $(document).mousemove(function(e){ + $(this).find('.td').css({ + left: e.pageX - p.left + 16, + top: e.pageY - p.top - th - 20 + }); + }); + }) + .mouseout(function(){ + $(this).find('.td').hide().detach(); + }); + }); +} + +function accordion(){ + if( !$('.rc_accor').length ){ + return; + } + $('.rc_accor').each(function(){ + $(this).find('.ac_ctrl:first').addClass('recent'); + $(this).find('.ac_content:not(:first)').hide(); + if($(this).hasClass('av')){ + $(this).find('.ac_ctrl').click(function(){ + var index = $(this).parents('.av').find('.ac_ctrl').index(this); + $(this).siblings('.ac_ctrl').removeClass('recent'); + $(this).addClass('recent'); + $(this).parents('.rc_accor').find('.ac_content:not(:eq('+index+'))').stop().slideUp(); + $(this).parents('.rc_accor').find('.ac_content:eq('+index+')').stop().slideToggle(); + return false; + }); + } else if($(this).hasClass('ah')){ + var w = $(this).find('.ac_content').css('width'); + $(this).find('.ac_content:not(:eq(0))').css({width:0}); + $(this).find('.ac_ctrl').click(function(){ + var index = $(this).parents('.ah').find('.ac_ctrl').index(this); + $(this).siblings('.ac_ctrl').removeClass('recent'); + $(this).addClass('recent'); + $(this).parents('.rc_accor').find('.ac_content:not(:eq('+index+'))').stop().animate({width:0}); + $(this).parents('.rc_accor').find('.ac_content:eq('+index+')').stop().show().animate({width:w}); + return false; + }); + } + + + + }); +} diff --git a/app/assets/javascripts/rss.js b/app/assets/javascripts/rss.js index a9d8ff32..737b08b7 100644 --- a/app/assets/javascripts/rss.js +++ b/app/assets/javascripts/rss.js @@ -393,9 +393,9 @@ modalWindow : function(settings,callbackFn){ }else{tempwidth="auto";} $rss("body").append('
'); - $rss("#rgsheath").css({background: "#000", width: "100%", position: "fixed", top: 0, left: 0,opacity:0.9,'z-index':199}); + $rss("#rgsheath").css({background: "#000", width: "100%", position: "fixed", top: 0, left: 0,opacity:0.5,'z-index':199}); $rss("body").append('
'); - $rss("#rgWindow").css({"position": "fixed", "z-index": "999", "background": "#fff", "border": "solid 3px #ccc", "padding": "20px", "overflow": "hidden", "border-radius": "12px", "-webkit-border-radius": "12px", "-moz-border-radius": "12px", "-ms-border-radius": "12px", "box-shadow": "0 0 20px rgba(0,0,0,0.9)","-webkit-box-shadow": "0 0 20px rgba(0,0,0,0.9)","-moz-box-shadow": "0 0 20px rgba(0,0,0,0.9)","-ms-box-shadow": "0 0 20px rgba(0,0,0,0.9)"}); + $rss("#rgWindow").css({"position": "fixed", "z-index": "999", "background": "#fff", "border": "solid 1px #ccc", "padding": "10px", "border-radius": "5px", "-webkit-border-radius": "5px", "-moz-border-radius": "5px", "-ms-border-radius": "5px", "box-shadow": "0 0 20px rgba(0,0,0,0.7)","-webkit-box-shadow": "0 0 20px rgba(0,0,0,0.7)","-moz-box-shadow": "0 0 20px rgba(0,0,0,0.7)","-ms-box-shadow": "0 0 20px rgba(0,0,0,0.7)"}); var rgWTop = (rgmaskHeight-20)/2; var rgWLeft = (rgmaskWidth-20)/2; $rss("#rgWindow").css({top:rgWTop+"px", left:rgWLeft+"px"}); @@ -433,8 +433,8 @@ modalWindow : function(settings,callbackFn){ $rss("#rgWindow").empty().show(); var closebtn = ""; if(closeBtn) - closebtn='X'; - $rss("#rgWindow").animate({"width":tempwidth+"px","height":tempheight+"px",top:rgWTop+"px", left:rgWLeft+"px"},500,function(){$rss("#rgWindow").html(closebtn+"
"+dhtml+"
"); + closebtn='X'; + $rss("#rgWindow").animate({"width":tempwidth+"px","height":tempheight+"px",top:rgWTop+"px", left:rgWLeft+"px"},500,function(){$rss("#rgWindow").html(closebtn+"
"+dhtml+"
"); $rss("#close_modal").mouseover(function(){$rss(this).css("color","#999");}).mouseout(function(){$rss(this).css("color","#666");}) $rss("#close_modal").click(function(){ $rss("#rgWindow").empty(); diff --git a/app/assets/javascripts/site_editor.js b/app/assets/javascripts/site_editor.js index 98405564..ef4acc85 100644 --- a/app/assets/javascripts/site_editor.js +++ b/app/assets/javascripts/site_editor.js @@ -7,4 +7,5 @@ //= require jquery //= require jquery_ujs //= require page_edit -//= require side_bar_history \ No newline at end of file +//= require side_bar_history +//= require rc \ No newline at end of file diff --git a/app/assets/stylesheets/admin_back_end.css.erb b/app/assets/stylesheets/admin_back_end.css.erb index 405281b4..5aecff45 100644 --- a/app/assets/stylesheets/admin_back_end.css.erb +++ b/app/assets/stylesheets/admin_back_end.css.erb @@ -14,39 +14,69 @@ body{ } #back_banner_link{ - background: url(<%= asset_path "orbitbar1.png" %>) repeat-x scroll 0 0; - height: 50px; - left: 0; - position: fixed; - top: 0; + background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #787e82), color-stop(0.05, #61676c), color-stop(1, #292c2d) ); + background:-moz-linear-gradient( center top -90deg, #787e82 0%, #61676c 5%, #292c2d 100% ); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#61676c', endColorstr='#292c2d'); + -moz-box-shadow: 0px 1px 5px 0px rgba(0,0,0,.7); + -webkit-box-shadow: 0px 1px 5px 0px rgba(0,0,0,.7); + box-shadow: 0px 1px 5px 0px rgba(0,0,0,.7); + border-top: 1px solid #474a4c; + border-bottom: 1px solid #1d2020; + height: 41px; width: 100%; - z-index: 5; + behavior: url(<%= asset_path "PIE.htc" %>); } .hmenu{ - height: 40px; - position: absolute; - right: 0; - top: 1px; - width: 250px; + float: right; + height: 41px; } #back_orbit{ - background: url(<%= asset_path "bar_orbit.png" %>) no-repeat scroll 0 0 transparent; - cursor:pointer; + background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #70787d), color-stop(1, #3b4043) ); + background:-moz-linear-gradient( center top -90deg, #70787d 0%, #3b4043 100% ); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#70787d', endColorstr='#3b4043'); + -webkit-border-radius: 0px 0px 5px 5px; + -moz-border-radius: 0px 0px 5px 5px; + border-radius: 0px 0px 5px 5px; + -moz-box-shadow: 0px 1px 1px 0px rgba(0,0,0,.7); + -webkit-box-shadow: 0px 1px 1px 0px rgba(0,0,0,.7); + box-shadow: 0px 1px 1px 0px rgba(0,0,0,.7); + cursor: pointer; + float: left; height: 43px; - left: 10px; - position: relative; + margin-left: 10px; width: 41px; + behavior: url(<%= asset_path "PIE.htc" %>); +} +#back_orbit span{ + text-indent: -9999px; + background: url(<%= asset_path "bar_orbit.png" %>) no-repeat scroll 0 0 transparent; + display: block; + height: 43px; + width: 100%; } #back_orbit:hover{ - background-position:0 -43px; - box-shadow: 0 3px 3px #000000; + background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #fefefe), color-stop(1, #e4e4e4) ); + background:-moz-linear-gradient( center top -90deg, #fefefe 0%, #e4e4e4 100% ); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fefefe', endColorstr='#e4e4e4'); + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + border-radius: 0px; +} +#back_orbit:hover span{ + background-position: 0 -44px; } #back_orbit:hover #orblist{ display:block; } #orblist{ - background: none repeat scroll 0 0 #FFFFFF; - border-radius: 0 3px 3px 3px; + background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #e4e4e4), color-stop(1, #FFFFFF) ); + background:-moz-linear-gradient( center top -90deg, #e4e4e4 0%, #FFFFFF 100% ); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e4e4e4', endColorstr='#FFFFFF'); + -webkit-border-radius: 0px 3px 3px 3px; + -moz-border-radius: 0px 3px 3px 3px; + border-radius: 0px 3px 3px 3px; + -webkit-box-shadow: 0 3px 3px #000000; + -moz-box-shadow: 0 3px 3px #000000; box-shadow: 0 3px 3px #000000; display: none; margin: 0; @@ -70,30 +100,37 @@ body{ background:#eee; color:#333; } - +#log_out{ + -moz-box-shadow:inset 1px 0px 0px 0px #73777b; + -webkit-box-shadow:inset 1px 0px 0px 0px #73777b; + box-shadow:inset 1px 0px 0px 0px #73777b; + border-right:1px solid #41474c; + border-left:1px solid #41474c; + float:right; + width:41px; + height:41px; +} +#log_out:hover{ + background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #01afde), color-stop(1, #007ec6) ); + background:-moz-linear-gradient( center top -90deg, #01afde 0%, #007ec6 100% ); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#01afde', endColorstr='#007ec6'); +} #log_out a{ background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right 0 transparent; - border: medium none !important; - display: block !important; - height: 40px !important; - line-height: normal !important; - padding: 0 !important; - position: absolute; - right: 0px; - text-indent: -10000px; - top: 0px; - width: 43px !important; + display: block; + height: 41px; + text-indent: -9999px; + width: 41px; } #log_out a:hover{ background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right bottom transparent !important; } .lang{ - color: #FFFFFF; - font-size: 15px; - line-height: 40px; - position: absolute; - right: 55px; - top: 0; + color: #FFFFFF; + float: right; + font-size: 15px; + line-height: 40px; + margin-right: 10px; } .lang a{ color:#fff; @@ -589,4 +626,40 @@ hr.student_block { position: absolute; top: -15%; width: 130%; +} +#rgContent .main2{ + padding:0; +} +#rgContent h1{ + border-bottom: 1px dashed #CCCCCC; + color: #333333; + font-size: 19px; + font-weight: bold; + margin: 0 0 20px; + padding: 0 0 10px; + text-align: center; +} +#rgContent label { + color: #888888; + display: block; + font-size: 12px; + margin: 25px 0 5px; + width: 100%; +} +#rgContent input { + color: #888888; + width: 98%; +} +#rgContent .button_bar { + float: none; + text-align: center; + width:100%; + margin:30px 0 0; +} +#rgContent .button_bar a { + float: none; + display:block; +} +#close_modal{ + display:none !important; } \ No newline at end of file diff --git a/app/assets/stylesheets/reset.css b/app/assets/stylesheets/reset.css index 44f2ae77..612cab19 100644 --- a/app/assets/stylesheets/reset.css +++ b/app/assets/stylesheets/reset.css @@ -42,3 +42,7 @@ input:focus, select:focus, textarea:focus { height:0; visibility:hidden; } +.fixed { + position: fixed; + z-index: 100; +} \ No newline at end of file diff --git a/app/assets/stylesheets/site_items.css.erb b/app/assets/stylesheets/site_items.css.erb index 151dabde..38b0a185 100644 --- a/app/assets/stylesheets/site_items.css.erb +++ b/app/assets/stylesheets/site_items.css.erb @@ -1,445 +1,482 @@ -html, body{ - height: 100%; - margin: 0; - padding: 0; -} -html{ - background: url(<%= asset_path "body.jpg" %>) no-repeat fixed 0 0 transparent; - background-size: cover; -} - -body{ - color: #000000; - font-family: Helvetica, '微軟正黑體'; -} -#back_banner_link{ - background: url(<%= asset_path "orbitbar1.png" %>) repeat-x scroll 0 0; - height: 50px; - left: 0; - position: fixed; - top: 0; - width: 100%; - z-index: 5; -} -.hmenu{ - height: 40px; - position: absolute; - right: 0; - top: 1px; - width: 250px; -} -#back_orbit{ - background: url(<%= asset_path "bar_orbit.png" %>) no-repeat scroll 0 0 transparent; - cursor:pointer; - height: 43px; - left: 10px; - position: relative; - width: 41px; -} -#back_orbit:hover{ - background-position:0 -43px; - box-shadow: 0 3px 3px #000000; -} -#back_orbit:hover #orblist{ - display:block; -} -#orblist{ - background: none repeat scroll 0 0 #FFFFFF; - border-radius: 0 3px 3px 3px; - box-shadow: 0 3px 3px #000000; - display: none; - margin: 0; - padding: 10px; - position: absolute; - top: 43px; - width: 130px; -} -#orblist li{ - border-bottom:1px solid #aaa; - list-style:none; -} -.orblink{ - color: #333333; - display: block; - font: 12px/100% arial,sans-serif; - padding: 5px; - text-decoration: none; -} -.orblink:hover{ - background:#eee; - color:#333; -} - -#log_out a{ - background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right 0 transparent; - border: medium none !important; - display: block !important; - height: 40px !important; - line-height: normal !important; - padding: 0 !important; - position: absolute; - right: 0px; - text-indent: -10000px; - top: 0px; - width: 43px !important; -} -#log_out a:hover{ - background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right bottom transparent !important; -} -.lang{ - color: #FFFFFF; - font-size: 15px; - line-height: 40px; - position: absolute; - right: 55px; - top: 0; -} -.lang a{ - color:#fff; - text-decoration:none; -} -.lang a:hover{ - text-decoration:underline; -} -#back_content{ - height: 100%; -} -#back_footer{ - background-color: #101010; - bottom: 0; - color: #FFFFFF; - font-size: 11px; - padding: 10px; - position: fixed; - width: 100%; - left: 0; - box-shadow: 0 -3px 4px #000; -} -.items_setup{ - padding:42px 0 0 0; -} -#back_sidebar .items_setup .list li{ - padding: 6px 0 7px 5px; -} -#back_sidebar .items_setup .list li a{ - display: inline; - font-size: 0.9em; - padding: 0; -} -#back_sidebar .items_setup .list li a span{ - background:none; - padding:0; - text-shadow:none; -} -.main { - background: none repeat scroll 0 0 #FFFFFF; - height: 100%; - margin-left: 220px; - padding: 0 40px; - position: relative; -} -.main_list { - padding-top: 70px; -} -.main_list ul { - clear:both; -} -#porfile { - padding-top: 100px; -} -/*add_buttom*/ -.button_bar { - float: right; - -moz-box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black; - -webkit-box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black; - box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black; - background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #4f4f4f), color-stop(1, #000000) ); - background:-moz-linear-gradient( center top, #4f4f4f 5%, #000000 100% ); - filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f', endColorstr='#000000'); - background-color:#4f4f4f; - -moz-border-radius:5px; - -webkit-border-radius:5px; - border-radius:5px; - display:inline-block; - padding:0; - margin:10px 0 60px; -} -.button_bar a { - text-decoration:none; - text-shadow:0px -1px 0px #000000; - font-size:12px; - color:#EDEDED; - border-right:1px solid #555; - -moz-box-shadow:1px 0px 0px black; - -webkit-box-shadow:1px 0px 0px black; - box-shadow:1px 0px 0px black; - padding: 6px 10px 4px; - display: inline-block; - float: left; -} -.button_bar a:active { - padding: 7px 10px 3px !important; - text-shadow:0px 1px 0px #000000; - background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #000000), color-stop(1, #4f4f4f) ); - background:-moz-linear-gradient( center top, #000000 5%, #4f4f4f 100% ); - filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#4f4f4f'); -} -.button_bar a:last-child { - border-right:none; - -moz-box-shadow:none; - -webkit-box-shadow:none; - box-shadow:none; - -moz-border-radius:0px 5px 5px 0px; - -webkit-border-radius:0px 5px 5px 0px; - border-radius:0px 5px 5px 0px; -} -.button_bar a:first-child { - -moz-border-radius:5px 0px 0px 5px; - -webkit-border-radius:5px 0px 0px 5px; - border-radius:5px 0px 0px 5px; -} -.button_bar a.new { - padding: 5px 10px; - -moz-border-radius:5px; - -webkit-border-radius:5px; - border-radius:5px; -} -.button_bar a:hover { - color:#FFFFFF; -} -.up { - margin:10px 0; -} -#person { - left: 245px; - position: fixed; - text-align: center; - top: 75px; - width: 140px; - background-color:#FFF; - padding:15px; - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - -moz-box-shadow: 0px 0px 4px #180902; /* Firefox */ - -webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */ - box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */ -} -#file { - display:none; -} -#person img { -} -.user_mail { - border: medium none; - border:1px solid #DDDDDD; - color: #666666; - font-size: 12px; - width: 140px; -} -#person label { - display: block; - margin: 15px 0 0; -} -#person label input { -} -#person label #user_admin { - float:right; - margin: 0; -} -#person label span { - text-align:left; - font-size:11px; - color:#888; - display:block; -} -#person select { - border: 1px solid #DDDDDD; - padding: 0; - width: 140px; -} -#porfile .users{ - margin-left: 180px; -} -.roles_block { - background: url(<%= asset_path "75.png" %>) repeat left top; - min-width:710px; - margin-bottom:50px; - position:relative; - padding-bottom: 20px; - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - -moz-box-shadow: 0px 0px 4px #180902; /* Firefox */ - -webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */ - box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */ -} -.roles_block h2 { - color: #FFFFFF; - font-weight: normal; - margin: 0; - padding: 0; - position: absolute; - text-shadow: 0 3px 2px #000000; - top: -30px; -} -.main hr { - height:8px; - border:none; - margin:0; - border-radius: 5px 5px 0px 0px; - -moz-border-radius: 5px 5px 0px 0px; - -webkit-border-radius: 5px 5px 0px 0px; - border-bottom:1px solid #000; -} -.main2{ - padding:70px 0 0; -} -#basic_block hr { - background-color: #666666; -} -#teacher_block hr { - background-color: #0071A9; -} -#student_block hr { - background-color: #AF0045; -} -.info_input { - padding:10px 20px; -} -.info_input table { - color:#fff; - width:100%; - font-size:14px; -} -.info_input table td { - padding:5px 10px 5px 0; - width: 10%; -} -.info_input .list_head { - background:url(<%= asset_path "line.png" %>) left bottom repeat-x; -} -.info_input .list_head td { -} -.info_input .list_item { - color:#AEAEAE; -} -.info_input .add { - display:block; - padding-left:22px; - font-size:12px; - line-height:21px; - height:19px; - background:url(<%= asset_path "icon.png" %>) no-repeat -59px 0; - margin-top: 10px; - color: #DDDDDD; -} - -.main table { - width:100%; -} -.main td { - padding-left:20px; - color:#fff; - font-size:14px; - line-height:40px; -} -.main tr.have td{ - background: url(<%= asset_path "75.png" %>) repeat left top; -} -.main tr.have td:first-child{ - border-radius: 5px 0 0 5px; - -moz-border-radius: 5px 0 0 5px; - -webkit-border-radius: 5px 0 0 5px; -} -.main tr.have td:last-child{ - border-radius: 0 5px 5px 0; - -moz-border-radius: 0 5px 5px 0; - -webkit-border-radius: 0 5px 5px 0; -} -.main thead td { - line-height:40px; - font-size:16px; - text-shadow: 0px 1px 1px #3e2914; -} -.main thead td.action { - width:140px; -} -.main tbody td.roles { - background-image: url(<%= asset_path "roles_type.jpg" %>); - background-repeat: repeat-x; -} -.main tbody td.teacher { - background-position: 0 -54px; -} -.main tbody td.student { - background-position: 0 -5px; -} -.main tbody td.action a { - background-image: url(<%= asset_path "icon.png" %>); - display: inline-block; - height: 19px; - margin-right: 10px; - top: 8px; - text-indent: -9999px; - width: 19px; - position: relative; -} -.main tbody td.action a.show { - background-position: left top; -} -.main tbody td.action a.show:hover { - background-position: left -19px; -} -.main tbody td.action a.edit { - background-position: -19px top; -} -.main tbody td.action a.edit:hover { - background-position: -19px -19px; -} -.main tbody td.action a.delete { - background-position: -38px top; -} -.main tbody td.action a.delete:hover { - background-position: -38px -19px; -} -.main tbody td.action a.switch { - background: url(<%= asset_path "switch.png" %>) no-repeat left 3px; - width: 40px; -} -.main tbody tr.disable td.action a.switch { - background-position:left bottom; -} -.main tbody td.action a.delete:hover { - background-position: -38px -19px; -} -.main tbody tr.have { -} -.main tbody tr.disable { - opacity: 0.7; -} -.main tbody tr { - background:none; - height:15px; -} -h1{ - margin:0 0 20px; -} -p{ - margin:0 0 10px; -} - -#back_sidebar .items_setup .list li{ - background:url(<%= asset_path "sidebar_li2.jpg" %>) repeat left top; - border:none; - padding: 0 0 0 5px; -} -#back_sidebar .items_setup .list li a{ - line-height:31px; -} -#back_sidebar .items_setup .list li:hover{ - background:url(<%= asset_path "sidebar_li2.jpg" %>) repeat left top; - border:none; -} -#back_sidebar .items_setup ul .list { +html, body{ + height: 100%; + margin: 0; + padding: 0; +} +html{ + background: url(<%= asset_path "body.jpg" %>) no-repeat fixed 0 0 transparent; + background-size: cover; +} + +body{ + color: #000000; + font-family: Helvetica, '微軟正黑體'; +} +#back_banner_link{ + background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #787e82), color-stop(0.05, #61676c), color-stop(1, #292c2d) ); + background:-moz-linear-gradient( center top -90deg, #787e82 0%, #61676c 5%, #292c2d 100% ); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#61676c', endColorstr='#292c2d'); + -moz-box-shadow: 0px 1px 5px 0px rgba(0,0,0,.7); + -webkit-box-shadow: 0px 1px 5px 0px rgba(0,0,0,.7); + box-shadow: 0px 1px 5px 0px rgba(0,0,0,.7); + border-top: 1px solid #474a4c; + border-bottom: 1px solid #1d2020; + height: 41px; + width: 100%; + behavior: url(<%= asset_path "PIE.htc" %>); +} +.hmenu{ + float: right; + height: 41px; +} +#back_orbit{ + background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #70787d), color-stop(1, #3b4043) ); + background:-moz-linear-gradient( center top -90deg, #70787d 0%, #3b4043 100% ); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#70787d', endColorstr='#3b4043'); + -webkit-border-radius: 0px 0px 5px 5px; + -moz-border-radius: 0px 0px 5px 5px; + border-radius: 0px 0px 5px 5px; + -moz-box-shadow: 0px 1px 1px 0px rgba(0,0,0,.7); + -webkit-box-shadow: 0px 1px 1px 0px rgba(0,0,0,.7); + box-shadow: 0px 1px 1px 0px rgba(0,0,0,.7); + cursor: pointer; + float: left; + height: 43px; + margin-left: 10px; + width: 41px; + behavior: url(<%= asset_path "PIE.htc" %>); +} +#back_orbit span{ + text-indent: -9999px; + background: url(<%= asset_path "bar_orbit.png" %>) no-repeat scroll 0 0 transparent; + display: block; + height: 43px; + width: 100%; +} +#back_orbit:hover{ + background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #fefefe), color-stop(1, #e4e4e4) ); + background:-moz-linear-gradient( center top -90deg, #fefefe 0%, #e4e4e4 100% ); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fefefe', endColorstr='#e4e4e4'); + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + border-radius: 0px; +} +#back_orbit:hover span{ + background-position: 0 -44px; +} +#back_orbit:hover #orblist{ + display:block; +} +#orblist{ + background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #e4e4e4), color-stop(1, #FFFFFF) ); + background:-moz-linear-gradient( center top -90deg, #e4e4e4 0%, #FFFFFF 100% ); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e4e4e4', endColorstr='#FFFFFF'); + -webkit-border-radius: 0px 3px 3px 3px; + -moz-border-radius: 0px 3px 3px 3px; + border-radius: 0px 3px 3px 3px; + -webkit-box-shadow: 0 3px 3px #000000; + -moz-box-shadow: 0 3px 3px #000000; + box-shadow: 0 3px 3px #000000; + display: none; + margin: 0; + padding: 10px; + position: absolute; + top: 43px; + width: 130px; +} +#orblist li{ + border-bottom:1px solid #aaa; + list-style:none; +} +.orblink{ + color: #333333; + display: block; + font: 12px/100% arial,sans-serif; + padding: 5px; + text-decoration: none; +} +.orblink:hover{ + background:#eee; + color:#333; +} +#log_out{ + -moz-box-shadow:inset 1px 0px 0px 0px #73777b; + -webkit-box-shadow:inset 1px 0px 0px 0px #73777b; + box-shadow:inset 1px 0px 0px 0px #73777b; + border-right:1px solid #41474c; + border-left:1px solid #41474c; + float:right; + width:41px; + height:41px; +} +#log_out:hover{ + background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #01afde), color-stop(1, #007ec6) ); + background:-moz-linear-gradient( center top -90deg, #01afde 0%, #007ec6 100% ); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#01afde', endColorstr='#007ec6'); +} +#log_out a{ + background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right 0 transparent; + display: block; + height: 41px; + text-indent: -9999px; + width: 41px; +} +#log_out a:hover{ + background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right bottom transparent !important; +} +.lang{ + color: #FFFFFF; + float: right; + font-size: 15px; + line-height: 40px; + margin-right: 10px; +} +.lang a{ + color:#fff; + text-decoration:none; +} +.lang a:hover{ + text-decoration:underline; +} +#back_content{ + height: 100%; +} +#back_footer{ + background-color: #101010; + bottom: 0; + color: #FFFFFF; + font-size: 11px; + padding: 10px; + position: fixed; + width: 100%; + left: 0; + box-shadow: 0 -3px 4px #000; +} +.items_setup{ + padding:42px 0 0 0; +} +#back_sidebar .items_setup .list li{ + padding: 6px 0 7px 5px; +} +#back_sidebar .items_setup .list li a{ + display: inline; + font-size: 0.9em; + padding: 0; +} +#back_sidebar .items_setup .list li a span{ + background:none; + padding:0; + text-shadow:none; +} +.main { + background: none repeat scroll 0 0 #FFFFFF; + height: 100%; + margin-left: 220px; + padding: 0 40px; + position: relative; +} +.main_list { + padding-top: 70px; +} +.main_list ul { + clear:both; +} +#porfile { + padding-top: 100px; +} +/*add_buttom*/ +.button_bar { + float: right; + -moz-box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black; + -webkit-box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black; + box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black; + background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #4f4f4f), color-stop(1, #000000) ); + background:-moz-linear-gradient( center top, #4f4f4f 5%, #000000 100% ); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f', endColorstr='#000000'); + background-color:#4f4f4f; + -moz-border-radius:5px; + -webkit-border-radius:5px; + border-radius:5px; + display:inline-block; + padding:0; + margin:10px 0 60px; +} +.button_bar a { + text-decoration:none; + text-shadow:0px -1px 0px #000000; + font-size:12px; + color:#EDEDED; + border-right:1px solid #555; + -moz-box-shadow:1px 0px 0px black; + -webkit-box-shadow:1px 0px 0px black; + box-shadow:1px 0px 0px black; + padding: 6px 10px 4px; + display: inline-block; + float: left; +} +.button_bar a:active { + padding: 7px 10px 3px !important; + text-shadow:0px 1px 0px #000000; + background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #000000), color-stop(1, #4f4f4f) ); + background:-moz-linear-gradient( center top, #000000 5%, #4f4f4f 100% ); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#4f4f4f'); +} +.button_bar a:last-child { + border-right:none; + -moz-box-shadow:none; + -webkit-box-shadow:none; + box-shadow:none; + -moz-border-radius:0px 5px 5px 0px; + -webkit-border-radius:0px 5px 5px 0px; + border-radius:0px 5px 5px 0px; +} +.button_bar a:first-child { + -moz-border-radius:5px 0px 0px 5px; + -webkit-border-radius:5px 0px 0px 5px; + border-radius:5px 0px 0px 5px; +} +.button_bar a.new { + padding: 5px 10px; + -moz-border-radius:5px; + -webkit-border-radius:5px; + border-radius:5px; +} +.button_bar a:hover { + color:#FFFFFF; +} +.up { + margin:10px 0; +} +#person { + left: 245px; + position: fixed; + text-align: center; + top: 75px; + width: 140px; + background-color:#FFF; + padding:15px; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -moz-box-shadow: 0px 0px 4px #180902; /* Firefox */ + -webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */ + box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */ +} +#file { + display:none; +} +#person img { +} +.user_mail { + border: medium none; + border:1px solid #DDDDDD; + color: #666666; + font-size: 12px; + width: 140px; +} +#person label { + display: block; + margin: 15px 0 0; +} +#person label input { +} +#person label #user_admin { + float:right; + margin: 0; +} +#person label span { + text-align:left; + font-size:11px; + color:#888; + display:block; +} +#person select { + border: 1px solid #DDDDDD; + padding: 0; + width: 140px; +} +#porfile .users{ + margin-left: 180px; +} +.roles_block { + background: url(<%= asset_path "75.png" %>) repeat left top; + min-width:710px; + margin-bottom:50px; + position:relative; + padding-bottom: 20px; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -moz-box-shadow: 0px 0px 4px #180902; /* Firefox */ + -webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */ + box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */ +} +.roles_block h2 { + color: #FFFFFF; + font-weight: normal; + margin: 0; + padding: 0; + position: absolute; + text-shadow: 0 3px 2px #000000; + top: -30px; +} +.main hr { + height:8px; + border:none; + margin:0; + border-radius: 5px 5px 0px 0px; + -moz-border-radius: 5px 5px 0px 0px; + -webkit-border-radius: 5px 5px 0px 0px; + border-bottom:1px solid #000; +} +.main2{ + padding:70px 0 0; +} +#basic_block hr { + background-color: #666666; +} +#teacher_block hr { + background-color: #0071A9; +} +#student_block hr { + background-color: #AF0045; +} +.info_input { + padding:10px 20px; +} +.info_input table { + color:#fff; + width:100%; + font-size:14px; +} +.info_input table td { + padding:5px 10px 5px 0; + width: 10%; +} +.info_input .list_head { + background:url(<%= asset_path "line.png" %>) left bottom repeat-x; +} +.info_input .list_head td { +} +.info_input .list_item { + color:#AEAEAE; +} +.info_input .add { + display:block; + padding-left:22px; + font-size:12px; + line-height:21px; + height:19px; + background:url(<%= asset_path "icon.png" %>) no-repeat -59px 0; + margin-top: 10px; + color: #DDDDDD; +} + +.main table { + width:100%; +} +.main td { + padding-left:20px; + color:#fff; + font-size:14px; + line-height:40px; +} +.main tr.have td{ + background: url(<%= asset_path "75.png" %>) repeat left top; +} +.main tr.have td:first-child{ + border-radius: 5px 0 0 5px; + -moz-border-radius: 5px 0 0 5px; + -webkit-border-radius: 5px 0 0 5px; +} +.main tr.have td:last-child{ + border-radius: 0 5px 5px 0; + -moz-border-radius: 0 5px 5px 0; + -webkit-border-radius: 0 5px 5px 0; +} +.main thead td { + line-height:40px; + font-size:16px; + text-shadow: 0px 1px 1px #3e2914; +} +.main thead td.action { + width:140px; +} +.main tbody td.roles { + background-image: url(<%= asset_path "roles_type.jpg" %>); + background-repeat: repeat-x; +} +.main tbody td.teacher { + background-position: 0 -54px; +} +.main tbody td.student { + background-position: 0 -5px; +} +.main tbody td.action a { + background-image: url(<%= asset_path "icon.png" %>); + display: inline-block; + height: 19px; + margin-right: 10px; + top: 8px; + text-indent: -9999px; + width: 19px; + position: relative; +} +.main tbody td.action a.show { + background-position: left top; +} +.main tbody td.action a.show:hover { + background-position: left -19px; +} +.main tbody td.action a.edit { + background-position: -19px top; +} +.main tbody td.action a.edit:hover { + background-position: -19px -19px; +} +.main tbody td.action a.delete { + background-position: -38px top; +} +.main tbody td.action a.delete:hover { + background-position: -38px -19px; +} +.main tbody td.action a.switch { + background: url(<%= asset_path "switch.png" %>) no-repeat left 3px; + width: 40px; +} +.main tbody tr.disable td.action a.switch { + background-position:left bottom; +} +.main tbody td.action a.delete:hover { + background-position: -38px -19px; +} +.main tbody tr.have { +} +.main tbody tr.disable { + opacity: 0.7; +} +.main tbody tr { + background:none; + height:15px; +} +h1{ + margin:0 0 20px; +} +p{ + margin:0 0 10px; +} + +#back_sidebar .items_setup .list li{ + background:url(<%= asset_path "sidebar_li2.jpg" %>) repeat left top; + border:none; + padding: 0 0 0 5px; +} +#back_sidebar .items_setup .list li a{ + line-height:31px; +} +#back_sidebar .items_setup .list li:hover{ + background:url(<%= asset_path "sidebar_li2.jpg" %>) repeat left top; + border:none; +} +#back_sidebar .items_setup ul .list { } \ No newline at end of file diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6bdac5ee..e4e94c12 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,7 +9,7 @@ class ApplicationController < ActionController::Base def front_end_available(module_app_title='') app_controller = ModuleApp.first(conditions: {:title => module_app_title} ) unless app_controller.enable_frontend? - render :nothing + render :nothing => true end end diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 693243c2..33c927ac 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -19,7 +19,7 @@ class PagesController < ApplicationController end def show - begin + #begin item = Item.first(:conditions => {:full_name => params[:page_name]}) case item._type when 'Page' @@ -28,9 +28,9 @@ class PagesController < ApplicationController when 'Link' redirect_to "http://#{item[:url]}" end - rescue - render :file => "#{Rails.root}/public/404.html", :status => :not_found - end + #rescue + # render :file => "#{Rails.root}/public/404.html", :status => :not_found + #end end end diff --git a/app/views/admin/assets/_asset.html.erb b/app/views/admin/assets/_asset.html.erb index b29bc51d..7aad2ef8 100644 --- a/app/views/admin/assets/_asset.html.erb +++ b/app/views/admin/assets/_asset.html.erb @@ -13,5 +13,5 @@ - + \ No newline at end of file diff --git a/app/views/admin/assets/_form.html.erb b/app/views/admin/assets/_form.html.erb index 3ee7c644..72199ceb 100644 --- a/app/views/admin/assets/_form.html.erb +++ b/app/views/admin/assets/_form.html.erb @@ -9,6 +9,6 @@

-<%= f.label :data, t('admin.data') %> +<%= f.label :data, t('admin.data'), :class => 'file' %> <%= f.file_field :data %>

\ No newline at end of file diff --git a/app/views/admin/assets/_new.html.erb b/app/views/admin/assets/_new.html.erb index 4f15fafc..49e638c8 100644 --- a/app/views/admin/assets/_new.html.erb +++ b/app/views/admin/assets/_new.html.erb @@ -9,7 +9,7 @@ <%= link_back %> <%= f.submit t(:create) %> <% else %> - <%= t(:create) %> + <%= t(:create) %> <% end %>
<% end %> diff --git a/app/views/admin/users/_sub_role_selector.html.erb b/app/views/admin/users/_sub_role_selector.html.erb index 6d7924ca..2305cb47 100644 --- a/app/views/admin/users/_sub_role_selector.html.erb +++ b/app/views/admin/users/_sub_role_selector.html.erb @@ -1,4 +1,4 @@ <% role.sub_roles.each do |sub_role| %> - <%= sub_role.i18n_variable[I18n.locale] %> - <%= check_box_tag "user[sub_role_ids][]", sub_role.id, @user.sub_role_ids.include?(sub_role.id), :class => 'sub_role_select' %> + <%= f.label sub_role.i18n_variable[I18n.locale], :for => "check_sub_role_#{sub_role.id}", :class => 'sub_role_select' %> + <%= check_box_tag "user[sub_role_ids][]", sub_role.id, @user.sub_role_ids.include?(sub_role.id), :id => "check_sub_role_#{sub_role.id}", :class => 'sub_role_select' %> <% end %> \ No newline at end of file diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 63137048..d800ab5d 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -1,31 +1,37 @@ - - - - - <%= @title || APP_CONFIG['orbit'] %> - - <%= stylesheet_link_tag "admin" %> - <%= javascript_include_tag "admin" %> - <%= yield :page_specific_css %> - <%= yield :page_specific_javascript %> - <%= csrf_meta_tag %> - - - - -
-
<%= yield :secondary %>
-
- <%= yield %> -
-
<%= yield :tertiary %>
- -
- - + + + + + <%= @title || APP_CONFIG['orbit'] %> + + + <%= stylesheet_link_tag "admin" %> + <%= javascript_include_tag "admin" %> + <%= yield :page_specific_css %> + <%= yield :page_specific_javascript %> + <%= csrf_meta_tag %> + + + + +
+
<%= yield :secondary %>
+
+ <%= yield %> +
+
<%= yield :tertiary %>
+ +
+ + diff --git a/app/views/layouts/site_editor.html.erb b/app/views/layouts/site_editor.html.erb index f419fb02..f4df75c4 100644 --- a/app/views/layouts/site_editor.html.erb +++ b/app/views/layouts/site_editor.html.erb @@ -1,32 +1,38 @@ - - - - - <%= @title || APP_CONFIG['orbit'] %> - - <%= stylesheet_link_tag "site_editor" %> - <%= javascript_include_tag "site_editor" %> - <%= yield :page_specific_css %> - <%= yield :page_specific_javascript %> - <%= csrf_meta_tag %> - - - - -
-
<%= yield :sidebar %>
-
- <%= yield %> -
-
<%= yield :tertiary %>
- -
- - - + + + + + <%= @title || APP_CONFIG['orbit'] %> + + + <%= stylesheet_link_tag "site_editor" %> + <%= javascript_include_tag "site_editor" %> + <%= yield :page_specific_css %> + <%= yield :page_specific_javascript %> + <%= csrf_meta_tag %> + + + + +
+
<%= yield :sidebar %>
+
+ <%= yield %> +
+
<%= yield :tertiary %>
+ +
+ + + diff --git a/config/environments/development.rb b/config/environments/development.rb index 48f4d956..d1b671e5 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -10,7 +10,7 @@ PrototypeR4::Application.configure do config.whiny_nils = true # Show full error reports and disable caching - config.consider_all_requests_local = true + config.consider_all_requests_local = false #config.action_view.debug_rjs = true config.action_controller.perform_caching = false diff --git a/lib/parsers/parser_back_end.rb b/lib/parsers/parser_back_end.rb index d11ce9b2..48b6a1df 100644 --- a/lib/parsers/parser_back_end.rb +++ b/lib/parsers/parser_back_end.rb @@ -107,7 +107,7 @@ module ParserBackEnd c.define_tag 'menu' do |tag| home = get_homepage menu = page.design.layout.menu - menu_level(home, 1, menu, true) + menu_level(home, 0, menu, true) end end end diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb index e96c9201..70006eb3 100644 --- a/lib/parsers/parser_common.rb +++ b/lib/parsers/parser_common.rb @@ -1,23 +1,33 @@ module ParserCommon def menu_level(page, current, menu, edit = false) + res = '' if current <= menu.levels - res = "" end end @@ -26,8 +36,11 @@ module ParserCommon res << menu.values["li_class_#{current}"] res << "_#{i}" if i res << ">" - res << "#{page.name}" - res << menu_level(page, current + 1, menu, edit) if page.children.size > 0 && !page.is_home? + if page.children.size > 0 + res << menu_level(page, current + 1, menu, edit) + else + res << "#{page.name}" + end res << "" end diff --git a/lib/parsers/parser_front_end.rb b/lib/parsers/parser_front_end.rb index 660a779b..3452f4fc 100644 --- a/lib/parsers/parser_front_end.rb +++ b/lib/parsers/parser_front_end.rb @@ -104,7 +104,7 @@ module ParserFrontEnd ret << "
" else part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s } rescue nil - ret << part.content + ret << part.content rescue nil end ret end @@ -118,7 +118,7 @@ module ParserFrontEnd c.define_tag 'menu' do |tag| home = get_homepage menu = page.design.layout.menu - menu_level(home, 1, menu) + menu_level(home, 0, menu) end end end diff --git a/lib/tasks/pages.rake b/lib/tasks/pages.rake new file mode 100644 index 00000000..8a43f420 --- /dev/null +++ b/lib/tasks/pages.rake @@ -0,0 +1,66 @@ +# encoding: utf-8 + +namespace :pages do + + task :build => :environment do + + Item.delete_all + + + var_10 = I18nVariable.create!( :document_class => 'Home', :key => 'home', :en => 'Homepage', :zh_tw => '首頁') + var_13 = I18nVariable.create!( :document_class => 'PagePart', :key => 'main_content', :en => 'This is the homepage', :zh_tw => '這是首頁', :parent_id => var_10.id ) + + + design = Design.new(:title => "Fraisier", :author => "Paul", :intro => "Strawberry cake") + + design.build_default_css(:file => File.open("#{Rails.root}/lib/fraisier/default.css")) + + # image = design.images.build(:file => File.open("#{Rails.root}/lib/fraisier/img/buttons.gif")) + # + # js = design.javascripts.build(:file => File.open("#{Rails.root}/lib/fraisier/inettuts.js")) + # + theme = design.themes.build(:file => File.open("#{Rails.root}/lib/fraisier/themes/default.css")) + theme_1 = design.themes.build(:file => File.open("#{Rails.root}/lib/fraisier/themes/red.css")) + + design.build_layout + design.layout.file = File.open("#{Rails.root}/lib/fraisier/layout.html") + + design.layout.save + theme.save + theme_1.save + # image.save + # js.save + + design.save + + + + design_1 = Design.new(:title => "Bob", :author => "Me", :intro => "Moran") + + design_1.build_default_css(:file => File.open("#{Rails.root}/lib/fraisier/default.css")) + + # image = design.images.build(:file => File.open("#{Rails.root}/lib/fraisier/img/buttons.gif")) + # + # js = design.javascripts.build(:file => File.open("#{Rails.root}/lib/fraisier/inettuts.js")) + # + theme = design_1.themes.build(:file => File.open("#{Rails.root}/lib/fraisier/themes/default.css")) + theme_1 = design_1.themes.build(:file => File.open("#{Rails.root}/lib/fraisier/themes/red.css")) + + design_1.build_layout + design_1.layout.file = File.open("#{Rails.root}/lib/fraisier/layout.html") + + design_1.layout.save + theme.save + theme_1.save + # image.save + # js.save + + design_1.save + + + home = Page.create!( :i18n_variable_id => var_10.id, :design_id => design_1.id, :name => 'home', :is_published => true, :theme_id => theme.id ) + home.page_parts.create!( :name => 'content_1', :content => File.open("#{Rails.root}/lib/template/home.page").read, :kind => 'text', :i18n_variable_id => var_13.id ) + + end + +end From 4d2809d40bfbff66f82e9b1e056c0868922d1f8f Mon Sep 17 00:00:00 2001 From: chris2tof Date: Fri, 13 Jan 2012 12:35:46 +0800 Subject: [PATCH 6/8] Update carrierwave #{column}_identifier must be used to get the name of the file --- Gemfile | 5 +++-- Gemfile.lock | 24 +++++++++++------------- config/initializers/carrierwave.rb | 6 +++--- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Gemfile b/Gemfile index 6fd6eaa1..3ff28976 100644 --- a/Gemfile +++ b/Gemfile @@ -3,14 +3,15 @@ gem 'rails' gem 'yajl-ruby', :require => 'yajl' gem 'bson_ext' -gem 'carrierwave', '0.5.4' +gem 'carrierwave' +gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid' gem 'ckeditor' gem 'devise' gem 'mini_magick' gem 'rubyzip' gem 'sinatra' gem 'execjs' -gem 'mongoid', :git => 'git://github.com/mongoid/mongoid.git', :ref => '7a915395db50e2bc6071a503a11530e644879e49' +gem 'mongoid' gem 'rake' gem 'jquery-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 14d92fe0..27a3d794 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,13 +1,3 @@ -GIT - remote: git://github.com/mongoid/mongoid.git - revision: 7a915395db50e2bc6071a503a11530e644879e49 - ref: 7a915395db50e2bc6071a503a11530e644879e49 - specs: - mongoid (2.4.0) - activemodel (~> 3.1) - mongo (~> 1.3) - tzinfo (~> 0.3.22) - GEM remote: http://rubygems.org/ specs: @@ -46,8 +36,11 @@ GEM bson_ext (1.5.2) bson (= 1.5.2) builder (3.0.0) - carrierwave (0.5.4) + carrierwave (0.5.8) activesupport (~> 3.0) + carrierwave-mongoid (0.1.3) + carrierwave (>= 0.5.6) + mongoid (~> 2.1) chronic (0.6.6) ckeditor (3.6.3) mime-types (~> 1.16) @@ -96,6 +89,10 @@ GEM subexec (~> 0.1.0) mongo (1.5.2) bson (= 1.5.2) + mongoid (2.4.0) + activemodel (~> 3.1) + mongo (~> 1.3) + tzinfo (~> 0.3.22) multi_json (1.0.4) orm_adapter (0.0.5) polyglot (0.3.3) @@ -192,7 +189,8 @@ PLATFORMS DEPENDENCIES bson_ext - carrierwave (= 0.5.4) + carrierwave + carrierwave-mongoid ckeditor coffee-rails database_cleaner @@ -203,7 +201,7 @@ DEPENDENCIES factory_girl_rails jquery-rails mini_magick - mongoid! + mongoid radius rails rake diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index 1c7f73c1..2c46dd11 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -1,5 +1,3 @@ -require 'carrierwave/orm/mongoid' - begin db_config = YAML::load(File.read(File.join(Rails.root, "/config/mongoid.yml"))) rescue @@ -12,4 +10,6 @@ CarrierWave.configure do |config| config.grid_fs_port = db_config[Rails.env]['port'] config.storage = :grid_fs config.grid_fs_access_url = "/gridfs" -end \ No newline at end of file +end + +CarrierWave::SanitizedFile.sanitize_regexp = /[^[:word:]\.\-\+]/ From 9ea613cf4eb01d23573c5405a879f8528c15e8a1 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Mon, 16 Jan 2012 08:14:05 +0800 Subject: [PATCH 7/8] Embed attribute_fields and sub_roles --- app/models/user/attribute.rb | 2 +- app/models/user/attribute_field.rb | 2 +- app/models/user/role.rb | 2 +- app/models/user/sub_role.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/user/attribute.rb b/app/models/user/attribute.rb index af8a1106..84650421 100644 --- a/app/models/user/attribute.rb +++ b/app/models/user/attribute.rb @@ -7,7 +7,7 @@ class Attribute field :built_in, :type => Boolean, :default => false field :disabled, :type => Boolean, :default => false - has_many :attribute_fields, :autosave => true, :dependent => :destroy + embeds_many :attribute_fields, :cascade_callbacks => true has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy accepts_nested_attributes_for :attribute_fields, :allow_destroy => true diff --git a/app/models/user/attribute_field.rb b/app/models/user/attribute_field.rb index 42bbf910..2d909b3e 100644 --- a/app/models/user/attribute_field.rb +++ b/app/models/user/attribute_field.rb @@ -10,7 +10,7 @@ class AttributeField field :built_in, :type => Boolean, :default => false field :disabled, :type => Boolean, :default => false - belongs_to :attribute + embedded_in :attribute has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy has_many :attribute_values diff --git a/app/models/user/role.rb b/app/models/user/role.rb index 86f7266f..788d281d 100644 --- a/app/models/user/role.rb +++ b/app/models/user/role.rb @@ -7,7 +7,7 @@ class Role field :built_in, :type => Boolean, :default => false field :disabled, :type => Boolean, :default => false - has_many :sub_roles, :autosave => true, :dependent => :destroy + embeds_many :sub_roles, :cascade_callbacks => true has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy has_many :users accepts_nested_attributes_for :i18n_variable, :allow_destroy => true diff --git a/app/models/user/sub_role.rb b/app/models/user/sub_role.rb index cdefb5f5..47f3e2de 100644 --- a/app/models/user/sub_role.rb +++ b/app/models/user/sub_role.rb @@ -1,6 +1,6 @@ class SubRole < Attribute - belongs_to :role + embedded_in :role has_and_belongs_to_many :users # Get an sub_role from key From 5f684ba0f4ada65315a73b3e2d90fd1981afde64 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 24 Jan 2012 11:36:24 +0800 Subject: [PATCH 8/8] Change "_filename" to "_identifier" for carrierwave --- app/controllers/admin/designs_controller.rb | 8 ++++---- app/controllers/admin/purchases_controller.rb | 2 +- app/models/design/design.rb | 6 +++--- app/models/design/stylesheet.rb | 4 ++-- app/models/design/theme.rb | 2 +- app/views/admin/assets/_asset.html.erb | 2 +- app/views/admin/designs/_design_file.html.erb | 4 ++-- lib/parsers/parser_layout.rb | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/controllers/admin/designs_controller.rb b/app/controllers/admin/designs_controller.rb index 5930d1bf..68fbb243 100644 --- a/app/controllers/admin/designs_controller.rb +++ b/app/controllers/admin/designs_controller.rb @@ -46,7 +46,7 @@ class Admin::DesignsController < ApplicationController filename = params[:filename] files = @design.themes + @design.javascripts + @design.images file_to_removed = files.find{ |obj| - obj.file_filename == filename + obj.file_identifier == filename } type = file_to_removed._type new_file = "" @@ -103,7 +103,7 @@ class Admin::DesignsController < ApplicationController temp_file.write (zip_file.read entry ).force_encoding('UTF-8') default_css = design.build_default_css default_css.file = temp_file - default_css.file_filename = filename + default_css.file_identifier = filename default_css.to_save = true when /\A(#{zip_name})\/(reset\.css)\z/ #for reset css filename = File.basename(entry.to_s) @@ -111,7 +111,7 @@ class Admin::DesignsController < ApplicationController temp_file.write (zip_file.read entry ).force_encoding('UTF-8') reset_css = design.build_reset_css reset_css.file = temp_file - reset_css.file_filename = filename + reset_css.file_identifier = filename reset_css.to_save = true when /\A(#{zip_name})\/(layout\.html)\z/ #for layout html filename = File.basename(entry.to_s) @@ -135,7 +135,7 @@ class Admin::DesignsController < ApplicationController temp_file.write (zip_file.read entry).force_encoding('UTF-8') build_and_store = eval("design.#{type}").build build_and_store.file = temp_file - build_and_store.file_filename = filename + build_and_store.file_identifier = filename build_and_store.to_save = true end end diff --git a/app/controllers/admin/purchases_controller.rb b/app/controllers/admin/purchases_controller.rb index 40a042f4..00980cec 100644 --- a/app/controllers/admin/purchases_controller.rb +++ b/app/controllers/admin/purchases_controller.rb @@ -172,7 +172,7 @@ class Admin::PurchasesController < ApplicationController def build_file(orig_zip, zip_name, dir, object, type = nil) - title = object.file_filename + title = object.file_identifier temp = File.new(dir + '/' + title, 'w+') temp.write orig_zip.read(zip_name + '/' + (type ? (type + '/') : '') + title) object.file = temp diff --git a/app/models/design/design.rb b/app/models/design/design.rb index e77f7f0f..eb1f5e64 100644 --- a/app/models/design/design.rb +++ b/app/models/design/design.rb @@ -31,7 +31,7 @@ class Design def files_with_duplicate? [self.javascripts, self.images,self.themes].each do |objects_hash| - ary = objects_hash.collect{ |k| k.file_filename} + ary = objects_hash.collect{ |k| k.file_identifier} ary.compact! # debugger return true if(ary.count!=ary.uniq.count) @@ -42,7 +42,7 @@ class Design def files_with_noname? [self.javascripts, self.images,self.themes].each do |objects_hash| objects_hash.each{ |k| - return true if(k.file_filename.nil? && !k.to_save?) + return true if(k.file_identifier.nil? && !k.to_save?) } end false @@ -121,7 +121,7 @@ class Design def process_object(object) if object.to_save - if object.file_filename.nil? + if object.file_identifier.nil? new_object = self.send(object._type.downcase.pluralize).build(object.attributes) new_object.file = object.file object.destroy diff --git a/app/models/design/stylesheet.rb b/app/models/design/stylesheet.rb index f26f1558..13fb154d 100644 --- a/app/models/design/stylesheet.rb +++ b/app/models/design/stylesheet.rb @@ -11,14 +11,14 @@ class Stylesheet < DesignFile content.scan(/(?<=url)(.*?)(?=\))/){ css_name = $1.gsub(' ','').gsub('(','') name = File.basename(css_name).gsub(/[\\\"]/, '') - file_name = images.detect{ |i| i.file_filename.eql?(name) }.file_url rescue nil + file_name = images.detect{ |i| i.file_identifier.eql?(name) }.file_url rescue nil names << [css_name, file_name] } names.each do |name| content.gsub!(name[0], name[1]) if name[1] end Dir.mktmpdir('f_path') { |dir| - orig_file_name = self.file_filename + orig_file_name = self.file_identifier temp_file = File.new(dir + '/' + orig_file_name, 'w+') temp_file.write orig_content.force_encoding("UTF-8") diff --git a/app/models/design/theme.rb b/app/models/design/theme.rb index e6974181..dd4a6b01 100644 --- a/app/models/design/theme.rb +++ b/app/models/design/theme.rb @@ -7,7 +7,7 @@ class Theme < Stylesheet protected def set_name - self.name = File.basename(self.file_filename,".css") + self.name = File.basename(self.file_identifier,".css") end end diff --git a/app/views/admin/assets/_asset.html.erb b/app/views/admin/assets/_asset.html.erb index 7aad2ef8..ea71dc6c 100644 --- a/app/views/admin/assets/_asset.html.erb +++ b/app/views/admin/assets/_asset.html.erb @@ -5,7 +5,7 @@ <%= asset.description %> <%= asset.data.file.content_type %> - <%= asset.data_filename %> + <%= asset.data_identifier %> <%= number_to_human_size(asset.data.file.file_length) %> <%= link_to t(:edit), edit_admin_asset_path(asset), :remote => true, :class => 'edit' %> diff --git a/app/views/admin/designs/_design_file.html.erb b/app/views/admin/designs/_design_file.html.erb index c2945069..9e494552 100644 --- a/app/views/admin/designs/_design_file.html.erb +++ b/app/views/admin/designs/_design_file.html.erb @@ -1,8 +1,8 @@ <%= f.label "field_name", t('admin.' + field_name) %>
    <% object.send(field_name).each do |t| %> -
  • > - <%= t.file_filename %> +
  • > + <%= t.file_identifier %> <% if classes.include?('r_destroy') %> <%= fields_for "design[" + field_name + "][]", t, :index => nil do |f| %> <%= f.hidden_field :id %> diff --git a/lib/parsers/parser_layout.rb b/lib/parsers/parser_layout.rb index e9eec7cc..16def68b 100644 --- a/lib/parsers/parser_layout.rb +++ b/lib/parsers/parser_layout.rb @@ -27,7 +27,7 @@ module ParserLayout layout.layout_parts.create(:name => tag.attr['name'], :editable => true) end c.define_tag 'image' do |tag| - image = layout.design.images.detect{ |i| i.file_filename.eql?(parse_html_image(tag.expand)) } + image = layout.design.images.detect{ |i| i.file_identifier.eql?(parse_html_image(tag.expand)) } image.update_attributes(:name => tag.attr['name'], :html_id => tag.attr['id'], :html_class => tag.attr['class']) end end