From 55d12e50f2ccc5013a3ebf6e4b3a773e3001a2fa Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 27 Mar 2012 15:03:00 +0800 Subject: [PATCH] Ray's changes in announcenment back-end --- app/assets/fonts/widget.css | 8 ++-- app/assets/javascripts/bootstrap.js | 3 +- app/assets/javascripts/orbit-1.0.js | 21 +++++++++- app/assets/stylesheets/bootstrap-orbit.css | 2 +- app/assets/stylesheets/list.css | 31 ++++++++++---- app/assets/stylesheets/reset.css.erb | 1 - app/assets/stylesheets/style.css.erb | 2 - app/assets/stylesheets/widget.css | 4 +- .../back_end/bulletins/_bulletin.html.erb | 18 +++++---- .../back_end/bulletins/_bulletins.html.erb | 14 ++++++- .../back_end/bulletins/_filter.html.erb | 40 +++++++++++++++++++ .../back_end/bulletins/_form.html.erb | 27 ++++++++++--- .../back_end/bulletins/edit.html.erb | 17 ++++---- .../back_end/bulletins/new.html.erb | 6 +-- 14 files changed, 150 insertions(+), 44 deletions(-) diff --git a/app/assets/fonts/widget.css b/app/assets/fonts/widget.css index 0c596876..fe83b22d 100644 --- a/app/assets/fonts/widget.css +++ b/app/assets/fonts/widget.css @@ -45,10 +45,10 @@ opacity: 1; filter: alpha(opacity=100); cursor: pointer; -} -.select-role { - display:none; - overflow:hidden; +} +.select-role { + display:none; + padding: 10px 0 0; } .file-upload { position:relative; diff --git a/app/assets/javascripts/bootstrap.js b/app/assets/javascripts/bootstrap.js index 116cfe61..af3bc727 100644 --- a/app/assets/javascripts/bootstrap.js +++ b/app/assets/javascripts/bootstrap.js @@ -1250,7 +1250,8 @@ var that = this , complete = function () { if (startEvent == 'show') that.reset() - that.$element.trigger(completeEvent) + that.$element.trigger(completeEvent) + mainTablePosition(); } this.$element diff --git a/app/assets/javascripts/orbit-1.0.js b/app/assets/javascripts/orbit-1.0.js index 91df38a1..cbb6e0b8 100644 --- a/app/assets/javascripts/orbit-1.0.js +++ b/app/assets/javascripts/orbit-1.0.js @@ -43,6 +43,25 @@ $(document).ready(function(){ $(document).on('click', '.sort-header > .sort', function() { $.getScript($(this).attr('rel')); }); + + + var $role = $('.select-role'); + var method =$('.privacy:eq(1)').attr('checked'); + if(method == 'checked'){ + $role.slideDown(0); + } + $('.privacy').each(function($i) { + $(this).click(function() { + switch ($i) { + case 0: + $role.slideUp(300); + break; + case 1: + $role.slideDown(300); + break; + } + }); + }); /*tinyscrollbar&windows-Size*/ resize(); @@ -80,7 +99,7 @@ function mainTablePosition() { var $height = $('#main-wrap > .subnav').height() var $table = $('#main-wrap > .table') //alert ($table.height()) - $table.stop().animate({marginTop:$height},500) + $table.stop().animate({marginTop:$height-17},500) //$table.css({marginTop : $height}) } $(window).scroll(function () { diff --git a/app/assets/stylesheets/bootstrap-orbit.css b/app/assets/stylesheets/bootstrap-orbit.css index 88bca1b3..eede71d4 100644 --- a/app/assets/stylesheets/bootstrap-orbit.css +++ b/app/assets/stylesheets/bootstrap-orbit.css @@ -98,7 +98,7 @@ h1, h2, h3, h4, h5, h6 { border-radius: 0 0 4px 4px; } table .span1-2 { - width: 94px; + min-width: 85px; float: none; margin-left: 0; } diff --git a/app/assets/stylesheets/list.css b/app/assets/stylesheets/list.css index ccf35f24..b4becb42 100644 --- a/app/assets/stylesheets/list.css +++ b/app/assets/stylesheets/list.css @@ -9,9 +9,9 @@ .main-list { margin-bottom: 0; } -.main-list thead th { - background-color: rgba(0,0,0,0.05); - border-right: 1px solid #ddd; +.main-wrap>.main-list thead th { + background-color: transparent; + border-right: medium none; } .main-list thead th:last-child { border-right: none; @@ -29,19 +29,22 @@ } .main-list tbody .quick-edit { position:relative; - height:40px; + height:20px; } .main-list tbody .quick-edit .nav { /*left: -55px;*/ position: absolute; /*top: -3px;*/ width: 350px; + left: -8px; } .main-list td { - /*height:80px;*/ + background-color: #FFFFFF; + border-bottom: 1px solid #DDDDDD; + border-top: medium none; } .main-list .nav { - margin-top: 15px; + margin-top: 0; margin-bottom: 3px; } .main-list tr.with_action:hover .hide { @@ -53,7 +56,7 @@ } .main-list .label-td { background-color: rgba(255, 255, 255, 1); - height: 60px; + height: 40px; overflow: hidden; position: absolute; width: 100%; @@ -74,6 +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; } .route-group .route { padding: 0; @@ -108,7 +120,10 @@ legend { -webkit-border-radius: 0; border-radius: 0; border-left: none; - border-right: 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; diff --git a/app/assets/stylesheets/reset.css.erb b/app/assets/stylesheets/reset.css.erb index 0d91f32a..5c0a9cd5 100644 --- a/app/assets/stylesheets/reset.css.erb +++ b/app/assets/stylesheets/reset.css.erb @@ -2,7 +2,6 @@ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockq -webkit-text-size-adjust:none; } html, body{ - background: url(<%= asset_path 'background.jpg' %>) repeat left top; height: 100%; } /*自定*/ diff --git a/app/assets/stylesheets/style.css.erb b/app/assets/stylesheets/style.css.erb index beae5a8e..2e203a02 100644 --- a/app/assets/stylesheets/style.css.erb +++ b/app/assets/stylesheets/style.css.erb @@ -350,8 +350,6 @@ border-top: none; } #post-body .editor { - background-color: #333333; - height: 20px; margin: 8px 0; width: 100%; } diff --git a/app/assets/stylesheets/widget.css b/app/assets/stylesheets/widget.css index b66a6074..b0e3568d 100644 --- a/app/assets/stylesheets/widget.css +++ b/app/assets/stylesheets/widget.css @@ -58,8 +58,8 @@ cursor: pointer; } .select-role { - display:none; - overflow:hidden; + display:none; + padding: 10px 0; } .file-upload { position:relative; diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb index a67464c1..62b28c0c 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb @@ -10,7 +10,10 @@ <% if bulletin.is_hidden? %> <%= t(:hidden) %> <% end %> - + + <%= bulletin.bulletin_category.i18n_variable[I18n.locale] %> + + <%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id) rescue ''%>
- - <%= bulletin.bulletin_category.i18n_variable[I18n.locale] %> - <%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id) rescue ''%> <%= bulletin.postdate %> <%= (bulletin.deadline) ? bulletin.deadline : t('bulletin.no_deadline') %> - <% bulletin.sorted_tags.each do |tag| %> - <%= tag[I18n.locale] %> - <% end %> +
+
+ <% bulletin.sorted_tags.each do |tag| %> + <%= tag[I18n.locale] %> + <% end %> +
+
<%= User.from_id(bulletin.update_user_id).name rescue ''%> diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletins.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletins.html.erb index bbe383bc..979f3f4a 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletins.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletins.html.erb @@ -1,4 +1,4 @@ - + + + + + + + + + + + + <%= render :partial => 'bulletin', :collection => @bulletins %> diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_filter.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_filter.html.erb index 5b078391..09222a36 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_filter.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_filter.html.erb @@ -53,5 +53,45 @@ Clear/重置 +
+ + + + + + + + + + + + + +
+ + + + <%= t('bulletin.status') %> + <%= content_tag(:b, nil, :class => is_sort?('status')) %> + + <%= t('bulletin.category') %> + <%= content_tag(:b, nil, :class => is_sort?('category')) %> + + <%= t('bulletin.title') %> + <%= content_tag(:b, nil, :class => is_sort?('title')) %> + + <%= t('bulletin.start_date') %> + <%= content_tag(:b, nil, :class => is_sort?('postdate')) %> + + <%= t('bulletin.end_date') %> + <%= content_tag(:b, nil, :class => is_sort?('deadline')) %> + + <%= t('bulletin.tags') %> + <%= content_tag(:b, nil, :class => is_sort?('tags')) %> + + <%= t('bulletin.last_modified') %> + <%= content_tag(:b, nil, :class => is_sort?('update_user_id')) %> +
+
\ No newline at end of file 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 f24ad40b..6dec078c 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 @@ -19,13 +19,16 @@ <%= f.error_messages %>
+ <% if params[:action] != 'new' %>
+

