Merge branch 'szzh' into develop

This commit is contained in:
sw 2015-04-27 18:04:22 +08:00
commit 3da4c07d35
27 changed files with 463 additions and 272 deletions

1
.gitignore vendored
View File

@ -27,3 +27,4 @@ vendor/cache
/files
/public/images/avatars
/public/files
/tags

47
Gemfile
View File

@ -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`

View File

@ -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") #老师评分列表

View File

@ -180,14 +180,18 @@ class ZipdownController < ApplicationController
def zipping(zip_name_refer, files_paths, output_path, is_attachment=false, not_exist_file=[])
ic = Iconv.new('GBK//IGNORE', 'UTF-8//IGNORE')
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|
files_paths.each do |filename|
rename_file = File.basename(filename)
rename_file = filename_to_real( File.basename(filename)) if is_attachment
rename_file = ic.iconv( (File.basename(filename)) ).to_s
rename_file = ic.iconv( filename_to_real( File.basename(filename))).to_s if is_attachment
begin
zipfile.add(rename_file, filename)
rescue Exception => e

View File

@ -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!
@ -89,6 +89,10 @@ class JournalsForMessage < ActiveRecord::Base
# self.destroy_all "id = #{message_id}"
end
def is_homework_jour?
self.jour_type != "HomeworkAttach"
end
def reference_user
User.find(reply_id)
end

View File

@ -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>&nbsp;|&nbsp;
<a href="javascript:void(0);" class=" c_dblue" onclick="show_upload(2);">软件</a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class=" c_dblue" onclick="show_upload(3);">媒体</a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class=" c_dblue" onclick="show_upload(4);">代码</a>&nbsp;|&nbsp;
<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>&nbsp;|&nbsp;
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(2);">软件</a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(3);">媒体</a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(4);">代码</a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(5);">其他</a>
</p>
<% end %>
</div><!---re_top end-->

View File

@ -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%>

View File

@ -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 @@
&nbsp;&nbsp;作品描述&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</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;">
<div class="cl"></div>
<p style="float: left;">
&nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<p style=" padding: 3px 0 3px 0;padding-left: 90px;">
</p>
<div style="float: left;margin-left: 10px;">
<%= render :partial => 'attachments/form' %>
</p>
</p>
</div>
<div class="cl"></div>
<p>
<label>&nbsp;&nbsp;&nbsp;开发项目
<img src="/images/bid/pic_question.png" width="16" height="16"

View File

@ -3,8 +3,6 @@
<%#= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:add_issues, @project) %>
<%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %>
<% if (@issue.author == User.current) || (User.current.admin?) %>
<%= link_to l(:button_edit), edit_issue_path(@issue), :onclick => 'showAndScrollTo("all_attributes", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? %>
<% else %>
<%= link_to l(:label_user_newfeedback), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? %>
<% end %>
<%= link_to l(:button_edit), edit_issue_path(@issue), :onclick => 'showAndScrollTo("all_attributes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %>
<%= link_to l(:label_user_newfeedback), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %>

View File

@ -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>

View File

@ -1,15 +1,24 @@
<div class="pr_info_join fl">
<!--关注项目-->
<% if ( !(User.current.member_of? @project) && User.current.login?) %> <!--added by linchun-->
<!--关注:非项目成员-->
<% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %>
<span><%= watcher_link_for_project(@project, User.current) %></span>
<% end %>
<!--加入项目 -->
<% if ( !(User.current.member_of? @project) && User.current.login?) %>
<% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %>
<%= join_in_project_link(@project, User.current) %>
<% end %>
<!--退出项目-->
<!--配置项目-->
<% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %>
<%= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %>
<% end %>
<!--项目类型-->
<% if (User.current.login? && User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.first.to_s.include?("Manager")) || User.current.admin? %>
<%= link_to "<span class='#{typeclass}'></span>#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%>
<% end %>
<!--退出项目-->
<% if (User.current.member_of? @project) && User.current.login? &&
Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.first.to_s != "Manager" %>
<%= exit_project_link(@project) %>
<% end %>
</div>

View File

@ -1,89 +1,119 @@
<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %>
<%= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
<div class="project_r_h">
<h2 class="project_h2">版本库</h2>
</div>
<div class="repository_con" style="line-height:1.9;">
<div class="repositorytitle" style="float:left;" >
<div class="repositorytitle" style="float:left;">
<%= render :partial => 'breadcrumbs',
:locals => { :path => @path, :kind => 'dir', :revision => @rev } %>
:locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
<%= render :partial => 'navigation' %>
</div><!--contextual end-->
</div>
<!--contextual end-->
<div class="cl"></div>
<div class=" c_dark f14">
<p > <%if @repository.type.to_s=="Repository::Git"%>
<%= @repos_url%>
<%else %>
<%=h @repository.url %>
<p>
<% if @repository.type.to_s=="Repository::Git" %>
<%= @repos_url %>
<% else %>
<%= h @repository.url %>
<% end %>
</p>
<p class="mb10 word_break">
(<%= l(:label_all_revisions) %><%= @repositories.sort.collect {|repo|
<p class="mb10 break_word">
(<%= l(:label_all_revisions) %><%= @repositories.sort.collect { |repo|
link_to h(repo.name),
{:controller => 'repositories', :action => 'show',
:id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil},
:class => 'repository' + (repo == @repository ? ' selected' : '') ,
:class => "mb10 word_break c_orange"}.join('&nbsp|&nbsp').html_safe %>)
:class => 'repository' + (repo == @repository ? ' selected' : ''),
:class => "mb10 break_word c_orange" }.join('&nbsp|&nbsp').html_safe %>)
</p>
<p>项目代码请设置好正确的编码方式utf-8否则中文会出现乱码</p>
<p>建立版本库文件夹,打开命令行执行如下:</p>
</div>
</div>
<div class="repos_explain">
<div class="repos_more"><a id="showgithelp" value="hide_help" onclick ="showhelpAndScrollTo('repos_git_more','repos_git_more'); return false;" class="c_dblue lh23">收起Git操作指南</a></div>
<div id="repos_git_more">
<br>
<div class=" c_dark f14">
<p>项目代码请设置好正确的编码方式utf-8否则中文会出现乱码</p>
<p>建立版本库文件夹,打开命令行执行如下:</p>
</div>
<div class="repos_explain">
<p>git init</p>
<p>git add *</p>
<p>git commit -m "first commit"</p>
<p>git remote add origin
http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git
</p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u origin master:master</p>
</div><!--repos_explain end-->
<div class="c_dark f14">
</div>
<!--repos_explain end-->
<div class="c_dark f14">
<p>已经有本地库,还没有配置远程地址,打开命令行执行如下:</p>
</div>
<div class="repos_explain">
</div>
<div class="repos_explain">
<p>git remote add origin http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git</p>
<p>git add .</p>
<p>git commit -m "first commit"</p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u origin master:master</p>
</div><!--repos_explain end-->
<div class="c_dark f14">
</div>
<!--repos_explain end-->
<div class="c_dark f14">
<p>已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:</p>
</div>
<div class="repos_explain">
</div>
<div class="repos_explain">
<p>git clone http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git</p>
<p>git push</p>
<p>git checkout -b branch_name</p>
<p>git push origin branch_name</p>
</div><!--repos_explain end-->
<div class="c_dark f14">
</div>
<!--repos_explain end-->
<div class="c_dark f14">
<p>从网上获取别人的开源版本库转交到trustie网站上打开命令行执行如下</p>
</div>
<div class="repos_explain">
</div>
<div class="repos_explain">
<p>git remote add trustie
http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git
</p>
<p>git add .</p>
<p>git commit -m "first commit"</p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u trustie master:master</p>
<p><a href="/users/646" class="c_orange">李海</a>提供</p>
</div>
</div>
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<%= render :partial => 'dir_list' %>
<% end %>
<% end %>
<%= render_properties(@properties) %>
<% if authorize_for('repositories', 'revisions') %>
<%= render_properties(@properties) %>
<% if authorize_for('repositories', 'revisions') %>
<% if @changesets && !@changesets.empty? %>
<h3>
<%= l(:label_latest_revision_plural) %>
</h3>
<%= render :partial => 'revisions',
:locals => {:project => @project, :path => @path,
:revisions => @changesets, :entry => nil }%>
:revisions => @changesets, :entry => nil} %>
<% end %>
<p style="padding-top: 10px;">
<% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
@ -94,7 +124,7 @@
:class => "orange_u_btn" %>
<% sep = '|' %>
<% end %>
<% if @repository.supports_directory_revisions? && ( has_branches || !@path.blank? || !@rev.blank? ) %>
<% if @repository.supports_directory_revisions? && (has_branches || !@path.blank? || !@rev.blank?) %>
<%= sep %>
<%= link_to l(:label_view_revisions),
{:action => 'changes',
@ -113,13 +143,14 @@
:id => @project, :page => nil, :key => User.current.rss_key})) %>
<% end %>
<% end %>
<% end %>
<% end %>
<!-- added by bai -->
<p class="fb c_dark mt10">查看如何提交代码:
<!-- added by bai -->
<p class="fb c_dark mt10">查看如何提交代码:
<%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "c_blue") %>
<%= link_to('English', en_usage_path, :class => "c_blue") %>
<div class="cl"></div>
<div class="cl"></div>
</div>

View File

@ -256,10 +256,51 @@
<% end %>
</ul>
</div>
<% if @contest_notifications.count < 5%>
<div id="J_Slide" class="d-p-index-box d-p-index-Dynamic">
<h3 style="margin-left: 5px; color: #e8770d;">
<strong><%=l(:label_issue_feedback_activities)%></strong>
<%= link_to l(:label_my_question), newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
<%= link_to l(:label_my_feedback), suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
</h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to l(:label_more_information), forums_path %></span>
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<% find_new_forum_topics(9 - @contest_notifications.count).each do |topic|%>
<li class="message-brief-intro" style="height: auto; line-height:2em; padding-bottom: 1px; border-bottom: 1px dashed ">
<div style="display: inline-block; width: 100%;">
<span class="memo_activity text_nowrap" style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %>
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %>
</span>
<div class='memo_activity memo_attr'>
<span class='memo_timestamp'>
<%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %>
</span>
<span class="memo_author">
<%=l(:label_question_sponsor)%>&nbsp;<%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
</span>
<span class="memo_last_person">
<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %>
<%=l(:label_final_reply)%>&nbsp;
<%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%>
<% end %>
</span>
<span class="memo_reply">
<%=l(:label_reply)%>
(<%= link_to topic.try(:replies_count), topic.event_url %>)
</span>
</div>
</div>
</li>
<% end %>
</ul>
</div>
</div>
<div id="J_Slide" class="d-p-index-box d-p-index-left">
<h3 style="margin-left: 5px; color: #e8770d;"><strong><%=l(:label_current_attendingcontest_work)%></strong></h3>
<div id="J_Slide" class="d-p-index-box d-p-index-left">
<h3 style="margin-left: 5px; color: #e8770d;"><strong><%=l(:label_current_attendingcontest_work)%></strong></h3>
<div class="d-p-projectlist-box">
<% if Softapplication.count > 0%>
<div class="d-p-projectlist">
@ -296,14 +337,56 @@
</p>
<% end %>
</div>
</div>
</div>
<% else %>
<div id="J_Slide" class="d-p-index-box d-p-index-left">
<h3 style="margin-left: 5px; color: #e8770d;"><strong><%=l(:label_current_attendingcontest_work)%></strong></h3>
<div class="d-p-projectlist-box">
<% if Softapplication.count > 0%>
<div class="d-p-projectlist">
<% find_all_hot_softapplication.map do |softapplication| break if(softapplication == find_all_hot_softapplication[5]) %>
<div id="J_Slide" class="d-p-index-box d-p-index-Dynamic">
<h3 style="margin-left: 5px; color: #e8770d;">
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
<div class="avatar-4" style="float: left; margin-top: 7px">
<%= image_tag('/images/app1.png')%>
</div>
<div style="float: left; margin-left: 10px; margin-top: 7px;margin-bottom: -2px; width: 380px;">
<%= link_to(softapplication.name, softapplication_path(softapplication.id), :class => "d-g-blue d-p-project-name", :title => "#{softapplication.name}", :target => "_blank") %>
</div>
<div class='text_nowrap' style="float: left;margin:5px; margin-left: 10px; margin-bottom:1px; width: 380px;">
<span class='font_lighter' title =<%=softapplication.description.to_s%>>
<%=softapplication.description.to_s.truncate(50, omission: '...')%>
</span>
</div><br />
<div style="padding-left: 55px; clear: left;">
<span class="font_lighter">
<%=l(:label_release_time)%>:&nbsp;
<%=format_time softapplication.created_at %>
</span>
</div>
</li>
<% end; reset_cycle %>
</div>
<% else %>
<p class="font_lighter">
<%= l(:label_no_ftapplication) %>
</p>
<% end %>
</div>
</div>
<div id="J_Slide" class="d-p-index-box d-p-index-Dynamic">
<h3 style="margin-left: 5px; color: #e8770d;">
<strong><%=l(:label_issue_feedback_activities)%></strong>
<%= link_to l(:label_my_question), newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
<%= link_to l(:label_my_feedback), suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
</h3>
</h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to l(:label_more_information), forums_path %></span>
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
@ -337,7 +420,11 @@
<% end %>
</ul>
</div>
</div>
</div>
<% end%>
<div class="clearfix"></div>

View File

@ -57,7 +57,6 @@
</span>
<span class="font_welcome_trustie">
<!--
edit by meng
@course_page.title存储在first_page表中的title字段
原本代码
<%= @course_page.title %>
@ -68,7 +67,6 @@
<% unless @course_page.nil? %>
<span class="font_welcome_trustie">
<!--
edit by meng
@course_page.title存储在first_page表中的title字段
原本代码
<%= @course_page.title %>
@ -77,7 +75,6 @@
</span>
<span class="font_welcome_tdescription">,
<!--
edit by meng
@course_page.description存储在first_page表中的description字段
原本代码
<%= @course_page.description %>

View File

@ -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} %>

View File

@ -10,6 +10,6 @@
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
<%= submit_tag l(:button_feedback_respond), :name => nil ,
:class => "enterprise",
:style => "float: right; margin-top: 1px; margin-right: 4px;"%>
:style => "float: right; margin-top: 1px; margin-right: 4px;margin-bottom: 5px;"%>
<% end %>

View File

@ -188,6 +188,7 @@ zh:
field_priority: 优先级
field_done_ratio: "% 完成"
field_is_private: 私有
field_is_private_tips: (设置为“私有”后本问题将仅对项目成员可见)
field_watcher: 跟踪者
label_relates_to: 关联到
label_duplicates: 重复

4
lib/tasks/ctags.rake Normal file
View File

@ -0,0 +1,4 @@
desc "rerun ctags on current project"
task :ctags do
%x{ ctags --exclude=.git --exclude='*.log' -R * `bundle show --paths` }
end

View File

@ -260,7 +260,7 @@ K.options = {
items : [ 'emoticons',
'source','plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', '|',
'formatblock', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
'italic', 'underline', 'removeformat', '|','imagedirectupload','table', 'link'
'italic', 'underline', 'removeformat', '|','imagedirectupload','table', 'link', 'fullscreen',"more"
],
noDisableItems : ['source', 'fullscreen'],
colorTable : [
@ -3909,10 +3909,15 @@ _extend(KToolbar, KWidget, {
});
},
get : function(name) {
if (this._itemMap[name]) {
return this._itemMap[name];
// if (this._itemMap[name]) {
// return this._itemMap[name];
// }
if($("#define").css('display') == 'block'){
pdiv = $("#define")
}else if($("#full").css('display') == 'block'){
pdiv = $("#full")
}
return (this._itemMap[name] = K('span.ke-icon-' + name, this.div).parent());
return (this._itemMap[name] = K('span.ke-icon-' + name, pdiv).parent());
},
select : function(name) {
_selectToolbar.call(this, name, function(knode) {
@ -4915,6 +4920,7 @@ KEditor.prototype = {
self.srcElement.before(container);
}
var toolbarDiv = K('.toolbar', container),
toolBarDivFull = K('.toolbar', container),
editDiv = K('.edit', container),
statusbar = self.statusbar = K('.statusbar', container);
container.removeClass('container')
@ -4959,9 +4965,36 @@ KEditor.prototype = {
htmlList.push('<span class="ke-toolbar-icon ke-toolbar-icon-url ke-icon-' + name + '" unselectable="on"></span></span>');
}
});
htmlList.unshift('<div style="display:block" id="define"/>')
htmlList.push('</div>')
var htmlListFull = [];
var fullItems = [
'emoticons',
'source','plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', '|',
'formatblock', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
'italic', 'underline', 'removeformat', '|','imagedirectupload','table', 'link', 'fullscreen',"less",
'/',
'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'plainpaste',
'justifyfull', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
'superscript', 'clearhtml', 'quickformat', 'selectall', 'fontname',
'strikethrough', 'lineheight', '|', 'imagedirectupload', 'hr', 'pagebreak',
'anchor', 'unlink'
]
K.each(fullItems, function(i, name) {
if (name == '|') {
htmlListFull.push('<span class="ke-inline-block ke-separator"></span>');
} else if (name == '/') {
htmlListFull.push('<div class="ke-hr"></div>');
} else {
htmlListFull.push('<span class="ke-outline" data-name="' + name + '" title="' + self.lang(name) + '" unselectable="on">');
htmlListFull.push('<span class="ke-toolbar-icon ke-toolbar-icon-url ke-icon-' + name + '" unselectable="on"></span></span>');
}
});
htmlListFull.unshift('<div style="display:none" id="full"/>')
htmlListFull.push('</div>')
var toolbar = self.toolbar = _toolbar({
src : toolbarDiv,
html : htmlList.join(''),
html : htmlList.join('')+htmlListFull.join(''),
noDisableItems : self.noDisableItems,
click : function(e, name) {
e.stop();
@ -4975,6 +5008,7 @@ KEditor.prototype = {
self.clickToolbar(name);
}
});
var editHeight = _removeUnit(height) - toolbar.div.height();
var edit = self.edit = _edit({
height : editHeight > 0 && _removeUnit(height) > self.minHeight ? editHeight : self.minHeight,
@ -5308,6 +5342,7 @@ KEditor.prototype = {
name = options.name,
knode = self.toolbar.get(name),
pos = knode.pos();
options.x = pos.x;
options.y = pos.y + knode.height();
options.z = self.options.zIndex;
@ -5992,4 +6027,5 @@ _plugin('core', function(K) {
});
});
});
})(window);

View File

@ -9,6 +9,8 @@
KindEditor.lang({
imagedirectupload:'本地图片',
more: '切换到更多功能',
less: '切换到简单功能',
source : 'HTML代码',
preview : '预览',
undo : '后退(Ctrl+Z)',

View File

@ -0,0 +1,15 @@
KindEditor.plugin('less', function(K) {
var self = this, name = 'less';
self.plugin.less = {
click : function(){
if($("#define").css('display') == 'block'){
$("#define").css('display','none')
$("#full").css('display','block')
}else if($("#full").css('display') == 'block'){
$("#full").css('display','none')
$("#define").css('display','block')
}
}
}
self.clickToolbar(name,self.plugin.less.click)
});

View File

@ -0,0 +1,15 @@
KindEditor.plugin('more', function(K) {
var self = this, name = 'more';
self.plugin.more = {
click : function(){
if($("#define").css('display') == 'block'){
$("#define").css('display','none')
$("#full").css('display','block')
}else if($("#full").css('display') == 'block'){
$("#full").css('display','none')
$("#define").css('display','block')
}
}
}
self.clickToolbar(name,self.plugin.more.click)
});

View File

@ -243,6 +243,11 @@
width: 16px;
height: 16px;
}
.ke-icon-more {
background-position: 0px -672px;
width: 16px;
height: 16px;
}
.ke-icon-plainpaste {
background-position: 0px -704px;
width: 16px;
@ -328,6 +333,11 @@
width: 16px;
height: 16px;
}
.ke-icon-less {
background-position: 0px -976px;
width: 16px;
height: 16px;
}
.ke-icon-baidumap {
background-position: 0px -976px;
width: 16px;

View File

@ -59,6 +59,29 @@ function show_more_msg() {
}
}
//项目版本库git帮助文档显示
function showhelpAndScrollTo(id, focus) {
var information = $("#showgithelp");
var val = information.attr("value");
if (val == "show_help") {
$("#showgithelp").text("收起Git操作指南");
information.attr("value", "hide_help");
$('#' + id).show();
if (focus !== null) {
$('#' + focus).focus();
}
$('html, body').animate({scrollTop: $('#' + id).offset().top}, 400);
}
else {
$("#showgithelp").text("显示Git操作指南");
information.attr("value", "show_help");
$('#' + id).hide();
}
}
///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////项目讨论区
function regexSubject() {
@ -191,27 +214,22 @@ function project_setting(n) {
}
//配置-验证项目名称
function regex_project_name()
{
function regex_project_name() {
var name = $.trim($("#project_name").val());
if(name.length == 0)
{
if (name.length == 0) {
$("#project_name_notice").show();
return false;
}
else
{
else {
$("#project_name_notice").hide();
return true;
}
}
//配置-信息提交
function submit_edit_project(id)
{
if(regex_project_name())
{
$("#edit_project_"+id).submit();
function submit_edit_project(id) {
if (regex_project_name()) {
$("#edit_project_" + id).submit();
}
}
@ -233,12 +251,13 @@ $(document).ready(function () {
//issue_project_id
});
function showAndScrollTo(id, focus) {
function showAndScrollTo(id, focus) {
$('#' + id).show();
if (focus !== null) {
$('#' + focus).focus();
}
$('html, body').animate({scrollTop: $('#' + id).offset().top}, 400);
}
/*缺陷完成度决定缺陷状态*/
@ -288,6 +307,3 @@ function showAndScrollTo(id, focus) {
}
});
}

View File

@ -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;}

View File

@ -177,7 +177,9 @@ a:hover.upload_btn_grey{background:#8a8a8a;}
a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; color:#64bdd9; }
a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
.r_txt_tit{width:510px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#09658c; font-size:14px;}
/* 版本库展示Git操作文档 */
.repos_more{height:23px; width:100%; border:1px solid #CCC; background:#F6F6F6; text-align:center; font-size:12px; padding-top:2px;}
.lh23{line-height: 23px;}
/* 弹框 新样式还没设计出来,暂时用的课程那边的样式 */
.alert .close{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-502px;background:url(images/close.png) no-repeat;cursor:pointer;}

View File

@ -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 ******/