Merge remote-tracking branch 'remotes/origin/develop' into szzh

Conflicts:
	app/views/layouts/base_newcontest.html.erb
memcached_alan
alan 11 years ago
commit 9c45e372b4

@ -1,4 +1,5 @@
source 'https://rubygems.org'
source 'http://rubygems.org'
#source 'http://ruby.sdutlinux.org/'
unless RUBY_PLATFORM =~ /w32/
# unix-like only
@ -15,23 +16,42 @@ gem "coderay", "~> 1.0.6"
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
gem "builder", "3.0.0"
gem 'acts-as-taggable-on', '2.4.1'
gem 'spreadsheet'
gem 'ruby-ole'
group :development do
gem 'better_errors', path: 'lib/better_errors'
gem 'rack-mini-profiler', path: 'lib/rack-mini-profiler'
if ENV['PRY']
gem 'pry'
gem 'pry-nav'
end
end
group :test do
# shoulda的版本做了改动
#gem "shoulda", "~> 3.3.2"
gem "shoulda", "> 3.3.2"
gem "mocha", "~> 0.13.3"
gem 'capybara', '~> 2.0.0'
gem 'nokogiri', '< 1.6.0'
gem "shoulda", "~> 3.5.0"
gem "mocha", "~> 1.1.0"
gem 'capybara', '~> 2.4.1'
gem 'nokogiri', '~> 1.6.3'
gem 'factory_girl', '~> 4.4.0'
gem 'selenium-webdriver', '~> 2.42.0'
# platforms :mri, :mingw do
# group :rmagick do
# # RMagick 2 supports ruby 1.9
# # RMagick 1 would be fine for ruby 1.8 but Bundler does not support
# # different requirements for the same gem on different platforms
# gem "rmagick", ">= 2.0.0"
# end
#end
end
group :development, :test do
# gem "guard-rails", '~> 0.5.3'
gem 'spork-testunit', '~> 0.0.8'
# gem 'guard-spork', '~> 1.5.1'
# gem 'guard-test', '~> 1.0.0'
gem 'ruby-prof', '~> 0.15.1' unless RUBY_PLATFORM =~ /w32/
gem 'pry'
gem 'pry-nav'
end
@ -53,15 +73,6 @@ group :ldap do
end
platforms :mri, :mingw do
group :rmagick do
# RMagick 2 supports ruby 1.9
# RMagick 1 would be fine for ruby 1.8 but Bundler does not support
# different requirements for the same gem on different platforms
gem "rmagick", ">= 2.0.0"
end
end
# Optional gem for OpenID authentication
group :openid do
gem "ruby-openid", "~> 2.1.4", :require => "openid"

@ -156,7 +156,16 @@ class ApplicationController < ActionController::Base
user
end
end
def try_to_autologin1
# auto-login feature starts a new session
user = User.try_to_autologin(params[:token])
if user
start_user_session(user)
end
user
end
# Sets the logged in user
def logged_user=(user)
reset_session
@ -248,6 +257,24 @@ class ApplicationController < ActionController::Base
end
end
end
def authorize1(ctrl = params[:controller], action = params[:action],token = params[:token], global = false)
if(!User.current.logged? && !token.nil?)
User.current =try_to_autologin1
end
allowed = authorize_allowed(params[:controller], params[:action],global)
if allowed
true
else
if @project && @project.archived?
render_403 :message => :notice_not_authorized_archived_project
else
deny_access
end
end
end
def authorize_allowed(ctrl = params[:controller], action = params[:action], global = false)
#modify by NWB
@ -261,6 +288,7 @@ class ApplicationController < ActionController::Base
allowed
end
def authorize_attachment_download(ctrl = params[:controller], action = params[:action], global = false)
case @attachment.container_type
when "Memo"
allowed = User.current.allowed_to?(:memos_attachments_download,nil,:global => true)
@ -289,6 +317,37 @@ class ApplicationController < ActionController::Base
end
end
def authorize_attachment_download1(ctrl = params[:controller], action = params[:action],token = params[:token], global = false)
if(!User.current.logged? && !token.nil?)
User.current = try_to_autologin1
end
case @attachment.container_type
when "Memo"
allowed = User.current.allowed_to?(:memos_attachments_download,nil,:global => true)
when "Message"
if @project
allowed = User.current.allowed_to?(:projects_attachments_download,@project,:global => false)
elsif @course
allowed = User.current.allowed_to?(:course_attachments_download, @course, :global => false)
end
when "contest"
return true
when "Course"
allowed = User.current.allowed_to?(:course_attachments_download, @course, :global => false)
else
return true
end
if allowed
true
else
if @project && @project.archived?
render_403 :message => :notice_not_authorized_archived_project
else
deny_access
end
end
end
def authorize_course(ctrl = params[:controller], action = params[:action], global = false)
allowed = User.current.allowed_to?({:controller => ctrl, :action => action}, @course || @course, :global => global)
if allowed
@ -789,4 +848,29 @@ class ApplicationController < ActionController::Base
@organizer = WebFooterOranizer.first
@companies = WebFooterCompany.all
end
def password_authentication
user, last_login_on = User.try_to_login(params[:user_name], params[:password])
successful_authentication(user, last_login_on)
end
def successful_authentication(user, last_login_on)
logger.info "Successful authentication for '#{user.login}' from #{request.remote_ip} at #{Time.now.utc}"
# Valid user
self.logged_user = user
# generate a key and set cookie if autologin
if params[:autologin] && Setting.autologin?
set_autologin_cookie(user)
end
call_hook(:controller_account_success_authentication_after, {:user => user })
end
end

@ -17,11 +17,12 @@
class AttachmentsController < ApplicationController
layout "users_base"
before_filter :find_project, :only => [:show, :download, :thumbnail, :destroy, :delete_homework]#, :except => [:upload, :autocomplete]
before_filter :file_readable, :read_authorize, :only => [:show, :thumbnail]#Modified by young
before_filter :delete_authorize, :only => :destroy
before_filter :authorize_global, :only => :upload
before_filter :authorize_attachment_download, :only => :download
before_filter :authorize_attachment_download1, :only => :download
#before_filter :login_without_softapplication, only: [:download]
accept_api_auth :show, :download, :upload
require 'iconv'

@ -810,9 +810,9 @@ class CoursesController < ApplicationController
# modify by nwb
# 添加私密性判断
if User.current.member_of_course?(@course)|| User.current.admin?
events = @activity.events(@date_from, @date_to)
events = @activity.events(@days, @course.created_at)
else
events = @activity.events(@date_from, @date_to, :is_public => 1)
events = @activity.events(@days, @course.created_at, :is_public => 1)
end
# 无新动态时,显示老动态

