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] =?UTF-8?q?1.=E7=8E=B0=E5=9C=A8=E7=AB=9E=E8=B5=9B=E4=BD=9C?=
=?UTF-8?q?=E5=93=81=E5=90=8D=E7=A7=B0=E3=80=81=E5=BC=80=E5=8F=91=E4=BA=BA?=
=?UTF-8?q?=E5=91=98=E3=80=81=E5=BC=80=E5=8F=91=E7=8E=AF=E5=A2=83=E7=9A=84?=
=?UTF-8?q?=E9=95=BF=E5=BA=A6=202.=E4=BF=AE=E5=A4=8D=E7=AB=9E=E8=B5=9B?=
=?UTF-8?q?=E4=BD=9C=E5=93=81=E4=B8=80=E4=B8=8A=E4=BC=A0=E7=9A=84=E5=9B=BE?=
=?UTF-8?q?=E7=89=87=EF=BC=8C=E7=BC=96=E8=BE=91=E6=97=B6=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE?=
=?UTF-8?q?=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 @@