Merge branch 'master' of 10.0.47.245:/home/trustie2

This commit is contained in:
yanxd 2014-05-04 18:40:58 +08:00
commit 5a6abab224
32 changed files with 922 additions and 931 deletions

View File

@ -33,15 +33,6 @@ class ContestsController < ApplicationController
if params[:contest_sort_type].present? if params[:contest_sort_type].present?
case params[:contest_sort_type] case params[:contest_sort_type]
when '0' when '0'
unless @offset == 0
@contests = @contests.offset(@offset).limit(@limit).all.reverse
else
limit = @contest_count % @limit
limit = @limit if limit == 0
@contests = @contests.offset(@offset).limit(limit).all.reverse
end
@s_state = 0
when '1'
unless @offset == 0 unless @offset == 0
@contests = @contests.reorder('contests.commit').offset(@offset).limit(@limit).all.reverse @contests = @contests.reorder('contests.commit').offset(@offset).limit(@limit).all.reverse
else else
@ -49,6 +40,15 @@ class ContestsController < ApplicationController
limit = @limit if limit == 0 limit = @limit if limit == 0
@contests = @contests.reorder('contests.commit').offset(@offset).limit(limit).all.reverse @contests = @contests.reorder('contests.commit').offset(@offset).limit(limit).all.reverse
end end
@s_state = 0
when '1'
unless @offset == 0
@contests = @contests.reorder('contests.created_on').offset(@offset).limit(@limit).all.reverse
else
limit = @contest_count % @limit
limit = @limit if limit == 0
@contests = @contests.reorder('contests.created_on').offset(@offset).limit(limit).all.reverse
end
@s_state = 1 @s_state = 1
when '2' when '2'
unless @offset == 0 unless @offset == 0
@ -62,11 +62,11 @@ class ContestsController < ApplicationController
end end
else else
unless @offset == 0 unless @offset == 0
@contests = @contests.reorder('contests.commit').offset(@offset).limit(@limit).all.reverse @contests = @contests.reorder('contests.created_on').offset(@offset).limit(@limit).all.reverse
else else
limit = @contest_count % @limit limit = @contest_count % @limit
limit = @limit if limit == 0 limit = @limit if limit == 0
@contests = @contests.reorder('contests.commit').offset(@offset).limit(limit).all.reverse @contests = @contests.reorder('contests.created_on').offset(@offset).limit(limit).all.reverse
end end
@s_state = 1 @s_state = 1
end end

View File

@ -138,6 +138,17 @@ class ProjectsController < ApplicationController
@project_count = @projects_all.count @project_count = @projects_all.count
@project_pages = Paginator.new @project_count, per_page_option, params['page'] @project_pages = Paginator.new @project_count, per_page_option, params['page']
#gcm activity count
@project_activity_count=Hash.new
@projects_all.each do |project|
@project_activity_count[project.id]=0
end
@project_activity_count=get_project_activity @projects_all,@project_activity_count
#gcm end
case params[:project_sort_type] case params[:project_sort_type]
when '0' when '0'
@ -149,6 +160,14 @@ class ProjectsController < ApplicationController
when '2' when '2'
@projects = @projects_all.order("watchers_count desc") @projects = @projects_all.order("watchers_count desc")
@s_type = 2 @s_type = 2
#gcm
when '3'
#@projects=desc_sort_course_by_avtivity(@project_activity_count_array,@project_all_array)
@projects=handle_project @projects_all,@project_activity_count
@s_type = 3
@projects = @projects[@project_pages.offset, @project_pages.per_page]
else else
@projects = @projects = @projects_all.order("grade desc") @projects = @projects = @projects_all.order("grade desc")
@s_type = 1 @s_type = 1
@ -193,122 +212,16 @@ class ProjectsController < ApplicationController
@project_count = @projects_all.count @project_count = @projects_all.count
@project_pages = Paginator.new @project_count, per_page_option, params['page'] @project_pages = Paginator.new @project_count, per_page_option, params['page']
#gcm activity count #gcm activity count
@project_activity_count=Hash.new @project_activity_count=Hash.new
#count initialize
@projects_all.each do |project| @projects_all.each do |project|
@project_activity_count[project.id]=0 @project_activity_count[project.id]=0
end end
@project_ids=@project_activity_count.keys()
days = Setting.activity_days_default.to_i
date_to ||= Date.today + 1
date_from = date_to - days-1.years
#approach 1 #@project_activity_count=get_project_activity @projects_all,@project_activity_count
=begin #gcm end
@projects_all.each do |project|
#issue_count
issues=Issue.where("project_id=?",project.id)
issue_count=0
issues.each do |issue|
issue_count+=issue.journals.count
end
#repository_count
repositories=Repository.where("project_id=?",project.id)
repository_count=0
repositories.each do |repository|
repository_count+=repository.changesets.count
end
#news_count
news_count=News.where("project_id=?",project.id).count
#document_count
document_count=Document.where("project_id=?",project.id).count
#file_count
file_count=Attachment.where("container_type='Project' AND container_id=?",project.id).count
#message_count
boards=Board.where("project_id=?",project.id)
message_count=0
boards.each do |board|
message_count+=board.messages.count
end
#time_entry_count
time_entry_count=TimeEntry.where("project_id=?",project.id).count
#sum
@project_activity_count[project.id.to_s]=issue_count+repository_count+news_count+document_count+file_count+message_count+time_entry_count
end
=end
#gcm
#gcm approach 2
#issue_count
Issue.where(project_id: @project_ids).where("updated_on>?",date_from).each do |issue|
# @project_activity_count[issue.project_id.to_s]+=1
@project_activity_count[issue.project_id]+=issue.journals.where("created_on>?",date_from).count
end
#repository_count
Repository.where(project_id: @project_ids).each do |repository|
# @project_activity_count[repository.project_id.to_s]+=1
@project_activity_count[repository.project_id]+=repository.changesets.where("committed_on>?",date_from).count
end
#news_count
News.where(project_id: @project_ids).where("created_on>?",date_from).each do |news|
@project_activity_count[news.project_id]+=1
end
#document_count
Document.where(project_id: @project_ids).where("created_on>?",date_from).each do |document|
@project_activity_count[document.project_id]+=1
end
#file_count
Attachment.where(container_id: @project_ids).where("container_type='Project' AND created_on>?",date_from).each do |attachment|
@project_activity_count[attachment.container_id]+=1
end
#message_count
Board.where(project_id: @project_ids).each do |board|
# @project_activity_count[board.project_id]+=1
@project_activity_count[board.project_id]+=board.messages.where("updated_on>?",date_from).count
end
#time_entry_count
TimeEntry.where(project_id: @project_ids).where("updated_on>?",date_from).each do |timeentry|
@project_activity_count[timeentry.project_id]+=1
end
#feedbackc_count
JournalsForMessage.where(jour_id: @project_ids).each do |jourformess|
@project_activity_count[jourformess.jour_id]+=1
end
#@project_activity_count!=0
@project_all_array=[]
i=0;
@projects_all.each do |project|
id=project.id
@project_all_array[i]=project
if @project_activity_count[id]==0
@project_activity_count[id]=1
end
i=i+1
end
@project_activity_count_array=@project_activity_count.values()
#gcm end
case params[:project_sort_type] case params[:project_sort_type]
@ -316,26 +229,48 @@ class ProjectsController < ApplicationController
@projects = @projects_all.order("created_on desc") @projects = @projects_all.order("created_on desc")
@s_type = 0 @s_type = 0
@projects = @projects.offset(@project_pages.offset).limit(@project_pages.per_page) @projects = @projects.offset(@project_pages.offset).limit(@project_pages.per_page)
#gcm
@project_activity_count=get_project_activity @projects,@project_activity_count
#gcmend
when '1' when '1'
@projects = @projects_all.order("course_ac_para desc") @projects = @projects_all.order("course_ac_para desc")
@s_type = 1 @s_type = 1
@projects = @projects.offset(@project_pages.offset).limit(@project_pages.per_page) @projects = @projects.offset(@project_pages.offset).limit(@project_pages.per_page)
#gcm
@project_activity_count=get_project_activity @projects,@project_activity_count
#gcmend
when '2' when '2'
@projects = @projects_all.order("watchers_count desc") @projects = @projects_all.order("watchers_count desc")
@s_type = 2 @s_type = 2
@projects = @projects.offset(@project_pages.offset).limit(@project_pages.per_page) @projects = @projects.offset(@project_pages.offset).limit(@project_pages.per_page)
#gcm
@project_activity_count=get_project_activity @projects,@project_activity_count
#gcmend
#gcm #gcm
when '3' when '3'
@projects=desc_sort_course_by_avtivity(@project_ids,@project_activity_count_array,@project_all_array)
#gcm
@project_activity_count=get_project_activity @projects_all,@project_activity_count
#gcmend
@projects=handle_project @projects_all,@project_activity_count
@s_type = 3 @s_type = 3
@projects = @projects[@project_pages.offset, @project_pages.per_page] @projects = @projects[@project_pages.offset, @project_pages.per_page]
#gcmend
else else
@s_type = 0 @s_type = 0
@projects = @projects_all.order("created_on desc") @projects = @projects_all.order("created_on desc")
@projects = @projects.offset(@project_pages.offset).limit(@project_pages.per_page) @projects = @projects.offset(@project_pages.offset).limit(@project_pages.per_page)
#gcm
@project_activity_count=get_project_activity @projects,@project_activity_count
#gcmend
end end
respond_to do |format| respond_to do |format|
@ -354,17 +289,76 @@ class ProjectsController < ApplicationController
end end
end end
#gcm
def search def search
#modified by nie #modified by nie
project_type = params[:project_type].to_i project_type = params[:project_type].to_i
projects_all = (project_type.eql? Project::ProjectType_course) ? Project.course_entities : Project.project_entities projects_all = (project_type.eql? Project::ProjectType_course) ? Project.course_entities : Project.project_entities
@projects = projects_all.visible @projects = projects_all.visible
@projects = @projects.visible.like(params[:name]) if params[:name].present? @projects_all = @projects.visible.like(params[:name]) if params[:name].present?
@offset, @limit = api_offset_and_limit({:limit => 10})
@project_count = @projects.visible.count @project_count = @projects_all.count
@project_pages = Paginator.new @project_count, @limit, params['page'] @project_pages = Paginator.new @project_count, per_page_option, params['page']
@offset ||= @project_pages.offset
@projects = @projects.visible.offset(@offset).limit(@limit).all #gcm activity count
@project_activity_count=Hash.new
# count initialize
@projects_all.each do |project|
@project_activity_count[project.id]=0
end
#@project_activity_count=get_project_activity @projects_all,@project_activity_count
#gcm end
case params[:project_sort_type]
when '0'
@projects = @projects_all.order("created_on desc")
@s_type = 0
@projects = @projects.offset(@project_pages.offset).limit(@project_pages.per_page)
#gcm
@project_activity_count=get_project_activity @projects,@project_activity_count
#gcmend
when '1'
@projects = @projects_all.order("course_ac_para desc")
@s_type = 1
@projects = @projects.offset(@project_pages.offset).limit(@project_pages.per_page)
#gcm
@project_activity_count=get_project_activity @projects,@project_activity_count
#gcmend
when '2'
@projects = @projects_all.order("watchers_count desc")
@s_type = 2
@projects = @projects.offset(@project_pages.offset).limit(@project_pages.per_page)
#gcm
@project_activity_count=get_project_activity @projects,@project_activity_count
#gcmend
when '3'
#@projects=desc_sort_course_by_avtivity(@project_activity_count_array,@project_all_array)
@project_activity_count=get_project_activity @projects_all,@project_activity_count_array #gcm
@projects=handle_project @projects_all,@project_activity_count
@s_type = 3
@projects = @projects[@project_pages.offset, @project_pages.per_page]
else
@s_type = 0
@projects = @projects_all.order("created_on desc")
@projects = @projects.offset(@project_pages.offset).limit(@project_pages.per_page)
#gcm
@project_activity_count=get_project_activity @projects,@project_activity_count
#gcmend
end
respond_to do |format| respond_to do |format|
format.html { format.html {
render :layout => 'base' render :layout => 'base'
@ -384,6 +378,38 @@ class ProjectsController < ApplicationController
} }
end end
end end
#gcmend
# def search
# #modified by nie
# project_type = params[:project_type].to_i
# projects_all = (project_type.eql? Project::ProjectType_course) ? Project.course_entities : Project.project_entities
# @projects = projects_all.visible
# @projects = @projects.visible.like(params[:name]) if params[:name].present?
# @offset, @limit = api_offset_and_limit({:limit => 10})
# @project_count = @projects.visible.count
# @project_pages = Paginator.new @project_count, @limit, params['page']
# @offset ||= @project_pages.offset
# @projects = @projects.visible.offset(@offset).limit(@limit).all
# respond_to do |format|
# format.html {
# render :layout => 'base'
# scope = Project
# unless params[:closed]
# scope = scope.active
# end
# }
# format.api {
# # @offset, @limit = api_offset_and_limit
# # @project_count = Project.visible.count
# # @projects = Project.visible.offset(@offset).limit(@limit).order('lft').all
# }
# format.atom {
# projects = Project.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all
# render_feed(projects, :title => "#{Setting.app_title}: #{l(:label_project_latest)}")
# }
# end
# end
# added by fq # added by fq
def new_join def new_join
@ -1018,7 +1044,93 @@ class ProjectsController < ApplicationController
end end
end end
def desc_sort_course_by_avtivity(ids,activity_count,projects)
#gcm
def get_project_activity projects,activities
@project_ids=activities.keys()
days = Setting.activity_days_default.to_i
date_to ||= Date.today + 1
date_from = date_to - days-1.years
#issue_count
Issue.where(project_id: @project_ids).where("updated_on>?",date_from).each do |issue|
# activities[issue.project_id.to_s]+=1
activities[issue.project_id]+=issue.journals.where("created_on>?",date_from).count
end
#repository_count
Repository.where(project_id: @project_ids).each do |repository|
# activities[repository.project_id.to_s]+=1
activities[repository.project_id]+=repository.changesets.where("committed_on>?",date_from).count
end
#news_count
News.where(project_id: @project_ids).where("created_on>?",date_from).each do |news|
activities[news.project_id]+=1
end
#document_count
Document.where(project_id: @project_ids).where("created_on>?",date_from).each do |document|
activities[document.project_id]+=1
end
#file_count
Attachment.where(container_id: @project_ids, container_type: Project).where("created_on>?",date_from).each do |attachment|
activities[attachment.container_id]+=1
end
#message_count
Board.where(project_id: @project_ids).each do |board|
# activities[board.project_id]+=1
activities[board.project_id]+=board.messages.where("updated_on>?",date_from).count
end
#time_entry_count
TimeEntry.where(project_id: @project_ids).where("updated_on>?",date_from).each do |timeentry|
activities[timeentry.project_id]+=1
end
#feedbackc_count
JournalsForMessage.where(jour_id: @project_ids, jour_type: Project).each do |jourformess|
activities[jourformess.jour_id]+=1
end
#activities!=0
i=0;
projects.each do |project|
id=project.id
if activities[id]==0
activities[id]=1
end
end
return activities
end
#gcmend
#gcm
def handle_project projects,activities
project_activity_count_array=activities.values()
project_array=[]
i=0;
projects.each do |project|
project_array[i]=project
i=i+1
end
projects=desc_sort_course_by_avtivity(project_activity_count_array,project_array)
return projects
end
#gcmend
#gcm
def desc_sort_course_by_avtivity(activity_count,projects)
return projects if activity_count.size<2 return projects if activity_count.size<2
(activity_count.size-2).downto(0) do |i| (activity_count.size-2).downto(0) do |i|
(0..i).each do |j| (0..i).each do |j|
@ -1029,20 +1141,7 @@ class ProjectsController < ApplicationController
end end
end end
return projects return projects
# len=activity_count.length
# for i in 0...(len-1) do
# for j in 0...(len-i-1) do
# if activity_count[j]>activity_count[j+1] do
# count_temp=activity_count[j]
# activity_count[j]=activity_count[j+1]
# activity_count[j+1]=count_temp
# end
# end
# end
#desc_sort_course_by_avtivity(@project_ids,@project_activity_count_array,@projects_all)
end end
#gcmend
end end