@ -13,6 +13,44 @@ class ForumsController < ApplicationController
include SortHelper
PageLimit = 20
def create_feedback
if User.current.logged?
@memo = Memo.new(params[:memo])
@memo.forum_id = "1"
@memo.author_id = User.current.id
#@forum = @memo.forum
respond_to do |format|
if @memo.save
format.html { redirect_to forum_path(@memo.forum) }
else
sort_init 'updated_at', 'desc'
sort_update 'created_at' => "#{Memo.table_name}.created_at",
'replies' => "#{Memo.table_name}.replies_count",
'updated_at' => "COALESCE (last_replies_memos.created_at, #{Memo.table_name}.created_at)"
@topic_count = @forum.topics.count
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
@memos = @forum.topics.
reorder("#{Memo.table_name}.sticky DESC").
includes(:last_reply).
limit(@topic_pages.per_page).
offset(@topic_pages.offset).
order(sort_clause).
preload(:author, {:last_reply => :author}).
all
flash.now[:error] = "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}"
# back_error_page = @memo.parent_id.nil? ? forum_path(@forum) : forum_memo_path(@forum, @memo.parent_id)
format.html { render action: :show, layout: 'base_forums' }#, error: "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}" }
format.json { render json: @memo.errors, status: :unprocessable_entity }
end
end
else
respond_to do |format|
format.html { redirect_to signin_path }
end
end
end
def create_memo
@memo = Memo.new(params[:memo])
@ -56,7 +94,6 @@ class ForumsController < ApplicationController
@forums_count = @forums_all.count
@forums_pages = Paginator.new @forums_count, @limit, params['page']
@offset ||= @forums_pages.offset
@forums = @forums_all.offset(@offset).limit(@limit).all
#@forums = Forum.all
@ -86,8 +123,6 @@ class ForumsController < ApplicationController
preload(:author, {:last_reply => :author}).
all
# @offset, @limit = api_offset_and_limit({:limit => 10})
# @forum = Forum.find(params[:id])
# @memos_all = @forum.topics
@ -176,7 +211,6 @@ class ForumsController < ApplicationController
@forums_count = @forums_all.count
@forums_pages = Paginator.new @forums_count, @limit, params['page']
@offset ||= @forums_pages.offset
@forums = @forums_all.offset(@offset).limit(@limit).all
respond_to do |format|
@ -208,11 +242,8 @@ class ForumsController < ApplicationController
end
end
private
def find_forum_if_available
@forum = Forum.find(params[:id]) if params[:id]
rescue ActiveRecord::RecordNotFound

@ -19,10 +19,13 @@ class IssuesController < ApplicationController
layout 'base_projects'#Added by young
default_search_scope :issues
before_filter :authorize1, :only => [:show]
before_filter :find_issue, :only => [:show, :edit, :update]
before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy]
before_filter :find_project, :only => [:new, :create, :update_form]
#before_filter :authorize, :except => [:index, :show]
before_filter :authorize, :except => [:index]
before_filter :find_optional_project, :only => [:index]
before_filter :check_for_default_issue_status, :only => [:new, :create]
before_filter :build_new_issue_from_params, :only => [:new, :create, :update_form]

@ -150,6 +150,7 @@ class MyController < ApplicationController
File.delete(diskfile1)
end
end
end
# Destroys user's account

@ -597,8 +597,8 @@ class ProjectsController < ApplicationController
"show_wiki_edits"=>true,
"show_journals_for_messages" => true
}
@date_to ||= Date.today + 1
@date_from = @date_to - @days-1.years
@with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
@author = (params[:user_id].blank? ? nil : User.active.find(params[:user_id]))
# 决定显示所用用户或单个用户活动
@ -612,9 +612,9 @@ class ProjectsController < ApplicationController
# modify by nwb
# 添加私密性判断
if User.current.member_of?(@project)|| User.current.admin?
events = @activity.events(@date_from, @date_to)
events = @activity.events(@days)
else
events = @activity.events(@date_from, @date_to, :is_public => 1)
events = @activity.events(@days,nil, :is_public => 1)
end
@offset, @limit = api_offset_and_limit({:limit => 10})

@ -41,7 +41,7 @@ class UsersController < ApplicationController
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index]
before_filter :auth_user_extension, only: :show
before_filter :rest_user_score, only: :show
#before_filter :rest_user_score, only: :show
#before_filter :select_entry, only: :user_projects
accept_api_auth :index, :show, :create, :update, :destroy,:tag_save , :tag_saveEx

@ -7,17 +7,6 @@ class ZipdownController < ApplicationController
SAVE_FOLDER = "#{Rails.root}/files"
OUTPUT_FOLDER = "#{Rails.root}/tmp/archiveZip"
#通过作业Id找到项目课程
def find_project_by_bid_id
obj_class = params[:obj_class]
obj_id = params[:obj_id]
obj = obj_class.constantize.find(obj_id)
case obj.class.to_s.to_sym
when :Bid
@project = obj.courses[0]
end
end
def assort
if params[:obj_class] == "Bid"
bid = Bid.find params[:obj_id]
@ -33,8 +22,8 @@ class ZipdownController < ApplicationController
end
send_file zipfile, :filename => bid.name + ".zip", :type => detect_content_type(zipfile) if zipfile
rescue Exception => e
render file: 'public/no_file_found.html'
#rescue Exception => e
# render file: 'public/no_file_found.html'
end
#下载某一学生的作业的所有文件
@ -56,12 +45,23 @@ class ZipdownController < ApplicationController
else
render_403
end
rescue => e
render file: 'public/file_not_found.html'
#rescue => e
# render file: 'public/file_not_found.html'
end
private
#通过作业Id找到项目课程
def find_project_by_bid_id
obj_class = params[:obj_class]
obj_id = params[:obj_id]
obj = obj_class.constantize.find(obj_id)
case obj.class.to_s.to_sym
when :Bid
@project = obj.courses[0]
end
end
def zip_bid(bid)
# Todo: User Access Controll
bid_homework_path = []
@ -101,10 +101,20 @@ class ZipdownController < ApplicationController
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
input_filename.each do |filename|
flag = true
index = 1
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)
flag = false
rescue Exception => e
zipfile.get_output_stream('FILE_NOTICE.txt') do |os|
os.write l(:label_file_exist)
end
next
end
end
unless not_exist_file.empty?
zipfile.get_output_stream('FILE_LOST.txt') do |os|
@ -113,9 +123,9 @@ class ZipdownController < ApplicationController
end
end
zipfile_name
rescue Errno => e
logger.error "[zipdown#zipping] ===> #{e}"
@error = e
#rescue Errno => e
# logger.error "[zipdown#zipping] ===> #{e}"
# @error = e
end
def detect_content_type(name)
content_type = Redmine::MimeType.of(name)

