Merge branch 'ad_banner' of https://github.com/Rulingcom/orbit into ad_banner

Conflicts:
	app/views/admin/ad_banners/_ad_image_update.html.erb
This commit is contained in:
Matthew K. Fu JuYuan 2012-04-13 16:52:14 +08:00
commit 430b0fd9ae
8 changed files with 109 additions and 46 deletions

View File

@ -51,7 +51,7 @@ $(document).ready(function(){
$('#main-sidebar').css("height", viewportheight-30); $('#main-sidebar').css("height", viewportheight-30);
$('#main-sidebar .viewport').css("height", viewportheight-30); $('#main-sidebar .viewport').css("height", viewportheight-30);
$('.post-title').css("width", viewportwidth-495); $('.post-title').css("width", viewportwidth-495);
$('#main-wrap > .subnav').css("width", viewportwidth-$mainWrapMarginLeft) $('#main-wrap .subnav').css("width", viewportwidth-$mainWrapMarginLeft);
$('#main-sidebar').tinyscrollbar(); $('#main-sidebar').tinyscrollbar();
$('.detal-list').tinyscrollbar(); $('.detal-list').tinyscrollbar();
$('#main-sidebar').tinyscrollbar({size:(viewportheight-34)}); $('#main-sidebar').tinyscrollbar({size:(viewportheight-34)});
@ -72,14 +72,14 @@ $(window).resize(function(){
$('#main-sidebar').css("height", viewportheight-30); $('#main-sidebar').css("height", viewportheight-30);
$('#main-sidebar .viewport').css("height", viewportheight-30); $('#main-sidebar .viewport').css("height", viewportheight-30);
$('.post-title').css("width", viewportwidth-495); $('.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)}); $('#main-sidebar').tinyscrollbar({size:(viewportheight-34)});
mainTablePosition(); mainTablePosition();
}); });
/*main-table position*/ /*main-table position*/
function mainTablePosition() { function mainTablePosition() {
var $height = $('#main-wrap .subnav').length && $('#main-wrap .subnav').height(); 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){ if($table && $table==0){
$table.css({marginTop:$height}); $table.css({marginTop:$height});
} }

View File

@ -1,28 +1,28 @@
var history_edited = false; var history_edited = false;
$('#back_sidebar a, #back_main a.nav').live('click', // $('#back_sidebar a, #back_main a.nav').live('click',
function () { // function () {
$.getScript(this.href); // $.getScript(this.href);
history.pushState(null, document.title, this.href); // history.pushState(null, document.title, this.href);
history_edited = true; // history_edited = true;
return false; // return false;
} // }
); // );
$('#back_main a.reload').live('click', // $('#back_main a.reload').live('click',
function () { // function () {
$.getScript(this.href); // $.getScript(this.href);
history.replaceState(null, document.title, this.href); // history.replaceState(null, document.title, this.href);
history_edited = true; // history_edited = true;
return false; // return false;
} // }
); // );
$('.form').live('submit', function () { // $('.form').live('submit', function () {
$.post(this.action, $(this).serialize(), null, 'script'); // $.post(this.action, $(this).serialize(), null, 'script');
history_edited = true; // history_edited = true;
return false; // return false;
}); // });
$(document).on('click', '.js_history', $(document).on('click', '.js_history',
function () { function () {

View File

@ -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;
}

View File

@ -83,7 +83,7 @@ module ApplicationHelper
end end
def active_for_action(controller_name, action_name) 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 end
def sortable(column) def sortable(column)

View File

@ -1,4 +1,4 @@
<li class="span3" id = 'asd'> <li class="span3">
<%= image_tag ad_image.file rescue nil%> <%= image_tag ad_image.file rescue nil%>
<p> <p>
<%= ad_image.display? ? '[Showing]' : '[NotShawing]' %> <%= ad_image.display? ? '[Showing]' : '[NotShawing]' %>

View File

@ -7,18 +7,4 @@
<li><%= link_to t('admin.member'), admin_users_path, :class => 'orblink' %></li> <li><%= link_to t('admin.member'), admin_users_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.translation'), admin_translations_path, :class => 'orblink' %></li> <li><%= link_to t('admin.translation'), admin_translations_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.site'), admin_sites_path, :class => 'orblink' %></li> <li><%= link_to t('admin.site'), admin_sites_path, :class => 'orblink' %></li>
<!-- <li><%= link_to t('admin.purchase'), admin_purchases_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.site_setting'), admin_sites_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.design'), admin_designs_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.announcement'), panel_announcement_back_end_root_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.super_pages'), '', :class => 'orblink' %></li>
<li><%= link_to t('admin.links'), '', :class => 'orblink' %></li>
<li><%= link_to t('admin.ad_banner'), admin_ad_banners_path, :class => 'orblink' %></li>
<li><%= link_to t('admin.calendar'), '', :class => 'orblink' %></li>
<li><%= link_to t('admin.nccu'), '', :class => 'orblink' %></li>
t('admin.dashbroad')
t('admin.content'
t('admin.add_drop_down_item')
-->
</ul> </ul>

View File

@ -2,14 +2,14 @@
<%= link_to content_tag(:i, nil, :class => 'icons-purchase') + t('admin.purchase'), admin_purchases_path %> <%= link_to content_tag(:i, nil, :class => 'icons-purchase') + t('admin.purchase'), admin_purchases_path %>
<% end -%> <% 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 %> <%= 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.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.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.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('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('bulletins', 'fact_check_setting') if (is_manager? rescue nil) %> <%= 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 -%>
<% 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.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.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.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 -%>
<% end -%> <% end -%>

View File

@ -1,7 +1,7 @@
$("#collapse-status").html("<%= j render 'filter_status' %>"); $("#collapse-status").html("<%= j render 'filter_status' %>");
$("#collapse-category").html("<%= j render 'filter_categories' %>"); $("#collapse-category").html("<%= j render 'filter_categories' %>");
$("#collapse-tags").html("<%= j render 'filter_tags' %>"); $("#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' %>"); $("#sort_headers").html("<%= j render 'sort_headers' %>");
$("#tbody_bulletins").html("<%= j render :partial => 'bulletin', :collection => @bulletins %>"); $("#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} %>"); $("#bulletin_pagination").html("<%= j paginate @bulletins, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>");