View File

@ -2,14 +2,49 @@ class SchoolController < ApplicationController
before_filter :require_admin, :only => :upload_logo before_filter :require_admin, :only => :upload_logo
def upload_logo def upload
uploaded_io = params[:logo]
school_id = 0
schools = School.where("name = ?", params[:school])
schools.each do |s|
school_id = s.id
end
unless uploaded_io.nil?
File.open(Rails.root.join('public', 'images', 'school', school_id.to_s+'.png'), 'wb') do |file|
file.write(uploaded_io.read)
end
s1 = School.find(school_id)
s1.logo_link = '/images/school/'+school_id.to_s+'.png'
s1.save
end
end
def upload_logo
end end
def index def index
end end
def get_province
@provinces = School.find_by_sql("select distinct province from schools")
options = ""
@provinces.each do |p|
options << "<option value = '#{p.province}' >#{p.province}</option>"
end
render :text => options
end
def get_options def get_options
@school = School.where("province = ?", params[:province]) @school = School.where("province = ?", params[:province])

View File

@ -8,6 +8,30 @@ class SoftapplicationsController < ApplicationController
def index def index
@softapplications = Softapplication.all @softapplications = Softapplication.all
#new added fenyefunction
@limit = 5
@softapplication_count = @softapplications.count
@softapplication_pages = Paginator.new @softapplication_count, @limit, params['page']
@offset ||= @softapplication_pages.offset
#@softapplications = @softapplications[@offset,@limit]
#new added end
#new added sort
if params[:softapplication_sort_type].present?
case params[:softapplication_sort_type]
when '0'
@softapplications = @softapplications[@offset, @limit]
@s_state = 0
when '1'
@softapplications = @softapplications.sort { |x, y| y[:created_at] <=> x[:created_at]}[@offset, @limit]
@s_state = 1
end
else
@softapplications = @softapplications.sort { |x, y| y[:created_at] <=> x[:created_at]}[@offset, @limit]
@s_state = 1
end
#new added end
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.json { render json: @softapplications } format.json { render json: @softapplications }
@ -16,8 +40,25 @@ class SoftapplicationsController < ApplicationController
# GET /softapplications/1 # GET /softapplications/1
# GET /softapplications/1.json # GET /softapplications/1.json
def percent_of(num, percent)
num.to_f / percent.to_f * 100.0
end
def show def show
@softapplication = Softapplication.find(params[:id]) @softapplication = Softapplication.find(params[:id])
# 打分统计
stars_reates = @softapplication.
rates(:quality)
stars_reates_count = stars_reates.count == 0 ? 1 : stars_reates.count
stars_status = stars_reates.select("stars, count(*) as scount").
group("stars")
@stars_status_map = Hash.new(0.0)
stars_status.each do |star_status|
@stars_status_map["star#{star_status.stars.to_i}".to_sym] =
percent_of(star_status.scount, stars_reates_count).to_s + "%"
end
@jours = @softapplication.journals_for_messages.order('created_on DESC') @jours = @softapplication.journals_for_messages.order('created_on DESC')
@image_results = [] @image_results = []
@softapplication.attachments.each do |f| @softapplication.attachments.each do |f|

View File

@ -39,8 +39,36 @@ class WelcomeController < ApplicationController
@courseCount = Project.course_entities.count @courseCount = Project.course_entities.count
@teacherCount = User.teacher.count @teacherCount = User.teacher.count
@studentCount = User.student.count @studentCount = User.student.count
@logoLink = logolink()
end end
def logolink()
id = params[:school_id]
logo_link = ""
if id.nil? and User.current.user_extensions.school.nil?
logo_link = '/images/transparent.png'
else
if id == "0"
logo_link = '/images/transparent.png'
else
if id.nil?
if School.find(User.current.user_extensions.school.id).logo_link.nil?
logo_link = '/images/transparent.png'
else
logo_link = School.find(User.current.user_extensions.school.id).logo_link
end
else
logo_link = School.find(id).logo_link
end
end
end
return logo_link
end
def contest def contest
end end