@ -140,10 +140,12 @@ module ApplicationHelper
# * :text - Link text (default to attachment filename)
# * :download - Force download (default: false)
def link_to_attachment(attachment, options={})
token = options[:token] if options[:token]
text = options.delete(:text) || attachment.filename
route_method = options.delete(:download) ? :download_named_attachment_path : :named_attachment_path
html_options = options.slice!(:only_path)
url = send(route_method, attachment, attachment.filename, options)
url << "?token=#{token}" unless token.nil?
link_to text, url, html_options
end
@ -1594,6 +1596,12 @@ module ApplicationHelper
s
end
def get_memo
@new_memo = Memo.new
#@new_memo.subject = "有什么想说的,尽管来咆哮吧~~"
@public_forum = Forum.find(1)
end
private
def wiki_helper

@ -224,6 +224,7 @@ module IssuesHelper
# as an array of strings
def details_to_strings(details, no_html=false, options={})
options[:only_path] = (options[:only_path] == false ? false : true)
options[:token] = options[:token] if options[:token]
strings = []
values_by_field = {}
details.each do |detail|
@ -312,7 +313,11 @@ module IssuesHelper
old_value = content_tag("del", old_value) if detail.old_value and detail.value.blank?
if detail.property == 'attachment' && !value.blank? && atta = Attachment.find_by_id(detail.prop_key)
# Link to the attachment if it has not been removed
if options[:token].nil?
value = link_to_attachment(atta, :download => true, :only_path => options[:only_path])
else
value = link_to_attachment(atta, :download => true, :only_path => options[:only_path], :token => options[:token])
end
if options[:only_path] != false && atta.is_text?
value += link_to(
image_tag('magnifier.png'),

@ -18,8 +18,12 @@
class IssueObserver < ActiveRecord::Observer
def after_create(issue)
thread1=Thread.new do
Mailer.issue_add(issue).deliver if Setting.notified_events.include?('issue_added')
Thread.start do
recipients = issue.recipients
recipients.each do |rec|
Mailer.issue_add(issue,rec).deliver if Setting.notified_events.include?('issue_added')
end
end
end
end

@ -20,7 +20,11 @@ class IssueOverdue < ActiveRecord::Base
#发邮件
#puts "11" + issue.id.to_s
#Mailer.issue_expire(issue).deliver
Mailer.issue_add(issue).deliver
recipients = issue.recipients
recipients.each do |rec|
Mailer.issue_edit(issue,rec).deliver
end
break
end
end

@ -23,8 +23,12 @@ class JournalObserver < ActiveRecord::Observer
(Setting.notified_events.include?('issue_status_updated') && journal.new_status.present?) ||
(Setting.notified_events.include?('issue_priority_updated') && journal.new_value_for('priority_id').present?)
)
Thread.new do
Mailer.issue_edit(journal).deliver
Thread.start do
recipients = journal.recipients
recipients.each do |rec|
Mailer.issue_edit(journal,rec).deliver
end
end
end
end

@ -95,29 +95,45 @@ class Mailer < ActionMailer::Base
# Example:
# issue_add(issue) => Mail::Message object
# Mailer.issue_add(issue).deliver => sends an email to issue recipients
def issue_add(issue)
def issue_add(issue, recipients)
issue_id = issue.project_index
redmine_headers 'Project' => issue.project.identifier,
'Issue-Id' => issue_id,
'Issue-Author' => issue.author.login
redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
message_id issue
@author = issue.author
@issue = issue
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id)
recipients = issue.recipients
cc = issue.watcher_recipients - recipients
mail :to => recipients,
token = Token.new(:user => User.find_by_mail(recipients), :action => 'autologin')
token.save
@token = token
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :token => @token.value)
cc = issue.watcher_recipients - issue.recipients
subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}"
mail(:to => recipients,
:cc => cc,
:subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}"
:subject => subject)
end
# issue.attachments.each do |attach|
# attachments["#{attach.filename}"] = File.read("#{attach.disk_filename}")
# end
# cc = issue.watcher_recipients - recipients
#mail.attachments['test'] = File.read("#{RAILS.root}/files/2015/01/150114094010_libegl.dll")
# Builds a Mail::Message object used to email recipients of the edited issue.
#
# Example:
# issue_edit(journal) => Mail::Message object
# Mailer.issue_edit(journal).deliver => sends an email to issue recipients
def issue_edit(journal)
def issue_edit(journal,recipients)
issue = journal.journalized.reload
issue_id = issue.project_index
redmine_headers 'Project' => issue.project.identifier,
@ -127,18 +143,34 @@ class Mailer < ActionMailer::Base
message_id journal
references issue
@author = journal.user
recipients = journal.recipients
token = Token.new(:user => User.find_by_mail(recipients), :action => 'autologin')
token.save
@token = token
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :anchor => "change-#{journal.id}", :token => @token.value)
# Watchers in cc
cc = journal.watcher_recipients - recipients
cc = journal.watcher_recipients - journal.recipients
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] "
s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
s << issue.subject
@issue = issue
@journal = journal
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue, :anchor => "change-#{journal.id}")
mail :to => recipients,
# @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue, :anchor => "change-#{journal.id}")
mail(:to => recipients,
:cc => cc,
:subject => s
:subject => s)
end
def self.deliver_mailer(to,cc, subject)
mail :to => to,
:cc => cc,
:subject => subject
end
# 用户申请加入项目邮件通知
@ -615,5 +647,15 @@ class Mailer < ActionMailer::Base
Rails.logger
end
def add_attachments(obj)
if email.attachments && email.attachments.any?
email.attachments.each do |attachment|
obj.attachments << Attachment.create(:container => obj,
:file => attachment.decoded,
:filename => attachment.filename,
:author => user,
:content_type => attachment.mime_type)
end
end
end
end

@ -380,7 +380,7 @@ class User < Principal
raise text
end
# Returns the user who matches the given autologin +key+ or nil
def self.try_to_autologin(key)
user = Token.find_active_user('autologin', key, Setting.autologin.to_i)
if user
@ -466,7 +466,11 @@ class User < Principal
User.hash_password("#{salt}#{User.hash_password clear_password}") == hashed_password
end
end
def check_password1?(clear_password)
clear_password == hashed_password
end
# Generates a random salt and computes hashed_password for +clear_password+
# The hashed password is stored in the following form: SHA1(salt + SHA1(password))
def salt_password(clear_password)

