From 45fa01c773d4273552ae842689e3b0a2a914754b Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 9 Apr 2015 09:22:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=BA=E9=99=B7=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E6=98=BE=E7=A4=BA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/issues_helper.rb | 14 +-- app/views/courses/settings.html.erb | 150 ++++++++++++++-------------- public/javascripts/course.js | 88 ++++++++-------- 3 files changed, 126 insertions(+), 126 deletions(-) diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 17c39b3fe..ffdabc3dc 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -67,15 +67,15 @@ module IssuesHelper s.html_safe end - def link_to_issue_type - if column_content[1].to_s == "缺陷" + def link_to_issue_type(value) + if value == "缺陷" class_type = "red_btn_cir ml10" - elsif column_content[1] == "功能" - class="blue_btn_cir ml10" - elsif column_content[1] == "支持" - class="green_btn_cir ml10" + elsif value == "功能" + class_type = "blue_btn_cir ml10" + elsif value == "支持" + class_type = "green_btn_cir ml10" else - class_type="orange_btn_cir ml10"> + class_type = "orange_btn_cir ml10" end end diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index 569ae302b..97c5ecf04 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -1,76 +1,76 @@ -
-

<%= l(:label_course_modify_settings)%>

-
-
-
-
    -
  • - 基本信息 -
  • -
  • - 成员 -
  • -
-
-
-
    - <%= labelled_form_for @course do |f| %> -
  • - <%= render :partial => "avatar/new_avatar_form", :locals => {source: @course} %> -
    -
  • -
  • - - - -
  • -
    -
  • - - - -
  • -
    -
  • - - <%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {} %> - <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %> -
  • -
    -
  • - - -
    - 学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。 -
  • -
  • - - -
    -
  • -
  • - - id="course_is_public" name="course[is_public]" type="checkbox"> - (打钩为公开,不打钩则不公开,若不公开,仅课程成员可见该课程。) -
    -
  • -
  • - - id="course_open_student" name="course[open_student]" type="checkbox" style="margin-left: 1px;"/> - (打钩为"学生列表公开",不打钩为不公开,若不公开,则课程外部人员看不到学生列表) -
    -
  • -
  • - 提交 - <%= link_to l(:button_cancel), course_path(@course), :class => "blue_btn grey_btn fl c_white" %> -
    -
  • - <% end %> -
-
- -
- <%= render :partial => "course_members" %> -
-
+
+

<%= l(:label_course_modify_settings)%>

+
+
+
+
    +
  • + 基本信息 +
  • +
  • + 成员 +
  • +
+
+
+
    + <%= labelled_form_for @course do |f| %> +
  • + <%= render :partial => "avatar/new_avatar_form", :locals => {source: @course} %> +
    +
  • +
  • + + + +
  • +
    +
  • + + + +
  • +
    +
  • + + <%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {} %> + <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %> +
  • +
    +
  • + + +
    + 学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。 +
  • +
  • + + +
    +
  • +
  • + + id="course_is_public" name="course[is_public]" type="checkbox"> + (打钩为公开,不打钩则不公开,若不公开,仅课程成员可见该课程。) +
    +
  • +
  • + + id="course_open_student" name="course[open_student]" type="checkbox" style="margin-left: 1px;"/> + (打钩为"学生列表公开",不打钩为不公开,若不公开,则课程外部人员看不到学生列表) +
    +
  • +
  • + 提交 + <%= link_to l(:button_cancel), course_path(@course), :class => "blue_btn grey_btn fl c_white" %> +
    +
  • + <% end %> +
+
+ +
+ <%= render :partial => "course_members" %> +
+
\ No newline at end of file diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 97f425a1c..2628ce1b5 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -129,7 +129,7 @@ function regexSubject() } function regexContent() { - var content = message_content_editor.html(); + var content = message_content_editor.html(); if(content.length ==0) { $("#message_content_span").text("描述不能为空"); @@ -146,7 +146,7 @@ function regexContent() } function submitCoursesBoard() { - message_content_editor.sync(); + message_content_editor.sync(); if(regexSubject()&®exContent()){$("#message-form").submit();} } /////////////////////////////////////////////////////////////// @@ -178,7 +178,7 @@ function regexTitle() function regexDescription() { - var name = news_description_editor.html(); + var name = news_description_editor.html(); if(name.length ==0) { $("#description_notice_span").text("描述不能为空"); @@ -186,12 +186,12 @@ function regexDescription() $("#description_notice_span").focus(); return false; } - else if(name.length >=6000){ - $("#description_notice_span").text("描述最多3000个汉字(或6000个英文字符)"); - $("#description_notice_span").css('color','#ff0000'); - $("#description_notice_span").focus(); - return false; - } + else if(name.length >=6000){ + $("#description_notice_span").text("描述最多3000个汉字(或6000个英文字符)"); + $("#description_notice_span").css('color','#ff0000'); + $("#description_notice_span").focus(); + return false; + } else { $("#description_notice_span").text("填写正确"); @@ -200,12 +200,12 @@ function regexDescription() } } -function submitNews(is_new) +function submitNews(is_new) { - alert(is_new) + alert(is_new) if(regexTitle() && regexDescription()) { - news_description_editor.sync(); + news_description_editor.sync(); $("#news-form").submit(); } } @@ -214,31 +214,31 @@ function submitFocus(obj) { $(obj).focus(); } - -/////////////////////////////////////////////////课程讨论区 -function course_board_submit_message_replay() -{ - if(MessageReplayVevify()) - { - message_content_editor.sync();//提交内容之前要sync,不然服务器端取不到值 - $("#message_form").submit(); - } -} -function MessageReplayVevify() { - var content = message_content_editor.html();//$.trim($("#message_content").val()); - if (content.length == 0) { - $("#message_content_span").text("<%= l(:label_reply_empty) %>"); - $("#message_content_span").css('color', '#ff0000'); - return false; - } - else { - $("#message_content_span").text("<%= l(:label_field_correct) %>"); - $("#message_content_span").css('color', '#008000'); - return true; - } -} -////////////////////////////////////////////////// - + +/////////////////////////////////////////////////课程讨论区 +function course_board_submit_message_replay() +{ + if(MessageReplayVevify()) + { + message_content_editor.sync();//提交内容之前要sync,不然服务器端取不到值 + $("#message_form").submit(); + } +} +function MessageReplayVevify() { + var content = message_content_editor.html();//$.trim($("#message_content").val()); + if (content.length == 0) { + $("#message_content_span").text("<%= l(:label_reply_empty) %>"); + $("#message_content_span").css('color', '#ff0000'); + return false; + } + else { + $("#message_content_span").text("<%= l(:label_field_correct) %>"); + $("#message_content_span").css('color', '#008000'); + return true; + } +} +////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////// //验证搜索时输入名字 @@ -370,7 +370,7 @@ function submit_new_bid(id) { if(regex_bid_name()&®ex_evaluation_num()) { - bid_description_editor.sync(); + bid_description_editor.sync(); $("#"+id).submit(); } } @@ -404,10 +404,10 @@ $(function(){ //将右侧的最小高度设置成左侧高度,美化界面 $(document).ready(function () { $("#RSide").css("min-height",$("#LSide").height()-30); -}); - -// 日历选择日期后关闭 -function regexDeadLine() -{ - ('#ui-datepicker-div').hide; +}); + +// 日历选择日期后关闭 +function regexDeadLine() +{ + ('#ui-datepicker-div').hide; } \ No newline at end of file