Audit

- <% if is_manager? || @bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || current_user.admin?%> + + <% if is_manager? || @bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || current_user.admin? %>
<%= f.label :fact_check_stat, t('announcement.bulletin.fact_check_stat') %> <%= content_tag :label,:class => "radio inline" do -%> @@ -45,6 +48,7 @@ <% end %>
+ <% end %>
@@ -100,9 +104,18 @@

Status

- <%= f.check_box :is_top %><%= t('top') %> - <%= f.check_box :is_hot %><%= t('hot') %> - <%= f.check_box :is_hidden %><%= t('hide') %> + <%= content_tag :label,:class => "checkbox inline" do -%> + <%= f.check_box :is_top %> + <%= t('top') %> + <% end -%> + <%= content_tag :label,:class => "checkbox inline" do -%> + <%= f.check_box :is_hot %> + <%= t('hot') %> + <% end -%> + <%= content_tag :label,:class => "checkbox inline" do -%> + <%= f.check_box :is_hidden %> + <%= t('hide') %> + <% end -%>
@@ -114,8 +127,10 @@

Tags

<% @tags.each do |tag| %> - <%= check_box_tag 'bulletin[tag_ids][]', tag.id, @bulletin.tag_ids.include?(tag.id)%> - <%= tag[I18n.locale] %> + <%= content_tag :label,:class => "checkbox inline" do -%> + <%= check_box_tag 'bulletin[tag_ids][]', tag.id, @bulletin.tag_ids.include?(tag.id)%> + <%= tag[I18n.locale] %> + <% end %> <% end %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/edit.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/edit.html.erb index ffe288cd..27211047 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/edit.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/edit.html.erb @@ -1,7 +1,10 @@ -

<%= t('announcement.editing_announcement') %>

- -<%= form_for @bulletin, :url => panel_announcement_back_end_bulletin_path(@bulletin), :html => {:class => 'clear'} do |f| %> - <%= render :partial => 'form', :locals => {:f => f} %> -<% end %> - -<%#= link_back %> + +
+ <%= form_for @bulletin, :url => panel_announcement_back_end_bulletin_path(@bulletin), :html => {:class => 'clear'} do |f| %> + <%= render :partial => 'form', :locals => {:f => f} %> + <% end %> +
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/new.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/new.html.erb index c05b645b..ded7fba0 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/new.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/new.html.erb @@ -1,5 +1,5 @@ -<%= form_for @bulletin, :url => panel_announcement_back_end_bulletins_path, :html => {:class => 'clear'} do |f| %> +
+<%= form_for @bulletin, :url => panel_announcement_back_end_bulletins_path do |f| %> <%= render :partial => 'form', :locals => {:f => f} %> <% end %> - -<%#= link_back %> +