diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index a301d270d..f6ec09b2a 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -51,7 +51,7 @@ class BoardsController < ApplicationController @boards = @course.boards.includes(:last_message => :author).all end end - if @boards.size == 1 + unless @course.boards.empty? @board = @course.boards.first end show and return diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index 89faf39e3..beaf8d821 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -88,9 +88,9 @@ $(function(){ function f_submit() { - var subject = $("#memo_subject").val(); - var content = $("#memo_content_1").val(); - $("#memo_subject").val(subject+":"+ content.substr(0,18)); +// var subject = $("#memo_subject").val(); +// var content = $("#memo_content_1").val(); +// $("#memo_subject").val(subject+":"+ content.substr(0,18)+"..."); $("#new_memo").submit(); } @@ -137,6 +137,30 @@ function cookieget(n) durationTime : 600 }); }); + + $(document).ready(function(){ + $("#subject").keydown(function(){ + var curLength=$("#subject").val().length; + if(curLength>50){ + var num=$("#subject").val().substr(0,50); + $("#subject").val(num); + } + else{ + $("#textCount").text(50-$("#subject").val().length) + } + }) + $("#subject").keyup(function(){ + var curLength=$("#subject").val().length; + if(curLength>50){ + var num=$("#subject").val().substr(0,50); + $("#subject").val(num); + } + else{ + $("#textCount").text(50-$("#subject").val().length) + } + }) + }) +