Merge branch 'szzh' of http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git into szzh
This commit is contained in:
commit
b7cac9427b
|
@ -236,11 +236,10 @@ class WordsController < ApplicationController
|
|||
#modify by nwb
|
||||
#添加对课程留言的支持
|
||||
referer = request.headers["Referer"]
|
||||
#referer = "http://forge.trustie.net/words/create_reply"
|
||||
obj_id = referer.match(%r(/([0-9]{1,})(/|\?|$)))[1]
|
||||
if referer.match(/project/)
|
||||
obj = Project.find_by_id(obj_id)
|
||||
elsif referer.match(/course/)
|
||||
obj = Course.find_by_id(obj_id)
|
||||
elsif referer.match(/user/)
|
||||
obj = User.find_by_id(obj_id)
|
||||
elsif ( referer.match(/bids/) || referer.match(/calls/) )
|
||||
|
@ -251,6 +250,8 @@ class WordsController < ApplicationController
|
|||
obj = Softapplication.find_by_id(obj_id)
|
||||
elsif ( referer.match(/homework_attach/) || referer.match(/homework_attach/) ) #new added
|
||||
obj = HomeworkAttach.find_by_id(obj_id)
|
||||
elsif referer.match(/course/)
|
||||
obj = Course.find_by_id(obj_id)
|
||||
else
|
||||
raise "create reply obj unknow type.#{referer}"
|
||||
end
|
||||
|
|
|
@ -110,7 +110,7 @@ class ZipdownController < ApplicationController
|
|||
#length = attach.storage_path.length
|
||||
homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1)
|
||||
end
|
||||
zipping("#{homeattach.user.name.to_s}_#{Time.now.to_i}.zip", homeworks_attach_path, OUTPUT_FOLDER, true)
|
||||
zipping("#{homework.user.user_extensions.student_id}_#{homeattach.user.name.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true)
|
||||
#user_attaches_paths
|
||||
#end
|
||||
end
|
||||
|
|
|
@ -317,27 +317,27 @@ module WelcomeHelper
|
|||
str << content_tag("span", "发表了") <<
|
||||
content_tag("span", find_all_event_type(event)) <<
|
||||
': '.html_safe <<
|
||||
link_to(strip_tags(event.event_description).gsub(/ /,''), event.event_url)
|
||||
link_to(strip_tags(event.event_description).gsub(/ /,''), event.event_url, {:title => event.event_description})
|
||||
when 'issue', 'message' , 'bid' , 'wiki-page' , 'document'
|
||||
str << content_tag("span", "发表了") <<
|
||||
content_tag("span", find_all_event_type(event)) <<
|
||||
': '.html_safe <<
|
||||
link_to(event.event_title, event.event_url)
|
||||
link_to(event.event_title, event.event_url, {:title => event.event_title})
|
||||
when 'reply' ,'Reply', 'Memo'
|
||||
str << content_tag("span", "发表了") <<
|
||||
content_tag("span", find_all_event_type(event)) <<
|
||||
': '.html_safe <<
|
||||
link_to(strip_tags(event.event_description).gsub(/ /,''), event.event_url)
|
||||
link_to(strip_tags(event.event_description).gsub(/ /,''), event.event_url, {:title => event.event_description})
|
||||
when 'attachment'
|
||||
str << content_tag('span', '上传了') <<
|
||||
content_tag('span', find_all_event_type(event)) <<
|
||||
': '.html_safe <<
|
||||
link_to(event.event_title, event.event_url) <<
|
||||
link_to(event.event_title, event.event_url, {:title => event.event_title}) <<
|
||||
link_to((' ['.html_safe+l(:label_downloads_list).to_s << ']'), project_files_path(event.container.project), :class => "attachments_list_color")
|
||||
else
|
||||
str << content_tag("span", "更新了") <<
|
||||
content_tag("span", find_all_event_type(event)) <<
|
||||
': '.html_safe << link_to(event.event_title, event.event_url)
|
||||
': '.html_safe << link_to(event.event_title, event.event_url, {:title => event.event_title})
|
||||
end
|
||||
str
|
||||
rescue Exception => e
|
||||
|
|
|
@ -36,7 +36,7 @@ class Bid < ActiveRecord::Base
|
|||
acts_as_attachable
|
||||
|
||||
NAME_LENGTH_LIMIT = 60
|
||||
DESCRIPTION_LENGTH_LIMIT = 250
|
||||
DESCRIPTION_LENGTH_LIMIT = 3000
|
||||
validates :name, length: {maximum: NAME_LENGTH_LIMIT}, presence: true
|
||||
validates :description, length: {maximum: DESCRIPTION_LENGTH_LIMIT}
|
||||
validates :author_id, presence: true
|
||||
|
|
|
@ -36,7 +36,8 @@
|
|||
:maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>
|
||||
</p>
|
||||
<% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %>
|
||||
<p><%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}", :onchange => "regexDeadLine();", :readonly => true) %>
|
||||
<p>
|
||||
<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}", :onchange => "regexDeadLine();", :readonly => true) %>
|
||||
<%= calendar_for('bid_deadline')%>
|
||||
<span id="bid_deadline_span">
|
||||
</span>
|
||||
|
|
|
@ -2,19 +2,40 @@
|
|||
<table>
|
||||
<tr>
|
||||
<td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
|
||||
<td style="width: auto; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
|
||||
<td style="width: auto; color: #15bccf">
|
||||
<strong>
|
||||
<%= l(:label_user_location) %> :
|
||||
</strong>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 8px"><a><%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index'%></a></td>
|
||||
<td><p class="top-content-list-homework"><%=link_to "主页", home_path %> > <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> >
|
||||
<span><%= link_to(@bid.courses.first.name.to_s, homework_course_path(@bid.courses.first)) if @bid.courses.first%></span> >
|
||||
<%=link_to(@bid.name, respond_path(@bid)) %> > <span><%= link_to "创建作业", new_homework_attach_path(@bid)%></span></p></td>
|
||||
<td style="padding-left: 8px">
|
||||
<a>
|
||||
<%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index'%>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<p class="top-content-list-homework">
|
||||
<%=link_to "主页", home_path %> >
|
||||
<%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> >
|
||||
<span>
|
||||
<%= link_to(@bid.courses.first.name.to_s, homework_course_path(@bid.courses.first)) if @bid.courses.first%>
|
||||
</span> >
|
||||
<%=link_to(@bid.name, respond_path(@bid)) %> >
|
||||
<span>
|
||||
<%= link_to "创建作业", new_homework_attach_path(@bid)%>
|
||||
</span>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p style="font-weight: bold; color: rgb(237,137,36)" xmlns="http://www.w3.org/1999/html"> <%=h l(:label_new_homework)%> </p>
|
||||
<p style="font-weight: bold; color: rgb(237,137,36)" xmlns="http://www.w3.org/1999/html">
|
||||
<%=h l(:label_new_homework)%>
|
||||
</p>
|
||||
|
||||
<div class="box">
|
||||
<%= form_for('new_form', :method => :post,
|
||||
:url => {:controller => 'homework_attach',
|
||||
|
@ -27,18 +48,20 @@
|
|||
<%= f.text_field "name", :required => true, :size => 60, :style => "width:490px;", :maxlength => 254 %>
|
||||
</p>
|
||||
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
||||
<strong>提交项目 :</strong>
|
||||
<strong>
|
||||
提交项目 :
|
||||
</strong>
|
||||
<%= f.select :project_id,options_for_select(user_projects_option), {},{:style => "width:490px;"} %>
|
||||
<%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target => '_blank' %>
|
||||
<p class="font_lighter" style="padding-left:120px;clear:left;">提交项目可以为空</p>
|
||||
<p class="font_lighter" style="padding-left:120px;clear:left;">
|
||||
提交项目可以为空
|
||||
</p>
|
||||
</p>
|
||||
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
||||
<strong style="vertical-align: top">描 述 :</strong>
|
||||
<strong style="vertical-align: top">
|
||||
描 述 :
|
||||
</strong>
|
||||
<span style="margin-left:-10px;padding-right: 20px;">
|
||||
<!--<script src="/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
|
||||
<%#= f.text_area :description, :rows => 15, :class => 'wiki-edit', :id => 'editor01' %></p>
|
||||
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>-->
|
||||
|
||||
<%= f.text_area "description", :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => 65534 %>
|
||||
</span>
|
||||
</p>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class ChangeBidsDescriptionType < ActiveRecord::Migration
|
||||
def change
|
||||
change_column :bids, :description, :text, default: nil
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20141013023400) do
|
||||
ActiveRecord::Schema.define(:version => 20141029065917) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -98,7 +98,7 @@ ActiveRecord::Schema.define(:version => 20141013023400) do
|
|||
t.string "budget", :null => false
|
||||
t.integer "author_id"
|
||||
t.date "deadline"
|
||||
t.string "description"
|
||||
t.text "description"
|
||||
t.datetime "created_on", :null => false
|
||||
t.datetime "updated_on", :null => false
|
||||
t.integer "commit"
|
||||
|
|
Loading…
Reference in New Issue