From 3ec8bb7be67041bcd96f75a83a1e8a6aa1e3d2d4 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Wed, 25 Apr 2012 15:10:28 +0800 Subject: [PATCH 01/28] Fix assets bug: when having a '.' in the name, the extension must be specified --- .gitignore | 3 +-- app/views/admin/ad_images/_form.html.erb | 4 ++-- .../panel/announcement/back_end/bulletins/_form.html.erb | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 71494e306..b57fdb65e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,8 +10,7 @@ uploads/**/* *.swp -public/javascripts -public/stylesheets +public/assets config/application.rb .rvmrc diff --git a/app/views/admin/ad_images/_form.html.erb b/app/views/admin/ad_images/_form.html.erb index ea30634c1..8fbefb337 100644 --- a/app/views/admin/ad_images/_form.html.erb +++ b/app/views/admin/ad_images/_form.html.erb @@ -3,10 +3,10 @@ <% end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "lib/datepicker" %> - <%= javascript_include_tag "lib/date.format" %> + <%= javascript_include_tag "lib/date.format.js" %> <%= javascript_include_tag "inc/modal-preview" %> <%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %> - <%= javascript_include_tag "inc/jquery.imagesloaded" %> + <%= javascript_include_tag "inc/jquery.imagesloaded.js" %> <% end %> diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb index b8aa5d2af..df86f2211 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb @@ -293,7 +293,7 @@ <% content_for :page_specific_javascript do %> <%= javascript_include_tag "bulletin_form" %> - <%= javascript_include_tag "inc/jquery.imagesloaded" %> + <%= javascript_include_tag "inc/jquery.imagesloaded.js" %> + + -<% end -%> - - + +<% end -%> diff --git a/config/routes.rb b/config/routes.rb index 3b48f300c..e8695f0ab 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -25,7 +25,7 @@ Orbit::Application.routes.draw do end - match 'ad_banner/:title/preview' => 'ad_banners#realtime_preview',:as => :realtime_preview_ad_banner,:via => :put + match 'ad_banner/:id/preview' => 'ad_banners#realtime_preview',:as => :realtime_preview_ad_banner,:via => :put resources :ad_banners do collection do match 'new_ad_image' => 'ad_images#new',:as => :new_ad_image,:via => :get From a704a054cc42167088f2154cf86e885c1754cfbe Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Wed, 25 Apr 2012 11:43:24 +0800 Subject: [PATCH 05/28] Remove useless files --- .../back_end/fact_checks_controller.rb | 75 ------------------- .../approvals/_list_table.html.erb.can_del | 2 +- .../fact_checks/_list_table.html.erb.can_del | 15 ---- .../fact_checks/_privilege_user.html.erb | 26 ------- .../fact_checks/index.html.erb.can_del | 50 ------------- .../back_end/fact_checks/setting.js.erb | 1 - 6 files changed, 1 insertion(+), 168 deletions(-) delete mode 100644 vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/fact_checks_controller.rb delete mode 100644 vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_list_table.html.erb.can_del delete mode 100644 vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_privilege_user.html.erb delete mode 100644 vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/index.html.erb.can_del delete mode 100644 vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.js.erb diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/fact_checks_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/fact_checks_controller.rb deleted file mode 100644 index 606225e9d..000000000 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/fact_checks_controller.rb +++ /dev/null @@ -1,75 +0,0 @@ -class Panel::Announcement::BackEnd::FactChecksController < OrbitBackendController - before_filter :authenticate_user! - include AdminHelper - # layout 'admin' - - def setting - @bulletin_categorys = BulletinCategory.all - if params.has_key?(:category_id) - first_category = BulletinCategory.find params[:category_id] - if params[:commit] == 'Update' - privilege_users = params[:users].collect{|key,value| User.find key } rescue [] - preload_object_auth_ary = first_category.object_auths.where(title: 'fact_check') || (first_category.object_auths.create :title=> 'fact_check') - preload_object_auth = preload_object_auth_ary.first - preload_object_auth.privilege_users = privilege_users - preload_object_auth.save! - end - else - first_category = @bulletin_categorys.first - end - preload_object_auth = first_category.object_auths.where(title: 'fact_check').empty?? (first_category.object_auths.create! :title=> 'fact_check') : first_category.object_auths.where(title: 'fact_check') - @users_array = preload_object_auth.first.privilege_users rescue [] - respond_to do |format| - format.html - format.js - end - end - - def update_setting - - end - # def index - # get_categorys(params[:bulletin_category_id]) - # - # @bulletins = params[:sort] ? get_sorted_bulletins : Bulletin.all - # @bulletin_categories = BulletinCategory.all - # - # module_app = ModuleApp.first(:conditions => {:key => 'announcement'}) - # @tags = Tag.all(:conditions => {:module_app_id => module_app.id}).order_by(I18n.locale, :asc) - # - # respond_to do |format| - # format.html # index.html.erb - # format.js - # format.xml { render :xml => @bulletins } - # end - # end - # - # def new - # - # end - # - # def create - # - # end - # - # def update - # - # end - # - # def edit - # - # end - # - # def destroy - # - # end - protected - def get_categorys(id = nil) - @bulletin_categorys = [] - if(is_manager? || is_admin?) - @bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true)) - elsif is_sub_manager? - @bulletin_categorys = BulletinCategory.authed_for_user(current_user,'submit_new') - end - end -end diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/_list_table.html.erb.can_del b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/_list_table.html.erb.can_del index 59bac03aa..edb738d3d 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/_list_table.html.erb.can_del +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/approvals/_list_table.html.erb.can_del @@ -10,6 +10,6 @@ <% bulletin_category.bulletins.each do |post| %> - <%= render :partial => 'panel/announcement/back_end/bulletins/bulletins', :locals => {:post => post,:fact_check_allow=>true} %> + <%= render :partial => 'panel/announcement/back_end/bulletins/bulletins', :locals => {:post => post,:approval_allow=>true} %> <% end %> \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_list_table.html.erb.can_del b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_list_table.html.erb.can_del deleted file mode 100644 index 59bac03aa..000000000 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_list_table.html.erb.can_del +++ /dev/null @@ -1,15 +0,0 @@ -

