From 503f71e55483cb9d649877c42a2710949fb9b36c Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Mon, 2 Apr 2012 02:46:34 +0800 Subject: [PATCH] Ray's changes in tags, css and js --- .../javascripts/inc/permission-checkbox.js | 12 +++++ app/assets/javascripts/orbit-1.0.js | 38 ++++++------- app/assets/javascripts/orbit-bar-member.js | 15 ++++++ .../stylesheets/inc/permission-checkbox.css | 53 +++++++++++++++++++ app/assets/stylesheets/list.css | 28 +++++----- app/assets/stylesheets/style.css.erb | 27 +++++++++- app/helpers/application_helper.rb | 2 +- app/views/admin/tags/_tag.html.erb | 9 +++- app/views/admin/tags/index.html.erb | 18 +++++-- app/views/admin/tags/update.js.erb | 2 +- .../back_end/fact_checks/setting.html.erb | 21 +++++--- 11 files changed, 172 insertions(+), 53 deletions(-) create mode 100644 app/assets/javascripts/inc/permission-checkbox.js create mode 100644 app/assets/javascripts/orbit-bar-member.js create mode 100644 app/assets/stylesheets/inc/permission-checkbox.css diff --git a/app/assets/javascripts/inc/permission-checkbox.js b/app/assets/javascripts/inc/permission-checkbox.js new file mode 100644 index 00000000..f106e795 --- /dev/null +++ b/app/assets/javascripts/inc/permission-checkbox.js @@ -0,0 +1,12 @@ +$('.check[checked="checked"]').parents(".checkbox").addClass("checked") +$(".checkbox").click(function(){ + if($(this).children(".check").attr("checked")){ + // uncheck + $(this).children(".check").attr('checked', false); + $(this).removeClass("checked"); + }else{ + // check + $(this).children(".check").attr({checked: "checked"}); + $(this).addClass("checked"); + } +}); \ No newline at end of file diff --git a/app/assets/javascripts/orbit-1.0.js b/app/assets/javascripts/orbit-1.0.js index ffd16e82..a894beea 100644 --- a/app/assets/javascripts/orbit-1.0.js +++ b/app/assets/javascripts/orbit-1.0.js @@ -9,27 +9,14 @@ function resize() { } } $(document).ready(function(){ - $(document).on('click', '.orbit-bar-member', function(){ - $(this).hasClass('open') ? $(this).removeClass('open') : $(this).addClass('open'); - $('.bar-login .dropdown-menu').toggle(); - return false; - }); - - $(document).click(function() { - $('.orbit-bar-member').removeClass("open"); - $('.bar-login .dropdown-menu').hide(); - }); - - $(document).on('click', '.bar-login .dropdown-menu', function(e) { - e.stopPropagation(); - $('.bar-login .dropdown-menu').show(); - }); $('.tip').tooltip({ placement: "left" }); $(document).on('click', '.privacy', function() { + + console.log($(this).val()); switch ($(this).val()) { case 'true': $(this).parents('.controls').children('.select-role').slideUp(300); @@ -68,7 +55,7 @@ $(document).ready(function(){ $('#main-sidebar').tinyscrollbar(); $('.detal-list').tinyscrollbar(); $('#main-sidebar').tinyscrollbar({size:(viewportheight-34)}); - mainTablePosition() + mainTablePosition(); /*isotope*/ var $container = $('#isotope'); @@ -87,18 +74,23 @@ $(window).resize(function(){ $('.post-title').css("width", viewportwidth-495); $('#main-wrap > .subnav').css("width", viewportwidth-$mainWrapMarginLeft) $('#main-sidebar').tinyscrollbar({size:(viewportheight-34)}); - mainTablePosition() + mainTablePosition(); }); /*main-table position*/ function mainTablePosition() { - var $height = $('#main-wrap > .subnav').height() - var $table = $('#main-wrap > .table') + var $height = $('#main-wrap .subnav').length && $('#main-wrap .subnav').height(); + var $table = $('#main-wrap > .table').length && $('#main-wrap > .table'); + var $nottable = $('#main-wrap .nottable').length && $('#main-wrap .nottable'); //alert ($table.height()) - $height = $height-17; - if($height<0){ - $height = 0; + if($nottable==0){ + if($height>0){ + $height = $height-17; + } + $table.stop().animate({marginTop:$height},500); } - $table.stop().animate({marginTop:$height},500) + if($table==0){ + $nottable.css({marginTop:$height}); + }; //$table.css({marginTop : $height}) } $(window).scroll(function () { diff --git a/app/assets/javascripts/orbit-bar-member.js b/app/assets/javascripts/orbit-bar-member.js new file mode 100644 index 00000000..5e65d4a3 --- /dev/null +++ b/app/assets/javascripts/orbit-bar-member.js @@ -0,0 +1,15 @@ +$(document).on('click', '.orbit-bar-member', function(){ + $(this).hasClass('open') ? $(this).removeClass('open') : $(this).addClass('open'); + $('.bar-login .dropdown-menu').toggle(); + return false; +}); + +$(document).click(function() { + $('.orbit-bar-member').removeClass("open"); + $('.bar-login .dropdown-menu').hide(); +}); + +$(document).on('click', '.bar-login .dropdown-menu', function(e) { + e.stopPropagation(); + $('.bar-login .dropdown-menu').show(); +}); \ No newline at end of file diff --git a/app/assets/stylesheets/inc/permission-checkbox.css b/app/assets/stylesheets/inc/permission-checkbox.css new file mode 100644 index 00000000..9d7beb5e --- /dev/null +++ b/app/assets/stylesheets/inc/permission-checkbox.css @@ -0,0 +1,53 @@ +.checkblock { + display: inline-block; + float: left; + width: 200px; +} +.check[type="checkbox"]{ + display:none; +} +.checkbox{ + padding:5px; + margin:5px; + display: inline-block; + color:#777777; + text-shadow: 0 1px 0px rgba(255,255,255,.4); + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + height: 30px; + position: relative; + cursor: pointer; + background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) ); + background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% ); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf'); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); +} +.checkbox .check-icon { + display: none; + position: absolute; + width: 22px; + height: 22px; + border-radius: 11px; + background-color: #d0f311; + right: -5px; + top: -5px; + box-shadow: 0px 0px 5px rgba(0,0,0,.05); +} +.checkbox .check-icon i { + margin: 1px 0 0 3px; +} +.checkbox .member-name { + line-height: 30px; + padding: 0 10px; +} +img.member-img { + display: inline-block; + float: left; + max-width: 30px; +} +.checked .check-icon { + display: block; +} \ No newline at end of file diff --git a/app/assets/stylesheets/list.css b/app/assets/stylesheets/list.css index b4becb42..11f17a55 100644 --- a/app/assets/stylesheets/list.css +++ b/app/assets/stylesheets/list.css @@ -39,8 +39,8 @@ left: -8px; } .main-list td { - background-color: #FFFFFF; - border-bottom: 1px solid #DDDDDD; + background-color: #FFFFFF; + border-bottom: 1px solid #DDDDDD; border-top: medium none; } .main-list .nav { @@ -77,15 +77,15 @@ -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; +} +.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; @@ -120,9 +120,9 @@ legend { -webkit-border-radius: 0; border-radius: 0; border-left: none; - border-right: none; - position: fixed; - top: 30px; + border-right: none; + position: fixed; + top: 30px; z-index: 50; } .subnav .nav > li:first-child > a, .subnav .nav > li:first-child > a:hover { diff --git a/app/assets/stylesheets/style.css.erb b/app/assets/stylesheets/style.css.erb index 2e203a02..a261bfe7 100644 --- a/app/assets/stylesheets/style.css.erb +++ b/app/assets/stylesheets/style.css.erb @@ -266,7 +266,6 @@ padding-top: 32px; padding-bottom: 18px; position: relative; - min-height: 100%; } #main-wrap > .form-actions { background-color: #FFF; @@ -383,6 +382,9 @@ border-top-color: #0088CC; margin-top: 6px; } +.filter form { + margin: 5px 10px; +} .filter .active { background-color: #0088CC; } @@ -417,6 +419,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; @@ -775,6 +797,9 @@ background-position: -224px -320px; } /*12*/ +.icons-check-2 { + background-position: -288px -352px; +} .icons-star-thin { background-position: -416px -352px; } diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9c03de3d..558129c7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -145,7 +145,7 @@ module ApplicationHelper javascripts << "\n" javascripts << "\n" javascripts << "\n" - javascripts << "\n" + javascripts << "\n" javascripts << "\n" javascripts << "\n" page.design.javascripts.each do |js| diff --git a/app/views/admin/tags/_tag.html.erb b/app/views/admin/tags/_tag.html.erb index a103efc4..1f9ff38a 100644 --- a/app/views/admin/tags/_tag.html.erb +++ b/app/views/admin/tags/_tag.html.erb @@ -1,8 +1,13 @@ -
+
+
+ <% @site_valid_locales.each do |locale| %> - <%= I18nVariable.from_locale(locale) %>: + <%#= I18nVariable.from_locale(locale) %> <%= tag[locale] %> <% end %> +
+
<%= link_to t(:edit), edit_admin_tag_path(tag), :remote => true %> <%= link_to t(:delete), admin_tag_path(tag), :confirm => t('sure?'), :method => :delete, :remote => true %> +
\ No newline at end of file diff --git a/app/views/admin/tags/index.html.erb b/app/views/admin/tags/index.html.erb index 5e757313..a8a1aa34 100644 --- a/app/views/admin/tags/index.html.erb +++ b/app/views/admin/tags/index.html.erb @@ -1,6 +1,16 @@ -
+ +
<%= render :partial => 'tag', :collection => @tags %>
-------------------------- -
-<%= render 'add' %> \ No newline at end of file +
+ <%= render 'add' %> +
\ No newline at end of file diff --git a/app/views/admin/tags/update.js.erb b/app/views/admin/tags/update.js.erb index 1df91e08..9cd63e4c 100644 --- a/app/views/admin/tags/update.js.erb +++ b/app/views/admin/tags/update.js.erb @@ -1 +1 @@ -$('#<%= dom_id @tag %>').html("<%= j render :partial => 'tag', :object => @tag %>") \ No newline at end of file +$('#<%= dom_id @tag %>').replaceWith("<%= j render :partial => 'tag', :object => @tag %>") \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.html.erb index d5d589cf..16e76f09 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.html.erb @@ -1,17 +1,24 @@ -<%= label_tag :fact_check_setting, t("announcement.bulletin.fact_check_setting") %> -
+<%#= label_tag :fact_check_setting, t("announcement.bulletin.fact_check_setting") %> <%= form_tag('', :remote => true) %> -<%= label_tag :category, t("announcement.bulletin.category") %> -<%= select_tag "category_id", options_from_collection_for_select(@bulletin_categorys, "id", "key") %> - -
-<%= label_tag :role, t("admin.roles") %> + +<%#= label_tag :role, t("admin.roles") %> +
<%= content_tag :div do -%> <% form_tag :action => "update_setting" do %> <%= render :partial => "privilege_user", :locals => {:users => @users_array} %> <%= submit_tag "Update" %> <% end -%> <% end -%> +