Merge branch 'educoder' into develop

dev_SaaS
caishi 6 years ago
commit 864ae768ad

@ -318,6 +318,9 @@ module ApplicationHelper
# TPM查看权限 # TPM查看权限
# result一般为页面权限 # result一般为页面权限
def shixun_view_allow shixun, result = nil def shixun_view_allow shixun, result = nil
if params[:openi].to_i == 1
result ? false : true
else
if User.current.manager_of_shixun?(shixun) if User.current.manager_of_shixun?(shixun)
result ? false : true result ? false : true
else else
@ -326,6 +329,7 @@ module ApplicationHelper
end end
end end
end end
end
# 判断TPM的代码是否被修改了 # 判断TPM的代码是否被修改了
# 判断依据是看tpm的最新提交记录和tpi数据库中存储的commit_id是否一致 # 判断依据是看tpm的最新提交记录和tpi数据库中存储的commit_id是否一致

@ -55,9 +55,10 @@
</li> </li>
<li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 4 %>" style="width: 100px"><a href="javascript:void(0);" class="edu-admin-nav-a" >实训课程+</a> <li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 4 %>" style="width: 100px"><a href="javascript:void(0);" class="edu-admin-nav-a" >实训课程+</a>
<ul class="edu-admin-nav-inner edu-absolute"> <ul class="edu-admin-nav-inner edu-absolute">
<li style="width: 100px"><%= link_to "实训课程列表", class_shixuns_managements_path %></li> <li style="width: 120px"><%= link_to "实训课程等级体系", class_shixuns_managements_path %></li>
<li style="width: 100px"><%= link_to "实训课程配置", subject_setting_list_managements_path %></li> <li style="width: 120px"><%= link_to "实训课程列表", class_shixuns_managements_path %></li>
<li style="width: 100px"><%= link_to "已发布实训课程", class_publish_shixuns_managements_path %></li> <li style="width: 120px"><%= link_to "实训课程配置", subject_setting_list_managements_path %></li>
<li style="width: 120px"><%= link_to "已发布实训课程", class_publish_shixuns_managements_path %></li>
</ul> </ul>
</li> </li>
<li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 13 %>"><a href="<%= career_list_managements_path %>" class="edu-admin-nav-a">职业路径</a></li> <li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 13 %>"><a href="<%= career_list_managements_path %>" class="edu-admin-nav-a">职业路径</a></li>

@ -0,0 +1,88 @@
<div class="mt20" id="levelSystem">
<table class="edu-pop-table edu-txt-center" cellpadding="0" cellspacing="0">
<thead>
<th width="10%">等级</th>
<th width="15%" class="edu-txt-left">名称</th>
<th width="45" class="edu-txt-left">实训课程数</th>
<th width="15%">创建时间</th>
<th width="15%">操作</th>
</thead>
<tbody>
<tr>
<td class="levelNo">1</td>
<td class="edu-txt-left levelName">初级课程</td>
<td class="edu-txt-left">500</td>
<td>2019-03-02 10:38</td>
<td>
<a href="javascript:void(0)" class="mr15">删除</a>
<a href="javascript:void(0)" class="mr15 renameLine">重命名</a>
</td>
</tr>
<tr>
<td class="levelNo">2</td>
<td class="edu-txt-left levelName">初级课程</td>
<td class="edu-txt-left">--</td>
<td>2019-03-02 10:38</td>
<td>
<a href="javascript:void(0)" class="mr15">删除</a>
<a href="javascript:void(0)" class="mr15 renameLine">重命名</a>
</td>
</tr>
<tr>
<td colspan="5">
<a href="javascript:void(0)" class="color-blue" onclick="createLevel();">+ 新建</a>
</td>
</tr>
</tbody>
</table>
</div>
<script type="text/html" id="template_newForm">
<div class="bor-grey-e mt20 clearfix padding10-20 edu-back-white" id="newForm">
<span class="fl mt3">名称</span>
<input type="text" class="winput-240-35 fl ml20"/>
<li class="fr mt3">
<a href="javascript:void(0)" class="mr15" onclick="cancelNew();">取消</a>
<a href="javascript:void(0)" class="mr15">保存</a>
</li>
</div>
</script>
<script>
//新建
function createLevel(){
if($("#newForm").length==0){
var bt = baidu.template;
bt.LEFT_DELIMITER = '<!';
bt.RIGHT_DELIMITER = '!>';
var html = bt('template_newForm', null);
$("#levelSystem").append(html);
}
}
//新建--取消
function cancelNew(){
$("#newForm").remove();
}
//重命名
var lastHtml="";
$("table").on("click",".renameLine",function(){
var tr=$(this).parents("tr");
lastHtml=$(tr).html();
var value=$(tr).find(".levelName").html();
var No=$(tr).find(".levelNo").html();
var html='<td>'+No+'</td>'+
'<td colspan="4" class="edu-txt-left">'+
'<input type="winput-240-35" name="rename" value="'+value+'"/>'+
'<a href="javascript:void(0)" class="mr15 ml20" onclick="cancelEdit(this);">取消</a>'+
'<a href="javascript:void(0)">保存</a>'+
'</td>';
$(tr).html(html);
})
//重命名--取消
function cancelEdit(item){
$(item).parents("tr").html(lastHtml);
}
</script>
Loading…
Cancel
Save