From 72efdbd742d4f3ac8a910bd5c817cf5c74570ba5 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Thu, 19 Apr 2012 11:50:54 +0800 Subject: [PATCH] changes before Chirs and Ray's trip --- Gemfile.lock | 4 + app/assets/javascripts/site_editor.js | 3 +- app/assets/stylesheets/list.css | 300 +++++++++--------- app/assets/stylesheets/new_admin.css.erb | 2 +- app/assets/stylesheets/sidebar.css.erb | 56 +++- app/assets/stylesheets/site_items.css.erb | 4 +- app/assets/stylesheets/style.css.erb | 24 ++ app/assets/stylesheets/widgets.css | 148 +++++++++ app/helpers/admin/item_helper.rb | 14 +- app/views/admin/ad_images/_form.html.erb | 16 +- .../admin/items/_site_map_left_bar.html.erb | 2 +- app/views/layouts/admin.html.erb | 74 ++--- app/views/layouts/site_editor.html.erb | 77 ++--- 13 files changed, 473 insertions(+), 251 deletions(-) create mode 100644 app/assets/stylesheets/widgets.css diff --git a/Gemfile.lock b/Gemfile.lock index 71742974..52453b6a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -97,6 +97,7 @@ GEM railties (~> 3.0) thor (~> 0.14) json (1.6.5) + libv8 (3.3.10.4) linecache19 (0.5.12) ruby_core_source (>= 0.1.4) mail (2.3.3) @@ -209,6 +210,8 @@ GEM rack (~> 1.0) tilt (~> 1.1, != 1.3.0) subexec (0.2.1) + therubyracer (0.9.10) + libv8 (~> 3.3.10) thor (0.14.6) tilt (1.3.3) tinymce-rails (3.4.8) @@ -269,6 +272,7 @@ DEPENDENCIES sinatra spork sprockets + therubyracer tinymce-rails uglifier watchr diff --git a/app/assets/javascripts/site_editor.js b/app/assets/javascripts/site_editor.js index 98405564..1eb5e3f1 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 new_admin \ No newline at end of file diff --git a/app/assets/stylesheets/list.css b/app/assets/stylesheets/list.css index 11f17a55..c7785778 100644 --- a/app/assets/stylesheets/list.css +++ b/app/assets/stylesheets/list.css @@ -1,151 +1,151 @@ -.list-remove { - position: relative; - top: 2px; - left: 2px; -} -.table th.select { - border-bottom:2px solid #0088CC; -} -.main-list { - margin-bottom: 0; -} -.main-wrap>.main-list thead th { - background-color: transparent; - border-right: medium none; -} -.main-list thead th:last-child { - border-right: none; -} -.main-list .span1 { - min-width: 32px; -} -.main-list .span7 { - min-width: 300px; -} -.main-list .nav-pills > li > a { - border-radius: 5px 5px 5px 5px; - margin: 2px; - padding:5px -} -.main-list tbody .quick-edit { - position:relative; - height:20px; -} -.main-list tbody .quick-edit .nav { - /*left: -55px;*/ - position: absolute; - /*top: -3px;*/ - width: 350px; - left: -8px; -} -.main-list td { - background-color: #FFFFFF; - border-bottom: 1px solid #DDDDDD; - border-top: medium none; -} -.main-list .nav { - margin-top: 0; - margin-bottom: 3px; -} -.main-list tr.with_action:hover .hide { - display:block !important; -} -.main-list .label-group { - position: relative; - height: 40px; -} -.main-list .label-td { - background-color: rgba(255, 255, 255, 1); - height: 40px; - overflow: hidden; - position: absolute; - width: 100%; - left: 0; - z-index: 1; -} -.main-list .label-td:hover { - height: auto; - text-align: center; - padding: 5px 5px 8px; - left: -6px; - top: -6px; - border: 1px solid rgba(0, 0, 0, 0.2); - box-shadow: 0px 5px 10px rgba(0,0,0,0.2); - -moz-box-shadow: 0px 5px 10px rgba(0,0,0,0.2); - -webkit-box-shadow: 0px 5px 10px rgba(0,0,0,0.2); - border-radius: 3px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - z-index: 5; -} -.table-label { - background-color: #F2F2F2; - position: relative; -} -.table-label .main-list thead th { - background-color: #F2F2F2; - border-right: 1px solid #DDDDDD; - border-top: 1px solid #DDDDDD !important; -} -.route-group .route { - padding: 0; -} -.route-group .route .breadcrumb { - border-width: 0!important; -} -.qe-block td { - height:auto; - padding: 0; -} -.qe-block .table td, .qe-block .table th { - padding: 8px; -} -.qe-block .form-horizontal { - margin-bottom: 0; -} -.qe-block .form-actions { - margin-bottom: 0; -} -legend { - font-size: 15px; - line-height: 30px; - margin-bottom: 15px; - padding-bottom: 5px; -} -.upload-picture { - margin-left: 20px; -} -.subnav { - -moz-border-radius: 0; - -webkit-border-radius: 0; - border-radius: 0; - border-left: none; - border-right: none; - position: fixed; - top: 30px; - z-index: 50; -} -.subnav .nav > li:first-child > a, .subnav .nav > li:first-child > a:hover { - -moz-border-radius: 0; - -webkit-border-radius: 0; - border-radius: 0; -} -.dropdown-menu.tags { - max-width: none; -} -.dropdown-menu.tags .tags-cloud { - width: 300px; - padding:10px; -} -.dropdown-menu.tags .tags-cloud .active { - background-color: #0088CC; - color: #FFFFFF; -} -.dropdown-menu.tags .tags-cloud a { - display: inline-block; - margin-bottom: 3px; -} -.dropdown-menu.tags li:last-child a { - display: block; - text-align:center; +.list-remove { + position: relative; + top: 2px; + left: 2px; +} +.table th.select { + border-bottom:2px solid #0088CC; +} +.main-list { + margin-bottom: 0; +} +.main-wrap>.main-list thead th { + background-color: transparent; + border-right: medium none; +} +.main-list thead th:last-child { + border-right: none; +} +.main-list .span1 { + min-width: 32px; +} +.main-list .span7 { + min-width: 300px; +} +.main-list .nav-pills > li > a { + border-radius: 5px 5px 5px 5px; + margin: 2px; + padding:5px +} +.main-list tbody .quick-edit { + position:relative; + height:20px; +} +.main-list tbody .quick-edit .nav { + /*left: -55px;*/ + position: absolute; + /*top: -3px;*/ + width: 350px; + left: -8px; +} +.main-list td { + background-color: #FFFFFF; + border-bottom: 1px solid #DDDDDD; + border-top: medium none; +} +.main-list .nav { + margin-top: 0; + margin-bottom: 3px; +} +.main-list tr.with_action:hover .hide { + display:block !important; +} +.main-list .label-group { + position: relative; + height: 40px; +} +.main-list .label-td { + background-color: rgba(255, 255, 255, 1); + height: 40px; + overflow: hidden; + position: absolute; + width: 100%; + left: 0; + z-index: 1; +} +.main-list .label-td:hover { + height: auto; + text-align: center; + padding: 5px 5px 8px; + left: -6px; + top: -6px; + border: 1px solid rgba(0, 0, 0, 0.2); + box-shadow: 0px 5px 10px rgba(0,0,0,0.2); + -moz-box-shadow: 0px 5px 10px rgba(0,0,0,0.2); + -webkit-box-shadow: 0px 5px 10px rgba(0,0,0,0.2); + border-radius: 3px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + z-index: 5; +} +.table-label { + background-color: #F2F2F2; + position: relative; +} +.table-label .main-list thead th { + background-color: #F2F2F2; + border-right: 1px solid #DDDDDD; + border-top: 1px solid #DDDDDD !important; +} +.route-group .route { + padding: 0; +} +.route-group .route .breadcrumb { + border-width: 0!important; +} +.qe-block td { + height:auto; + padding: 0; +} +.qe-block .table td, .qe-block .table th { + padding: 8px; +} +.qe-block .form-horizontal { + margin-bottom: 0; +} +.qe-block .form-actions { + margin-bottom: 0; +} +legend { + font-size: 15px; + line-height: 30px; + margin-bottom: 15px; + padding-bottom: 5px; +} +.upload-picture { + margin-left: 20px; +} +.subnav { + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + border-left: none; + border-right: none; + position: fixed; + top: 30px; + z-index: 50; +} +.subnav .nav > li:first-child > a, .subnav .nav > li:first-child > a:hover { + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +.dropdown-menu.tags { + max-width: none; +} +.dropdown-menu.tags .tags-cloud { + width: 300px; + padding:10px; +} +.dropdown-menu.tags .tags-cloud .active { + background-color: #0088CC; + color: #FFFFFF; +} +.dropdown-menu.tags .tags-cloud a { + display: inline-block; + margin-bottom: 3px; +} +.dropdown-menu.tags li:last-child a { + display: block; + text-align:center; } \ No newline at end of file diff --git a/app/assets/stylesheets/new_admin.css.erb b/app/assets/stylesheets/new_admin.css.erb index d81761bc..9d687eb6 100644 --- a/app/assets/stylesheets/new_admin.css.erb +++ b/app/assets/stylesheets/new_admin.css.erb @@ -8,7 +8,7 @@ *= require bootstrap *= require bootstrap-orbit *= require list - *= require widget + *= require widgets *= require style *= require scroll_style *= require isotope diff --git a/app/assets/stylesheets/sidebar.css.erb b/app/assets/stylesheets/sidebar.css.erb index f5a5d572..79022cac 100644 --- a/app/assets/stylesheets/sidebar.css.erb +++ b/app/assets/stylesheets/sidebar.css.erb @@ -1,13 +1,9 @@ #back_sidebar { - background: url(<%= asset_path "75.png" %>) repeat scroll left top transparent; - box-shadow: 3px 0 4px #472A12; - border-right: 1px solid #121212; - height: 100%; left: 0; position: fixed; top: 0; - width: 220px; + width: 160px; } #back_sidebar h1 { @@ -91,4 +87,54 @@ } #sidebar .translations_setup { margin-top: 42px; +} + + +#main-sidebar{ + left:0; +} +#main-sidebar .list{ +} +#main-sidebar li{ + position:relative; +} +#main-sidebar li a{ + border-bottom: 1px solid #CCCCCC; + display: block; + padding: 10px 0 10px 10px; +} +#main-sidebar ul ul li a{ + padding: 10px 0 10px 20px; +} +#main-sidebar li:hover .quick-edit{ + display:block; +} +#main-sidebar .quick-edit{ + background: none repeat scroll 0 0 #FFFFFF; + border: 1px solid #DDDDDD; + border-radius: 5px 5px 5px 5px; + display: none; + margin:-3px 0 0 3px; + padding: 3px; + z-index:1; +} +#main-sidebar .quick-edit:after{ + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +#main-sidebar .quick-edit a{ + border-bottom: medium none; + border-radius: 5px 5px 5px 5px; + font-size:12px; + float: left; + margin: 0 3px 0 0; + padding: 3px; +} + +#main-sidebar .quick-edit a:hover{ + background: none repeat scroll 0 0 #EEEEEE; + border-bottom:none; } \ 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 4e23bd4c..922bfe56 100644 --- a/app/assets/stylesheets/site_items.css.erb +++ b/app/assets/stylesheets/site_items.css.erb @@ -4,7 +4,7 @@ html, body{ padding: 0; } html{ - background: url(<%= asset_path "body.jpg" %>) no-repeat fixed 0 0 transparent; + background-size: cover; } @@ -172,8 +172,6 @@ body{ .main { background: none repeat scroll 0 0 #FFFFFF; height: 100%; - margin-left: 220px; - padding: 0 40px; position: relative; } .main_list { diff --git a/app/assets/stylesheets/style.css.erb b/app/assets/stylesheets/style.css.erb index d2e33b04..39beaec9 100644 --- a/app/assets/stylesheets/style.css.erb +++ b/app/assets/stylesheets/style.css.erb @@ -261,6 +261,10 @@ box-shadow: 0px 2px 1px rgba(0,0,0,0.1); -moz-box-shadow: 0px 2px 1px rgba(0,0,0,0.1); -webkit-box-shadow: 0px 2px 1px rgba(0,0,0,0.1); + display: none; +} +#main-sidebar .nav > li.active > .nav { + display: block; } #main-sidebar .nav > li > .nav > li > a { margin-left: 0; @@ -433,6 +437,26 @@ .filters .in { /*border-bottom: 1px solid rgba(0,0,0,0.07)*/ } +#tags { +} +#tags .tag { + line-height: 32px; + padding: 0 10px; + background-color: #FFFFFF; + border-bottom: 1px solid #DDDDDD; + border-top: medium none; +} +#tags .tag form, #tags .tag form input { + margin:0; +} +#tags .tagitem { + display: inline-block; + float: left; +} +#tags .action { + display: inline-block; + float: right; +} .sign-in { width: 360px; margin: 0 auto 70px; diff --git a/app/assets/stylesheets/widgets.css b/app/assets/stylesheets/widgets.css new file mode 100644 index 00000000..7a658f36 --- /dev/null +++ b/app/assets/stylesheets/widgets.css @@ -0,0 +1,148 @@ +.widget-size-300 { + width:298px; +} +.widget-box { + background-color: #FFF; + overflow: hidden; + min-width: 300px; + margin: 0 0 5px 5px; + position:relative; +} +.widget-box .widget-title { + color: #FFF; + padding-left: 5px; + border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + -webkit-border-radius: 5px 5px 0 0; + background-image: -moz-linear-gradient(top, #B7B7B7, #9d9d9d); + background-image: -ms-linear-gradient(top, #B7B7B7, #9d9d9d); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#B7B7B7), to(#9d9d9d)); + background-image: -webkit-linear-gradient(top, #B7B7B7, #9d9d9d); + background-image: -o-linear-gradient(top, #B7B7B7, #9d9d9d); + background-image: linear-gradient(top, #B7B7B7, #9d9d9d); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#B7B7B7', endColorstr='#9d9d9d', GradientType=0); +} +.widget-box .widget-title [class^="icons-"] { + margin: 3px 5px 0 2px; +} +.widget-box .widget-content { + padding: 10px; + border-width: 0 1px 1px; + border-style: solid; + border-color: #CCCCCC; + border-radius: 0 0 5px 5px; + -moz-border-radius: 0 0 5px 5px; + -webkit-border-radius: 0 0 5px 5px; +} +.widget-box .form-horizontal .control-group > label { + width: 50px; +} +.widget-box .form-horizontal .controls { + margin-left: 60px; +} +.widget-action { + position:absolute; + right:1px; + top:6px; +} +.action { + float: left; + display:inline-block; + margin-right: 5px; + opacity: 0.8; + filter: alpha(opacity=80); +} +.action:hover { + opacity: 1; + filter: alpha(opacity=100); + cursor: pointer; +} +.select-role { + display:none; + padding: 10px 0; +} +.file-upload { + position:relative; + overflow: hidden; +} +.file-upload .file-name { + white-space: nowrap; + overflow: hidden; + border-style: solid; + border-width: 1px 1px 1px 0; + border-color: #CCC; + display: inline-block; + float: left; + padding: 4px 10px; + height: 18px; + line-height: 18px; + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; + text-align: left; + margin: 0; + width: 182px; +} +.file-upload .upload { + margin:0; + padding:0; + position:absolute; + top: 0; + left:0; + opacity:.0; + font-size: 60px; + left: -595px/9; + filter: alpha(opacity: 0); + outline: none; +} +.file-upload .upload:focus { + position:absolute; +} +.upload-picture { + margin-bottom: 5px; + text-align: center; + width: 276px; + overflow: hidden; + height: 90px; +} +.upload-picture img { + left: 0; + margin-top: -15%; + width: 100%; +} +.widget-box .widgetInfo { + display: inline-block; + text-align: center; + width: 255px; + margin : 0px 0 5px; + padding: 5px 10px; +} +.file-upload .input-medium { + border-radius: 3px 3px 3px 3px !important; + width: 267px; + position: relative; + z-index: 5; +} +#widget-link table { + margin-bottom:0 +} +/*Date*/ +.showDate { + border-style: solid; + border-width: 1px 0 1px 1px; + border-color: #CCC; + display: inline-block; + float: left; + padding: 4px 10px; + height: 18px; + line-height: 18px; + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; + text-align: center; +} +.calendarInput { + position: absolute; + visibility: hidden; + left: 11px; +} \ No newline at end of file diff --git a/app/helpers/admin/item_helper.rb b/app/helpers/admin/item_helper.rb index d7a3455b..c9715a71 100644 --- a/app/helpers/admin/item_helper.rb +++ b/app/helpers/admin/item_helper.rb @@ -12,12 +12,14 @@ module Admin::ItemHelper ret << "" end ret.html_safe @@ -26,11 +28,9 @@ module Admin::ItemHelper def render_children(parent) if children = parent.children ret = '' - ret << "" ret end end diff --git a/app/views/admin/ad_images/_form.html.erb b/app/views/admin/ad_images/_form.html.erb index 1089db3b..8e7f18df 100644 --- a/app/views/admin/ad_images/_form.html.erb +++ b/app/views/admin/ad_images/_form.html.erb @@ -161,13 +161,13 @@ <%= content_tag :div,:class => "tab-pane #{active_when_default_locale_eq locale}",:id=>"#{locale}" do%>
<%= f.fields_for :title,@ad_image.title do |f| %> - <%= f.text_field locale,:class=>"ad_image-title",:placeholder => "輸入標題"%> + <%= f.text_field locale,:class=>"ad_image-title post-title",:placeholder => "輸入標題"%> <% end %>
- +
<%= f.fields_for :context, @ad_image.context do |f| %> - <%= f.text_area locale,:style => "width:100%", :class => "asd_tinymce_textarea" %> + <%= f.text_area locale,:style => "width:100%", :class => "asd_tinymce_textarea post-title" %> <% end %>
@@ -177,12 +177,12 @@ +
+ + + +
-
- - - -
\ No newline at end of file diff --git a/app/views/admin/items/_site_map_left_bar.html.erb b/app/views/admin/items/_site_map_left_bar.html.erb index 8dbcb722..b2a48a19 100644 --- a/app/views/admin/items/_site_map_left_bar.html.erb +++ b/app/views/admin/items/_site_map_left_bar.html.erb @@ -1,3 +1,3 @@ -
+
<%= render_node_and_children(Item.first(:conditions => {:parent_id => nil})) %>
\ No newline at end of file diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 4adce7a5..3c2df376 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -1,37 +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 efcc54ca..e5ed9bb9 100644 --- a/app/views/layouts/site_editor.html.erb +++ b/app/views/layouts/site_editor.html.erb @@ -1,38 +1,39 @@ - - - - - <%= @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 %>
+ +
+ + +