View File

@ -62,12 +62,12 @@ module ContestsHelper
content = ''.html_safe content = ''.html_safe
case state case state
when 0 when 0
content << content_tag('li', link_to(l(:label_sort_by_active), {controller: 'contests', action: 'index' ,:contest_sort_type => '1'})) content << content_tag('li', link_to(l(:label_sort_by_time), {controller: 'contests', action: 'index' ,:contest_sort_type => '1'}))
content << content_tag('li', link_to(l(:label_sort_by_time), {controller: 'contests', action: 'index' ,:contest_sort_type => '0'}, :class=>"selected"), :class=>"selected") content << content_tag('li', link_to(l(:label_sort_by_active), {controller: 'contests', action: 'index' ,:contest_sort_type => '0'}, :class=>"selected"), :class=>"selected")
when 1 when 1
content << content_tag('li', link_to(l(:label_sort_by_active), {controller: 'contests', action: 'index' ,:contest_sort_type => '1'}, :class=>"selected"), :class=>"selected") content << content_tag('li', link_to(l(:label_sort_by_time), {controller: 'contests', action: 'index' ,:contest_sort_type => '1'}, :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_time), {controller: 'contests', action: 'index' ,:contest_sort_type => '0'})) content << content_tag('li', link_to(l(:label_sort_by_active), {controller: 'contests', action: 'index' ,:contest_sort_type => '0'}))
end end
content = content_tag('ul', content) content = content_tag('ul', content)
content_tag('div', content, :class => "tabs") content_tag('div', content, :class => "tabs")

View File

@ -1,2 +1,18 @@
module SoftapplicationsHelper module SoftapplicationsHelper
def sort_softapplication(state)
content = ''.html_safe
case state
when 0
content << content_tag('li', link_to(l(:label_sort_by_time), {controller: 'softapplications', action: 'index' ,:softapplication_sort_type => '1'}))
content << content_tag('li', link_to(l(:label_sort_by_active), {controller: 'softapplications', action: 'index' ,:softapplication_sort_type => '0'}, :class=>"selected"), :class=>"selected")
when 1
content << content_tag('li', link_to(l(:label_sort_by_time), {controller: 'softapplications', action: 'index' ,:softapplication_sort_type => '1'}, :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_active), {controller: 'softapplications', action: 'index' ,:softapplication_sort_type => '0'}))
end
content = content_tag('ul', content)
content_tag('div', content, :class => "tabs")
end
end end

View File

@ -54,57 +54,111 @@ module UserScoreHelper
watcher_count = Watcher.where("watchable_type = 'principal' AND watchable_id = ?", user.id).count watcher_count = Watcher.where("watchable_type = 'principal' AND watchable_id = ?", user.id).count
end end
def calculate_skill_count(user) def calculate_skill_count(user)
praise_count = 0 praise_count_l0 = 0
tread_count = 0 praise_count_l1 = 0
praise_count_l2 = 0
tread_count_l0 = 0
tread_count_l1 = 0
tread_count_l2 = 0
issues = Issue.where('author_id = ?', user.id) issues = Issue.where('author_id = ?', user.id)
issues.each do |i| issues.each do |i|
ptcs = PraiseTreadCache.where('object_id = ?', i.id) pts = PraiseTread.where('praise_tread_object_id = ?', i.id)
ptcs.each do |p| pts.each do |p|
praise_count = praise_count + p.praise_num templevel = calculate_level(User.find(p.user_id))
tread_count = tread_count + p.tread_num
if templevel.to_i == 0
if p.praise_or_tread == 1
praise_count_l0 = praise_count_l0 + 1
else
tread_count_l0 = tread_count_l0 + 1
end
end
if templevel.to_i == 1
if p.praise_or_tread == 1
praise_count_l1 = praise_count_l1 + 1
else
tread_count_l1 = tread_count_l1 + 1
end
end
if templevel.to_i == 2
if p.praise_or_tread == 1
praise_count_l2 = praise_count_l2 + 1
else
tread_count_l2 + tread_count_l2 + 1
end
end
end end
end end
bids = Bid.where('author_id = ?', user.id) bids = Bid.where('author_id = ?', user.id)
bids.each do |b| bids.each do |b|
ptcs = PraiseTreadCache.where('object_id = ?', b.id) ptcs = PraiseTread.where('praise_tread_object_id = ?', b.id)
ptcs.each do |p| ptcs.each do |p|
praise_count = praise_count + p.praise_num templevel = calculate_level(User.find(p.user_id))
tread_count = tread_count + p.tread_num
if templevel.to_i == 0
if p.praise_or_tread == 1
praise_count_l0 = praise_count_l0 + 1
else
tread_count_l0 = tread_count_l0 + 1
end
end
if templevel.to_i == 1
if p.praise_or_tread == 1
praise_count_l1 = praise_count_l1 + 1
else
tread_count_l1 = tread_count_l1 + 1
end
end
if templevel.to_i == 2
if p.praise_or_tread == 1
praise_count_l2 = praise_count_l2 + 1
else
tread_count_l2 + tread_count_l2 + 1
end
end
end end
end end
contests = Contest.where('author_id = ?', user.id) contests = Contest.where('author_id = ?', user.id)
contests.each do |c| contests.each do |c|
ptcs = PraiseTreadCache.where('object_id = ?', c.id) ptcs = PraiseTread.where('praise_tread_object_id = ?', c.id)
ptcs.each do |p| ptcs.each do |p|
praise_count = praise_count + p.praise_num templevel = calculate_level(User.find(p.user_id))
tread_count = tread_count + p.tread_num
if templevel.to_i == 0
if p.praise_or_tread == 1
praise_count_l0 = praise_count_l0 + 1
else
tread_count_l0 = tread_count_l0 + 1
end
end
if templevel.to_i == 1
if p.praise_or_tread == 1
praise_count_l1 = praise_count_l1 + 1
else
tread_count_l1 = tread_count_l1 + 1
end
end
if templevel.to_i == 2
if p.praise_or_tread == 1
praise_count_l2 = praise_count_l2 + 1
else
tread_count_l2 + tread_count_l2 + 1
end
end
end end
end end
level = calculate_level(user)
skill_score = 0
if level == 0
skill_score = praise_count - 0.5 * tread_count
end
if level == 1
skill_score = 2 * praise_count - 1.5 * tread_count
end
if level == 2
skill_socre = 3 * praise_count - 2.5 * tread_count
end
if level == 3
skill_socre = 4 * praise_count - 3.5 * tread_count
end
if level == 4
skill_socre = 5 * praise_count - 4.5 * tread_count
end
# case level # case level
# when 0 skill_score = praise_count - 0.5 * tread_count # when 0 skill_score = praise_count - 0.5 * tread_count
@ -114,12 +168,19 @@ module UserScoreHelper
# when 4 skill_socre = 5 * praise_count - 4.5 * tread_count # when 4 skill_socre = 5 * praise_count - 4.5 * tread_count
# end # end
skill_score = 2 * praise_count_l0.to_f + 3 * praise_count_l1.to_f + 4 * praise_count_l2.to_f
- 1 * tread_count_l0.to_f - 1.5 * tread_count_l1.to_f - 2 * tread_count_l2.to_f
tread_user_count = PraiseTread.where('praise_or_tread = ? AND user_id = ?', 0, user.id).count tread_user_count = PraiseTread.where('praise_or_tread = ? AND user_id = ?', 0, user.id).count
skill_score = skill_score - 0.5 * tread_user_count skill_score = skill_score.to_f - tread_user_count.to_f
return skill_score return skill_score
@ -135,7 +196,7 @@ module UserScoreHelper
issues.each do |i| issues.each do |i|
ptcs = PraiseTreadCache.where('object_id = ?', i.id) ptcs = PraiseTreadCache.where('object_id = ?', i.id)
ptcs.each do |p| ptcs.each do |p|
if p.praise_num > max_praise_num if p.praise_num.to_i > max_praise_num.to_i
max_praise_num = p.praise_num max_praise_num = p.praise_num
end end
end end
@ -145,7 +206,7 @@ module UserScoreHelper
bids.each do |b| bids.each do |b|
ptcs = PraiseTreadCache.where('object_id = ?', b.id) ptcs = PraiseTreadCache.where('object_id = ?', b.id)
ptcs.each do |p| ptcs.each do |p|
if p.praise_num > max_praise_num if p.praise_num.to_i > max_praise_num.to_i
max_praise_num = p.praise_num max_praise_num = p.praise_num
end end
end end
@ -155,7 +216,7 @@ module UserScoreHelper
contests.each do |c| contests.each do |c|
ptcs = PraiseTreadCache.where('object_id = ?', c.id) ptcs = PraiseTreadCache.where('object_id = ?', c.id)
ptcs.each do |p| ptcs.each do |p|
if p.praise_num > max_praise_num if p.praise_num.to_i > max_praise_num.to_i
max_praise_num = p.praise_num max_praise_num = p.praise_num
end end
end end

View File

