add authorization

This commit is contained in:
manson 2014-08-15 11:22:02 +08:00
parent c3a78aaf54
commit abe3948b4c
3 changed files with 45 additions and 31 deletions

View File

@ -1,4 +1,5 @@
class Admin::AdBannersController < OrbitAdminController
before_action ->(module_app = @app_title) { set_variables module_app }
def index
@banners = Banner.all

View File

@ -111,7 +111,7 @@
font-weight: normal;
}
.bottomnav{
z-index: 999;
/*z-index: 999;*/
}
.ad-banner-detail{
display: none;
@ -167,7 +167,7 @@
margin: 0;
}
.ad-image-btn{
padding: 2px 25px;
padding: 2px 20px;
line-height: 22px;
color: #FFF;
background: #000;
@ -198,7 +198,12 @@
text-align: center;
font-size: 16px;
}
@media all and (max-width: 768px) {
@media all and (max-width: 1000px) {
.ad-banner-info table{
display: none;
}
}
@media all and (max-width: 767px) {
.ad-banner-detail{
position: relative;
margin-bottom: 10px;
@ -227,6 +232,7 @@
</div>
<% if can_edit_or_delete?(banner) %>
<div class="ad-banner-edit">
<a data-title="<%= t(:setting) %>"
data-id="<%= banner.id.to_s %>"
@ -252,6 +258,7 @@
</div>
</a>
</div>
<% end %>
<div class="ad-banner-info">
<table class="table">
@ -268,6 +275,7 @@
</table>
</div>
<% if can_edit_or_delete?(banner) %>
<div id="ad-banner-<%= banner.id.to_s %>" class="ad-banner-detail">
<div class="ad-banner-images-wrap-arrow"></div>
<div class="ad-banner-images-wrap">
@ -310,6 +318,7 @@
<% end %>
</div>
</div>
<% end %>
</div>
<% if ((i+1)%3==0) or (i+1 == @banners.count) %></div><br/ ><% end %>

View File

@ -3,19 +3,22 @@
<%= javascript_include_tag "cycle2" %>
<%= javascript_include_tag "ad_banner/banner_preview" %>
<% end %>
<div id="banner_index">
<%= render 'index' %>
</div>
<div class="bottomnav clearfix" style="left: 81px;">
<% if current_user.is_admin? or current_user.is_manager?(@module_app) %>
<div class="bottomnav clearfix" style="left: 81px;">
<div class="action pull-right">
<a data-title="<%= t("ad_banner.new_banner") %>" data-id="new" data-fx="fade" class="btn btn-primary open-slide" href="#">
<i class="icon-plus"></i><%= t("ad_banner.new_banner") %>
</a>
</div>
<div class="pagination pagination-centered"></div>
</div>
</div>
<div id="pageslide">
<div id="pageslide">
<div class="page-title clearfix">
<a class="pull-right" href="javascript:$.pageslide.close()">
<i class="icons-arrow-left-2"></i>
@ -37,6 +40,7 @@
</div>
</div>
</div>
</div>
</div>
<%= render 'layouts/delete_modal', delete_options: @delete_options %>
<%= render 'layouts/delete_modal', delete_options: @delete_options %>
<% end %>