@ -36,6 +36,7 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_attach/praise_alert') %>');
showModal('ajax-modal', '480px');
$('#ajax-modal').css('height','240px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='#' onclick='hiddent_alert_model();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","").css("left","").css("width","511");

@ -0,0 +1,6 @@
$(function(){
$("#button1").click(function(){
myTips("您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!","success");
});
})

@ -78,7 +78,10 @@
</span>
&nbsp;&nbsp;作品描述&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<%= f.text_area "description", :class => "w620", :style=>"width:432px;", :maxlength => 3000, :placeholder => "最多3000个汉字", :onkeyup => "regexDescription();"%>
<%= 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>
<br/> <span id="homework_attach_description_span" style="padding-left: 100px;"></span>
</p>
<div class="cl"></div>

@ -0,0 +1,150 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>意见反馈浮窗</title>
<script>
function mypostion(o){
var width=$(window).width();
var height=$(window).height();
var divW=$(o).outerWidth();
var divH=$(o).outerHeight();
var left=(width-divW)/2+$(window).scrollLeft();
var top=(height-divH)/2+$(window).scrollTop();
return {"left":left,"top":top};
};
function myTips(msg,status){
if(status!="success" && status!="error"){status="error";};
if (status=="success") {
$("body").append('<div class="ui-mask" id="ui-mask"></div><div class="change_success" id="change_success"><!--span class="send_close" onclick="$(this).parent().remove();$("#ui-mask").remove();"></span--><i></i>'+msg+'</div>');
var my=mypostion("#change_success");
$("#change_success").css({"position":"absolute","z-index":"9999999","top":my.top+"px","left":my.left+"px"});
$("#ui-mask").show();
$("#change_success").show();
setTimeout(function(){
$("#change_success,#ui-mask").fadeOut("slow",function(){
$("#ui-mask").remove();
$("#change_success").remove();
});
},2500);
}
else{
$("body").append('<div class="ui-mask" id="ui-mask"></div><div class="change_error" id="change_error"><!--span class="send_close" onclick="$(this).parent().remove();$("#ui-mask").remove();"></span--><i></i>'+msg+'</div>');
var my=mypostion("#change_error");
$("#change_error").css({"position":"absolute","z-index":"9999999","top":my.top+"px","left":my.left+"px"});
$("#ui-mask").show();
$("#change_error").show();
setTimeout(function(){
$("#change_error,#ui-mask").fadeOut("slow",function(){
$("#ui-mask").remove();
$("#change_error").remove();
});
},1000);
};
};
$(function(){
$("#button1").click(function(){
myTips("您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!","success");
});
})
function f_submit()
{
$("#new_memo").submit();
}
</script>
<style type="text/css">
/*浮窗*/
body{ height:3000px; font-family:'微软雅黑';}
a{ text-decoration:none;}
#roll{ background:url(/images/f_opnion.jpg) 0 0 no-repeat;width:157px; height:332px; position:absolute;}
.opnionBox{ width: 130px; height:146px; margin:76px auto 20px; }
.opnionText{ width: 120px !important; height:130px; outline:none; border:none !important;padding: 0 5px !important; color: #03a8bb;line-height:1.5; font-size:12px; }
a.opnionButton{ width:40px; height:20px; display:block; margin:0 auto;font-size:14px; color:#fd6e2a; font-weight: bold; }
a:hover.opnionButton{ text-decoration:underline;}
.opnionCall{ color:#03a8bb; font-size:12px; width:105px; margin:0 auto;}
.opnionCall .tectitle{ font-size:14px; alignment-adjust: central; color:#03a8bb; margin-bottom:8px,}
/*提示框*/
.ui-mask{background-color:#000;opacity:0.5;filter:alpha(opacity=50);width:100%;height:100%;position:fixed;_position:absolute;left:0;top:0;z-index:9999998;display:none;}
.change_success{
display:block;
height:60px;
width:300px;
line-height:1.9;
font-size:14px;
font-weight:500;
background:#fff;
color:#1395a4;
border:5px solid #1395a4;
font-size:14px;
padding:30px 20px;
position: absolute;
_position: absolute;
left:0;
top:0;
z-index:9999999;
}
</style>
</head>
<body>
<div id="roll">
<div class="opnionBox">
<% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
<div class="actions" style="max-width:680px">
<p style="margin:0; padding:0;">
<%= f.text_area :subject, :class => "opnionText",:placeholder => "有什么想说的,尽管来咆哮吧~~"%>
</p>
<p style="margin:0; padding:0;">
<%= f.hidden_field :content, :required => true ,:value=>'该贴来自用户反馈!'%>
</p>
<%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %>
<a href="javascript:void(0);" class="opnionButton" id="" onclick="f_submit();">提&nbsp;&nbsp;交</a>
<% end %>
</div>
</form>
<div class="clear"></div>
</div>
<div class="opnionCall">
<div class="tectitle">技术支持:</div>
<p ><%= l(:label_course_adcolick) %><a href="http://user.trustie.net/users/12/user_newfeedback">黄井泉</a><br>
<%= l(:label_course_adcolick) %><a href="http://user.trustie.net/users/34/user_newfeedback">白羽</a></p>
</div>
</div>
</body>
</html>
<script>
var roll=document.getElementById('roll'),
initX=0,
initY,
compY,
sp=15,
//可调整时间间隔步进值不宜过大不然IE下有点闪屏
timeGap=5,
doc=document.documentElement,
docBody=document.body;
compY=initY=100;
roll.style.right=initX+"px";
;(function(){
var curScrollTop=(doc.scrollTop||docBody.scrollTop||0)-(doc.clientTop||docBody.clientTop||0);
//每次comP的值都不一样直到roll.style.top===doc.scrollTop+initY
compY+=(curScrollTop+initY-compY)/sp;
roll.style.top=Math.ceil(compY)+"px";
setTimeout(arguments.callee,timeGap);
})();
</script>

@ -27,6 +27,7 @@
#@nav_dispaly_user_label = 1
end
%>
<%= render :partial => "layouts/base_feedback" %>
<div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;">
<div class="welcome_logo">
<%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px")%>

@ -26,7 +26,6 @@
</head>
<!--add by huang-->
<body class="<%= h body_css_classes %>">
<%= render :partial => 'courses/course_ad' %>
<div id="wrapper">
<div id="wrapper2">
<div id="wrapper3">

@ -83,7 +83,7 @@
</a> >
<span title="<%= @contest.name%>">
<%= link_to h(truncate(@contest.name, length: 20, omission: '...')), show_contest_contest_path(@contest) %>
<%= link_to h(truncate(@contest.name, length: 20, omission: '...')), contest_contestnotifications_path(@contest) %>
</span>
</td>
</tr>

@ -39,7 +39,7 @@
</div>
</div>
<div id="ajax-indicator" ><span><%= l(:label_loading) %></span></div>
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
<div id="ajax-modal" style="display:none;"></div>

@ -1,3 +1,15 @@
<%= l(:text_issue_added, :id => "##{@issue.project_index}", :author => h(@issue.author)) %>
<ul>
<% unless @issue.attachments.nil? %>
<% @issue.attachments.each do |attach| %>
<li> <%= l(:label_attachment) %><%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %><%= l(:label_added) %></li>
<% end %>
<% end %>
</ul>
<hr />
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>

@ -1,4 +1,11 @@
<%= l(:text_issue_added, :id => "##{@issue.project_index}", :author => @issue.author) %>
<% @issue.attachments.each do |attach| %>
<%= l(:label_attachment) %>
<%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %> <%= l(:label_added) %>
<% end %>
----------------------------------------
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>

@ -1,7 +1,7 @@
<%= l(:text_issue_updated, :id => "##{@issue.project_index}", :author => h(@journal.user)) %>
<ul>
<% details_to_strings(@journal.details, false, :only_path => false).each do |string| %>
<% details_to_strings(@journal.details, false, :only_path => false, :token => @token.value).each do |string| %>
<li><%= string %></li>
<% end %>
</ul>

@ -1,6 +1,6 @@
<%= l(:text_issue_updated, :id => "##{@issue.project_index}", :author => @journal.user) %>
<% details_to_strings(@journal.details, true).each do |string| -%>
<% details_to_strings(@journal.details, true, :token => @token.value).each do |string| -%>
<%= string %>
<% end -%>

@ -123,7 +123,7 @@
<br/>
</p>
<p style="width:400px;padding-left: 52px;">
<p style="width:400px;padding-left: 50px;">
<label style="margin-right: 1px;">
<%= l(:label_identity) %><span style="color: #bb0000;"> *</span></label>
<select onchange="showtechnical_title(this.value, $('#userTechnical_title'));" name="identity" id="userIdentity" class="location" style="margin: 0px;">
@ -187,13 +187,13 @@
<!-- added by bai 增加账户里的性别-->
<span id='gender' style='display:none'>
<% if @user.user_extensions.nil? %>
<p style="width:400px;padding-left: 54px;">
<p style="width:400px;padding-left: 52px;">
<%= l(:label_gender) %>&nbsp;&nbsp;
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
</p>
<% else %>
<% if @user.user_extensions.gender == 0 %><!-- label_gender_male -->
<p style="width:400px;padding-left: 54px;">
<p style="width:400px;padding-left: 52px;">
<%= l(:label_gender) %>&nbsp;&nbsp;
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
</p>
@ -318,7 +318,7 @@
});
</script>
<p style="width:400px;padding-left: 57px;"><label style="margin-right: 5px;"><%= l(:label_location) %></label>
<p style="width:400px;padding-left: 55px;"><label style="margin-right: 5px;"><%= l(:label_location) %></label>
<select onchange="showcity(this.value, document.getElementById('userCity'));" name="province" id="userProvince" class="location">
<option value="">--请选择省份--</option>
<option value="北京">北京</option>
@ -382,7 +382,7 @@
<legend onclick="toggleFieldset(this);">
<%= l(:field_mail_notification) %>
</legend>
<div style="padding-left: 26px;"> <!-- modified by ming -->
<div style="padding-left: 8px;"> <!-- modified by ming -->
<p style="width:380px;">
<%= render :partial => 'users/mail_notifications' %>
</p></div>

@ -49,7 +49,7 @@ form #search_type{
<%= form_tag({controller: :welcome, action: :search }, method: :get) do %>
<div class="project-search" style="float: right">
<div class='search_widget'>
<%= text_field_tag :q, nil, placeholder:'请输入要搜索的关键字', :size => 27, %>
<%= text_field_tag :q, nil, placeholder:'请输入要搜索的关键字', :size => 27, style: "float:left" %>
<%= select_tag(:search_type, options_for_select(select_option), :style => "float:right" ) %>
</div>
<%#= hidden_field_tag 'project_type', project_type %>

@ -89,7 +89,7 @@ form #search_by
<div class="project-search" style="float: right">
<div class='search_widget' >
<%= text_field_tag :q, nil, placeholder:'请输入要搜索的关键字' %>
<%= text_field_tag :q, nil, placeholder:'请输入要搜索的关键字', style:"float:left" %>
<input type="text" name="search_by_input" style="display: none" id="search_by_input" value="0">
<%= select_tag(:search_type, options_for_select(select_option), :onchange => "searchTypeChange();", :style => "float:right" ) %>
<%= select_tag(:search_by,options_for_select([["昵称","0"],["姓名","1"],["邮箱","2"]]), :onchange => "searchByChange();",:style => "float:right" ) %>

@ -87,12 +87,12 @@ default:
address: smtp.qq.com
port: 587
domain: smtp.qq.com
address: smtp.126.com
port: 25
domain: smtp.126.com
authentication: :plain
user_name: 939547590@qq.com
password: 'suwen11223344'
user_name: "alanlong9278@126.com"
password: "alanlong8788786"
# Absolute path to the directory where attachments are stored.
# The default is the 'files' directory in your Redmine instance.

@ -2239,5 +2239,6 @@ zh:
label_course_prompt: 课程:
label_contain_resource: 已包含资源:
label_quote_resource_failed: ",此资源引用失败! "
label_file_lost: 以下文件在服务器丢失,请联系相关人员重新上传:
label_file_lost: 以下无法成功下载,请联系相关人员重新上传:
label_file_exist: 该作品中有重复命名文件,请通过文件名学号和姓名信息进入该作业详细界面手动下载

@ -168,6 +168,7 @@ RedmineApp::Application.routes.draw do
end
member do
post 'create_memo'
post 'create_feedback'
match 'search_memo', :via => [:get, :post]
end
resources :memos do
@ -177,6 +178,7 @@ RedmineApp::Application.routes.draw do
end
end
resources :shares
#added by william

@ -0,0 +1,10 @@
class AddDataForMembers < ActiveRecord::Migration
def change
StudentsForCourse.all.each do |stu|
if Member.where(:user_id => stu.student_id, :course_id => stu.course_id).first.nil?
mem = Member.new(:user_id => stu.student_id, :course_id => stu.course_id, :course_group_id => 0, :project_id => -1, :mail_notification => 0, :role_ids => [10])
mem.save!
end
end
end
end

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20150108035338) do
ActiveRecord::Schema.define(:version => 20150112024820) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -833,6 +833,7 @@ ActiveRecord::Schema.define(:version => 20150108035338) do
t.datetime "closed_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.text "polls_description"
end
create_table "praise_tread_caches", :force => true do |t|

@ -50,15 +50,13 @@ module Redmine
module ClassMethods
# Returns events of type event_type visible by user that occured between from and to
def find_events(event_type, user, from, to, options)
def find_events(event_type, user, days, created_time, options)
provider_options = activity_provider_options[event_type]
raise "#{self.name} can not provide #{event_type} events." if provider_options.nil?
scope = self
if from && to
scope = scope.scoped(:conditions => ["#{provider_options[:timestamp]} BETWEEN ? AND ?", from, to])
end
if options[:author]
return [] if provider_options[:author_key].nil?
@ -93,7 +91,22 @@ module Redmine
ActiveSupport::Deprecation.warn "acts_as_activity_provider with implicit :permission option is deprecated. Add a visible scope to the #{self.name} model or use explicit :permission option."
scope = scope.scoped(:conditions => Project.allowed_to_condition(user, "view_#{self.name.underscore.pluralize}".to_sym, options))
end
unless scope.all(provider_options[:find_options].dup).first.nil?
if provider_options[:timestamp].include? "updated_on"
to = scope.scoped(:order => "#{provider_options[:timestamp]} desc").all(provider_options[:find_options].dup).first.updated_on
else
to = scope.scoped(:order => "#{provider_options[:timestamp]} desc").all(provider_options[:find_options].dup).first.created_on
end
if options[:course]
from = (to - days.days) > created_time ? (to - days.days) : created_time.to_date
else
from = to - days.days - 1.years
end
end
if from && to
scope = scope.scoped(:conditions => ["#{provider_options[:timestamp]} BETWEEN ? AND ?", from, to])
end
scope.all(provider_options[:find_options].dup)
end

@ -79,7 +79,7 @@ module Redmine
# Returns an array of events for the given date range
# sorted in reverse chronological order
def events(from = nil, to = nil, options={})
def events(days = nil, created_time = nil, options={})
e = []
@options[:limit] = options[:limit]
# modify by nwb
@ -87,7 +87,7 @@ module Redmine
@scope.each do |event_type|
constantized_providers(event_type).each do |provider|
e += provider.find_events(event_type, @user, from, to, @options)
e += provider.find_events(event_type, @user, days, created_time, @options)
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

@ -118,7 +118,7 @@ a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;}
.upload_con { }
.upload_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; margin-top:25px; padding-left:20px; padding-top:5px;}
.upload_box{ width:430px; margin:15px auto;}
a.upload_btn{ display:block; float:left; margin-top:15px; width:80px; height:30px; text-align: center; color:#fff; font-size:14px; background:#15bccf; margin-right:15px;}
a.upload_btn{ display:block; float:left; margin-top:15px; width:80px; height:30px; text-align: center; color:#fff; font-size:14px; background:#15bccf; margin-right:15px;padding-top: 10px;}
a:hover.upload_btn{ background:#55a1b9;}
a.upload_btn_grey{background:#a3a3a3;}
a:hover.upload_btn_grey{background:#8a8a8a;}

@ -97,8 +97,10 @@ table.annotate td.author {
background: inherit;
}
table.annotate td.line-code { background-color: #fafafa; word-break: break-all;}
div.action_M { background: #fd8 }
div.action_D { background: #f88 }
div.action_A { background: #bfb }

@ -1,6 +1,16 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
one:
act_id:
act_type: MyString
user_id:
two:
act_id:
act_type: MyString
user_id:
id: 1
act_id: 1
act_type: JournalsForMessage
@ -10,3 +20,4 @@ two:
act_id: 2
act_type: JournalsForMessage
user_id: 5

@ -1,5 +1,14 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
<<<<<<< HEAD
one:
typeId: 1
typeName: MyString
two:
typeId: 1
typeName: MyString
=======
courses_001_infos:
id: 1
course_id: 1
@ -13,3 +22,4 @@ courses_002_infos:
created_at: 2013-09-30 15:36:00
updated_at: 2014-04-19 01:50:41
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0

@ -1,10 +1,24 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
<<<<<<< HEAD
one:
=======
courses_001_statuses:
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0
changesets_count: 1
watchers_count: 1
course_id: 1
grade: 1.5
course_ac_para: 1
<<<<<<< HEAD
two:
changesets_count: 1
watchers_count: 1
course_id: 1
grade: 1.5
course_ac_para: 1
=======
created_at: 2013-09-30 15:36:00
updated_at: 2014-04-19 01:50:41
@ -16,3 +30,4 @@ courses_002_statuses:
course_ac_para: 1
created_at: 2013-09-30 15:36:00
updated_at: 2014-04-19 01:50:41
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0

@ -1,5 +1,14 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
<<<<<<< HEAD
one:
name:
province: MyString
two:
name:
province: MyString
=======
school_117:
id: 117
name: 国防科学技术大学
@ -11,3 +20,4 @@ school_001:
name: 摧毁地球人学校
province: 火星
logo_link:
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0

@ -1,3 +1,44 @@
<<<<<<< HEAD
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
person_one_extra:
id: 44
user_id: 29
birthday: "2013-09-30 21:19:25"
brief_introduction: nil
gender: 1
location: "江苏"
occupation: ""
work_experience: nil
zip_code: nil
created_at: "2013-09-30 21:19:25"
updated_at: "2013-10-09 19:00:06"
technical_title: nil
identity: 2
student_id: nil
teacher_realname: nil
student_realname: nil
location_city: "南京"
person_mao_extra:
id: 22
user_id: 193
birthday: "2013-09-30 21:19:25"
brief_introduction: "期待..."
gender: 0
location: "湖南长沙"
occupation: "国防科技大学计算机学院"
work_experience: nil
zip_code: nil
created_at: "2013-09-30 21:19:25"
updated_at: "2013-10-09 19:00:06"
technical_title: "教授"
identity: 0
student_id: nil
teacher_realname: nil
student_realname: nil
location_city: nil
=======
user_extension_006:
id: 6
user_id: 6
@ -55,3 +96,4 @@ user_extension_025:
student_realname: 'ue_realname'
location_city: 哈尔滨
school_id: 117
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0

@ -0,0 +1,7 @@
require 'test_helper'
class AppliedProjectControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

@ -0,0 +1,49 @@
require 'test_helper'
class ApplyProjectMastersControllerTest < ActionController::TestCase
setup do
@apply_project_master = apply_project_masters(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:apply_project_masters)
end
test "should get new" do
get :new
assert_response :success
end
test "should create apply_project_master" do
assert_difference('ApplyProjectMaster.count') do
post :create, apply_project_master: { }
end
assert_redirected_to apply_project_master_path(assigns(:apply_project_master))
end
test "should show apply_project_master" do
get :show, id: @apply_project_master
assert_response :success
end
test "should get edit" do
get :edit, id: @apply_project_master
assert_response :success
end
test "should update apply_project_master" do
put :update, id: @apply_project_master, apply_project_master: { }
assert_redirected_to apply_project_master_path(assigns(:apply_project_master))
end
test "should destroy apply_project_master" do
assert_difference('ApplyProjectMaster.count', -1) do
delete :destroy, id: @apply_project_master
end
assert_redirected_to apply_project_masters_path
end
end

@ -0,0 +1,7 @@
require 'test_helper'
class AttachmentTypeEditControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

@ -0,0 +1,49 @@
require 'test_helper'
class ContestnotificationsControllerTest < ActionController::TestCase
setup do
@contestnotification = contestnotifications(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:contestnotifications)
end
test "should get new" do
get :new
assert_response :success
end
test "should create contestnotification" do
assert_difference('Contestnotification.count') do
post :create, contestnotification: { author_id: @contestnotification.author_id, comments_count: @contestnotification.comments_count, contest_id: @contestnotification.contest_id, description: @contestnotification.description, summary: @contestnotification.summary, title: @contestnotification.title }
end
assert_redirected_to contestnotification_path(assigns(:contestnotification))
end
test "should show contestnotification" do
get :show, id: @contestnotification
assert_response :success
end
test "should get edit" do
get :edit, id: @contestnotification
assert_response :success
end
test "should update contestnotification" do
put :update, id: @contestnotification, contestnotification: { author_id: @contestnotification.author_id, comments_count: @contestnotification.comments_count, contest_id: @contestnotification.contest_id, description: @contestnotification.description, summary: @contestnotification.summary, title: @contestnotification.title }
assert_redirected_to contestnotification_path(assigns(:contestnotification))
end
test "should destroy contestnotification" do
assert_difference('Contestnotification.count', -1) do
delete :destroy, id: @contestnotification
end
assert_redirected_to contestnotifications_path
end
end

@ -0,0 +1,49 @@
require 'test_helper'
class ForumsControllerTest < ActionController::TestCase
setup do
@forum = forums(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:forums)
end
test "should get new" do
get :new
assert_response :success
end
test "should create forum" do
assert_difference('Forum.count') do
post :create, forum: { }
end
assert_redirected_to forum_path(assigns(:forum))
end
test "should show forum" do
get :show, id: @forum
assert_response :success
end
test "should get edit" do
get :edit, id: @forum
assert_response :success
end
test "should update forum" do
put :update, id: @forum, forum: { }
assert_redirected_to forum_path(assigns(:forum))
end
test "should destroy forum" do
assert_difference('Forum.count', -1) do
delete :destroy, id: @forum
end
assert_redirected_to forums_path
end
end

@ -0,0 +1,11 @@
require 'test_helper'
class MemosControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
def test_memo_create_fail
memo = Memo.create(:subject => nil)
assert true
end
end

@ -0,0 +1,49 @@
require 'test_helper'
class NoUsesControllerTest < ActionController::TestCase
setup do
@no_use = no_uses(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:no_uses)
end
test "should get new" do
get :new
assert_response :success
end
test "should create no_use" do
assert_difference('NoUse.count') do
post :create, no_use: { }
end
assert_redirected_to no_use_path(assigns(:no_use))
end
test "should show no_use" do
get :show, id: @no_use
assert_response :success
end
test "should get edit" do
get :edit, id: @no_use
assert_response :success
end
test "should update no_use" do
put :update, id: @no_use, no_use: { }
assert_redirected_to no_use_path(assigns(:no_use))
end
test "should destroy no_use" do
assert_difference('NoUse.count', -1) do
delete :destroy, id: @no_use
end
assert_redirected_to no_uses_path
end
end

@ -0,0 +1,7 @@
require 'test_helper'
class NotificationcommentsControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

@ -0,0 +1,49 @@
require 'test_helper'
class OpenSourceProjectsControllerTest < ActionController::TestCase
setup do
@open_source_project = open_source_projects(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:open_source_projects)
end
test "should get new" do
get :new
assert_response :success
end
test "should create open_source_project" do
assert_difference('OpenSourceProject.count') do
post :create, open_source_project: { String: @open_source_project.String }
end
assert_redirected_to open_source_project_path(assigns(:open_source_project))
end
test "should show open_source_project" do
get :show, id: @open_source_project
assert_response :success
end
test "should get edit" do
get :edit, id: @open_source_project
assert_response :success
end
test "should update open_source_project" do
put :update, id: @open_source_project, open_source_project: { String: @open_source_project.String }
assert_redirected_to open_source_project_path(assigns(:open_source_project))
end
test "should destroy open_source_project" do
assert_difference('OpenSourceProject.count', -1) do
delete :destroy, id: @open_source_project
end
assert_redirected_to open_source_projects_path
end
end

@ -0,0 +1,49 @@
require 'test_helper'
class SoftapplicationsControllerTest < ActionController::TestCase
setup do
@softapplication = softapplications(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:softapplications)
end
test "should get new" do
get :new
assert_response :success
end
test "should create softapplication" do
assert_difference('Softapplication.count') do
post :create, softapplication: { android_min_version_available: @softapplication.android_min_version_available, app_type_id: @softapplication.app_type_id, app_type_name: @softapplication.app_type_name, description: @softapplication.description, name: @softapplication.name, user_id: @softapplication.user_id }
end
assert_redirected_to softapplication_path(assigns(:softapplication))
end
test "should show softapplication" do
get :show, id: @softapplication
assert_response :success
end
test "should get edit" do
get :edit, id: @softapplication
assert_response :success
end
test "should update softapplication" do
put :update, id: @softapplication, softapplication: { android_min_version_available: @softapplication.android_min_version_available, app_type_id: @softapplication.app_type_id, app_type_name: @softapplication.app_type_name, description: @softapplication.description, name: @softapplication.name, user_id: @softapplication.user_id }
assert_redirected_to softapplication_path(assigns(:softapplication))
end
test "should destroy softapplication" do
assert_difference('Softapplication.count', -1) do
delete :destroy, id: @softapplication
end
assert_redirected_to softapplications_path
end
end

@ -0,0 +1,13 @@
require 'test_helper'
class TestControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
test "get test index error" do
@request.env["REQUEST_URI"] = ""
get :index
assert_template :index
# assert_template layout: "layouts/base", partial: ["layouts/base_header","_base_header", 'layouts/base_footer', "_base_footer",]
end
end

@ -1,6 +1,10 @@
require 'test_helper'
<<<<<<< HEAD:test/unit/relative_memo_to_open_source_project_test.rb
class RelativeMemoToOpenSourceProjectTest < ActiveSupport::TestCase
=======
class WebFooterCompaniesControllerTest < ActionController::TestCase
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0:test/functional/web_footer_companies_controller_test.rb
# test "the truth" do
# assert true
# end

@ -0,0 +1,7 @@
require 'test_helper'
class AttachmentstypeTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -1,6 +1,10 @@
require 'test_helper'
<<<<<<< HEAD:test/unit/applied_project_test.rb
class AppliedProjectTest < ActiveSupport::TestCase
=======
class ContestNotificationTest < ActiveSupport::TestCase
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0:test/unit/contest_notification_test.rb
# test "the truth" do
# assert true
# end

@ -0,0 +1,7 @@
require 'test_helper'
class ContestingSoftapplicationTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -0,0 +1,7 @@
require 'test_helper'
class ContestnotificationTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -1,3 +1,12 @@
<<<<<<< HEAD:test/unit/bug_to_osp_test.rb
require 'test_helper'
class BugToOspTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
=======
require 'test_helper'
class CourseGroupTest < ActiveSupport::TestCase
@ -5,3 +14,4 @@ class CourseGroupTest < ActiveSupport::TestCase
# assert true
# end
end
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0:test/unit/course_group_test.rb

@ -0,0 +1,7 @@
require 'test_helper'
class CourseInfosTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -0,0 +1,7 @@
require 'test_helper'
class CourseStatusTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -0,0 +1,7 @@
require 'test_helper'
class ForumTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -0,0 +1,4 @@
require 'test_helper'
class AppliedProjectHelperTest < ActionView::TestCase
end

@ -0,0 +1,4 @@
require 'test_helper'
class ApplyProjectMastersHelperTest < ActionView::TestCase
end

@ -0,0 +1,4 @@
require 'test_helper'
class AttachmentTypeEditHelperTest < ActionView::TestCase
end

@ -0,0 +1,4 @@
require 'test_helper'
class ContestnotificationsHelperTest < ActionView::TestCase
end

@ -0,0 +1,12 @@
require File.expand_path('../../../test_helper', __FILE__)
class CoursesHelperTest < ActionView::TestCase
include CoursesHelper
# test "test truth" do
# @project = Project.find_by_id 6834
# teacherNum = teacherCount @project
# studentNum = studentCount @project
# assert_equal 1, teacherNum
# assert_equal 5, studentNum
# end
end

@ -0,0 +1,4 @@
require 'test_helper'
class ForumsHelperTest < ActionView::TestCase
end

@ -0,0 +1,4 @@
require 'test_helper'
class MemosHelperTest < ActionView::TestCase
end

@ -0,0 +1,4 @@
require 'test_helper'
class NoUsesHelperTest < ActionView::TestCase
end

@ -0,0 +1,4 @@
require 'test_helper'
class NotificationcommentsHelperTest < ActionView::TestCase
end

@ -0,0 +1,4 @@
require 'test_helper'
class OpenSourceProjectsHelperTest < ActionView::TestCase
end

@ -0,0 +1,4 @@
require 'test_helper'
class SchoolHelperTest < ActionView::TestCase
end

@ -0,0 +1,4 @@
require 'test_helper'
class SoftapplicationsHelperTest < ActionView::TestCase
end

@ -0,0 +1,4 @@
require 'test_helper'
class StoresHelperTest < ActionView::TestCase
end

@ -0,0 +1,4 @@
require 'test_helper'
class TestHelperTest < ActionView::TestCase
end

@ -0,0 +1,4 @@
require 'test_helper'
class ZipdownHelperTest < ActionView::TestCase
end

@ -0,0 +1,7 @@
require 'test_helper'
class JoinInContestTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -0,0 +1,7 @@
require 'test_helper'
class JournalReplyTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -0,0 +1,17 @@
# encoding: utf-8
require 'test_helper'
class MemoTest < ActiveSupport::TestCase
test "the truth" do
assert true
end
def test_the_truth
assert true
end
test "should not save memo without content" do
memo = Memo.new
assert !memo.save, "assert, save memo without content."
end
end

@ -0,0 +1,7 @@
require 'test_helper'
class NoUseTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -0,0 +1,7 @@
require 'test_helper'
class NotificationcommentsTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -0,0 +1,7 @@
require 'test_helper'
class OpenSourceProjectTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -1,6 +1,10 @@
require 'test_helper'
<<<<<<< HEAD:test/functional/school_controller_test.rb
class SchoolControllerTest < ActionController::TestCase
=======
class OptionNumberTest < ActiveSupport::TestCase
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0:test/unit/option_number_test.rb
# test "the truth" do
# assert true
# end

@ -1,6 +1,10 @@
require 'test_helper'
<<<<<<< HEAD:test/unit/apply_project_master_test.rb
class ApplyProjectMasterTest < ActiveSupport::TestCase
=======
class ProjectScoreTest < ActiveSupport::TestCase
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0:test/unit/project_score_test.rb
# test "the truth" do
# assert true
# end

@ -0,0 +1,7 @@
require 'test_helper'
class RelativeMemoTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -0,0 +1,7 @@
require 'test_helper'
class SchoolTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -0,0 +1,7 @@
require 'test_helper'
class SoftapplicationTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -0,0 +1,7 @@
require 'test_helper'
class UserScoreDetailsTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -1,6 +1,10 @@
require 'test_helper'
<<<<<<< HEAD:test/functional/user_score_controller_test.rb
class UserScoreControllerTest < ActionController::TestCase
=======
class WebFooterCompanyTest < ActiveSupport::TestCase
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0:test/unit/web_footer_company_test.rb
# test "the truth" do
# assert true
# end

@ -1,6 +1,10 @@
require 'test_helper'
<<<<<<< HEAD:test/functional/zipdown_controller_test.rb
class ZipdownControllerTest < ActionController::TestCase
=======
class WebFooterOranizerTest < ActiveSupport::TestCase
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0:test/unit/web_footer_oranizer_test.rb
# test "the truth" do
# assert true
# end

Loading…
Cancel
Save