修改课程讨论区的js

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2015-05-07 17:38:08 +08:00
parent 4bf08e49da
commit 3b58810528
10 changed files with 43 additions and 50 deletions

View File

@ -44,17 +44,15 @@
<br/> <br/>
<p>
<p class="break_word" id="contentmessage<%=topic.id %>"> <div id="contentmessage<%=topic.id %>" class="project_board_content">
<%= topic.content %> </p> <%= topic.content %>
<div class="lg-foot" style="display: block" id="lg-foot<%= topic.id %>" onclick="show_more_reply('#contentmessage<%=topic.id %>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');">
<label id="expend_more_information<%= topic.id%>" value="show_more"><%= l(:label_expend_information)%></label>
<span class="g-arr-down">
<img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" />
</span>
</div> </div>
<label id="expend_more_information<%= topic.id%>" onclick="show_more_reply('#contentmessage<%=topic.id %>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</label>
<span class="g-arr-down">
<img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" />
</span>
</p>
<%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %> <%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %>
</div> </div>
<%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %> <%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %>

View File

@ -1,5 +1,4 @@
<div class="project_r_h" xmlns="http://www.w3.org/1999/html">
<div class="project_r_h">
<h2 class="project_h2 fl"> <h2 class="project_h2 fl">
<% if User.current.language == "zh"%> <% if User.current.language == "zh"%>
<%= h @board.name %> <%= h @board.name %>
@ -36,24 +35,25 @@
<div class="talkmain_box" style="border:none; margin-bottom:0;"> <div class="talkmain_box" style="border:none; margin-bottom:0;">
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %> <%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
<div class="talkmain_txt fl mt5"> <div class="talkmain_txt fl mt5">
<% author = topic.author.to_s + "" %> <% author = topic.author.to_s + "" %>
<%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %> <%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %>
<p class="talkmain_tit fl fb">&nbsp;&nbsp;<%= h(topic.subject) %></p> <p class="talkmain_tit fl fb">&nbsp;&nbsp;<%= h(topic.subject) %></p>
<% if topic.sticky? %> <% if topic.sticky? %>
<a href="javascript:void(0)" class="talk_up fr c_red"><%= l(:label_board_sticky)%></a> <a href="javascript:void(0)" class="talk_up fr c_red"><%= l(:label_board_sticky)%></a>
<% end %> <% end %>
<div class="cl"></div>
<br/> <p id="contentmessage<%=topic.id %>" class="project_board_content">
<%= topic.content %>
</p> <p>
<label id="expend_more_information<%= topic.id%>" onclick="show_more_reply('#contentmessage<%=topic.id %>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</label>
<span class="g-arr-down">
<img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" />
</span>
</p>
<p class="break_word" id="contentmessage<%=topic.id %>">
<%= topic.content %> </p>
<div class="lg-foot" style="display: block" id="lg-foot<%= topic.id %>" onclick="show_more_reply('#contentmessage<%=topic.id %>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');">
<label id="expend_more_information<%= topic.id%>" value="show_more"><%= l(:label_expend_information)%></label>
<span class="g-arr-down">
<img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" />
</span>
</div>
<%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %> <%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %>
@ -166,6 +166,7 @@
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@project}: #{@board}") %> <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@project}: #{@board}") %>
<% end %> <% end %>
</div>
<script type="text/javascript"> <script type="text/javascript">
// var flag = false; // var flag = false;
// jQuery(document).ready(function($) { // jQuery(document).ready(function($) {

View File

