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 class Admin::AdBannersController < OrbitAdminController
before_action ->(module_app = @app_title) { set_variables module_app }
def index def index
@banners = Banner.all @banners = Banner.all

View File

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

View File

@ -3,40 +3,44 @@
<%= javascript_include_tag "cycle2" %> <%= javascript_include_tag "cycle2" %>
<%= javascript_include_tag "ad_banner/banner_preview" %> <%= javascript_include_tag "ad_banner/banner_preview" %>
<% end %> <% end %>
<div id="banner_index"> <div id="banner_index">
<%= render 'index' %> <%= render 'index' %>
</div> </div>
<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 id="pageslide"> <% if current_user.is_admin? or current_user.is_manager?(@module_app) %>
<div class="page-title clearfix"> <div class="bottomnav clearfix" style="left: 81px;">
<a class="pull-right" href="javascript:$.pageslide.close()"> <div class="action pull-right">
<i class="icons-arrow-left-2"></i> <a data-title="<%= t("ad_banner.new_banner") %>" data-id="new" data-fx="fade" class="btn btn-primary open-slide" href="#">
</a> <i class="icon-plus"></i><%= t("ad_banner.new_banner") %>
<span></span> </a>
</div>
<div class="pagination pagination-centered"></div>
</div> </div>
<div class="view-page">
<div class="nano"> <div id="pageslide">
<div class="content"> <div class="page-title clearfix">
<%= form_for :ad_banner, url: nil, remote: true do |f| %> <a class="pull-right" href="javascript:$.pageslide.close()">
<fieldset> <i class="icons-arrow-left-2"></i>
<%= render :partial => "form", :locals => { :f => f } %> </a>
<div class="form-actions"> <span></span>
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a> </div>
<%= f.submit t(:submit), class: 'btn btn-primary btn-small' %> <div class="view-page">
</div> <div class="nano">
</fieldset> <div class="content">
<% end %> <%= form_for :ad_banner, url: nil, remote: true do |f| %>
<fieldset>
<%= render :partial => "form", :locals => { :f => f } %>
<div class="form-actions">
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:submit), class: 'btn btn-primary btn-small' %>
</div>
</fieldset>
<% end %>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
<%= render 'layouts/delete_modal', delete_options: @delete_options %> <%= render 'layouts/delete_modal', delete_options: @delete_options %>
<% end %>