From 93e3247685183df2d6ee0ebb651cbe8f3fc80f3c Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 20 Apr 2015 14:54:04 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=90=8D=E7=A7=B0=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E4=B8=BA=E7=A9=BA=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/settings/_new_edit.html.erb | 7 +++-- public/javascripts/project.js | 30 +++++++++++++++++-- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/app/views/projects/settings/_new_edit.html.erb b/app/views/projects/settings/_new_edit.html.erb index 58c328e87..a8998ece5 100644 --- a/app/views/projects/settings/_new_edit.html.erb +++ b/app/views/projects/settings/_new_edit.html.erb @@ -1,3 +1,4 @@ +<%= error_messages_for 'project' %> <%= labelled_form_for @project do |f| %> - 保存 + 保存 <% end %>
diff --git a/public/javascripts/project.js b/public/javascripts/project.js index b5f769723..68ac2bc45 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -90,7 +90,7 @@ function regexContent() { return false; } -// 项目编辑和提交 +// 项目讨论区编辑和提交 function submitProjectsBoard() { if (regexSubject() && regexContent()) { $("#message-form").submit(); @@ -161,7 +161,7 @@ function course_setting(id) { $('#tbc_0' + (3 - id)).removeClass().addClass("undis"); } -//项目类型 +//项目类型(朋友圈、开发组、科研组) function show_window() { $('#light').css('display', 'block'); $('#fade').css('display', 'block'); @@ -189,6 +189,32 @@ function project_setting(n) { } } } + +//配置-验证项目名称 +function regex_project_name() +{ + var name = $.trim($("#project_name").val()); + if(name.length == 0) + { + $("#project_name_notice").show(); + return false; + } + else + { + $("#project_name_notice").hide(); + return true; + } +} + +//配置-信息提交 +function submit_edit_project(id) +{ + if(regex_project_name()) + { + $("#edit_project_"+id).submit(); + } +} + //配置--成员---申请列表--拒绝 function refusal_applied_member() { $('#new_membership').append("");