@ -50,22 +50,7 @@ function show_newreply()
{ {
$("#replyContent").toggle(); $("#replyContent").toggle();
} }
function show_more() {
$("#contentmessage").toggleClass("course_description_none");
var information = $("#expend_more_information2");
var arrow = $("#arrow2");
var val = information.attr("value");
if (val == "show_more") {
$("#expend_more_information2").text("收起");
information.attr("value", "hide_more");
arrow.attr("src", "/images/jiantouup.jpg")
}
else {
$("#expend_more_information2").text("展开");
information.attr("value", "show_more");
arrow.attr("src", "/images/jiantou.jpg")
}
}
function regexContent() function regexContent()
{ {
var content = $.trim($("#message_content").val()); var content = $.trim($("#message_content").val());

View File

@ -46,7 +46,7 @@
<% end %><!--meny end --> <% end %><!--meny end -->
<!-- more --> <!-- more -->
<div class="subNav subNav_jiantou" onclick="expand_tools_expand();" id="expand_tools_expand"><%= l(:label_project_more) %></div> <div class="subNav subNav_jiantou" onclick="$('#navContent').toggle(500);" id="expand_tools_expand"><%= l(:label_project_more) %></div>
<ul class="navContent"> <ul class="navContent" id="navContent">
<%= render 'projects/tools_expand' %> <%= render 'projects/tools_expand' %>
</ul> </ul>

View File

@ -157,8 +157,8 @@
<!--邀请加入--> <!--邀请加入-->
<div class="subNavBox"> <div class="subNavBox">
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<div class="subNav currentDd currentDt subNav_jiantou" id="expand_tools_expand_invit" onclick="expand_tools_expand('invit');"><%= l(:label_invite)%></div> <div class="subNav currentDd currentDt subNav_jiantou" id="expand_tools_expand_invit" onclick="$('#navContent_invit').toggle(500);"><%= l(:label_invite)%></div>
<ul class="navContent " style="display:block"> <ul class="navContent " style="display:block" id="navContent_invit">
<li><%= link_to l(:label_invite_new_user), :controller=>"projects", :action=>"invite_members_by_mail", :id => @project %></li> <li><%= link_to l(:label_invite_new_user), :controller=>"projects", :action=>"invite_members_by_mail", :id => @project %></li>
<% if User.current.allowed_to?(:manage_members, @project) %> <% if User.current.allowed_to?(:manage_members, @project) %>
<li><%= link_to l(:label_invite_trustie_user), :controller=>"projects", :action=>"invite_members", :id => @project %></li> <li><%= link_to l(:label_invite_trustie_user), :controller=>"projects", :action=>"invite_members", :id => @project %></li>

View File

@ -2,7 +2,12 @@
<% <%
roles = Role.givable.all roles = Role.givable.all
if @project.project_type == Project::ProjectType_course if @project.project_type == Project::ProjectType_course
roles = roles[3..5] if User.current.language == "zh"
roles = ["管理人员","开发者","报告人员"]
else
roles = ["管理人员","开发者","报告人员"]
# roles = roles[3..5]
end
else else
roles = roles[0..2] roles = roles[0..2]
end end

View File

@ -33,9 +33,10 @@ function expand_tools_expand(content) {
$("#expand_tools_expand_invit").next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500); $("#expand_tools_expand_invit").next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
} }
else { else {
$("#expand_tools_expand").toggleClass("currentDd").siblings(".subNav").removeClass("currentDd"); // $("#expand_tools_expand").toggleClass("currentDd").siblings(".subNav").removeClass("currentDd");
$("#expand_tools_expand").toggleClass("currentDt").siblings(".subNav").removeClass("currentDt"); // $("#expand_tools_expand").toggleClass("currentDt").siblings(".subNav").removeClass("currentDt");
$("#expand_tools_expand").next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500); // $("#expand_tools_expand").next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
$("#navContent").toggle(500);
} }
// 修改数字控制速度, slideUp(500)控制卷起速度 // 修改数字控制速度, slideUp(500)控制卷起速度
@ -64,12 +65,12 @@ function show_more_reply(contentid, id2, id3) {
var arrow = $(id3); var arrow = $(id3);
var val = information.attr("value"); var val = information.attr("value");
if (val == "show_more") { if (val == "show_more") {
$(id2).text("收起"); $(id2).text("[收起]");
information.attr("value", "hide_more"); information.attr("value", "hide_more");
arrow.attr("src", "/images/jiantouup.jpg") arrow.attr("src", "/images/jiantouup.jpg")
} }
else { else {
$(id2).text("展开更多信息"); $(id2).text("[展开]");
information.attr("value", "show_more"); information.attr("value", "show_more");
arrow.attr("src", "/images/jiantou.jpg") arrow.attr("src", "/images/jiantou.jpg")
} }

View File

@ -534,7 +534,7 @@ a.files_tag_select{ background:#64bdd9; color:#fff; border:1px solid #64bdd9; pa
.w664{ width:664px;} .w664{ width:664px;}
.w140{ width:140px;} .w140{ width:140px;}
.talklist_box{ } .talklist_box{ }
.talkmain_box{ width:670px; border-bottom:1px dashed #d9d9d9; padding-bottom:20px; margin-bottom:20px;} .talkmain_box{ width:670px; border-bottom:1px dashed #d9d9d9; margin-bottom:20px; margin-top: 10px;}
.talkmain_pic{} .talkmain_pic{}
a.talkmain_pic{ display:block; width:42px; height:42px; padding:2px; border:1px solid #e3e3e3;} a.talkmain_pic{ display:block; width:42px; height:42px; padding:2px; border:1px solid #e3e3e3;}
a:hover.talkmain_pic{border:1px solid #64bdd9;} a:hover.talkmain_pic{border:1px solid #64bdd9;}
@ -576,3 +576,4 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}

View File

@ -49,6 +49,7 @@ a:hover.subnav_green{ background:#14ad5a;}
/*简介*/ /*简介*/
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;} .project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;} .course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
.project_board_content{overflow: hidden;max-height: 50px;word-break: break-all;word-wrap: break-word;}
.course_description_none{max-height: none;} .course_description_none{max-height: none;}
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;} .lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;}
.lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;} .lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;}

View File

@ -697,7 +697,7 @@ tr.open span.expander {background-image: url(../images/bullet_toggle_minus.png);
.w664{ width:664px;} .w664{ width:664px;}
.w140{ width:140px;} .w140{ width:140px;}
.talklist_box{ } .talklist_box{ }
.talkmain_box{ width:670px; border-bottom:1px dashed #d9d9d9; padding-bottom:20px; margin-bottom:20px;} .talkmain_box{ width:670px; border-bottom:1px dashed #d9d9d9; margin-bottom:20px; margin-top: 10px;}
.talkmain_pic{} .talkmain_pic{}
a.talkmain_pic{ display:block; width:42px; height:42px; padding:2px; border:1px solid #e3e3e3;} a.talkmain_pic{ display:block; width:42px; height:42px; padding:2px; border:1px solid #e3e3e3;}
a:hover.talkmain_pic{border:1px solid #64bdd9;} a:hover.talkmain_pic{border:1px solid #64bdd9;}
@ -726,3 +726,4 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}
.newtalk { margin-top:8px; margin-right:8px;} .newtalk { margin-top:8px; margin-right:8px;}
.talk_new{ border-bottom:1px dashed #d9d9d9; padding-bottom:10px;} .talk_new{ border-bottom:1px dashed #d9d9d9; padding-bottom:10px;}
#about_newtalk{ display:none;} #about_newtalk{ display:none;}