@ -13,7 +13,7 @@
<table border="0"> <table border="0">
<tr> <tr>
<td> <td>
<strong><%= l(:label_contests_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= contest.budget%></span></strong> <strong><%= l(:label_contests_reward_method) %>:&nbsp;&nbsp;<span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= contest.budget%></span></strong>
</td> </td>
</tr> </tr>

View File

@ -14,7 +14,7 @@
<tr> <tr>
<td>简介:</td> <td>简介:</td>
<td> <td>
<%= c_softapplication.softapplication.description %> <%= c_softapplication.softapplication.description.truncate(90, omission: '...') %>
</td> </td>
</tr></br> </tr></br>
</div> </div>

View File

@ -1,4 +1,132 @@
<!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 --> <!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 -->
<style>
#ver-zebra, .file_table_des
{
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
margin: 5px 10px;
width: 98%;
text-align: left;
border-collapse: collapse;
line-height: 20px;
font-size: 14px;
}
#ver-zebra th
{
font-size: 14px;
font-weight: normal;
padding: 12px 15px;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #039;
text-align: left;
}
#ver-zebra td
{
padding: 8px 15px;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #669;
}
#ver-zebra td.description {
background-color: white;
padding: 0px;
margin: 0px auto;
}
div.tags_area {
padding: 2px 10px 10px 10px;
margin: 0px;
margin-bottom: 10px;
/*border-bottom: 1px dashed #CCCCCC;*/
overflow: hidden;
position: relative;
}
.tags_gradint {
}
.read-more{
padding: 5px;
border-top: 4px double #ddd;
background: #fff;
color: #333;
}
.read-more a{
padding-right: 22px;
background: url() no-repeat 100% 50%;
font-weight: bold;
text-decoration: none;
}
.read-more a:hover{
color: #000;
}
.vzebra-odd
{
background: #eff2ff;
}
.vzebra-even
{
background: #e8edff;
}
#ver-zebra #vzebra-adventure, #ver-zebra #vzebra-children
{
background: #ffffff;
border-bottom: 1px solid #c8d4fd;
}
#ver-zebra #vzebra-comedy, #ver-zebra #vzebra-action
{
background: #ffffff;
border-bottom: 1px solid #d6dfff;
}
.filename{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
div.pagination{
margin: 10px 0px;
height: 1.5em;
text-align: left;
font-size: 13px;
}
.m5p5{
display: inline-block;
height: auto;
color: white !important;
margin: 8px;
padding: 3px 7px;
}
.m5p5:hover {
text-decoration: none;
/*padding-bottom: 3px;*/
/*border-bottom: 1px solid #666666;*/
border-radius: 4px;
border: 1px solid #15bccf;
box-shadow: 3px 3px 3px #666666;
}
.relation_file_div{
margin: 0px 25px;
}
.relation_file_div fieldset{
margin: 0px 0px;
padding: 10px;
border-radius: 5px;
transition: all 2s linear 1s;
}
.relation_file_div input#attach_search:focus{
border: 1px solid #1B95C6;
box-shadow: 0px 0px 4px #1B95C6;
width: 200px;
}
.relation_file_div input#attach_search{
width: 150px;
outline: none;
border-radius: 5px;
-webkit-transition: 1s width;
-moz-transition : 1s width;
-o-transition : 1s width;
transition : 1s width;
}
</style>
<span class="borad-title"><%=(@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>资源共享区</span> <span class="borad-title"><%=(@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>资源共享区</span>
@ -88,9 +216,7 @@
<td class='description' colspan="5"> <td class='description' colspan="5">
<div class="tags_area"> <div class="tags_area">
<% @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %> <% @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %>
<div id='attach_<%=file.id%>' ><%#需要交由浏览器异步刷新或者一次连表查询n+1 查询问题搞不定%> <%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"}%>
<%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"}%>
</div>
<div class="tags_gradint"></div> <div class="tags_gradint"></div>
</div> </div>
<div class="read-more hidden"><a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a></div> <div class="read-more hidden"><a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a></div>

View File

@ -1,31 +1,31 @@
<!--add by huang--> <!--add by huang-->
<div class="clearfix"></div> <div class="clearfix"></div>
<div id="footer" style="margin-left:-5px;padding-top: 50px;clear: both;font-size: 12px;"> <div id="footer" style="margin-left:-5px;padding-top: 150px;clear: both;font-size: 12px;">
<div style="border-top:solid 1px #C6E9F1;width: auto;margin-top: 80px;"></div> <div style="border-top:solid 1px #C6E9F1;"></div>
<div class="base_footer"> <div class="base_footer">
<div align="center"> <div align="center">
<!--gcm--> <!--gcm-->
<p> <p>
<span>主办单位:</span> <span>主办单位:</span>
<span class="footer_text_link"><%= link_to "国防科学技术大学并行与分布处理国家重点实验室","http://www.nudt.edu.cn/ArticleShow.asp?ID=47",:target=>"_blank"%></span> <span class="footer_text_link"><%= link_to "国防科学技术大学并行与分布处理国家重点实验室","http://www.nudt.edu.cn/ArticleShow.asp?ID=47",:target=>"_blank"%></span>
<span class="footer_text_link"><%= link_to "计算机科学与技术系", "http://www.nudt.edu.cn/ArticleShow.asp?ID=41", :target => "_blank" %></span> <span class="footer_text_link"><%= link_to "计算机科学与技术系", "http://www.nudt.edu.cn/ArticleShow.asp?ID=41", :target => "_blank" %></span>
<span id="copyright">版权@2007~2014</span> <span id="copyright">版权@2007~2014</span>
<span id="contact_us" class="footer_text_link"><%= link_to "联系我们","http://forge.trustie.net/projects/2/member",:target=>"_blank"%></span> <span id="contact_us" class="footer_text_link"><%= link_to "联系我们","http://forge.trustie.net/projects/2/member",:target=>"_blank"%></span>
<span id="record"class="footer_text_link"><%= link_to "湘ICP备09019772","http://www.miibeian.gov.cn/"%></span> <span id="record"class="footer_text_link"><%= link_to "湘ICP备09019772","http://www.miibeian.gov.cn/"%></span>
</p> </p>
<div id="logo_link"> <div id="logo_link">
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/nudt.png',:size=>'100x30',:alt=>"国防科学技术大学计算机学院"),"http://www.nudt.edu.cn/special.asp?classid=12"%></span> <span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/nudt.png',:size=>'100x30',:alt=>"国防科学技术大学计算机学院"),"http://www.nudt.edu.cn/special.asp?classid=12"%></span>
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/peking_eecs.png',:size=>'100x30',:alt=>"北京大学信息科学技术学院软件研究所"), "http://eecs.pku.edu.cn"%></span> <span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/peking_eecs.png',:size=>'100x30',:alt=>"北京大学信息科学技术学院软件研究所"), "http://eecs.pku.edu.cn"%></span>
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/buaa_scse.png',:size=>'100x30',:alt=>"北京航空航天大学计算机学院"), "http://scse.buaa.edu.cn/"%></span> <span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/buaa_scse.png',:size=>'100x30',:alt=>"北京航空航天大学计算机学院"), "http://scse.buaa.edu.cn/"%></span>
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/iscas.png',:size=>'100x30',:alt=>"中国科学院软件研究所"), "http://www.iscas.ac.cn"%></span> <span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/iscas.png',:size=>'100x30',:alt=>"中国科学院软件研究所"), "http://www.iscas.ac.cn"%></span>
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/inforbus.png',:size=>'100x30',:alt=>"山东中创软件商用中间件股份有限公司"), "http://www.inforbus.com"%></span> <span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/inforbus.png',:size=>'100x30',:alt=>"山东中创软件商用中间件股份有限公司"), "http://www.inforbus.com"%></span>
</div> </div>
<!--gcm--> <!--gcm-->
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="debug"> <div class="debug">

View File

@ -0,0 +1,22 @@
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">创新竞赛社区</td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="305px">
<div class="project-search" style="float: right">
<%= text_field_tag 'name', params[:name], :size => 25 %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
</div>
</td>
</tr>
<tr>
<td style="padding-left: 8px"><%=link_to request.host()+"/softapplications", :controller=>'softapplications', :action=>'index' %></td>
<td ><%=link_to l(:field_homepage), home_path %> >
<%=link_to l(:label_contest_softapplication), :controller=>'softapplications', :action=>'index' %>
</td>
</tr>
</table>
</div>

View File

@ -108,22 +108,23 @@
<!-- added by Wen --> <!-- added by Wen -->
<p style="width:357px;padding-left: 26px;"> <p style="padding-left: 26px;">
<% unless User.current.user_extensions.school.nil? %> <% unless User.current.user_extensions.school.nil? %>
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span><%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province, User.current.user_extensions.school.province), :onclick => "get_options(this.value)" %>
<input id="occupation" name="occupation" type="hidden" value="<%=User.current.user_extensions.school.id%>" /> <%= l(:field_occupation) %>&nbsp;<span class="required">*</span>
<input id="occupation_name" type="text" value="<%=User.current.user_extensions.school.name%>" readonly />
<input id="province" name="province" type="text" value="<%=User.current.user_extensions.school.province%>" readonly />
<input id="occupation" name="occupation" type="hidden" value="<%=User.current.user_extensions.school.id%>" />
<input id="occupation_name" type="text" value="<%=User.current.user_extensions.school.name%>" readonly />
<!--<%= select_tag "occupation",
options_for_select([[User.current.user_extensions.school.name, User.current.user_extensions.school.id]]) %>-->
<% else %> <% else %>
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span><%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onclick => "get_options(this.value)" %>
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span>
<input id="province" name="province" type="text" value="请单击选择省份及学校" readonly >
<input id="occupation" name="occupation" type="hidden" />
<input id="occupation_name" type="text" readonly />
<input id="occupation" name="occupation" type="hidden" />
<input id="occupation_name" type="text" readonly />
<% end %> <% end %>
<!-- <input id="occupation" readonly />--> <!-- <input id="occupation" readonly />-->
</p> </p>
@ -131,6 +132,18 @@
<div id="WOpenWindow"> <div id="WOpenWindow">
<a class="modal_close" href="#"></a> <a class="modal_close" href="#"></a>
<h2>学校列表</h2> <h2>学校列表</h2>
<div class="pcontent">
<ul id="provincelist" class="school_list">
<% @ss = School.find_by_sql("select distinct province from schools") %>
<% @ss.each do |s| %>
<li style="width: 15%; float: left;">
<a style="cursor: pointer;" onclick = "get_options('<%= s.province %>')"><%= s.province %>
</a>
</li>
<% end %>
</ul>
</div>
<hr/>
<div class="content" style="font-size: 13px"> <div class="content" style="font-size: 13px">
<ul id="schoollist" class="school_list"> <ul id="schoollist" class="school_list">

View File

@ -52,7 +52,7 @@
<!--gcm--> <!--gcm-->
<p class="stats"> <p class="stats">
<%= content_tag('span', link_to("#{@project_activity_count[@project.id]}", member_project_path(@project)), :class => "info") %> <%= content_tag('span', link_to("#{@project_activity_count[@project.id]}", project_path(@project)), :class => "info") %>
<%= content_tag('span', l(:label_x_activity, :count => @project_activity_count[@project.id])) %> <%= content_tag('span', l(:label_x_activity, :count => @project_activity_count[@project.id])) %>
</p> </p>
<!--gcm--> <!--gcm-->

