附件权限控制

This commit is contained in:
daiao 2018-02-09 11:30:43 +08:00
parent 71e3ff3df6
commit 9e64872470
2 changed files with 5 additions and 4 deletions

View File

@ -1,7 +1,7 @@
<% @statistics.each do |statistic| %>
<div class="data_list_item cl pr">
<img src="<%= url_to_avatar(statistic.creator) %>" width="50" class="fl">
<% if User.current.id == statistic.user_id || User.current.admin %>
<% if User.current.id == statistic.user_id || User.current.admin? %>
<div class="homepagePostSetting" style="top: 10px;right: 12px">
<ul>
<li class="homepagePostSettingIcon">

View File

@ -1,11 +1,13 @@
<%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min.css' %>
<%= javascript_include_tag '/editormd/lib/marked.min.js','/editormd/lib/prettify.min.js','/editormd/lib/raphael.min.js','/editormd/lib/underscore.min.js','/editormd/lib/sequence-diagram.min.js',
'/editormd/lib/flowchart.min.js','/editormd/lib/jquery.flowchart.min.js','/editormd/editormd.js' %>
<div class="data_showdetail">
<div class="data_showdetail mb20">
<div class="detail_part mt15">
<label>数据类别名称:</label>
<%= @statistic.name %>
<%= link_to '编辑', edit_statistic_path(@statistic) ,:class => "submit_btn fr mr45" %>
<% if User.current.id == @statistic.user_id || User.current.admin? %>
<%= link_to '编辑', edit_statistic_path(@statistic) ,:class => "submit_btn fr mr45" %>
<% end %>
</div>
<div class="cl detail_part">
@ -29,7 +31,6 @@
<% end %>
<div class="detail_part">
<label>&nbsp;</label>
<%= link_to '返回', statistics_path ,:class=>"grey_btn" %>
</div>
</div>