“课程名称”不显示,英文名称为空时不显示“课程英文名称”

This commit is contained in:
cxt 2016-08-31 14:33:29 +08:00
parent 076feb17e8
commit 8494d71e8e
4 changed files with 7 additions and 5 deletions

View File

@ -1,9 +1,9 @@
<p style="position:relative; display:inline;"><% if syllabus.eng_name && !syllabus.eng_name.empty? %>
<span><%=syllabus.eng_name %></span>
<% else%>
<span style="color: #888">课程英文名称</span>
<span style="color: #888"></span>
<% end %>
<% if User.current == syllabus.user || User.current.admin? %>
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_ng_name_png", :style => "width:15px; position:absolute; right: -20px; top: 5px;", :class => "none", :onclick => "show_edit_eng_name('#{syllabus.eng_name}');"%>
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_ng_name_png", :style => "width:15px; position:absolute; right: -20px; top: 5px;", :class => "none", :onclick => "show_edit_eng_name('#{syllabus.eng_name}');", :title => '编辑课程英文名称'%>
<% end %>
</p>

View File

@ -6,4 +6,4 @@
<div id="syllabus_eng_name_show">
<%= render :partial => 'layouts/syllabus_eng_name', :locals => {:syllabus => @syllabus}%>
</div>
<input type="text" class="none" style="width:300px;" placeholder="请编辑英文名称" id="syllabus_eng_name_edit"/>
<input type="text" class="none" style="width:300px;" placeholder="请编辑英文名称" id="syllabus_eng_name_edit"/>

View File

@ -1,5 +1,6 @@
<h2 style="position:relative; display:inline;">课程名称:<%=syllabus.title %>
<h2 style="position:relative; display:inline;">
<%=syllabus.title %>
<% if User.current == syllabus.user || User.current.admin? %>
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_title_png", :class => "none", :style => "width:15px; position:absolute; right: -20px; top: 15px;", :onclick => "show_edit_title('#{syllabus.title}');"%>
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_title_png", :class => "none", :style => "width:15px; position:absolute; right: -20px; top: 15px;", :onclick => "show_edit_title('#{syllabus.title}');", :title => '编辑课程名称'%>
<% end %>
</h2>

View File

@ -1,3 +1,4 @@
$("#syllabus_eng_name_show").html("<%= escape_javascript render :partial => 'layouts/syllabus_eng_name', :locals => {:syllabus => @syllabus} %>");
$("#syllabus_eng_name_show").show();
$("#syllabus_edit_ng_name_png").show();
$("#syllabus_eng_name_edit").hide();