View File

@ -1,4 +1,22 @@
<% port = ":3000" if Rails.env.development? %> <% port = ":3000" if Rails.env.development? %>
<script type="text/javascript">
$(document).ready(function() {
$("#province").html("<option value='0' selected = true style='display: none;'></option>");
$.ajax({
type :"POST",
url :'/school/get_province',
data :'text',
success: function(data){
$("#province").append(data);
}
})
});
</script>
<script type="text/javascript"> <script type="text/javascript">
function get_school(value){ function get_school(value){
$.ajax({ $.ajax({
@ -50,9 +68,9 @@
<a href="http://course.trustie.net<%=port%>">我的学校</a> <a href="http://course.trustie.net<%=port%>">我的学校</a>
</p> </p>
<ul> <ul>
<li style="width: 40%; float: left">请选择省份:<%= select_tag "province", <li style="width: 40%; float: left">请选择省份:
options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), <select id="province" name="province" onchange="get_school(this.value)"></select>
:onclick => "get_school(this.value)" %></li> </li>
<li style="width: 50%; float: left"><input type="text" id="key_word" name="key_word" /> <li style="width: 50%; float: left"><input type="text" id="key_word" name="key_word" />
<input type="button" class="enterprise" value="搜索" onclick="ssearch()"></li> <input type="button" class="enterprise" value="搜索" onclick="ssearch()"></li>
</ul> </ul>

View File

@ -1 +1,5 @@
<input type="file" /> <%= form_tag({action: :upload},method: "post", multipart: true) do %>
<%= text_field_tag 'school'%>
<%= file_field_tag 'logo' %>
<%= submit_tag('Upload') %>
<% end %>

View File

@ -1,33 +1,39 @@
<h1>参赛应用</h1>
<table>
<tr>
<th>Name</th>
<th>Description</th>
<th>App type</th>
<th>App type name</th>
<th>Android min version available</th>
<th>User</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @softapplications.each do |softapplication| %> <%=render :partial => 'layouts/base_softapplication_index_top_content'%>
<tr>
<td><%= softapplication.name %></td> <% if @softapplications.size > 0%>
<td><%= softapplication.description %></td> <%= sort_softapplication(@s_state)%>
<td><%= softapplication.app_type_id %></td>
<td><%= softapplication.app_type_name %></td> <div width="95%" border="0" style="padding-left: 10px; padding-top: 10px;">
<td><%= softapplication.android_min_version_available %></td> <% @softapplications.each do |softapplication| %>
<td><%= softapplication.user_id %></td> <div>
<td><%= link_to 'Show', softapplication %></td> <span style="font-size: 15px; margin-right: 10px;"><strong><%= link_to softapplication.name, softapplication, :target => "_blank" %></strong></span>
<td><%= link_to 'Edit', edit_softapplication_path(softapplication) %></td> <span><%= rating_for softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></span>
<td><%= link_to 'Destroy', softapplication, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr> </div>
<div class="avatar-4"; style="float: left; margin-top: 7px "><%= image_tag('/images/app1.png')%></div>
<div style="float: left; width: 600px; padding-top: 6px; margin-left: 8px"><%= softapplication.description.truncate(95, omission: '...') %></div>
<div style="float: left; width: 200px; margin-left: 70px; margin-top: -3px; ">
<%contest = softapplication.contests.first%>
<p>所属竞赛:<%= contest ? link_to(contest.name.truncate(10, omission: '...'), show_softapplication_contest_path(contest), title: contest.name.to_s ) : '尚未加入竞赛'%></p>
<p>所属类别:<%= softapplication.app_type_name %></p>
<p>系统支持:<%= softapplication.android_min_version_available %></p>
</div>
<div style="padding-left: 53px">
<span>开发人员:<%= softapplication.application_developers %></span>
<span style="padding-left: 50px">发布时间:<%=format_time softapplication.created_at %></span>
</div>
<div style="border-left: 1px solid #d9d8d8; border-bottom: 1px solid #d9d8d8; margin-left: 50px; padding-bottom: 10px; margin-bottom: 20px; width: 66%"></div>
<div class="underline-contests_one" style="margin-top: -7px"></div>
<% end %>
</div>
<% else %>
<%= render :partial => "layouts/no_content"%>
<% end %> <% end %>
</table>
<br />
<%= link_to 'New Softapplication', new_softapplication_path %> <div class="pagination"><%= pagination_links_full @softapplication_pages, @softapplication_count, :per_page_links => false %></div>
<% html_title l(:label_softapplication_list)%>

View File

@ -27,7 +27,7 @@
<tr> <tr>
<td style="width: 570px; padding-left:40px; word-wrap: break-word; word-break: break-all">所属类别:<%= @softapplication.app_type_name %></td> <td style="width: 570px; padding-left:40px; word-wrap: break-word; word-break: break-all">所属类别:<%= @softapplication.app_type_name %></td>
<% contest = @softapplication.contests.first %> <% contest = @softapplication.contests.first %>
<td style="width: 240px; word-wrap: break-word; word-break: break-all">所属竞赛:<%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%></td> <td style="width: 240px; word-wrap: break-word; word-break: break-all">所属竞赛:<%= contest ? link_to(contest.name, show_softapplication_contest_path(contest)) : '尚未加入竞赛'%></td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 40px">发布人员:<%= @softapplication.user.name %></td> <td style="padding-left: 40px">发布人员:<%= @softapplication.user.name %></td>
@ -56,14 +56,40 @@
<div class="underline-contests_one"></div> <div class="underline-contests_one"></div>
<div style="height: auto; padding-bottom: 10px"> <div style="height: auto; padding-bottom: 10px">
<strong><div style="font-size: 15px">应用简介:</div></strong> <strong><div style="font-size: 15px;">应用简介:</div></strong>
<div><%= @softapplication.description.truncate(150, omission: '...') %></div> <div style="padding-top: 5px"><%= @softapplication.description %></div>
</div> </div>
<div class="underline-contests_one"></div> <div class="underline-contests_one"></div>
<div style="height: 240px"> <div style="height: auto; padding-bottom: 10px">
<div style="font-size: 15px;"><strong>应用得分:</strong></div>
<div style="overflow: hidden">
<div style="margin-left: 25%; float: left">
<div style="padding-left: 45px; padding-bottom: 5px">得分比例</div>
<div>
<% 100.step(20,-20) do |star| %>
<div data-kls="Softapplication" data-id="2" data-dimension="quality" data-average="3.25" class="rateable div_inline jDisabled" style="height: 20px; width: 115px; overflow: hidden; z-index: 1; position: relative;">
<div class="jRatingColor" style="width: <%=star%>%;"></div>
<div class="jRatingAverage" style="width: 0px; top: -20px;"></div>
<div class="jStar" style="width: 115px; height: 20px; top: -40px; background: url(&quot;/images/seems_rateable/stars.png&quot;) repeat-x scroll 0% 0% transparent;">
</div>
</div>
<%= @stars_status_map["star#{(star/20).to_s}".to_sym] %>
<br>
<% end %>
</div>
</div>
<div style="float: left; padding-left: 100px; padding-top:35px ">
<div style="padding-left: 25px;">最终得分</div>
<div style="padding-top: 3px"><%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></div>
</div>
</div>
</div>
<div class="underline-contests_one"></div>
<div style="height: auto; padding-bottom: 10px">
<strong><div style="font-size: 15px">软件截图:</div></strong> <strong><div style="font-size: 15px">软件截图:</div></strong>
<div class="softapplication-img"> <div class="softapplication-img" style="padding-top: 5px">
<% @image_results.take(4).each do |attachment| %> <% @image_results.take(4).each do |attachment| %>
<%= link_to_attachment_img attachment, :class => "soft-application", :download => "true" %> <%= link_to_attachment_img attachment, :class => "soft-application", :download => "true" %>
<% end %> <% end %>
@ -72,7 +98,18 @@
</div> </div>
<div class="underline-contests_one"></div> <div class="underline-contests_one"></div>
<!-- <div style="margin-left: 22%;">
<% 100.step(20,-20) do |star| %>
<div data-kls="Softapplication" data-id="2" data-dimension="quality" data-average="3.25" class="rateable div_inline jDisabled" style="height: 20px; width: 115px; overflow: hidden; z-index: 1; position: relative;">
<div class="jRatingColor" style="width: <%=star%>%;"></div>
<div class="jRatingAverage" style="width: 0px; top: -20px;"></div>
<div class="jStar" style="width: 115px; height: 20px; top: -40px; background: url(&quot;/images/seems_rateable/stars.png&quot;) repeat-x scroll 0% 0% transparent;">
</div>
</div>
<%= @stars_status_map["star#{(star/20).to_s}".to_sym] %>
<br>
<% end %>
</div> -->
<div style="height: 50px"> <div style="height: 50px">
<div style="font-size: 15px"><strong>软件评论:</strong></div> <div style="font-size: 15px"><strong>软件评论:</strong></div>
<div style="padding-left: 210px">评分: <%= rating_for @softapplication, dimension: :quality, class: 'rateable div_inline' %></div> <div style="padding-left: 210px">评分: <%= rating_for @softapplication, dimension: :quality, class: 'rateable div_inline' %></div>

View File

@ -12,14 +12,13 @@
<tr> <tr>
<td><%= user.lastname %><%= user.firstname %></td> <td><%= user.lastname %><%= user.firstname %></td>
<!-- <td><%= calculate_collaboration_count(user) %></td> <td><%= calculate_collaboration_count(user) %></td>
<td><%= calculate_influence_count(user) %></td> <td><%= calculate_influence_count(user) %></td>
<td><%= calculate_skill_count(user) %></td> <td><%= calculate_skill_count(user) %></td>
<td><%= calculate_file(user) %></td> <td><%= calculate_file(user) %></td>
<td><%= calculate_issue(user) %></td> <td><%= calculate_issue(user) %></td>
<td><%= calculate_level(user) %></td> <td><%= calculate_level(user) %></td>
-->
<td><%= user.changesets.count %></td>
</tr> </tr>
<% end %> <% end %>
</table> </table>

View File

@ -201,7 +201,7 @@
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject"> <div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
<h3 style="margin-left: 5px; color: #e8770d;"><strong>最新参赛应用</strong></h3> <h3 style="margin-left: 5px; color: #e8770d;"><strong>最新参赛应用</strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", {:controller => 'softapplications', :action => 'index', :host => Setting.contest_domain}, :target => "_blank" %></span>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<% if Softapplication.count > 0%> <% if Softapplication.count > 0%>
<div class="d-p-projectlist"> <div class="d-p-projectlist">

View File

@ -1,22 +1,11 @@
<%= stylesheet_link_tag 'welcome' %> <%= stylesheet_link_tag 'welcome' %>
<script type="text/javascript" language="javascript"> <%= javascript_include_tag 'welcome' %>
function clearInfo(id, content) { <script type="text/javascript" language="javascript">
var text = $('#' + id);
if (text.val() == content) {
$('#' + id).val('');
}
}
$(function(){ $(function(){
$("#main").find("a").attr("target", "_blank"); $("#main").find("a").attr("target", "_blank");
}); });
function showInfo(id, content) {
var text = $('#' + id);
if (text.val() == '') {
$('#' + id).val(content);
}
}
// 给主页用户弹新页面 // 给主页用户弹新页面
$(document).ready(function($) { $(document).ready(function($) {
$("#loggedas").find("a").attr("target", "_blank"); $("#loggedas").find("a").attr("target", "_blank");
@ -24,73 +13,6 @@
}); });
</script> </script>
<script type="text/javascript">
(function (){
window.onload = function(){
function fixedBar(id, options){
var ele = document.getElementById(id);
if(!ele) return;
if(/msie (\d+\.\d+)/i.test(navigator.userAgent)){
var pageHeight=window.innerHeight;
var d=document;
if(typeof pageHeight!="number"){
if(document.compatMode=="CSS1Compat"){
pageHeight=document.documentElement.clientHeight;
}else{
pageHeight=document.body.clientHeight;
}
}
var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop;
if(options.addclass) ele.className = options.addclass;
ele.style.position= 'absolute';
if(options.show){
ele.style.top = 0 + "px";
ele.style.display= 'block';
}
window.attachEvent('onscroll' , function (){
var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop;
ele.style.top = 0 + "px";
if(options.autoHidden){
if(ieScrollTop==0){
ele.style.display="none";
}else{
ele.style.display="block";
}
}
});
}else{
var ele = document.getElementById(id);
if(typeof pageHeight!="number"){
if(document.compatMode=="CSS1Compat"){
pageHeight=document.documentElement.clientHeight;
}else{
pageHeight=document.body.clientHeight;
}
}
if(options.show) ele.style.display= 'block';
ele.style.top = 0 +'px';
window.addEventListener('scroll',function (){
if(options.autoHidden){
if(baidu.page.getScrollTop()==0){
ele.style.display="none";
}else{
ele.style.display="block";
}
}
},false);
}
}
fixedBar('backTopBtn' , {autoHidden: true, top : 186});
fixedBar('identifier-pannel' , {autoHidden: false , top : 956 , show : true});
}
})();
</script>
<div class='top_bar'> <div class='top_bar'>
<div id="identifier-pannel" style="display:none"> <div id="identifier-pannel" style="display:none">
<%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %> <%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
@ -98,59 +20,37 @@
</div> </div>
<div class="main-content-bar"> <div class="main-content-bar">
<div style="float: left"> <div style="float: left">
<%= image_tag(@logoLink, size:'75x75') %>
<% if params[:school_id].nil? and User.current.user_extensions.school.nil? %> </div>
<%= image_tag '/images/transparent.png', size: "75x75" %> <div class="welcome_left" >
<% else%> <br />
<% if params[:school_id] == "0" %> <span class="font_welcome_school"> <% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
<%= image_tag '/images/transparent.png', size: "75x75" %> <% else%>
<% else %> <% if params[:school_id] == "0" %>
<% if params[:school_id].nil? %> <% else %>
<% if School.find(User.current.user_extensions.school.id).logo_link.nil? %> <% if params[:school_id].nil? %>
<%= image_tag '/images/transparent.png', size: "75x75" %> <%= School.find(User.current.user_extensions.school.id).name %>
<br />
<% else %> <% else %>
<%= image_tag(School.find(User.current.user_extensions.school.id).logo_link, size: "75x75") %> <%= School.find(params[:school_id]).name %>
<br />
<% end %> <% end %>
<br />
<% else %>
<%= image_tag(School.find(params[:school_id]).logo_link, size: "75x75") %>
<br />
<% end %> <% end %>
<% end %> <% end %> </span>
<% end %>
</div>
<div class="welcome_left" >
<span class="font_welcome_school">
<% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
<% else%>
<% if params[:school_id] == "0" %>
<% else %>
<% if params[:school_id].nil? %>
<%= School.find(User.current.user_extensions.school.id).name %>
<br />
<% else %>
<%= School.find(params[:school_id]).name %>
<br />
<% end %>
<% end %>
<% end %>
</span>
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_course) %> </span> <span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_course) %> </span>
<% if params[:school_id].nil? and User.current.user_extensions.school.nil? %> <% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
<span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span> <span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span>
<% else %> <% else %>
<% if params[:school_id] == "0" %> <% if params[:school_id] == "0" %>
<span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span> <span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<div class="search-bar"> <div class="search-bar">
<%= render :partial => "search_project", :locals => {:project_type => Project::ProjectType_course}%> <%= render :partial => "search_project", :locals => {:project_type => Project::ProjectType_course}%>
</div> </div>
<div style="clear: both;"></div> <div style="clear: both;"></div>
</div> </div>
</div> </div>
@ -201,31 +101,6 @@
</div> </div>
</div> </div>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject hidden" style="float: right;">
<div class="web_status">
<h3 style="margin-left: 5px; color: #e8770d;"><strong>当前网站状态</strong></h3>
<table>
<tbody>
<tr>
<td>课程总量: <%#=@course.count%></td>
<td>教师数量: <%#=@teacher.count%></td>
</tr>
<tr>
<td>用户总量: <%#=User.count%></td>
<td>学生数量: <%#=@student.count%></td>
</tr>
<tr>
<td>资源总量: <%#=Attachment.count%></td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<div class='hidden' style="text-align: right; padding-right: 20px">
<%= link_to "意见反馈" , suggestion_send_path, {:class => 'orangeButton', :style => "color: #EEEEEE" }%>
</div>
</div>
</div>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;"> <div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<h3 style="padding-bottom:px ;margin-left: 5px; color: #e8770d;"> <h3 style="padding-bottom:px ;margin-left: 5px; color: #e8770d;">
<strong>问题和反馈动态</strong> <strong>问题和反馈动态</strong>

View File

@ -1,22 +1,11 @@
<%= stylesheet_link_tag 'welcome' %> <%= stylesheet_link_tag 'welcome' %>
<script type="text/javascript" language="javascript"> <%= javascript_include_tag 'welcome' %>
function clearInfo(id, content) { <script type="text/javascript" language="javascript">
var text = $('#' + id);
if (text.val() == content) {
$('#' + id).val('');
}
}
$(function(){ $(function(){
$("#main").find("a").attr("target", "_blank"); $("#main").find("a").attr("target", "_blank");
}); });
function showInfo(id, content) {
var text = $('#' + id);
if (text.val() == '') {
$('#' + id).val(content);
}
}
// 给主页用户弹新页面 // 给主页用户弹新页面
$(document).ready(function($) { $(document).ready(function($) {
$("#loggedas").find("a").attr("target", "_blank"); $("#loggedas").find("a").attr("target", "_blank");
@ -24,73 +13,6 @@
}); });
</script> </script>
<script type="text/javascript">
(function (){
window.onload = function(){
function fixedBar(id, options){
var ele = document.getElementById(id);
if(!ele) return;
if(/msie (\d+\.\d+)/i.test(navigator.userAgent)){
var pageHeight=window.innerHeight;
var d=document;
if(typeof pageHeight!="number"){
if(document.compatMode=="CSS1Compat"){
pageHeight=document.documentElement.clientHeight;
}else{
pageHeight=document.body.clientHeight;
}
}
var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop;
if(options.addclass) ele.className = options.addclass;
ele.style.position= 'absolute';
if(options.show){
ele.style.top = 0 + "px";
ele.style.display= 'block';
}
window.attachEvent('onscroll' , function (){
var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop;
ele.style.top = 0 + "px";
if(options.autoHidden){
if(ieScrollTop==0){
ele.style.display="none";
}else{
ele.style.display="block";
}
}
});
}else{
var ele = document.getElementById(id);
if(typeof pageHeight!="number"){
if(document.compatMode=="CSS1Compat"){
pageHeight=document.documentElement.clientHeight;
}else{
pageHeight=document.body.clientHeight;
}
}
if(options.show) ele.style.display= 'block';
ele.style.top = 0 +'px';
window.addEventListener('scroll',function (){
if(options.autoHidden){
if(baidu.page.getScrollTop()==0){
ele.style.display="none";
}else{
ele.style.display="block";
}
}
},false);
}
}
fixedBar('backTopBtn' , {autoHidden: true, top : 186});
fixedBar('identifier-pannel' , {autoHidden: false , top : 956 , show : true});
}
})();
</script>
<div class='top_bar'> <div class='top_bar'>
<div id="identifier-pannel" style="display:none"> <div id="identifier-pannel" style="display:none">
<%= link_to image_tag('/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" ), home_path %> <%= link_to image_tag('/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" ), home_path %>
@ -192,57 +114,7 @@
<% end %> <% end %>
</div> </div>
</ul> </ul>
</div> </div>
<!-- <div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<h3 style="margin-left: 5px; color: color: (51, 119, 51);"><strong>热门竞赛</strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", {:controller => 'bids', :action => 'contest', :project_type => 1, :host => Setting.contest_domain}, :target => "_blank" %></span>
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
<li style="background-image:none;">
<p class="layout">
<span style = "background: url('/images/007.gif') no-repeat scroll ;background-position: left center;"><%= link_to( contest.name, respond_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}",
:style => "margin-left: 28px;", :target => "_blank") %></span>
</p>
<p class="layout-1" >
<%= content_tag "span", contest.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => contest.description %>
</p>
</li>
<% end %>
</ul>
</div>
</div> -->
<!-- <div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<h3 style="margin-left: 5px; color: color: (51, 119, 51);"><strong>热门众包</strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", {:controller => 'bids', :action => 'index'}, :target => "_blank" %></span>
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<% find_all_hot_bid.map do |bid| break if(bid == find_all_hot_bid[5]) %>
<li style="background-image:none;">
<p class="layout">
<span style = "background: url('/images/007.gif') no-repeat scroll ;background-position: left center;"><%= link_to( bid.name, respond_path(bid.id), :class => "d-g-blue d-p-project-name", :title => "#{bid.name}",
:style => "margin-left: 28px;", :target => "_blank") %></span>
</p>
<p class="layout-1" >
<%= content_tag "span", bid.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => bid.description %>
</p>
</li>
<% end %>
</ul>
</div>
</div> -->
<br/><br/><br/><br/><br/><br/><br/>
<div class="clr">
</div>
<div style="padding-top: 40px"></div>
<div class="clearfix"></div> <div class="clearfix"></div>

View File

@ -1425,7 +1425,7 @@ zh:
label_has_praisers: 赞(%{count}) label_has_praisers: 赞(%{count})
label_has_watchers: 关注(%{count}) label_has_watchers: 关注(%{count})
label_has_fans: 粉丝(%{count}) label_has_fans: 粉丝(%{count})
label_coursefile_sharingarea: 课程资源共享 label_coursefile_sharingarea: 课程文件共享专
#modify by men #modify by men
label_x_has_fans: label_x_has_fans:
zero: 粉丝(%{count}) zero: 粉丝(%{count})
@ -1547,7 +1547,6 @@ zh:
label_sort_by_time: 按时间排序 label_sort_by_time: 按时间排序
label_sort_by_active: 按活跃度排序 label_sort_by_active: 按活跃度排序
label_sort_by_influence: 按影响力排序 label_sort_by_influence: 按影响力排序
label_sort_by_activity: 按动态数排序
label_bids_published: 发布于 label_bids_published: 发布于
label_bids_published_ago: 之前 label_bids_published_ago: 之前
label_welcome_trustie: Trustie label_welcome_trustie: Trustie
@ -1668,7 +1667,7 @@ zh:
label_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。) label_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。)
label_course_view_student: 查看其他课程 label_course_view_student: 查看其他课程
label_course_student: 学生 label_course_student: 学生
label_homework: 课程实践 label_homework: 课程作业
label_course_file: 资源库 #资料共享 label_course_file: 资源库 #资料共享
label_stores_index: 资源搜索 label_stores_index: 资源搜索
label_course_new_homework: 新建作业 label_course_new_homework: 新建作业
@ -1716,11 +1715,6 @@ zh:
zero: 份资料 zero: 份资料
one: 份资料 one: 份资料
other: 份资料 other: 份资料
#added by gcm
label_x_activity:
zero: 个动态
one: 个动态
other: 个动态
@ -1765,13 +1759,13 @@ zh:
label_has_been: 已经被 label_has_been: 已经被
label_course_userd_by: 个课程引用 label_course_userd_by: 个课程引用
label_school_all: 中国高校
role_of_course: 课程角色 role_of_course: 课程角色
label_student: 学生 label_student: 学生
#added by Wen
label_school_all: 中国高校
label_project_grade: 项目得分 label_project_grade: 项目得分
label_user_grade: 个人得分 label_user_grade: 个人得分
label_user_for_project_grade: 个人得分 label_user_for_project_grade: 个人得分
@ -1829,8 +1823,7 @@ zh:
label_sumbit_empty: 搜索内容不能为空 label_sumbit_empty: 搜索内容不能为空
#add by linchun (竞赛相关) #add by linchun (竞赛相关)
label_upload_files: 上传资源 label_upload_files: 上传文件
label_relation_files: 关联已有资源
label_upload_softwarepackage: 上传软件包 label_upload_softwarepackage: 上传软件包
label_upload_cuttingphoto: 上传截图 label_upload_cuttingphoto: 上传截图
label_contests_reward_method: 奖励方式 label_contests_reward_method: 奖励方式
@ -1869,8 +1862,19 @@ zh:
label_add_contest_succeed_fail: 添加失败,该应用已参赛. label_add_contest_succeed_fail: 添加失败,该应用已参赛.
label_no_ftapplication: 暂无应用 label_no_ftapplication: 暂无应用
label_edit_softapplication: 修改应用 label_edit_softapplication: 修改应用
label_contest_delete: 删除竞赛
label_softapplication_list: 应用列表
label_coursefile_sharingarea: 课程资源共享区
label_sort_by_activity: 按动态数排序
label_homework: 课程实践
label_x_activity:
zero: 个动态
one: 个动态
other: 个动态
label_school_all: 中国高校
label_upload_files: 上传资源
label_relation_files: 关联已有资源
label_contest_settings: 配置竞赛 label_contest_settings: 配置竞赛
label_contest_delete: 删除竞赛 label_contest_delete: 删除竞赛

View File

@ -581,6 +581,9 @@ RedmineApp::Application.routes.draw do
#######confusing######## #######confusing########
post 'school/get_options/:province', :to => 'school#get_options' post 'school/get_options/:province', :to => 'school#get_options'
get 'school/get_options/:province', :to => 'school#get_options' get 'school/get_options/:province', :to => 'school#get_options'
post 'school/get_province', :to => 'school#get_province'
get 'school/get_province', :to => 'school#get_province'
post 'school/get_schoollist/:province', :to => 'school#get_schoollist' post 'school/get_schoollist/:province', :to => 'school#get_schoollist'
get 'school/get_schoollist/:province', :to => 'school#get_schoollist' get 'school/get_schoollist/:province', :to => 'school#get_schoollist'
@ -588,6 +591,8 @@ RedmineApp::Application.routes.draw do
post 'school/search_school/', :to => 'school#search_school' post 'school/search_school/', :to => 'school#search_school'
get 'school/search_school/', :to => 'school#search_school' get 'school/search_school/', :to => 'school#search_school'
post 'school/upload', :to => 'school#upload'
######added by nie ######added by nie
match 'tags/show_projects_tags',:to => 'tags#show_projects_tags' match 'tags/show_projects_tags',:to => 'tags#show_projects_tags'
########### added by liuping ########### added by liuping

View File

@ -0,0 +1,15 @@
class ChangeDefaultLogoForSchool < ActiveRecord::Migration
def up
execute <<-SQL
UPDATE schools SET logo_link = '/images/school/default.png'
WHERE id <> 117
SQL
end
def down
execute <<-SQL
UPDATE schools SET logo_link = '/images/transparent.png'
WHERE id <> 117
SQL
end
end

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140424072458) do ActiveRecord::Schema.define(:version => 20140428013546) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
@ -23,15 +23,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type"
add_index "activities", ["user_id"], :name => "index_activities_on_user_id" add_index "activities", ["user_id"], :name => "index_activities_on_user_id"
create_table "apply_project_masters", :force => true do |t|
t.integer "user_id"
t.string "apply_type"
t.integer "apply_id"
t.integer "status"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "attachments", :force => true do |t| create_table "attachments", :force => true do |t|
t.integer "container_id" t.integer "container_id"
t.string "container_type", :limit => 30 t.string "container_type", :limit => 30
@ -71,20 +62,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type" add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type"
create_table "bak_mentioned", :primary_key => "Id", :force => true do |t|
t.string "this_real_name", :limit => 1000
t.integer "is_mentioned_in"
t.string "context", :limit => 2000
end
add_index "bak_mentioned", ["this_real_name", "is_mentioned_in"], :name => "name_mention", :length => {"this_real_name"=>900, "is_mentioned_in"=>nil}
add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name"
add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name_2"
add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name_3", :length => {"this_real_name"=>900}
add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name_4"
add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name_5"
add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name_6"
create_table "biding_projects", :force => true do |t| create_table "biding_projects", :force => true do |t|
t.integer "project_id" t.integer "project_id"
t.integer "bid_id" t.integer "bid_id"
@ -124,11 +101,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id"
add_index "boards", ["project_id"], :name => "boards_project_id" add_index "boards", ["project_id"], :name => "boards_project_id"
create_table "categories", :primary_key => "Id", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "proj_categories"
end
create_table "changes", :force => true do |t| create_table "changes", :force => true do |t|
t.integer "changeset_id", :null => false t.integer "changeset_id", :null => false
t.string "action", :limit => 1, :default => "", :null => false t.string "action", :limit => 1, :default => "", :null => false
@ -293,14 +265,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "documents", ["created_on"], :name => "index_documents_on_created_on" add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
add_index "documents", ["project_id"], :name => "documents_project_id" add_index "documents", ["project_id"], :name => "documents_project_id"
create_table "eco_projects", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.integer "eco_proj_id"
t.datetime "date_collected"
end
add_index "eco_projects", ["proj_id"], :name => "proj_id"
create_table "enabled_modules", :force => true do |t| create_table "enabled_modules", :force => true do |t|
t.integer "project_id" t.integer "project_id"
t.string "name", :null => false t.string "name", :null => false
@ -322,137 +286,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type"
add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id"
create_table "events", :primary_key => "event_id", :force => true do |t|
t.string "job_name"
t.datetime "event_time"
t.string "event_type", :limit => 20
end
create_table "fm_article", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "article_title", :limit => 16777215
t.text "article_link", :limit => 16777215
t.text "article_time", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_article", ["proj_id"], :name => "proj_id"
create_table "fm_bugtracker_link", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_bugtracker_link", ["proj_id"], :name => "proj_id"
create_table "fm_datametric_link", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_datametric_link", ["proj_id"], :name => "proj_id"
create_table "fm_dependency_link", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_dependency_link", ["proj_id"], :name => "proj_id"
create_table "fm_download_link", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "download_link", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_download_link", ["proj_id"], :name => "proj_id"
create_table "fm_heartbeat", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.float "popularity_score", :limit => 12
t.float "vitality_score", :limit => 12
t.integer "subscription"
t.integer "voting_score"
t.integer "voting_count"
t.datetime "date_collected"
end
add_index "fm_heartbeat", ["proj_id"], :name => "proj_id"
create_table "fm_license", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_license", ["proj_id"], :name => "proj_id"
create_table "fm_mailinglist_link", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_mailinglist_link", ["proj_id"], :name => "proj_id"
create_table "fm_operating_system", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_operating_system", ["proj_id"], :name => "proj_id"
create_table "fm_programming_language", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_programming_language", ["proj_id"], :name => "proj_id"
create_table "fm_project_spotlight", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.text "project_name", :limit => 16777215
t.text "project_spotlight_link", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_project_spotlight", ["proj_id"], :name => "proj_id"
create_table "fm_release", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.text "release_version", :limit => 16777215
t.text "release_time", :limit => 16777215
t.text "release_tag", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_release", ["proj_id"], :name => "proj_id"
create_table "fm_submit", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "submitter", :limit => 16777215
t.text "submitter_link", :limit => 16777215
t.text "submit_time", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_submit", ["proj_id"], :name => "proj_id"
create_table "fm_summary", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.text "description", :limit => 16777215
t.datetime "date_collected"
end
add_index "fm_summary", ["proj_id"], :name => "proj_id"
create_table "forums", :force => true do |t| create_table "forums", :force => true do |t|
t.string "name", :null => false t.string "name", :null => false
t.string "description", :default => "" t.string "description", :default => ""
@ -685,22 +518,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "news", ["created_on"], :name => "index_news_on_created_on" add_index "news", ["created_on"], :name => "index_news_on_created_on"
add_index "news", ["project_id"], :name => "news_project_id" add_index "news", ["project_id"], :name => "news_project_id"
create_table "no_uses", :force => true do |t|
t.integer "user_id", :null => false
t.string "no_use_type"
t.integer "no_use_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "ohloh_tagged", :force => true do |t|
t.integer "proj_id", :default => 0, :null => false
t.string "description", :limit => 100, :null => false
t.datetime "date_collected"
end
add_index "ohloh_tagged", ["proj_id"], :name => "proj_id"
create_table "open_id_authentication_associations", :force => true do |t| create_table "open_id_authentication_associations", :force => true do |t|
t.integer "issued" t.integer "issued"
t.integer "lifetime" t.integer "lifetime"
@ -716,19 +533,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
t.string "salt", :null => false t.string "salt", :null => false
end end
create_table "open_source_projects", :force => true do |t|
t.string "name"
t.text "description"
t.integer "commit_count", :default => 0
t.integer "code_line", :default => 0
t.integer "users_count", :default => 0
t.date "last_commit_time"
t.string "url"
t.date "date_collected"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "praise_tread_caches", :force => true do |t| create_table "praise_tread_caches", :force => true do |t|
t.integer "object_id", :null => false t.integer "object_id", :null => false
t.string "object_type" t.string "object_type"
@ -808,23 +612,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "queries", ["project_id"], :name => "index_queries_on_project_id" add_index "queries", ["project_id"], :name => "index_queries_on_project_id"
add_index "queries", ["user_id"], :name => "index_queries_on_user_id" add_index "queries", ["user_id"], :name => "index_queries_on_user_id"
create_table "relative_memos", :force => true do |t|
t.integer "osp_id", :null => false
t.integer "parent_id"
t.string "subject", :null => false
t.text "content", :null => false
t.integer "author_id"
t.integer "replies_count", :default => 0
t.integer "last_reply_id"
t.boolean "lock", :default => false
t.boolean "sticky", :default => false
t.boolean "is_quote", :default => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "viewed_count_crawl", :default => 0
t.integer "viewed_count_local", :default => 0
end
create_table "repositories", :force => true do |t| create_table "repositories", :force => true do |t|
t.integer "project_id", :default => 0, :null => false t.integer "project_id", :default => 0, :null => false
t.string "url", :default => "", :null => false t.string "url", :default => "", :null => false
@ -983,22 +770,6 @@ ActiveRecord::Schema.define(:version => 20140424072458) do
add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id" add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id"
add_index "tokens", ["value"], :name => "tokens_value", :unique => true add_index "tokens", ["value"], :name => "tokens_value", :unique => true
create_table "tprojects", :force => true do |t|
t.string "name", :limit => 1000, :default => "0"
t.text "description", :limit => 16777215
t.string "commit_count", :limit => 100, :default => "0"
t.string "code_line", :limit => 100
t.string "last_commit_time", :limit => 100
t.string "url", :limit => 1000
t.datetime "date_collected"
t.string "created_at", :limit => 100
t.string "updated_at", :limit => 100
t.integer "proj_id", :null => false
t.string "user_count", :limit => 100
end
add_index "tprojects", ["proj_id"], :name => "proj_id"
create_table "trackers", :force => true do |t| create_table "trackers", :force => true do |t|
t.string "name", :limit => 30, :default => "", :null => false t.string "name", :limit => 30, :default => "", :null => false
t.boolean "is_in_chlog", :default => false, :null => false t.boolean "is_in_chlog", :default => false, :null => false

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

