Merge remote-tracking branch 'origin/szzh' into szzh
This commit is contained in:
commit
df7b33fe48
|
@ -27,3 +27,4 @@ vendor/cache
|
|||
/files
|
||||
/public/images/avatars
|
||||
/public/files
|
||||
/tags
|
||||
|
|
47
Gemfile
47
Gemfile
|
@ -6,6 +6,7 @@ unless RUBY_PLATFORM =~ /w32/
|
|||
gem 'iconv'
|
||||
end
|
||||
|
||||
gem "mysql2", "= 0.3.18"
|
||||
gem 'redis-rails'
|
||||
gem 'rubyzip'
|
||||
gem 'delayed_job_active_record'#, :group => :production
|
||||
|
@ -22,9 +23,6 @@ gem "builder", "3.0.0"
|
|||
gem 'acts-as-taggable-on', '2.4.1'
|
||||
gem 'spreadsheet'
|
||||
gem 'ruby-ole'
|
||||
#gem 'email_verifier', path: 'lib/email_verifier'
|
||||
gem 'rufus-scheduler'
|
||||
#gem 'dalli', path: 'lib/dalli-2.7.2'
|
||||
gem 'rails_kindeditor',path:'lib/rails_kindeditor'
|
||||
group :development do
|
||||
gem 'grape-swagger'
|
||||
|
@ -84,56 +82,13 @@ group :openid do
|
|||
gem "rack-openid"
|
||||
end
|
||||
|
||||
# Optional gem for exporting the gantt to a PNG file, not supported with jruby
|
||||
platforms :jruby do
|
||||
# jruby-openssl is bundled with JRuby 1.7.0
|
||||
gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERSION < '1.7.0'
|
||||
gem "activerecord-jdbc-adapter", "1.2.5"
|
||||
end
|
||||
|
||||
# Include database gems for the adapters found in the database
|
||||
# configuration file
|
||||
require 'erb'
|
||||
require 'yaml'
|
||||
database_file = File.join(File.dirname(__FILE__), "config/database.yml")
|
||||
if File.exist?(database_file)
|
||||
database_config = YAML::load(ERB.new(IO.read(database_file)).result)
|
||||
adapters = database_config.values.map {|c| c['adapter']}.compact.uniq
|
||||
if adapters.any?
|
||||
adapters.each do |adapter|
|
||||
case adapter
|
||||
when 'mysql2'
|
||||
gem "mysql2", "= 0.3.18", :platforms => [:mri, :mingw]
|
||||
gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
|
||||
when 'mysql'
|
||||
gem "mysql", "~> 2.8.1", :platforms => [:mri, :mingw]
|
||||
gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
|
||||
when /postgresql/
|
||||
gem "pg", ">= 0.11.0", :platforms => [:mri, :mingw]
|
||||
gem "activerecord-jdbcpostgresql-adapter", :platforms => :jruby
|
||||
when /sqlite3/
|
||||
gem "sqlite3", :platforms => [:mri, :mingw]
|
||||
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
||||
when /sqlserver/
|
||||
gem "tiny_tds", "~> 0.5.1", :platforms => [:mri, :mingw]
|
||||
gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw]
|
||||
else
|
||||
warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems")
|
||||
end
|
||||
end
|
||||
else
|
||||
warn("No adapter found in config/database.yml, please configure it first")
|
||||
end
|
||||
else
|
||||
warn("Please configure your config/database.yml first")
|
||||
end
|
||||
|
||||
local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
|
||||
if File.exists?(local_gemfile)
|
||||
puts "Loading Gemfile.local ..." if $DEBUG # `ruby -d` or `bundle -v`
|
||||
instance_eval File.read(local_gemfile)
|
||||
end
|
||||
|
||||
# Load plugins' Gemfiles
|
||||
Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file|
|
||||
puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
|
||||
|
|
|
@ -473,8 +473,10 @@ class HomeworkAttachController < ApplicationController
|
|||
|
||||
#保存评论
|
||||
@is_comprehensive_evaluation = @is_teacher ? 1 : (@is_anonymous_comments ? 2 : 3) #判断当前评论是老师评论?匿评?留言
|
||||
if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "" #有没有留言
|
||||
@homework.addjours User.current.id, params[:new_form][:user_message],0,@is_comprehensive_evaluation
|
||||
if params[:new_form] && params[:new_form][:user_message] #有没有留言
|
||||
@homework.addjours(User.current.id, params[:new_form][:user_message],0,@is_comprehensive_evaluation) if @is_teacher
|
||||
else
|
||||
@homework.addjours User.current.id, "",0,@is_comprehensive_evaluation if @is_teacher
|
||||
end
|
||||
|
||||
@teacher_stars = @stars_reates.where("is_teacher_score = 1") #老师评分列表
|
||||
|
|
|
@ -184,6 +184,7 @@ class ZipdownController < ApplicationController
|
|||
|
||||
rename_zipfile = zip_name_refer ||= "#{Time.now.to_i.to_s}.zip"
|
||||
zipfile_name = "#{output_path}/#{rename_zipfile}"
|
||||
Zip.unicode_names = true
|
||||
|
||||
Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name))
|
||||
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
|
||||
|
@ -241,4 +242,4 @@ class ZipdownController < ApplicationController
|
|||
attach = Attachment.find_by_disk_filename(name)
|
||||
attach.filename
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -56,7 +56,7 @@ class JournalsForMessage < ActiveRecord::Base
|
|||
|
||||
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
|
||||
|
||||
validates :notes, presence: true
|
||||
validates :notes, presence: true, if: :is_homework_jour?
|
||||
after_create :act_as_activity #huang
|
||||
after_create :reset_counters!
|
||||
after_destroy :reset_counters!
|
||||
|
@ -88,6 +88,10 @@ class JournalsForMessage < ActiveRecord::Base
|
|||
self.find(message_id).destroy
|
||||
# self.destroy_all "id = #{message_id}"
|
||||
end
|
||||
|
||||
def is_homework_jour?
|
||||
self.jour_type != "HomeworkAttach"
|
||||
end
|
||||
|
||||
def reference_user
|
||||
User.find(reply_id)
|
||||
|
|
|
@ -62,11 +62,11 @@
|
|||
<!--<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload();">上传资源</a>-->
|
||||
<p class="c_grey fr mt10 mr5">
|
||||
上传:
|
||||
<a href="javascript:void(0);" class=" c_dblue" onclick="show_upload(1);">课件</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue" onclick="show_upload(2);">软件</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue" onclick="show_upload(3);">媒体</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue" onclick="show_upload(4);">代码</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue" onclick="show_upload(5);">其他</a>
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(1);">课件</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(2);">软件</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(3);">媒体</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(4);">代码</a> |
|
||||
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(5);">其他</a>
|
||||
</p>
|
||||
<% end %>
|
||||
</div><!---re_top end-->
|
||||
|
|
|
@ -36,7 +36,8 @@
|
|||
<% end %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<p><%= textilizable jour.nil? ? "" : jour.notes%></p>
|
||||
<% notes = textilizable(jour.nil? ? "" : jour.notes)%>
|
||||
<%= notes.empty? ? "<p></p>".html_safe : notes%>
|
||||
</div>
|
||||
<% unless jour.nil? %>
|
||||
<% ids = 'project_respond_form_'+ jour.id.to_s%>
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
<%= f.text_field "name", :required => true, :size => 60, :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称", :onkeyup => "regexName();" %>
|
||||
<span id="homework_attach_name_span"></span>
|
||||
</p>
|
||||
<p>
|
||||
<p style="float:left;">
|
||||
<label style="float:left;">
|
||||
<span class="c_red">
|
||||
*
|
||||
|
@ -80,17 +80,16 @@
|
|||
作品描述 :
|
||||
</label>
|
||||
<%= f.text_area "description", :class => "w620", :maxlength => 3000, :style => "width:430px", :placeholder => "最多3000个汉字", :onkeyup => "regexDescription();"%>
|
||||
<br />
|
||||
<span id="homework_attach_description_span" style="padding-left: 100px;"></span>
|
||||
<p id="homework_attach_description_span" style="padding-left: 100px;"></p>
|
||||
</p>
|
||||
<p>
|
||||
<label style="float: left;">
|
||||
添加附件 :
|
||||
</label>
|
||||
<p style=" padding: 3px 0 3px 0;padding-left: 90px;">
|
||||
<%= render :partial => 'attachments/form' %>
|
||||
</p>
|
||||
<div class="cl"></div>
|
||||
<p style="float: left;">
|
||||
添加附件 :
|
||||
</p>
|
||||
<div style="float: left;margin-left: 10px;">
|
||||
<%= render :partial => 'attachments/form' %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<p>
|
||||
<label> 开发项目
|
||||
<img src="/images/bid/pic_question.png" width="16" height="16"
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<% if @issue.safe_attribute? 'is_private' %>
|
||||
<%= f.check_box :is_private, :no_label => true, :class => "ml30" %>
|
||||
<label class="fl ml5 mt3" for="issue_is_private" id="issue_is_private_label"><%= l(:field_is_private) %></label>
|
||||
<label class="fl ml5 mt3" for="issue_is_private" id="issue_is_private_tips"><%= l(:field_is_private_tips)%></label>
|
||||
<% end %>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<div class="cl"></div>
|
||||
<div id='<%=id%>' class="respond-form">
|
||||
<% if reply_allow %>
|
||||
<% if journal.jour_type == "Course" %>
|
||||
<% if journal.jour_type == "Course" || journal.jour_type == "Project" %>
|
||||
<%= render :partial => "words/new_respond_course", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name} %>
|
||||
<% else %>
|
||||
<%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name} %>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%= form_tag(words_create_reply_path, :remote => true) do %>
|
||||
<%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5',
|
||||
<%= text_area_tag 'user_notes', "", :class => 'noline',
|
||||
:style => "resize: none;", :rows => 4,
|
||||
:placeholder => l(:label_feedback_respond_content),
|
||||
:maxlength => 250 %>
|
||||
|
@ -9,7 +9,7 @@
|
|||
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
|
||||
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
|
||||
<%= submit_tag l(:button_feedback_respond), :name => nil ,
|
||||
:class => "reply_btn",
|
||||
:style => "float: right; margin-top: 1px; margin-right: 4px;"%>
|
||||
:class => "enterprise",
|
||||
:style => "float: right; margin-top: 1px; margin-right: 4px;margin-bottom: 5px;"%>
|
||||
|
||||
<% end %>
|
|
@ -188,6 +188,7 @@ zh:
|
|||
field_priority: 优先级
|
||||
field_done_ratio: "% 完成"
|
||||
field_is_private: 私有
|
||||
field_is_private_tips: (设置为“私有”后本问题将仅对项目成员可见)
|
||||
field_watcher: 跟踪者
|
||||
label_relates_to: 关联到
|
||||
label_duplicates: 重复
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
desc "rerun ctags on current project"
|
||||
task :ctags do
|
||||
%x{ ctags --exclude=.git --exclude='*.log' -R * `bundle show --paths` }
|
||||
end
|
|
@ -118,7 +118,7 @@ a:hover.ping_sub{ background:#14a8b9;}
|
|||
.ping_dispic img{ height:46px; width:46px;}
|
||||
.ping_discon{ float:left; width:350px; margin-left:15px;}
|
||||
.ping_distop span{ float:left;}
|
||||
.ping_distop p{ color:#5f5f5f;}
|
||||
.ping_distop p{ color:#5f5f5f;min-height: 24px;}
|
||||
.ping_disfoot a{ float:right; color:#15bccf; margin-left:5px;}
|
||||
|
||||
.ping_distop span a{ float:right; /*width:20px;*/ height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}
|
||||
|
|
|
@ -296,6 +296,7 @@ a:hover.close_btn {background-position:-66px 0;}
|
|||
|
||||
.hiddent{ overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
|
||||
.break_word_firefox{white-space: pre-wrap;word-break: break-all;}
|
||||
.font_bold{font-weight: bold;}
|
||||
|
||||
|
||||
/***** Ajax indicator ******/
|
||||
|
|
Loading…
Reference in New Issue