- <%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %> |
+ <%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %> |
From 4957f6d55a8829765ae72908623e0376d2ae0086 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 9 Oct 2014 14:14:31 +0800
Subject: [PATCH 02/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E6=8F=8F=E8=BF=B0=E5=AD=97=E6=AE=B5=E7=9A=84=E7=B1=BB=E5=9E=8B?=
=?UTF-8?q?=EF=BC=8C=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/bids/_history.html.erb | 26 +++++++++----------
...55029_update_homeworkattach_description.rb | 5 ++++
db/schema.rb | 4 +--
3 files changed, 19 insertions(+), 16 deletions(-)
create mode 100644 db/migrate/20141009055029_update_homeworkattach_description.rb
diff --git a/app/views/bids/_history.html.erb b/app/views/bids/_history.html.erb
index 0961e3cf8..00a497e78 100644
--- a/app/views/bids/_history.html.erb
+++ b/app/views/bids/_history.html.erb
@@ -26,22 +26,20 @@
<%= link_to journal.user, user_path(journal.user)%>
<%= label %>
- <%= textilizable journal.notes%>
+ <%= textilizable journal.notes%>
<%= l(:label_bids_published) %> <%= time_tag(journal.created_on).html_safe %> <%= l(:label_bids_published_ago) %>
- <% ids = 'project_respond_form_'+ journal.id.to_s%>
+ <% ids = 'project_respond_form_'+ journal.id.to_s%>
- <% if reply_allow %>
- <%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
- :method => 'post', :title => l(:button_quote))%>
- <%= link_to l(:label_bid_respond_quote),'',
- {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"}
- %>
- <% end %>
-<% if @user==User.current|| User.current.admin? %>
- <%#= link_to(l(:label_bid_respond_delete), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm),
- :remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
- <%= link_to(l(:label_bid_respond_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
-<% end %>
+ <% if reply_allow %>
+ <%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
+ :method => 'post', :title => l(:button_quote))%>
+ <%= link_to l(:label_bid_respond_quote),'',
+ {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"}
+ %>
+ <% end %>
+ <% if @user==User.current|| User.current.admin? %>
+ <%= link_to(l(:label_bid_respond_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
+ <% end %>
diff --git a/db/migrate/20141009055029_update_homeworkattach_description.rb b/db/migrate/20141009055029_update_homeworkattach_description.rb
new file mode 100644
index 000000000..7f107077f
--- /dev/null
+++ b/db/migrate/20141009055029_update_homeworkattach_description.rb
@@ -0,0 +1,5 @@
+class UpdateHomeworkattachDescription < ActiveRecord::Migration
+ def change
+ change_column :homework_attaches, :description, :text, default: nil
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 172a11ec5..ea5c2107d 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20141009010934) do
+ActiveRecord::Schema.define(:version => 20141009055029) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -473,7 +473,7 @@ ActiveRecord::Schema.define(:version => 20141009010934) do
t.datetime "updated_at", :null => false
t.string "reward"
t.string "name"
- t.string "description"
+ t.text "description"
t.integer "state"
t.integer "project_id", :default => 0
end
From eedbc540e5e6f03e4761c8042f60ff937c00ad72 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 9 Oct 2014 14:25:33 +0800
Subject: [PATCH 03/13] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=97=B6=E6=A0=87=E9=A2=98=E3=80=81=E6=8F=8F?=
=?UTF-8?q?=E8=BF=B0=E5=AD=97=E6=AE=B5=E5=AD=97=E6=95=B0=E9=99=90=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/homework_attach/edit.html.erb | 4 ++--
app/views/homework_attach/new.html.erb | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/views/homework_attach/edit.html.erb b/app/views/homework_attach/edit.html.erb
index a0876440c..fae1f97b5 100644
--- a/app/views/homework_attach/edit.html.erb
+++ b/app/views/homework_attach/edit.html.erb
@@ -44,7 +44,7 @@
<%= form_for(@homework) do |f|%>
标 题 *:
- <%= f.text_field :name, :required => true, :name => "homework_name", :size => 60, :style => "width:490px;"%>
+ <%= f.text_field :name, :required => true, :name => "homework_name", :size => 60, :style => "width:490px;", :maxlength => 254%>
提交项目 :
@@ -60,7 +60,7 @@
描 述 :
- <%= f.text_area :description, :rows => 8, :name => "homework_description", :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
+ <%= f.text_area :description, :rows => 8, :name => "homework_description", :class => 'wiki-edit', :maxlength => 65534, :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 d05dfb735..29e606442 100644
--- a/app/views/homework_attach/new.html.erb
+++ b/app/views/homework_attach/new.html.erb
@@ -24,7 +24,7 @@
}) do |f|%>
标 题 *:
- <%= f.text_field "name", :required => true, :size => 60, :style => "width:490px;" %>
+ <%= f.text_field "name", :required => true, :size => 60, :style => "width:490px;", :maxlength => 254 %>
提交项目 :
@@ -39,7 +39,7 @@
<%#= f.text_area :description, :rows => 15, :class => 'wiki-edit', :id => 'editor01' %>
-->
- <%= f.text_area "description", :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
+ <%= f.text_area "description", :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => 65534 %>
From 8b7a775419073af56c50827d45a7e97f8ae5d9c8 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 9 Oct 2014 16:24:12 +0800
Subject: [PATCH 04/13] =?UTF-8?q?#1269=20=E4=BF=AE=E5=A4=8D=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE--=E6=97=A5=E5=8E=86=E4=BF=A1=E6=81=AF=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E8=B6=85=E5=87=BA=E8=BE=B9=E6=A1=86=E7=9A=84BUG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/calendars/show.html.erb | 53 +++++++++++-----------
app/views/common/_calendar.html.erb | 68 ++++++++++++++++-------------
2 files changed, 62 insertions(+), 59 deletions(-)
diff --git a/app/views/calendars/show.html.erb b/app/views/calendars/show.html.erb
index 9166974fa..65b740203 100644
--- a/app/views/calendars/show.html.erb
+++ b/app/views/calendars/show.html.erb
@@ -2,38 +2,35 @@
<%= form_tag({:controller => 'calendars', :action => 'show', :project_id => @project},
:method => :get, :id => 'query_form') do %>
-<%= hidden_field_tag 'set_filter', '1' %>
-
-
-
- <%= link_to_previous_month(@year, @month) %> | <%= link_to_next_month(@year, @month) %>
-
-
-
-<%= label_tag('month', l(:label_month)) %>
-<%= select_month(@month, :prefix => "month", :discard_type => true) %>
-<%= label_tag('year', l(:label_year)) %>
-<%= select_year(@year, :prefix => "year", :discard_type => true) %>
-
-<%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %>
-<%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, :class => 'icon icon-reload' %>
-
+ <%= hidden_field_tag 'set_filter', '1' %>
+
+
+ <%= link_to_previous_month(@year, @month) %> | <%= link_to_next_month(@year, @month) %>
+
+
+ <%= label_tag('month', l(:label_month)) %>
+ <%= select_month(@month, :prefix => "month", :discard_type => true) %>
+ <%= label_tag('year', l(:label_year)) %>
+ <%= select_year(@year, :prefix => "year", :discard_type => true) %>
+
+ <%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %>
+ <%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, :class => 'icon icon-reload' %>
+
<% end %>
<%= error_messages_for 'query' %>
<% if @query.valid? %>
-<%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %>
-
-
- <%= l(:text_tip_issue_begin_day) %>
- <%= l(:text_tip_issue_end_day) %>
- <%= l(:text_tip_issue_begin_end_day) %>
-
+ <%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %>
+
+ <%= l(:text_tip_issue_begin_day) %>
+ <%= l(:text_tip_issue_end_day) %>
+ <%= l(:text_tip_issue_begin_end_day) %>
+
<% end %>
<% content_for :sidebar do %>
diff --git a/app/views/common/_calendar.html.erb b/app/views/common/_calendar.html.erb
index 7951b68ce..83f8e217b 100644
--- a/app/views/common/_calendar.html.erb
+++ b/app/views/common/_calendar.html.erb
@@ -1,32 +1,38 @@
-
-
- | <% 7.times do |i| %><%= day_name( (calendar.first_wday+i)%7 ) %> | <% end %>
-
-
-
-<% day = calendar.startdt
-while day <= calendar.enddt %>
-<%= ("#{(day+(11-day.cwday)%7).cweek} | ".html_safe) if day.cwday == calendar.first_wday %>
-
- <%= day.day %>
-<% calendar.events_on(day).each do |i| %>
- <% if i.is_a? Issue %>
-
- <%= h("#{i.project} -") unless @project && @project == i.project %>
- <%= link_to_issue i, :truncate => 30 %>
- <%= render_issue_tooltip i %>
-
- <% else %>
-
- <%= h("#{i.project} -") unless @project && @project == i.project %>
- <%= link_to_version i%>
-
- <% end %>
-<% end %>
- |
-<%= ' '.html_safe if day.cwday==calendar.last_wday and day!=calendar.enddt %>
-<% day = day + 1
-end %>
-
-
+
+
+
+ |
+ <% 7.times do |i| %>
+ <%= day_name( (calendar.first_wday+i)%7 ) %> |
+ <% end %>
+
+
+
+
+ <% day = calendar.startdt
+ while day <= calendar.enddt %>
+ <%= ("#{(day+(11-day.cwday)%7).cweek} | ".html_safe) if day.cwday == calendar.first_wday %>
+
+ <%= day.day %>
+ <% calendar.events_on(day).each do |i| %>
+ <% if i.is_a? Issue %>
+
+ <%= h("#{i.project} -") unless @project && @project == i.project %>
+ <%= link_to_issue i, :truncate => 30 %>
+ <%= render_issue_tooltip i %>
+
+ <% else %>
+
+ <%= h("#{i.project} -") unless @project && @project == i.project %>
+ <%= link_to_version i%>
+
+ <% end %>
+ <% end %>
+ |
+ <%= ' '.html_safe if day.cwday==calendar.last_wday and day!=calendar.enddt %>
+ <% day = day + 1
+ end %>
+
+
From 7f08652cd14ba8df228a5cddc3d14056802aa590 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 9 Oct 2014 17:49:16 +0800
Subject: [PATCH 05/13] =?UTF-8?q?=20#1250=20=E4=BF=AE=E6=94=B9=E8=B5=84?=
=?UTF-8?q?=E6=96=99=E4=BF=9D=E5=AD=98=E5=90=8E=E6=8F=90=E7=A4=BA=E4=BF=A1?=
=?UTF-8?q?=E6=81=AF=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=20=20=E8=A7=A3?=
=?UTF-8?q?=E5=86=B3=E6=96=B9=E6=A1=88=EF=BC=9Aflash=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E4=B8=80=E6=AC=A1=E5=90=8E=E8=87=AA=E5=8A=A8=E6=B8=85=E7=A9=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/my_controller.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb
index 1e58c53f1..ccdf80464 100644
--- a/app/controllers/my_controller.rb
+++ b/app/controllers/my_controller.rb
@@ -130,7 +130,7 @@ class MyController < ApplicationController
@user.pref.save
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
set_language_if_valid @user.language
- flash[:notice] = l(:notice_account_updated)
+ flash.now[:notice] = l(:notice_account_updated)
redirect_to user_path(@user)
return
else
@@ -160,7 +160,7 @@ class MyController < ApplicationController
@user.destroy
if @user.destroyed?
logout_user
- flash[:notice] = l(:notice_account_deleted)
+ flash.now[:notice] = l(:notice_account_deleted)
end
redirect_to home_path
end
@@ -170,7 +170,7 @@ class MyController < ApplicationController
def password
@user = User.current
unless @user.change_password_allowed?
- flash[:error] = l(:notice_can_t_change_password)
+ flash.now[:error] = l(:notice_can_t_change_password)
redirect_to my_account_path
return
end
From 8cd3dd0287f32a43a9a4b3c50fae91fe9eccaf7d Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 10 Oct 2014 09:21:10 +0800
Subject: [PATCH 06/13] =?UTF-8?q?1.#1249=20=E6=9C=AA=E7=99=BB=E5=BD=95?=
=?UTF-8?q?=E5=92=8C=E9=9D=9E=E6=9C=AC=E4=BA=BA=E8=BF=9B=E5=85=A5=E7=94=A8?=
=?UTF-8?q?=E6=88=B7=E8=AF=BE=E7=A8=8B=E7=95=8C=E9=9D=A2=E6=97=B6=E9=9A=90?=
=?UTF-8?q?=E8=97=8F=E8=AF=BE=E7=A8=8B=E4=B8=8D=E6=98=BE=E7=A4=BA=20?=
=?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=B9=E6=A1=88=EF=BC=9A=E5=88=A4=E6=96=AD?=
=?UTF-8?q?=E5=BD=93=E5=89=8D=E7=94=A8=E6=88=B7=E5=92=8C=E6=89=80=E6=9F=A5?=
=?UTF-8?q?=E7=9C=8B=E7=9A=84=E7=94=A8=E6=88=B7=E6=98=AF=E5=90=A6=E4=B8=80?=
=?UTF-8?q?=E8=87=B4=EF=BC=8C=E4=B8=8D=E4=B8=80=E8=87=B4=E5=8F=96=E6=B6=88?=
=?UTF-8?q?=E9=9A=90=E8=97=8F=E8=AF=BE=E7=A8=8B=E7=9A=84=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=202.=E5=9B=BD=E9=99=85=E5=8C=96=E4=BB=A3=E7=A0=81=E4=BB=A5?=
=?UTF-8?q?=E5=8F=8A=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 13 +++-
app/views/my/account.html.erb | 96 +++++++++++++----------------
app/views/welcome/course.html.erb | 21 ++++---
config/locales/zh.yml | 1 +
4 files changed, 65 insertions(+), 66 deletions(-)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index d8ecb4ef7..638a883d2 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -226,7 +226,14 @@ class UsersController < ApplicationController
end
end
- membership = @user.coursememberships.all#@user.coursememberships.all(:conditions => Course.visible_condition(User.current))
+ #@user.coursememberships.all(:conditions => Course.visible_condition(User.current))
+
+ if User.current == @user || User.current.admin?
+ membership = @user.coursememberships.all
+ else
+ membership = @user.coursememberships.all(:conditions => Course.visible_condition(User.current))
+ end
+
membership.sort! {|older, newer| newer.created_on <=> older.created_on }
@memberships = []
membership.collect { |e|
@@ -235,9 +242,9 @@ class UsersController < ApplicationController
## 判断课程是否过期 [需封装]
@memberships_doing = []
@memberships_done = []
- now_time = Time.now.year
+ #now_time = Time.now.year
@memberships.map { |e|
- end_time = e.course.get_time.year
+ #end_time = e.course.get_time.year
isDone = course_endTime_timeout?(e.course)
if isDone
@memberships_done.push e
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb
index a57e35e65..3cb4fad80 100644
--- a/app/views/my/account.html.erb
+++ b/app/views/my/account.html.erb
@@ -12,8 +12,6 @@
);
-
-
-
-
<%= link_to(l(:button_change_password), {:action => 'password'}, :class => 'icon icon-passwd') if @user.change_password_allowed? %>
<%= call_hook(:view_my_account_contextual, :user => @user) %>
@@ -39,9 +32,7 @@
<%= l(:label_my_account) %>
<%= error_messages_for 'user' %>
-
|