View File

@ -0,0 +1,64 @@
(function () {
window.onload = function(){
function fixedBar(id, options){
var ele = document.getElementById(id);
if(!ele) return;
if(/msie (\d+\.\d+)/i.test(navigator.userAgent)){
var pageHeight=window.innerHeight;
var d=document;
if(typeof pageHeight!="number"){
if(document.compatMode=="CSS1Compat"){
pageHeight=document.documentElement.clientHeight;
}else{
pageHeight=document.body.clientHeight;
}
}
var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop;
if(options.addclass) ele.className = options.addclass;
ele.style.position= 'absolute';
if(options.show){
ele.style.top = 0 + "px";
ele.style.display= 'block';
}
window.attachEvent('onscroll' , function (){
var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop;
ele.style.top = 0 + "px";
if(options.autoHidden){
if(ieScrollTop==0){
ele.style.display="none";
}else{
ele.style.display="block";
}
}
});
}else{
var ele = document.getElementById(id);
if(typeof pageHeight!="number"){
if(document.compatMode=="CSS1Compat"){
pageHeight=document.documentElement.clientHeight;
}else{
pageHeight=document.body.clientHeight;
}
}
if(options.show) ele.style.display= 'block';
ele.style.top = 0 +'px';
window.addEventListener('scroll',function (){
if(options.autoHidden){
if(baidu.page.getScrollTop()==0){
ele.style.display="none";
}else{
ele.style.display="block";
}
}
},false);
}
}
fixedBar('backTopBtn' , {autoHidden: true, top : 186});
fixedBar('identifier-pannel' , {autoHidden: false , top : 956 , show : true});
}
})();