<%= bulletin_category.key %>

- - - - - - - - - - -<% bulletin_category.bulletins.each do |post| %> - <%= render :partial => 'panel/announcement/back_end/bulletins/bulletins', :locals => {:post => post,:fact_check_allow=>true} %> -<% end %> -
<%= t('bulletin.status') %><%= t('bulletin.category') %><%= t('bulletin.title') %><%= t('bulletin.postdate') %><%= t('bulletin.deadline') %><%= t('bulletin.action') %>
\ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_privilege_user.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_privilege_user.html.erb deleted file mode 100644 index 759e941dc..000000000 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_privilege_user.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<%= content_tag :div ,:id => "users_checkbox_ary",:class => 'clear' do -%> -<% sys_users = User.all -%> - <% sys_users.each do |user| -%> - -
- - <% user.sub_roles.each do |sr| %> - - <% end %> - <%= content_tag :div,:data=>{'original-title'=>t('announcement.bulletin.fact_check_setting_window_title'),:content => "#{user.sub_roles.collect{|sr| sr.key}.join(',')}"},:class=>"checkbox clear" do %> -
-
-
- <% if user.avatar? %> - <%= image_tag(user.avatar.thumb.url,:class => "member-img") %> - <% else %> - <%= image_tag "person.png",:class => "member-img" %> - <% end %> -
- <%= label_tag "lab-user-#{user.id}", (user.name rescue ''),:class=>"member-name",:id=>nil -%> - <%= check_box_tag "[users][#{user.id}]", 'true',users.include?(user),:class => "check" -%> - <%end -%> -
- - <% end -%> -<% end -%> \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/index.html.erb.can_del b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/index.html.erb.can_del deleted file mode 100644 index 32f3d8207..000000000 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/index.html.erb.can_del +++ /dev/null @@ -1,50 +0,0 @@ -<%= render 'panel/announcement/back_end/bulletins/filter' %> - - <%= render 'panel/announcement/back_end/bulletins/bulletins' %> -
-
- <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_panel_announcement_back_end_bulletin_path, :class => 'btn btn-primary' %> -
- - \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.js.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.js.erb deleted file mode 100644 index a01c9d6ab..000000000 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/setting.js.erb +++ /dev/null @@ -1 +0,0 @@ -$("#users_checkbox_ary").replaceWith('<%= (render :partial => 'privilege_user', :locals => {:users => @users_array}).html_safe%>'); \ No newline at end of file From a3a109fb8b1cd6b71dabb6299796acf361946ba2 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Wed, 25 Apr 2012 13:58:03 +0800 Subject: [PATCH 06/28] Remove JS debug msg. --- app/views/admin/ad_banners/_modal_preview.html.erb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/views/admin/ad_banners/_modal_preview.html.erb b/app/views/admin/ad_banners/_modal_preview.html.erb index 12e95020b..a79dc56e4 100644 --- a/app/views/admin/ad_banners/_modal_preview.html.erb +++ b/app/views/admin/ad_banners/_modal_preview.html.erb @@ -21,7 +21,6 @@ $(document).ready(function() { $("#slideshow-<%=ad_banner.title.dehumanize%>").on("show", function () { - console.info("<%= ad_banner.ad_fx.nil?? "fade": ad_banner.ad_fx %>"+" <%= ad_banner.transition_msec %>"); $("#slideshow-<%=ad_banner.title.dehumanize%>").find(".ad_banner_slideshow").cycle({delay: -1000, fx: "<%= ad_banner.ad_fx.nil?? "fade": ad_banner.ad_fx %>", timeoutFn: getTimeout }); }); $(".modal").on("hidden", function () { From 65a6f9c4166f428bc934279ad230be169844db05 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Wed, 25 Apr 2012 16:26:27 +0800 Subject: [PATCH 07/28] Ray's css fix for quick edit --- app/assets/stylesheets/list.css | 18 +++++++ app/assets/stylesheets/style.css.erb | 54 +++++++++++-------- app/assets/stylesheets/widgets.css | 22 +++++--- .../admin/ad_banners/_ad_banner_tab.html.erb | 38 +++++++------ app/views/admin/ad_images/_form.html.erb | 2 +- .../bulletins/_bulletin_link_qe.html.erb | 5 +- .../bulletins/_quick_edit_picture.html.erb | 35 ++++++------ .../bulletins/_quick_edit_tags.html.erb | 16 +++--- 8 files changed, 117 insertions(+), 73 deletions(-) diff --git a/app/assets/stylesheets/list.css b/app/assets/stylesheets/list.css index 6808e5331..eb9be54c7 100644 --- a/app/assets/stylesheets/list.css +++ b/app/assets/stylesheets/list.css @@ -35,6 +35,9 @@ width: 350px; left: -8px; } +.main-list tr:first-child td { + border-top: 1px solid #DDDDDD; +} .main-list td { background-color: #FFFFFF; border-bottom: 1px solid #DDDDDD; @@ -75,6 +78,9 @@ -moz-border-radius: 3px; z-index: 5; } +.qe-edit-div .table-condensed { + background-color: #F2F2F2; +} .table-label { background-color: #F2F2F2; position: relative; @@ -94,6 +100,18 @@ height:auto; padding: 0; } +.qe-block legend { + padding-left: 8px; + margin-bottom: 0; + padding-bottom: 0; +} +.qe-block .control-group { + margin-bottom: 0; +} +.qe-block .controls, .qe-block .control-label { + margin-top: 10px; + margin-bottom: 10px; +} .qe-block .table td, .qe-block .table th { padding: 8px; } diff --git a/app/assets/stylesheets/style.css.erb b/app/assets/stylesheets/style.css.erb index ac151e906..e832fa8a6 100644 --- a/app/assets/stylesheets/style.css.erb +++ b/app/assets/stylesheets/style.css.erb @@ -1,5 +1,5 @@ -/*style*/ - +/*style*/ + @font-face{ font-family: 'WebSymbolsRegular'; src: url(<%= asset_path 'websymbols-regular-webfont.eot' %>); @@ -109,7 +109,7 @@ text-indent: -9999px; padding:6px; } -#orbit-bar .nav > li.search { +#orbit-bar .nav > li.search { background-image: none; overflow: hidden; width: 28px; @@ -323,9 +323,9 @@ #main-wrap .breadcrumb li { font-size: 12px; color: #999; -} -.form-actions .btn { - margin-bottom: 0; +} +.form-actions .btn { + margin-bottom: 0; } #sub-wiget { clear: right; @@ -569,8 +569,8 @@ padding: 5px; } .popover-content { - -webkit-border-radius: 0 0 3px 3px; - -moz-border-radius: 0 0 3px 3px; + -webkit-border-radius: 0 0 3px 3px; + -moz-border-radius: 0 0 3px 3px; border-radius: 0 0 3px 3px; padding: 5px; } @@ -612,20 +612,32 @@ } .text-green { color: #39b54a !important; +} +.adbanner-setup { + margin-right: 10px; + margin-bottom: 30px !important; +} +.adbanner-list { + border-top: 1px solid #AAA; + margin-right: 10px; + padding-top: 10px; + position: relative; +} +.adbanner-list ul { + margin: 0px; +} +.adbanner-list ul li { + list-style: none; + margin-left: 0; + margin-right: 20px; +} +.adbanner-action { + position: absolute; + top: -32px; + right: 0; } -.adbanner-list { - margin-top: 20px; -} -.adbanner-list ul { - margin: 0px; -} -.adbanner-list ul li { - list-style: none; - margin-left: 0; - margin-right: 20px; -} -.adbanner-action { - margin-bottom: 20px; +#bulletin_link_qe form { + margin: 0; } [class^="icons-"] { display: inline-block; diff --git a/app/assets/stylesheets/widgets.css b/app/assets/stylesheets/widgets.css index 80756ecb1..04273d5bc 100644 --- a/app/assets/stylesheets/widgets.css +++ b/app/assets/stylesheets/widgets.css @@ -1,5 +1,5 @@ -/*Widget*/ - +/*Widget*/ + .widget-size-300 { width:298px; @@ -100,6 +100,18 @@ } .file-upload .upload:focus { position:absolute; +} +.file-upload .input-medium { + border-radius: 3px 3px 3px 3px !important; + width: 267px; + position: relative; + z-index: 5; + display: block; + clear: both; +} +.file-upload .control-label { + margin-top: 0; + margin-bottom: 5px; } .upload-picture { margin-bottom: 5px; @@ -120,12 +132,6 @@ 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 } diff --git a/app/views/admin/ad_banners/_ad_banner_tab.html.erb b/app/views/admin/ad_banners/_ad_banner_tab.html.erb index c1e406db9..c60bf0e23 100644 --- a/app/views/admin/ad_banners/_ad_banner_tab.html.erb +++ b/app/views/admin/ad_banners/_ad_banner_tab.html.erb @@ -1,23 +1,27 @@ -
" id=<%= ad_banner_tab.title %>> -

<%= t("admin.ad.banner_best_size") %>:

+
" id=<%= ad_banner_tab.title %>> <%= form_for ad_banner_tab,:url=> admin_ad_banner_path(ad_banner_tab),:method => :put,:class=>"input-medium" do |f| -%> - <%= f.label :ad_fx, t('admin.ad.ab_fx') %> - <%= f.select :ad_fx ,AdBanner::FX_TYPES %> - <%= f.label :transition_sec, t('admin.ad.transition_sec') %> - <%= f.text_field :transition_sec,:placeholder=>t('admin.ad.sec_place_holder'),:class=> "span3" %> <%= t("admin.ad.trans_unit_sec") %> - <%= f.submit t("admin.ad.update_banner") %> - <%= f.submit t("cancel"),:type=>'reset' %> -
-
- <%= link_to t("admin.ad.new_image"),new_admin_ad_banner_ad_image_path(ad_banner_tab) ,:class => "btn btn-primary"%> - <%= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(ad_banner_tab.title) , :class=>'preview_trigger btn btn-success'%> +
+ + <%= f.label :ad_fx, t('admin.ad.ab_fx') %> + <%= f.select :ad_fx ,AdBanner::FX_TYPES %> + <%= f.label :transition_sec, t('admin.ad.transition_sec') %> + <%= f.text_field :transition_sec,:placeholder=>"3秒請輸入3000",:class=> "span3" %> <%= t("admin.ad.trans_unit_sec") %> +
+ <%= f.submit t("admin.ad.update_banner"), :class => 'btn' %> + <%= f.submit t("cancel"),:type=>'reset', :class => 'btn' %> +
+

圖片列表

+
+
+ <%= link_to t("admin.ad.new_image"),new_admin_ad_banner_ad_image_path(ad_banner_tab) ,:class => "btn btn-primary"%> + <%= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(ad_banner_tab.title) , :class=>'preview_trigger btn btn-success'%> +
+
    + <%= render :partial => "ad_image_update", :collection => ad_banner_tab.ad_images,:as => :ad_image,:locals=>{:ad_banner => ad_banner_tab} %> +
+ <%#= render :partial => 'new_add_banner_file', :object => ad_banner_tab.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %>
-
    - <%= render :partial => "ad_image_update", :collection => ad_banner_tab.ad_images,:as => :ad_image,:locals=>{:ad_banner => ad_banner_tab} %> -
- <%#= render :partial => 'new_add_banner_file', :object => ad_banner_tab.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %> -
<% end -%> <%#= render :partial => 'preview_block',:locals=> {:ad_banner =>ad_banner_tab} %>
diff --git a/app/views/admin/ad_images/_form.html.erb b/app/views/admin/ad_images/_form.html.erb index ea30634c1..4a759f52b 100644 --- a/app/views/admin/ad_images/_form.html.erb +++ b/app/views/admin/ad_images/_form.html.erb @@ -83,7 +83,7 @@ 此區塊圖片尺寸請使用580px × 225px
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link_qe.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link_qe.html.erb index c146da486..fd013f56c 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link_qe.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link_qe.html.erb @@ -25,12 +25,11 @@
<% end %> <% end %> - +