From 01ea6238a441c4000c3ac9a9dca106f14c37db9b Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 30 Jul 2014 10:48:33 +0800
Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AB=9E=E8=B5=9B?=
=?UTF-8?q?=E9=80=9A=E7=9F=A5=E6=8F=8F=E8=BF=B0=E8=BF=87=E9=95=BF=E6=97=B6?=
=?UTF-8?q?=E6=8A=A5=E9=94=99=E7=9A=84BUG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/initializers/task.rb | 6 ++++++
...0730024419_update_contestnotifications_description.rb | 9 +++++++++
db/schema.rb | 4 ++--
3 files changed, 17 insertions(+), 2 deletions(-)
create mode 100644 db/migrate/20140730024419_update_contestnotifications_description.rb
diff --git a/config/initializers/task.rb b/config/initializers/task.rb
index 5b4f35098..51c903355 100644
--- a/config/initializers/task.rb
+++ b/config/initializers/task.rb
@@ -2,3 +2,9 @@ Mailer.mail_issue.each do |t|
t.join
end
+#Thread.new do
+# if Time.now == Time.
+#
+# end
+#end
+
diff --git a/db/migrate/20140730024419_update_contestnotifications_description.rb b/db/migrate/20140730024419_update_contestnotifications_description.rb
new file mode 100644
index 000000000..a959e93bd
--- /dev/null
+++ b/db/migrate/20140730024419_update_contestnotifications_description.rb
@@ -0,0 +1,9 @@
+class UpdateContestnotificationsDescription < ActiveRecord::Migration
+ def up
+ change_column :contestnotifications, :description, :text
+ end
+
+ def down
+ change_column :contestnotifications, :description, :string
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 3cbfefa76..e9f2d5308 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 => 20140728014933) do
+ActiveRecord::Schema.define(:version => 20140730024419) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -272,7 +272,7 @@ ActiveRecord::Schema.define(:version => 20140728014933) do
t.integer "contest_id"
t.string "title"
t.string "summary"
- t.string "description"
+ t.text "description"
t.integer "author_id"
t.integer "notificationcomments_count"
t.datetime "created_at", :null => false
From 1f4943483e65db2db7330aea116a8074dfa003ff Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 30 Jul 2014 13:52:55 +0800
Subject: [PATCH 2/5] =?UTF-8?q?1.=E7=8E=B0=E5=9C=A8=E7=AB=9E=E8=B5=9B?=
=?UTF-8?q?=E4=BD=9C=E5=93=81=E5=90=8D=E7=A7=B0=E3=80=81=E5=BC=80=E5=8F=91?=
=?UTF-8?q?=E4=BA=BA=E5=91=98=E3=80=81=E5=BC=80=E5=8F=91=E7=8E=AF=E5=A2=83?=
=?UTF-8?q?=E7=9A=84=E9=95=BF=E5=BA=A6=202.=E4=BF=AE=E5=A4=8D=E7=AB=9E?=
=?UTF-8?q?=E8=B5=9B=E4=BD=9C=E5=93=81=E4=B8=80=E4=B8=8A=E4=BC=A0=E7=9A=84?=
=?UTF-8?q?=E5=9B=BE=E7=89=87=EF=BC=8C=E7=BC=96=E8=BE=91=E6=97=B6=E8=B5=84?=
=?UTF-8?q?=E6=BA=90=E5=88=97=E8=A1=A8=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/softapplication.rb | 4 ++++
app/views/attachments/_links.html.erb | 5 ++++-
app/views/contests/_new_softapplication.html.erb | 10 ++++++----
app/views/softapplications/_form.html.erb | 15 ++++++++++-----
4 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/app/models/softapplication.rb b/app/models/softapplication.rb
index 770d70d53..a572a22ba 100644
--- a/app/models/softapplication.rb
+++ b/app/models/softapplication.rb
@@ -11,6 +11,10 @@ class Softapplication < ActiveRecord::Base
belongs_to :project
has_many :contests, :through => :contesting_softapplications
+ validates_length_of :name, :maximum => 125
+ validates_length_of :application_developers, :maximum => 125
+ validates_length_of :android_min_version_available, :maximum => 125
+
def add_jour(user, notes, reference_user_id = 0, options = {})
if options.count == 0
self.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id)
diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb
index 99ecab35d..4d938707e 100644
--- a/app/views/attachments/_links.html.erb
+++ b/app/views/attachments/_links.html.erb
@@ -1,6 +1,9 @@
<% for attachment in attachments %>
-
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
+
+
+ <%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
+
<% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'),
:controller => 'attachments', :action => 'show',
diff --git a/app/views/contests/_new_softapplication.html.erb b/app/views/contests/_new_softapplication.html.erb
index 830bcd314..c83bdf6e9 100644
--- a/app/views/contests/_new_softapplication.html.erb
+++ b/app/views/contests/_new_softapplication.html.erb
@@ -6,7 +6,7 @@
<%= l(:label_work_name) %>
* :
<%= f.text_field :name, :required => true, :size => 60, :style => "width:350px;" %> |
-
+
(<%= l(:label_workname_lengthlimit) %>)
@@ -15,8 +15,10 @@
<%= l(:label_running_platform) %>
* :
- <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:350px;" %> |
-
+
+ <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:350px;" %>
+ |
+ (<%= l(:label_workdescription_lengthlimit) %>)
@@ -55,7 +57,7 @@
<%= l(:label_softapplication_developers) %>
* :
<%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:350px;" %> |
-
+
(<%= l(:label_workdescription_lengthlimit) %>)
diff --git a/app/views/softapplications/_form.html.erb b/app/views/softapplications/_form.html.erb
index 27954a7d0..58f8093a6 100644
--- a/app/views/softapplications/_form.html.erb
+++ b/app/views/softapplications/_form.html.erb
@@ -32,7 +32,7 @@
<%= l(:label_work_name) %>
* : <%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %> |
- <%= l(:label_softapplication_name_condition)%>
+ (<%= l(:label_workname_lengthlimit) %>)
@@ -40,7 +40,7 @@
<%= l(:label_running_platform) %>
* : <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %> |
-
+ (<%= l(:label_workdescription_lengthlimit) %>)
@@ -73,7 +73,7 @@
<%= l(:label_work_description) %>
* : <%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %> |
- <%= l(:label_softapplication_description_condition)%>
+
@@ -82,7 +82,7 @@
<%= l(:label_softapplication_developers) %>
* : <%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %> |
-
+ (<%= l(:label_workdescription_lengthlimit) %>)
@@ -100,10 +100,15 @@