app/views/layouts/educode_sales/application.html.erb in educode_sales-0.1.0 vs app/views/layouts/educode_sales/application.html.erb in educode_sales-0.1.1
- old
+ new
@@ -41,45 +41,66 @@
<!-- 左侧导航区域(可配合layui已有的垂直导航) -->
<ul class="layui-nav layui-nav-tree" lay-filter="test">
<li class="layui-nav-item layui-nav-itemed">
<a class="" href="javascript:;">销售活动</a>
<dl class="layui-nav-child">
+ <% if can? :trends, EducodeSales::SaleTrend %>
<dd>
<a href="/educode_sales/sale_trends/trends" class="<%= current?('layui-this', trends_sale_trends_path) %>">市场态势</a>
</dd>
+ <% end %>
+ <% if can? :sales, EducodeSales::Staff %>
<dd><a href="/educode_sales/sales" class="<%= current?('layui-this', sales_path) %>">销售分工</a>
</dd>
+ <% end %>
+ <% if can? :read, EducodeSales::Business %>
<dd><a href="/educode_sales/businesses" class="<%= current?('layui-this', businesses_path) %>">商机管理</a>
</dd>
+ <% end %>
+ <% if can? :read, EducodeSales::Place %>
<dd><a href="/educode_sales/places" class="<%= current?('layui-this', places_path) %>">渠道管理</a></dd>
+ <% end %>
+ <% if can? :read, EducodeSales::SalePlan %>
<dd><a href="/educode_sales/plans" class="<%= current?('layui-this', plans_path) %>">销售计划</a></dd>
- <!-- <dd><a href="/educode_sales/statistics">销售数据统计</a></dd> -->
+ <% end %>
</dl>
</li>
<li class="layui-nav-item layui-nav-itemed">
<a class="" href="javascript:;">运营活动</a>
<dl class="layui-nav-child">
+ <% if can? :read, EducodeSales::OperationTrend %>
<dd>
<a href="/educode_sales/operations/trends" class="<%= current?('layui-this', trends_operations_path) %>">运营态势</a>
</dd>
+ <% end %>
+ <% if can? :operations, EducodeSales::Staff %>
<dd>
- <a href="/educode_sales/sales/operations" class="<%= current?('layui-this', sale_trends_sales_path) %>">运营分工</a>
+ <a href="/educode_sales/sales/operations" class="<%= current?('layui-this', operations_sales_path) %>">运营分工</a>
</dd>
+ <% end %>
+ <% if can? :read, EducodeSales::Teacher %>
<dd><a href="/educode_sales/teachers" class="<%= current?('layui-this', teachers_path) %>">教师运营</a></dd>
+ <% end %>
+ <% if can? :read, EducodeSales::Activity %>
<dd><a href="/educode_sales/activities" class="<%= current?('layui-this', activities_path) %>">活动运营</a></dd>
+ <% end %>
+ <% if can? :read, EducodeSales::OperationPlan %>
<dd>
<a href="/educode_sales/operation_plans" class="<%= current?('layui-this', operation_plans_path) %>">运营计划</a>
</dd>
+ <% end %>
</dl>
</li>
+ <% if @current_admin.is_admin %>
<li class="layui-nav-item layui-nav-itemed">
<a class="" href="javascript:;">系统设置</a>
<dl class="layui-nav-child">
<dd><a href="/educode_sales/roles" class="<%= current?('layui-this', roles_path) %>">角色管理</a></dd>
<dd><a href="/educode_sales/staffs" class="<%= current?('layui-this', staffs_path) %>">人员管理</a></dd>
<dd><a href="/educode_sales/commons" class="<%= current?('layui-this', commons_path) %>">字典列表</a></dd>
</dl>
</li>
+ <% end %>
</ul>
</div>
</div>
<div class="layui-body">