<% for user in @users -%>
- <% unless user.id == 1%>
<% messages_count = user.messages.count %>
<% messages_score = messages_count * 0.05%>
@@ -51,15 +50,12 @@
<%= form_for(@homework) do |f|%>
- 标 题:
+ 标 题 *:
<%= f.text_field :name, :required => true, :name => "homework_name", :size => 60, :style => "width:490px;"%>
- 提交项目:
+ 提交项目 :
<% if @homework.project.nil? %>
<%= f.select :project_id, options_for_select(user_projects_option),:name => "project_id", :required => true%>
<% else %>
@@ -57,7 +57,7 @@
提交项目可以为空
- 描 述:
+ 描 述 :
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
diff --git a/app/views/homework_attach/new.html.erb b/app/views/homework_attach/new.html.erb
index 9c594835..9f0b69f5 100644
--- a/app/views/homework_attach/new.html.erb
+++ b/app/views/homework_attach/new.html.erb
@@ -23,17 +23,17 @@
:bid_id => @bid
}) do |f|%>
- 标 题:
+ 标 题 *:
<%= f.text_field "name", :required => true, :size => 60, :style => "width:490px;" %>
- 提交项目:
+ 提交项目 :
<%= f.select :project_id, options_for_select(user_projects_option),:name => "project_id", :required => true, :style => "width:490px;"%>
<%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target => '_blank' %>
提交项目可以为空
- 描 述:
+ 描 述 :
<%= f.text_area "description", :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
From b6ebbab8309ea9553c48f24971ba7fe24d99c9b3 Mon Sep 17 00:00:00 2001
From: nwb
Date: Fri, 4 Jul 2014 14:19:34 +0800
Subject: [PATCH 4/9] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=89=88=E6=9C=AC?=
=?UTF-8?q?=E5=BA=93=E5=90=8D=E7=A7=B0=E9=99=90=E5=AE=9A=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/messages_controller.rb | 3 +++
app/models/repository.rb | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index 2a408788..2915ff8f 100644
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -87,8 +87,11 @@ class MessagesController < ApplicationController
call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
attachments = Attachment.attach_files(@reply, params[:attachments])
render_attachment_warning_if_needed(@reply)
+ else
+ #render file: 'messages#show', layout: 'base_courses'
end
redirect_to board_message_path(@board, @topic, :r => @reply)
+
end
# Edit a message
diff --git a/app/models/repository.rb b/app/models/repository.rb
index ce7ac9d0..57a81827 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -42,7 +42,7 @@ class Repository < ActiveRecord::Base
validates_uniqueness_of :identifier, :scope => :project_id, :allow_blank => true
validates_exclusion_of :identifier, :in => %w(show entry raw changes annotate diff show stats graph)
# donwcase letters, digits, dashes, underscores but not digits only
- validates_format_of :identifier, :with => /\A(?!\d+$)[a-z0-9\-_]*\z/, :allow_blank => true
+ validates_format_of :identifier, :with => /^[a-zA-Z0-9_\-]+$/, :allow_blank => true
# Checks if the SCM is enabled when creating a repository
validate :repo_create_validation, :on => :create
From 8ccc39ae71160709deea843d2f01ecb566927c06 Mon Sep 17 00:00:00 2001
From: yanxd
Date: Fri, 4 Jul 2014 14:43:57 +0800
Subject: [PATCH 5/9] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=9B=B4=E5=A4=9A?=
=?UTF-8?q?=E6=8A=A5=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index 20bda61e..b46ab52b 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -281,12 +281,11 @@ class CoursesController < ApplicationController
if @school_id == "0" or @school_id.nil?
@courses_all = Course.active.visible.
joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id").
- where("#{Course.table_name}.course_type = ? ", Course::CourseType_course)
else
@courses_all = Course.active.visible.
joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id").
joins(:course_extra).
- where("#{Course.table_name}.course_type = ? AND #{Course.table_name}.school_id = ?", Course::CourseType_course, @school_id)
+ where("#{Course.table_name}.school_id = ?", @school_id)
end
@course_count = @courses_all.count
@@ -407,8 +406,7 @@ class CoursesController < ApplicationController
else
@courses_all = Course.active.visible.
joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id").
- joins(:course_extra).
- where("#{Course.table_name}.course_type = ? AND #{Course.table_name}.school_id = ?", Course::CourseType_course, @school_id)
+ where("#{Course.table_name}.school_id = ?", @school_id)
end
@course_count = @courses_all.count
From 71b17cd98e009a290108558cc9aa6c7ce7e3dab6 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 4 Jul 2014 14:47:38 +0800
Subject: [PATCH 6/9] 1
---
app/views/bids/_homework_list.html.erb | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb
index 70504057..9f6b45db 100644
--- a/app/views/bids/_homework_list.html.erb
+++ b/app/views/bids/_homework_list.html.erb
@@ -1,6 +1,6 @@
<% is_student = is_cur_course_student(@bid.courses.first) %>
-<% is_teacher = is_course_teacher User.current,@bid.courses.first %>
+<% is_teacher = is_course_teacher(User.current,@bid.courses.first) %>
<% is_evaluation = @bid.is_evaluation == 1 || @bid.is_evaluation == nil %>
<%= form_tag(:controller => 'bids', :action => "show_courseEx", :method => :get) do %>
@@ -21,7 +21,6 @@
<% end %>
-
From eac725a0f4c662dafe8a714130e16854fce33628 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 4 Jul 2014 15:21:56 +0800
Subject: [PATCH 7/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E3=80=81=E7=94=A8=E6=88=B7=E3=80=81=E8=AF=BE=E7=A8=8B=E7=95=8C?=
=?UTF-8?q?=E9=9D=A2=E4=B8=AD=E7=9B=B8=E5=85=B3=E5=AD=A6=E6=A0=A1=E7=9A=84?=
=?UTF-8?q?=E9=93=BE=E6=8E=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/base_courses.html.erb | 2 +-
app/views/layouts/base_homework.html.erb | 2 +-
app/views/layouts/base_users.html.erb | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index ac5cc104..5958e18b 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -167,7 +167,7 @@