From 93ac99d23573dbada55e0dc215d706d08c466eb7 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Thu, 12 Apr 2012 18:12:46 +0800 Subject: [PATCH 1/7] Add missing css in "inc" --- .../stylesheets/inc/permission-checkbox.css | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 app/assets/stylesheets/inc/permission-checkbox.css diff --git a/app/assets/stylesheets/inc/permission-checkbox.css b/app/assets/stylesheets/inc/permission-checkbox.css new file mode 100644 index 00000000..0adf7225 --- /dev/null +++ b/app/assets/stylesheets/inc/permission-checkbox.css @@ -0,0 +1,77 @@ +.checkblock { + display: inline-block; + float: left; + width: 200px; +} +.check[type="checkbox"]{ + display:none; +} +.checkbox{ + padding: 5px; + margin: 5px 5px 10px; + 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: 26px; + height: 26px; + background: url('img/check.png') no-repeat left top; + right: -10px; + top: -5px; +} +.checkbox .member-name { + cursor: pointer; + font-family: helvetica; + font-size: 12px; + line-height: 30px; + padding: 0 10px 0 40px; + color: #333333; + display: inline-block; + margin-bottom: 0; +} +.member-avatar { + position: absolute; + width: 34px; + height: 34px; + overflow: hidden; + margin-top: -2px; +} +img.member-img { + max-width: 100%; +} +.checked .check-icon { + display: block; +} +.popover-inner { + width: auto; + display: inline-block; + text-align: center; +} +.popover-title { + display: block; + font-size: 12px; + font-weight: normal; + padding: 3px 10px; +} +.popover-content { + padding: 3px 10px; + color: #898989; +} +.popover-content p { + font-size: 12px; +} \ No newline at end of file From 015c0cb4524f93e2982dc7cc50d34c13c13c0e09 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Thu, 12 Apr 2012 18:13:10 +0800 Subject: [PATCH 2/7] Delete useless code in items --- app/views/layouts/_drop_down_menu.html.erb | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/app/views/layouts/_drop_down_menu.html.erb b/app/views/layouts/_drop_down_menu.html.erb index 900437a6..89285ebb 100644 --- a/app/views/layouts/_drop_down_menu.html.erb +++ b/app/views/layouts/_drop_down_menu.html.erb @@ -7,18 +7,4 @@
  • <%= link_to t('admin.member'), admin_users_path, :class => 'orblink' %>
  • <%= link_to t('admin.translation'), admin_translations_path, :class => 'orblink' %>
  • <%= link_to t('admin.site'), admin_sites_path, :class => 'orblink' %>
  • - - \ No newline at end of file From 167f6d07a0cc6496523c6920fe69bf0687d8115e Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Thu, 12 Apr 2012 18:13:26 +0800 Subject: [PATCH 3/7] Remove extra "]" --- .../views/panel/announcement/back_end/bulletins/index.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.js.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.js.erb index 292e97bd..24e36542 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.js.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.js.erb @@ -1,7 +1,7 @@ $("#collapse-status").html("<%= j render 'filter_status' %>"); $("#collapse-category").html("<%= j render 'filter_categories' %>"); $("#collapse-tags").html("<%= j render 'filter_tags' %>"); -$("#delete_bulletins").attr("action", "<%= delete_panel_announcement_back_end_bulletins_path(:direction => params[:direction], :sort => params[:sort], :filter => @filter]) %>"); +$("#delete_bulletins").attr("action", "<%= delete_panel_announcement_back_end_bulletins_path(:direction => params[:direction], :sort => params[:sort], :filter => @filter) %>"); $("#sort_headers").html("<%= j render 'sort_headers' %>"); $("#tbody_bulletins").html("<%= j render :partial => 'bulletin', :collection => @bulletins %>"); $("#bulletin_pagination").html("<%= j paginate @bulletins, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>"); \ No newline at end of file From 6728c35023bff21f6d7e7cc858997777ef46e0ec Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Thu, 12 Apr 2012 18:14:00 +0800 Subject: [PATCH 4/7] Fix side_bar. In the case of tags, take the uri instead of controller name --- app/helpers/application_helper.rb | 2 +- app/views/layouts/_side_bar.html.erb | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2f37a517..e45fa4d6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -83,7 +83,7 @@ module ApplicationHelper end def active_for_action(controller_name, action_name) - (controller.controller_name.eql?(controller_name) && controller.action_name.eql?(action_name)) ? 'active' : nil + ((controller.controller_name.eql?(controller_name) || request.fullpath.eql?(controller_name)) && controller.action_name.eql?(action_name)) ? 'active' : nil end def sortable(column) diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb index 3a36a48a..f74f24f6 100644 --- a/app/views/layouts/_side_bar.html.erb +++ b/app/views/layouts/_side_bar.html.erb @@ -2,14 +2,14 @@ <%= link_to content_tag(:i, nil, :class => 'icons-purchase') + t('admin.purchase'), admin_purchases_path %> <% end -%> -<%= content_tag :li, :class => active_for_controllers('bulletins', 'tags', 'bulletin_categorys') do -%> +<%= content_tag :li, :class => active_for_controllers('bulletins', 'tags', 'bulletin_categorys', 'fact_checks') do -%> <%= link_to content_tag(:i, nil, :class => 'icons-announcement') + t('admin.announcement'), panel_announcement_back_end_bulletins_path %> - <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('bulletins', 'tags', 'bulletin_categorys')) do -%> + <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('bulletins', 'tags', 'bulletin_categorys', 'fact_checks')) do -%> <%= content_tag :li, link_to(t('admin.all_articles'), panel_announcement_back_end_bulletins_path), :class => active_for_action('bulletins', 'index') %> <%= content_tag :li, link_to(t('admin.add_new'), new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') %> <%= content_tag :li, link_to(t('admin.categories'), panel_announcement_back_end_bulletin_categorys_path), :class => active_for_action('bulletin_categorys', 'index') %> - <%= content_tag :li, link_to(t('admin.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('tags', 'index') %> - <%= content_tag :li, link_to(t('announcement.bulletin.fact_check_setting'), panel_announcement_back_end_fact_checks_setting_path), :class => active_for_action('bulletins', 'fact_check_setting') if (is_manager? rescue nil) %> + <%= content_tag :li, link_to(t('admin.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('panel/bulletin/back_end/tags', 'index') %> + <%= content_tag :li, link_to(t('announcement.bulletin.fact_check_setting'), panel_announcement_back_end_fact_checks_setting_path), :class => active_for_action('fact_checks', 'setting') if (is_manager? rescue nil) %> <% end -%> <% end -%> @@ -44,7 +44,7 @@ <%= content_tag :li, link_to(t('admin.all_articles'), panel_web_resource_back_end_web_links_path), :class => active_for_action('web_link', 'index') %> <%= content_tag :li, link_to(t('admin.add_new'), new_panel_web_resource_back_end_web_link_path), :class => active_for_action('web_link', 'new') %> <%= content_tag :li, link_to(t('admin.categories'), panel_web_resource_back_end_web_link_categorys_path), :class => active_for_action('web_link_categorys', 'index') %> - <%= content_tag :li, link_to(t('admin.tags'), panel_web_resource_back_end_tags_path), :class => active_for_action('tags', 'index') %> + <%= content_tag :li, link_to(t('admin.tags'), panel_web_resource_back_end_tags_path), :class => active_for_action('panel/web_resource/back_end/tags', 'index') %> <% end -%> <% end -%> From f8873267a2a185dd13fe46fabb288b674e3c82c2 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Thu, 12 Apr 2012 18:41:14 +0800 Subject: [PATCH 5/7] Ray's fix for announcement list --- app/assets/javascripts/orbit-1.0.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/orbit-1.0.js b/app/assets/javascripts/orbit-1.0.js index e83c69f6..5f69b297 100644 --- a/app/assets/javascripts/orbit-1.0.js +++ b/app/assets/javascripts/orbit-1.0.js @@ -51,7 +51,7 @@ $(document).ready(function(){ $('#main-sidebar').css("height", viewportheight-30); $('#main-sidebar .viewport').css("height", viewportheight-30); $('.post-title').css("width", viewportwidth-495); - $('#main-wrap > .subnav').css("width", viewportwidth-$mainWrapMarginLeft) + $('#main-wrap .subnav').css("width", viewportwidth-$mainWrapMarginLeft); $('#main-sidebar').tinyscrollbar(); $('.detal-list').tinyscrollbar(); $('#main-sidebar').tinyscrollbar({size:(viewportheight-34)}); @@ -72,14 +72,14 @@ $(window).resize(function(){ $('#main-sidebar').css("height", viewportheight-30); $('#main-sidebar .viewport').css("height", viewportheight-30); $('.post-title').css("width", viewportwidth-495); - $('#main-wrap > .subnav').css("width", viewportwidth-$mainWrapMarginLeft) + $('#main-wrap .subnav').css("width", viewportwidth-$mainWrapMarginLeft) $('#main-sidebar').tinyscrollbar({size:(viewportheight-34)}); mainTablePosition(); }); /*main-table position*/ function mainTablePosition() { var $height = $('#main-wrap .subnav').length && $('#main-wrap .subnav').height(); - var $table = $('#main-wrap > table').length && $('#main-wrap > table'); + var $table = $('.main-list').length && $('.main-list:last'); if($table && $table==0){ $table.css({marginTop:$height}); } From de035cb89a34d29fecf0f7b2bcaa64de781d6b31 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Fri, 13 Apr 2012 12:47:57 +0800 Subject: [PATCH 6/7] fix date selector value fill back problem --- app/views/admin/ad_images/_form.html.erb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/admin/ad_images/_form.html.erb b/app/views/admin/ad_images/_form.html.erb index d595b1e7..c04246a8 100644 --- a/app/views/admin/ad_images/_form.html.erb +++ b/app/views/admin/ad_images/_form.html.erb @@ -32,13 +32,15 @@ today = today.format('isoDate'); var state = false; var arr = state ? "▼" : "▲" + var start_date = <%= "'#{@ad_image.post_date.strftime('%Y / %m / %d')}'"%> || today + var end_date = <%= "'#{@ad_image.unpost_date.strftime('%Y / %m / %d')}'"%> || today //calendarRange - $('#calendarRange .showDate').html(today+" - "+today) - $('#calendarRange .calendarInput').val(today+" - "+today); + $('#calendarRange .showDate').html(start_date+" - "+end_date) + $('#calendarRange .calendarInput').val(start_date+" - "+end_date); $('#calendarRange #widgetCalendar').DatePicker({ flat: true, format: 'Y / m / d', - date: today, + date: [start_date,end_date], calendars: 1, mode: 'range', starts: 1, From ca0fc4c767bce96d249cc1f96156512f419d85a2 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Fri, 13 Apr 2012 15:53:25 +0800 Subject: [PATCH 7/7] Comment out code that bugged upload image in ad_banner --- app/assets/javascripts/side_bar_history.js | 42 +++++++++---------- .../ad_banners/_ad_image_update.html.erb | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/assets/javascripts/side_bar_history.js b/app/assets/javascripts/side_bar_history.js index e9505aa1..4b5da1d4 100644 --- a/app/assets/javascripts/side_bar_history.js +++ b/app/assets/javascripts/side_bar_history.js @@ -1,28 +1,28 @@ var history_edited = false; -$('#back_sidebar a, #back_main a.nav').live('click', - function () { - $.getScript(this.href); - history.pushState(null, document.title, this.href); - history_edited = true; - return false; - } -); +// $('#back_sidebar a, #back_main a.nav').live('click', +// function () { +// $.getScript(this.href); +// history.pushState(null, document.title, this.href); +// history_edited = true; +// return false; +// } +// ); -$('#back_main a.reload').live('click', - function () { - $.getScript(this.href); - history.replaceState(null, document.title, this.href); - history_edited = true; - return false; - } -); +// $('#back_main a.reload').live('click', +// function () { +// $.getScript(this.href); +// history.replaceState(null, document.title, this.href); +// history_edited = true; +// return false; +// } +// ); -$('.form').live('submit', function () { - $.post(this.action, $(this).serialize(), null, 'script'); - history_edited = true; - return false; -}); +// $('.form').live('submit', function () { +// $.post(this.action, $(this).serialize(), null, 'script'); +// history_edited = true; +// return false; +// }); $(document).on('click', '.js_history', function () { diff --git a/app/views/admin/ad_banners/_ad_image_update.html.erb b/app/views/admin/ad_banners/_ad_image_update.html.erb index 366d370d..b2dfdc73 100644 --- a/app/views/admin/ad_banners/_ad_image_update.html.erb +++ b/app/views/admin/ad_banners/_ad_image_update.html.erb @@ -1,5 +1,5 @@
  • - <%= image_tag ad_image.file %> + <%= image_tag ad_image.file rescue nil %>

    <%= ad_image.display? ? '[Showing]' : '[NotShawing]' %> <%= "#{ad_image.post_date ||'NeedReset' }~#{ad_image.unpost_date || 'NeedReset'}" %>