限制项目描述字数

This commit is contained in:
huangjingquan 2013-08-13 11:11:45 +08:00
parent 53c6a981e9
commit 48442e95f5
3 changed files with 5 additions and 1 deletions

View File

@ -88,6 +88,7 @@ class Project < ActiveRecord::Base
validates_presence_of :name, :identifier
validates_uniqueness_of :identifier
validates_associated :repository, :wiki
validates_length_of :description, :maximum => 255
validates_length_of :name, :maximum => 255
validates_length_of :homepage, :maximum => 255
validates_length_of :identifier, :in => 1..IDENTIFIER_MAX_LENGTH

View File

@ -67,7 +67,8 @@
<td colspan="2" valign="top" width="50" ><img src="/images/new/user.jpg" width="40" height="40"/></td>
<td><table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong> <%= h(e.project) if @project.nil? || @project != e.project %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title(e.event_title), e.event_url %></td>
<td colspan="2" valign="top"><strong> <%= h(e.project) if @project.nil? || @project != e.project %></strong>
<span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title(e.event_title), e.event_url %></td>
</tr>
<tr>
<td colspan="2" width="580px" ><p class="font_description"><%= format_activity_description(e.event_description) %></p></td>

View File

@ -28,6 +28,7 @@
<div class="spaceleft">
<!--informations-->
<div class="inf_user_image">
<% @project = Project.find(@project.id)%>
<table>
<tr>
<td><%= link_to image_tag(url_to_avatar(@project), :class => 'avatar2') %></td>
@ -70,6 +71,7 @@
<div style="padding-bottom: 8px">
<div class="font_lighter_sidebar">
<%= textilizable @project.description %>
</div>
<div class="created_on_project">