View File

@ -624,7 +624,7 @@ ul.tool li{list-style-type:none;
font-family: Tahoma,"Microsoft YaHei"; font-family: Tahoma,"Microsoft YaHei";
font-weight: bold; font-weight: bold;
font-size: 20px; font-size: 20px;
color:#FF9900; color:#e8770d;
} }
.font_welcome_Cdescription{ .font_welcome_Cdescription{

View File

@ -235,7 +235,7 @@ body {
top: 200px; top: 200px;
} }
#WOpenWindow .school_list{ #WOpenWindow .school_list{
width1000px; width: 900px;
line-height: 20px; line-height: 20px;
} }
@ -257,6 +257,12 @@ body {
} }
#WOpenWindow .content{ #WOpenWindow .content{
width: 1000px; width: 1000px;
height: 220px;
overflow: scroll;
}
#WOpenWindow .pcontent{
} }

View File

@ -2247,130 +2247,4 @@ ul.messages-for-user-reply li {
.footer_text_link{ .footer_text_link{
margin: 0px 5px; margin: 0px 5px;
} }
/*gcm*/ /*gcm*/
#ver-zebra, .file_table_des
{
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
margin: 5px 10px;
width: 98%;
text-align: left;
border-collapse: collapse;
line-height: 20px;
font-size: 14px;
}
#ver-zebra th
{
font-size: 14px;
font-weight: normal;
padding: 12px 15px;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #039;
text-align: left;
}
#ver-zebra td
{
padding: 8px 15px;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #669;
}
#ver-zebra td.description {
background-color: white;
padding: 0px;
margin: 0px auto;
}
div.tags_area {
padding: 2px 10px 10px 10px;
margin: 0px;
margin-bottom: 10px;
/*border-bottom: 1px dashed #CCCCCC;*/
overflow: hidden;
position: relative;
}
.tags_gradint {
}
.read-more{
padding: 5px;
border-top: 4px double #ddd;
background: #fff;
color: #333;
}
.read-more a{
padding-right: 22px;
background: url() no-repeat 100% 50%;
font-weight: bold;
text-decoration: none;
}
.read-more a:hover{
color: #000;
}
.vzebra-odd
{
background: #eff2ff;
}
.vzebra-even
{
background: #e8edff;
}
#ver-zebra #vzebra-adventure, #ver-zebra #vzebra-children
{
background: #ffffff;
border-bottom: 1px solid #c8d4fd;
}
#ver-zebra #vzebra-comedy, #ver-zebra #vzebra-action
{
background: #ffffff;
border-bottom: 1px solid #d6dfff;
}
.filename{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
div.pagination{
margin: 10px 0px;
height: 1.5em;
text-align: left;
font-size: 13px;
}
.m5p5{
display: inline-block;
height: auto;
color: white !important;
margin: 8px;
padding: 3px 7px;
}
.m5p5:hover {
text-decoration: none;
/*padding-bottom: 3px;*/
/*border-bottom: 1px solid #666666;*/
border-radius: 4px;
border: 1px solid #15bccf;
box-shadow: 3px 3px 3px #666666;
}
.relation_file_div{
margin: 0px 25px;
}
.relation_file_div fieldset{
margin: 0px 0px;
padding: 10px;
border-radius: 5px;
transition: all 2s linear 1s;
}
.relation_file_div input#attach_search:focus{
border: 1px solid #1B95C6;
box-shadow: 0px 0px 4px #1B95C6;
width: 200px;
}
.relation_file_div input#attach_search{
width: 150px;
outline: none;
border-radius: 5px;
-webkit-transition: 1s width;
-moz-transition : 1s width;
-o-transition : 1s width;
transition : 1s width;
}