socialforge/app/views/syllabuses/show.html.erb

92 lines
4.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<% end %>
<script type="text/javascript">
$(function() {
sd_create_editor_from_data(<%= @syllabus.id %>, null, "100%", "<%= @syllabus.class.to_s %>");
});
</script>
<div class="RightBanner" >
<p >课程信息</p>
</div>
<% if @syllabus.des_status == 1 && @syllabus.courses.empty? %>
<div class="syllabusbox_tishi">
<% if User.current == @syllabus.user %>
<p >您建立的课程还未创建班级,请
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "syllabusbox_a_blue", :target => '_blank'%>
</p>
<% elsif User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
<p >本课程下还未创建班级,请
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "syllabusbox_a_blue", :target => '_blank'%>
</p>
<% else %>
<p >本课程下还未创建班级,敬请期待。
</p>
<% end %>
</div>
<% end %>
<div class="<%=@syllabus.des_status == 0 ? 'HomeWork' : 'syllabusbox'%>">
<% if @syllabus.des_status == 0%>
<% if User.current == @syllabus.user %>
<p class="syllabus_info_tishi">您建立的课程尚未填写课程大纲,请完善您的<%=link_to '课程大纲', edit_syllabus_path(@syllabus), :class => 'syllabusbox_a_blue' %></p>
<% else %>
<p class="syllabus_info_tishi"><%=@syllabus.user.show_name %>老师尚未完成课程大纲的编写,敬请期待。</p>
<% end %>
<% else %>
<div class="syllabuscon">
<%=@syllabus.description.html_safe %>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @syllabus} %>
</div>
</div>
<% if User.current.logged? && User.current == @syllabus.user%>
<div class="homepagePostSetting" style="margin:10px;">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li><%=link_to '编辑', edit_syllabus_path(@syllabus), :class => 'postOptionLink'%></li>
<li><%=link_to '删除', delete_des_syllabus_path(@syllabus), :class => 'postOptionLink', :confirm => l(:text_are_you_sure)%></li>
</ul>
</li>
</ul>
</div>
<div class="cl"></div>
<% end %>
<div class="fr fontGrey2">更新时间:<%=format_time @syllabus.updated_at %><div></div></div>
<div class="cl"></div>
<% end %>
<% count=@syllabus.journals_for_messages.count %>
<div class="homepagePostReply">
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => @syllabus, :user_activity_id => @syllabus.id} %>
<% comments = @syllabus.journals_for_messages.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
<div class="" id="reply_div_<%= @syllabus.id %>">
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
</div>
<% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @syllabus.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10">
<% if User.current.logged? %>
<div nhname='new_message_<%= @syllabus.id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_syllabus_message', :id => @syllabus.id},:method => "post") do |f|%>
<div nhname='toolbar_container_<%= @syllabus.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @syllabus.id%>' name="comment"></textarea>
<a id="new_message_submit_btn_<%= @syllabus.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= @syllabus.id%>'></p>
<% end%>
</div>
<% else %>
<%= render :partial => "users/show_unlogged" %>
<% end %>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div><!--回复框 用正式版样式-->
</div><!--HomeWork end-->