Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop
This commit is contained in:
commit
b167193172
|
@ -49,7 +49,7 @@ class ProjectsController < ApplicationController
|
|||
# before_filter :authorize, :except => [:new_join, :new_homework, :homework, :statistics, :search, :watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file,
|
||||
# :statistics, :feedback, :course, :enterprise_course, :course_enterprise, :project_respond, :share,
|
||||
# :show_projects_score, :issue_score_index, :news_score_index, :file_score_index, :code_submit_score_index, :projects_topic_score_index]
|
||||
before_filter :authorize, :only => [:sort_project_demo, :show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen]
|
||||
before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen]
|
||||
before_filter :authorize_global, :only => [:new, :create]
|
||||
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
|
||||
#by young
|
||||
|
@ -127,32 +127,39 @@ class ProjectsController < ApplicationController
|
|||
def index
|
||||
#Modified by nie
|
||||
@project_type = params[:project_type]
|
||||
@limit = 10
|
||||
@project_count = Project.visible.where("project_type = ?", 0).count
|
||||
@project_pages = Paginator.new @project_count, @limit, params['page']
|
||||
if params[:project_sort_type].present?
|
||||
case params[:project_sort_type]
|
||||
when '0'
|
||||
@projects = @projects = Project.visible.where("project_type = ?", 0).order("created_on desc").offset(@project_pages.offset).limit(@limit).all
|
||||
@s_type = 0
|
||||
when '1'
|
||||
@projects = sort_project_demo project_type = 0, order_by="grade desc", @project_pages.offset, @limit
|
||||
@s_type = 1
|
||||
when '2'
|
||||
@projects = sort_project_demo project_type = 0, order_by="watchers_count desc", @project_pages.offset, @limit
|
||||
@s_type = 2
|
||||
end
|
||||
per_page_option = 10
|
||||
|
||||
@projects_all = Project.active.visible.
|
||||
joins("LEFT JOIN #{ProjectStatus.table_name} ON #{Project.table_name}.id = #{ProjectStatus.table_name}.project_id").
|
||||
where("#{Project.table_name}.project_type = ? ", Project::ProjectType_project)
|
||||
|
||||
@project_count = @projects_all.count
|
||||
@project_pages = Paginator.new @project_count, per_page_option, params['page']
|
||||
|
||||
|
||||
case params[:project_sort_type]
|
||||
when '0'
|
||||
@projects = @projects_all.order("created_on desc")
|
||||
@s_type = 0
|
||||
when '1'
|
||||
@projects = @projects_all.order("grade desc")
|
||||
@s_type = 1
|
||||
when '2'
|
||||
@projects = @projects_all.order("watchers_count desc")
|
||||
@s_type = 2
|
||||
else
|
||||
@projects = sort_project_demo project_type = 0, order_by="grade desc", @project_pages.offset, @limit
|
||||
@s_type = 1
|
||||
@projects = @projects = @projects_all.order("grade desc")
|
||||
@s_type = 1
|
||||
end
|
||||
@projects = @projects.offset(@project_pages.offset).limit(@project_pages.per_page)
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
render :layout => 'base'
|
||||
scope = Project
|
||||
unless params[:closed]
|
||||
scope = scope.active
|
||||
end
|
||||
# scope = Project
|
||||
# unless params[:closed]
|
||||
# scope = scope.active
|
||||
# end
|
||||
}
|
||||
format.api {
|
||||
# @offset, @limit = api_offset_and_limit
|
||||
|
@ -168,34 +175,34 @@ class ProjectsController < ApplicationController
|
|||
|
||||
def course
|
||||
@project_type = params[:project_type]
|
||||
@limit = 10;
|
||||
@project_count = Project.visible.where("project_type = 1").count
|
||||
@project_pages = Paginator.new @project_count, @limit, params['page']
|
||||
if params[:project_sort_type].present?
|
||||
case params[:project_sort_type]
|
||||
when '0'
|
||||
@projects = Project.visible.where("project_type = ?", 1).order("created_on desc").offset(@project_pages.offset).limit(@limit).all
|
||||
@s_type = 0
|
||||
when '1'
|
||||
@projects = sort_project_demo 1, "course_ac_para desc", @project_pages.offset, @limit
|
||||
@s_type = 1
|
||||
when '2'
|
||||
@projects = sort_project_demo 1, "watchers_count desc", @project_pages.offset, @limit
|
||||
@s_type = 2
|
||||
end
|
||||
per_page_option = 10
|
||||
|
||||
@projects_all = Project.active.visible.
|
||||
joins("LEFT JOIN #{ProjectStatus.table_name} ON #{Project.table_name}.id = #{ProjectStatus.table_name}.project_id").
|
||||
where("#{Project.table_name}.project_type = ? ", Project::ProjectType_course)
|
||||
|
||||
@project_count = @projects_all.count
|
||||
@project_pages = Paginator.new @project_count, per_page_option, params['page']
|
||||
|
||||
case params[:project_sort_type]
|
||||
when '0'
|
||||
@projects = @projects_all.order("created_on desc")
|
||||
@s_type = 0
|
||||
when '1'
|
||||
@projects = @projects_all.order("course_ac_para desc")
|
||||
@s_type = 1
|
||||
when '2'
|
||||
@projects = @projects_all.order("watchers_count desc")
|
||||
@s_type = 2
|
||||
else
|
||||
# @projects = sort_project_demo 1, "course_ac_para desc", @project_pages.offset, @limit
|
||||
@s_type = 0
|
||||
@projects = Project.visible.where("project_type = ?", 1).order("created_on desc").offset(@project_pages.offset).limit(@limit).all
|
||||
# @s_type = 0
|
||||
@s_type = 0
|
||||
@projects = @projects_all.order("created_on desc")
|
||||
end
|
||||
@projects = @projects.offset(@project_pages.offset).limit(@project_pages.per_page)
|
||||
|
||||
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
|
||||
|
@ -208,17 +215,8 @@ class ProjectsController < ApplicationController
|
|||
}
|
||||
end
|
||||
end
|
||||
|
||||
def sort_project_demo project_type, order_by, offset, limit
|
||||
#Project.visible.joins(:project_status).where("#{Project.table_name}.project_type = ?", project_type).order(order_by).offset(offset).limit(limit).all
|
||||
Project.visible.find_by_sql("
|
||||
SELECT *
|
||||
FROM projects AS p RIGHT OUTER JOIN (
|
||||
SELECT project_id,grade FROM project_statuses
|
||||
WHERE project_type = #{project_type} ORDER BY #{order_by} LIMIT #{limit} OFFSET #{offset}) AS t ON p.id = t.project_id ")
|
||||
end
|
||||
|
||||
def search
|
||||
|
||||
def search
|
||||
#modified by nie
|
||||
@projects = Project.visible
|
||||
@projects = @projects.visible.where('project_type = ?', params[:project_type]).like(params[:name]) if params[:name].present?
|
||||
|
@ -298,10 +296,17 @@ class ProjectsController < ApplicationController
|
|||
#Ended by young
|
||||
|
||||
def feedback
|
||||
page = params[:page]
|
||||
# Find the page of the requested reply
|
||||
@jours = @project.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
|
||||
@limit = 10
|
||||
if params[:r] && page.nil?
|
||||
offset = @jours.count(:conditions => ["#{JournalsForMessage.table_name}.id > ?", params[:r].to_i])
|
||||
page = 1 + offset / @limit
|
||||
end
|
||||
|
||||
@feedback_count = @jours.count
|
||||
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||
@feedback_pages = Paginator.new @feedback_count, @limit, page
|
||||
@offset ||= @feedback_pages.offset
|
||||
@jour = @jours[@offset, @limit]
|
||||
@state = false
|
||||
|
@ -461,7 +466,7 @@ class ProjectsController < ApplicationController
|
|||
project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id)
|
||||
user_grades = UserGrade.create(:user_id => User.current.id, :project_id => @project.id)
|
||||
if params[:project][:is_public] == '1' || @course_tag=="1"
|
||||
project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0)
|
||||
project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0, :project_type => @project.project_type)
|
||||
end
|
||||
@project.members << m
|
||||
@project.project_infos << project
|
||||
|
|
|
@ -65,7 +65,7 @@ module ApplicationHelper
|
|||
if user.is_a?(User)
|
||||
name = h(user.name(options[:format]))
|
||||
if user.active? || (User.current.admin? && user.logged?)
|
||||
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.forge_domain}, :class => user.css_classes
|
||||
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => user.css_classes
|
||||
else
|
||||
name
|
||||
end
|
||||
|
@ -1500,20 +1500,20 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def render_dynamic_nav
|
||||
home_link = link_to l(:field_homepage), {:controller => 'welcome', :action => 'index',:host => Setting.forge_domain}
|
||||
home_link = link_to l(:field_homepage), {:controller => 'welcome', :action => 'index'}
|
||||
course_all_course_link = link_to l(:label_course_all), {:controller => 'projects', :action => 'course', :project_type => 1}
|
||||
course_teacher_all_link = link_to l(:label_teacher_all), {:controller => 'users', :action => 'index', :role => 'teacher'}
|
||||
courses_link = link_to l(:label_course_practice), {:controller => 'projects', :action => 'course', :project_type => 1, :host=>Setting.course_domain}
|
||||
projects_link = link_to l(:label_project_deposit), {:controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}
|
||||
courses_link = link_to l(:label_course_practice), {:controller => 'projects', :action => 'course', :project_type => 1}
|
||||
projects_link = link_to l(:label_project_deposit), {:controller => 'projects', :action => 'index', :project_type => 0}
|
||||
users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index'}
|
||||
contest_link = link_to l(:label_contest_innovate), {:controller => 'bids', :action => 'contest', :project_type => 1, :host=>Setting.contest_domain}
|
||||
contest_link = link_to l(:label_contest_innovate), {:controller => 'bids', :action => 'contest', :project_type => 1 }
|
||||
bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'}
|
||||
forum_link = link_to l(:label_project_module_forums), {:controller => "forums", :action => "index", :host => Setting.forge_domain}
|
||||
stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index', :host => Setting.forge_domain}
|
||||
forum_link = link_to l(:label_project_module_forums), {:controller => "forums", :action => "index"}
|
||||
stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'}
|
||||
|
||||
#@nav_dispaly_project_label
|
||||
nav_list = Array.new
|
||||
nav_list.push(home_link)
|
||||
nav_list.push(home_link)
|
||||
nav_list.push(course_all_course_link) if @nav_dispaly_course_all_label
|
||||
nav_list.push(course_teacher_all_link) if @nav_dispaly_teacher_all_label
|
||||
|
||||
|
|
|
@ -9,8 +9,13 @@ module CoursesHelper
|
|||
=end
|
||||
TeacherRoles = [3, 4, 7, 9]
|
||||
StudentRoles = [5, 10]
|
||||
|
||||
AllPeople = StudentRoles+TeacherRoles
|
||||
## return people count
|
||||
|
||||
# 返回x项目成员数量,即roles表中定义的所有成员
|
||||
def projectCount project
|
||||
searchCountByRoles project, AllPeople
|
||||
end
|
||||
|
||||
# 返回教师数量,即roles表中定义的Manager
|
||||
def teacherCount project
|
||||
|
|
|
@ -25,7 +25,7 @@ module JournalsHelper
|
|||
links = []
|
||||
if !journal.notes.blank?
|
||||
links << link_to(l(:button_quote),
|
||||
{:controller => 'journals', :action => 'new', :id => issue, :journal_id => journal},
|
||||
{:controller => 'journals', :action => 'new', :id => issue.id, :journal_id => journal},
|
||||
:remote => true,
|
||||
:method => 'post',
|
||||
:title => l(:button_quote)) if options[:reply_links]
|
||||
|
|
|
@ -285,6 +285,7 @@ module ProjectsHelper
|
|||
SELECT project_id,grade FROM project_statuses
|
||||
WHERE project_type = 0 ORDER BY grade DESC LIMIT #{limit} ) AS t ON p.id = t.project_id ")
|
||||
end
|
||||
|
||||
|
||||
# 判断课程是否结束,快别用,这个定日子的方法有问题
|
||||
def course_timeout? project
|
||||
|
|
|
@ -39,6 +39,13 @@ module WelcomeHelper
|
|||
end
|
||||
end
|
||||
|
||||
def get_project_avatar project
|
||||
if get_avatar?(project)
|
||||
url_to_avatar(project)
|
||||
else
|
||||
'../images/avatars/Project/project.jpg'
|
||||
end
|
||||
end
|
||||
# 前略·天国の首页君/Earth has been unable stop to welcomePage's.
|
||||
# sum - 要搜索的项目数量
|
||||
# max_rate - 新项目所占所有项目的比重,10分制
|
||||
|
@ -56,10 +63,22 @@ module WelcomeHelper
|
|||
c2 = c2 - c1
|
||||
(c1.take(max)+c2).take(sum)
|
||||
end
|
||||
|
||||
|
||||
def find_miracle_project(sum, max_rate)
|
||||
max = sum*(max_rate.to_f/10)
|
||||
c1 = find_new_project(sum).to_a.dup
|
||||
c2 = find_all_hot_project(sum).to_a.dup
|
||||
(c2.take(sum-max)+c1.take(max)).take(sum)
|
||||
end
|
||||
|
||||
def find_new_course limit=15
|
||||
Project.visible.joins(:course_extra).where("#{Project.table_name}.project_type = ? ", 1).order("courses.time DESC, #{Project.table_name}.created_on DESC").limit(limit).all
|
||||
end
|
||||
|
||||
def find_new_project limit=15
|
||||
Project.visible.where("#{Project.table_name}.project_type = ? ", 0).order("#{Project.table_name}.updated_on DESC, #{Project.table_name}.created_on DESC").limit(limit).all
|
||||
end
|
||||
|
||||
|
||||
def find_all_hot_project limit=15
|
||||
sort_project_by_hot limit
|
||||
|
@ -214,7 +233,7 @@ module WelcomeHelper
|
|||
"show_news" => true,
|
||||
"show_bids" => true
|
||||
}
|
||||
activity.scope_select{|t| ['changesets', 'documents', 'memos', 'messages', 'journals_for_messages'].include?(t) ? nil : 'You may think you know what the following code does, may be. but why don"t you close this file and go play with something else, Now?' }
|
||||
activity.scope_select{|t| ['changesets', 'documents', 'memos', 'messages', 'journals_for_messages', 'bids', 'news'].include?(t) ? nil : 'You may think you know what the following code does, may be. but why don"t you close this file and go play with something else, Now?' }
|
||||
activity.events_welcome(nil, nil, {:limit => limit, :types => 'welcome'})
|
||||
end
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class Issue < ActiveRecord::Base
|
|||
# sort by id so that limited eager loading doesn't break with postgresql
|
||||
:order_column => "#{table_name}.id"
|
||||
acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id} (#{o.status}): #{o.subject}"},
|
||||
:url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}},
|
||||
:url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o}},
|
||||
:type => Proc.new {|o| 'issue' + (o.closed? ? ' closed' : '') }
|
||||
|
||||
acts_as_activity_provider :find_options => {:include => [:project, :author, :tracker]},
|
||||
|
@ -212,9 +212,14 @@ class Issue < ActiveRecord::Base
|
|||
@workflow_rule_by_attribute = nil
|
||||
@assignable_versions = nil
|
||||
@relations = nil
|
||||
@to_param = nil
|
||||
base_reload(*args)
|
||||
end
|
||||
|
||||
def to_param
|
||||
@to_param ||= "#{id}_#{self.project.name}(#{self.project.issues.index(self)+1}-#{self.project.issues.count})"#.parameterize
|
||||
end
|
||||
|
||||
# Overrides Redmine::Acts::Customizable::InstanceMethods#available_custom_fields
|
||||
def available_custom_fields
|
||||
(project && tracker) ? (project.all_issue_custom_fields & tracker.custom_fields.all) : []
|
||||
|
|
|
@ -27,8 +27,10 @@ class JournalsForMessage < ActiveRecord::Base
|
|||
:datetime => Proc.new {|o| o.updated_on },
|
||||
:author => Proc.new {|o| o.user },
|
||||
:description => Proc.new{|o| o.notes },
|
||||
:type => Proc.new {|o| o.jour_type }#,
|
||||
#:url => Proc.new {|o| ''}#{:controller => 'documents', :action => 'show', :id => o.id}}
|
||||
:type => Proc.new {|o| o.jour_type },
|
||||
:url => Proc.new {|o|
|
||||
(o.jour.kind_of? Project) ? {:controller => 'projects', :action => 'feedback', :id => o.jour, :r => o.id, :anchor => "word_li_#{o.id}"} : {}
|
||||
}#{:controller => 'documents', :action => 'show', :id => o.id}}
|
||||
acts_as_activity_provider :author_key => :user_id,
|
||||
:timestamp => "#{self.table_name}.updated_on",
|
||||
:find_options => {:include => :project }
|
||||
|
|
|
@ -9,14 +9,14 @@
|
|||
<div class="next-prev-links contextual">
|
||||
<%= link_to_if @prev_issue_id,
|
||||
"\xc2\xab #{l(:label_previous)}",
|
||||
(@prev_issue_id ? issue_path(@prev_issue_id) : nil),
|
||||
(@prev_issue_id ? issue_path(Issue.find_by_id(@prev_issue_id)) : nil),
|
||||
:title => "##{@prev_issue_id}" %> |
|
||||
<% if @issue_position && @issue_count %>
|
||||
<span class="position"><%= l(:label_item_position, :position => @issue_position, :count => @issue_count) %></span> |
|
||||
<% end %>
|
||||
<%= link_to_if @next_issue_id,
|
||||
"#{l(:label_next)} \xc2\xbb",
|
||||
(@next_issue_id ? issue_path(@next_issue_id) : nil),
|
||||
(@next_issue_id ? issue_path(Issue.find_by_id(@next_issue_id)) : nil),
|
||||
:title => "##{@next_issue_id}" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -87,7 +87,7 @@ end %>
|
|||
<% if @issue.description? %>
|
||||
<div class="description">
|
||||
<div class="contextual">
|
||||
<%= link_to l(:button_quote), quoted_issue_path(@issue), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
|
||||
<%= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
|
||||
</div>
|
||||
|
||||
<p><strong><%=l(:field_description)%></strong></p>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
<li><%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.course_domain} %></li>
|
||||
<% end -%>
|
||||
<li><%=link_to l(:label_my_projects),{:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %></li>
|
||||
<li><%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.forge_domain}%></li>
|
||||
<li><%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li style="padding:0 0; margin:0 0;display:inline;border-bottom: 0;">
|
||||
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.forge_domain }, {:class => 'my-message'} if User.current.logged?%>
|
||||
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.user_domain }, {:class => 'my-message'} if User.current.logged?%>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
@nav_dispaly_bid_label = 1
|
||||
elsif (realUrl.match(/forums/))
|
||||
@nav_dispaly_forum_label = 1
|
||||
elsif (realUrl.match(/[^projects]\/course[^\.]/))
|
||||
elsif (realUrl.match(/[^forge]\/course[^\.]/))
|
||||
@nav_dispaly_course_label = 1
|
||||
@nav_dispaly_project_label = 1
|
||||
@nav_dispaly_contest_label = 1
|
||||
|
@ -21,6 +21,14 @@
|
|||
@nav_dispaly_course_all_label = 1
|
||||
@nav_dispaly_teacher_all_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
elsif (realUrl.match(/user\.trustie\.net/))
|
||||
@nav_dispaly_project_label = 1
|
||||
@nav_dispaly_user_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
elsif (realUrl.match(/forge\.trustie\.net/))
|
||||
@nav_dispaly_project_label = 1
|
||||
@nav_dispaly_user_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
else
|
||||
@nav_dispaly_course_label = 1
|
||||
@nav_dispaly_project_label = 1
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
<div class="pagination">
|
||||
<ul>
|
||||
<%= pagination_links_full @project_pages %>
|
||||
<%= pagination_links_full @project_pages, @project_count %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
<div class="pagination">
|
||||
<ul>
|
||||
<%= pagination_links_full @project_pages %>
|
||||
<%= pagination_links_full @project_pages, @project_count %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<%= form_tag(:controller => 'projects', :action => "search", :method => :get) do %>
|
||||
<div class="project-search" style="float: right">
|
||||
<%= text_field_tag 'name', params[:name], placeholder:'请输入要搜索的关键字', :size => 30 %>
|
||||
<%= hidden_field_tag 'project_type', project_type %>
|
||||
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
||||
</div>
|
||||
<% end %>
|
|
@ -95,7 +95,8 @@
|
|||
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie_course) %> </span><span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_course_description) %></span>
|
||||
</div>
|
||||
<div class="search-bar">
|
||||
<%= render :partial => "search_bar"%>
|
||||
<%= render :partial => "search_project", :locals => {:project_type => 1}%>
|
||||
<div class='font_lighter' style="margin: 0; padding: 0; margin-top: 4px;">全站课程搜索。</div>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
|
|
|
@ -87,15 +87,16 @@
|
|||
</script>
|
||||
<div class='top_bar'>
|
||||
<div id="identifier-pannel" style="display:none">
|
||||
<%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
|
||||
<%= link_to image_tag('/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" ), home_path %>
|
||||
<div class="weixin-content">微信扫码</div>
|
||||
</div>
|
||||
<div class="main-content-bar">
|
||||
<div class="welcome_left" >
|
||||
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie_project) %> </span><span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_project_description) %></span>
|
||||
</div>
|
||||
<div class="search-bar">
|
||||
<%= render :partial => "search_bar"%>
|
||||
<div class="search-bar">
|
||||
<%= render :partial => "search_project", :locals => {:project_type => 0}%>
|
||||
<div class='font_lighter' style="margin: 0; padding: 0; margin-top: 4px;">全站项目搜索。不会搜索私有项目</div>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
|
@ -105,11 +106,63 @@
|
|||
|
||||
|
||||
<%= stylesheet_link_tag 'welcome' %>
|
||||
|
||||
|
||||
<div class="left" style="float: left; min-height: 470px; width: 48%;">
|
||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
|
||||
<h3 style="margin-left: 5px; color: #e8770d;"><strong>热门项目</strong></h3>
|
||||
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}, :target => "_blank" %></span>
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_miracle_project(10, 3).map do |project| %>
|
||||
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
|
||||
<div style="float: left;">
|
||||
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
|
||||
</div>
|
||||
<!-- 上左下右 -->
|
||||
<div style="float: left; margin-left: 10px; width: 380px;">
|
||||
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
|
||||
(<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
|
||||
</div>
|
||||
<div style="float: left;margin:5px; margin-left: 10px; width: 380px;">
|
||||
<span class='font_lighter' title =<%=project.description.to_s%>><%=project.description.truncate(50, omission: '...')%></span>
|
||||
</div>
|
||||
<div style="position:absolute; bottom:0;right:0;margin:5px 10px 5px 5px ;">
|
||||
<%= content_tag "span", show_grade(project),
|
||||
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300; ",
|
||||
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
|
||||
:class => "tooltip",
|
||||
:id => "tooltip-#{project.id}" %>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
<% end; reset_cycle %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
||||
<ul class="user-welcome-message-list">
|
||||
<h3 style="color: rgb(21, 188, 207)"><strong>用户动态</strong></h3>
|
||||
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'users', :action => 'index'}, :target => "_blank" %></span>
|
||||
<div class="user-message-box-list" style="margin-top: 10px;">
|
||||
<% find_all_activities.each do |event| %>
|
||||
<li style="display: block;height:60px; padding-bottom: 4px;">
|
||||
<div class="inner-right" style="float: left; height: 100%; ">
|
||||
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
|
||||
</div>
|
||||
|
||||
<div class="inner-right" style="float: right; width:86%; height: 100%; ">
|
||||
<span style="color: green;"><%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;", :target => "_blank" %></span><%= show_user_content event %>
|
||||
<p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前</span> <span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="right" style="float: right; min-height: 470px; width: 48%; ">
|
||||
<ul class="welcome-message-list">
|
||||
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 6px;">
|
||||
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
|
||||
<h3 style="color: rgb(21, 188, 207);"><strong>贴吧动态</strong></h3>
|
||||
<span style="margin-top: -30px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span>
|
||||
</div>
|
||||
|
@ -133,88 +186,8 @@
|
|||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="right" style="float: right; min-height: 470px; width: 48%; ">
|
||||
<ul class="user-welcome-message-list">
|
||||
<h3 style="color: rgb(21, 188, 207)"><strong>用户动态</strong></h3>
|
||||
<span style="margin-top: -30px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'users', :action => 'index'}, :target => "_blank" %></span>
|
||||
<div class="user-message-box-list">
|
||||
<% find_all_activities.each do |event| %>
|
||||
<li style="display: block;height:60px; padding-bottom: 4px;">
|
||||
<div class="inner-right" style="float: left; height: 100%; ">
|
||||
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
|
||||
</div>
|
||||
|
||||
<div class="inner-right" style="float: right; width:86%; height: 100%; ">
|
||||
<span style="color: green;"><%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;", :target => "_blank" %></span><%= show_user_content event %>
|
||||
<p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前</span> <span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
|
||||
<h3 style="margin-left: 5px; color: #e8770d;"><strong>热门项目</strong></h3>
|
||||
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}, :target => "_blank" %></span>
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_all_hot_project.map do |project| break if(project == find_all_hot_project[15]) %>
|
||||
<li style="background-image:none;">
|
||||
<div style="float: left;">
|
||||
<%= image_tag url_to_avatar(project), :class => "avatar-4" %>
|
||||
</div>
|
||||
<div style="float: left; margin-left: 10px; width: 360px;">
|
||||
<p class="layout">
|
||||
<span style="display: inline-block; width: 250px;"><%= link_to( project.name, :controller => 'projects', :action => 'show', :host=> Setting.project_domain, :id => project.id, :class => "d-g-blue d-p-project-name", :title => "#{project.name}", :target => "_blank" )%></span>
|
||||
<%= content_tag "span", show_grade(project),
|
||||
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300; ",
|
||||
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
|
||||
:class => "tooltip",
|
||||
:id => "tooltip-#{project.id}" %>
|
||||
</p>
|
||||
<p class="layout-1" >
|
||||
<%= content_tag "span", project.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => project.description %>
|
||||
</p>
|
||||
</div>
|
||||
</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: #e8770d;"><strong>热门课程</strong></h3>
|
||||
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :project_sort_type => 1, :host => Setting.course_domain}, :target => "_blank" %></span>
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_all_hot_course.map do |project| break if(project == find_all_hot_course[5]) %>
|
||||
<li style="background-image:none;">
|
||||
<div style="float: left;">
|
||||
<% if get_avatar?(project)%>
|
||||
<%= image_tag(url_to_avatar(project), :class => "avatar-4") %>
|
||||
<% else %>
|
||||
<%= image_tag('../images/avatars/Project/course.jpg', :class => "avatar-4") %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div style="float: left; margin-left: 10px; width: 360px;">
|
||||
<p class="layout">
|
||||
<%= link_to( project.name, :controller => 'projects', :action => 'show', :id => project.id, :host => Setting.course_domain, :class => "d-g-blue d-p-project-name",:title => "#{project.name}", :target => "_blank" )%>
|
||||
<span style="cursor: pointer; display: inline-block; float: right; color: #ec6300; white-space: nowrap;">学生人数:<%= link_to "#{studentCount(project)}", project_member_path(project, :role => 2) ,:course =>'1', :target => "_blank" %></span>
|
||||
</p>
|
||||
<p class="layout-1" >
|
||||
<%= content_tag "span", project.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => project.description %>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</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="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">
|
||||
|
@ -232,9 +205,9 @@
|
|||
<% end %>
|
||||
</ul>
|
||||
</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="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">
|
||||
|
@ -252,7 +225,7 @@
|
|||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -236,11 +236,11 @@ tags_max_length:
|
|||
tags_show_search_results:
|
||||
format: int
|
||||
default: 5
|
||||
forge_domain:
|
||||
default: forge.trustie.net
|
||||
user_domain:
|
||||
default: user.trustie.net
|
||||
project_domain:
|
||||
default: forge.trustie.net
|
||||
contest_domain:
|
||||
default: forge.trustie.net
|
||||
default: contest.trustie.net
|
||||
course_domain:
|
||||
default: forge.trustie.net
|
||||
default: course.trustie.net
|
||||
|
|
|
@ -203,7 +203,7 @@ Redmine::AccessControl.map do |map|
|
|||
end
|
||||
#by young
|
||||
Redmine::MenuManager.map :top_menu do |menu|
|
||||
menu.push :home, {:host => Setting.forge_domain}
|
||||
menu.push :home, {:host => Setting.user_domain}
|
||||
menu.push :course_practice, {:controller => 'projects', :action => 'course', :project_type => 1}
|
||||
menu.push :project_deposit, { :controller => 'projects', :action => 'index', :project_type => 0}, :caption => :label_project_deposit
|
||||
menu.push :software_user, {:controller => 'users', :action => 'index'}
|
||||
|
@ -264,10 +264,10 @@ end
|
|||
# end
|
||||
|
||||
Redmine::MenuManager.map :account_menu do |menu|
|
||||
menu.push :login, {:controller => 'account', :action => 'login', :host => Setting.forge_domain}, :if => Proc.new { !User.current.logged? }
|
||||
menu.push :register, {:controller => 'account', :action => 'register', :host => Setting.forge_domain}, :if => Proc.new { !User.current.logged? && Setting.self_registration? }
|
||||
menu.push :login, {:controller => 'account', :action => 'login', :host => Setting.project_domain}, :if => Proc.new { !User.current.logged? }
|
||||
menu.push :register, {:controller => 'account', :action => 'register'}, :if => Proc.new { !User.current.logged? && Setting.self_registration? }
|
||||
# menu.push :my_account, { :controller => 'my', :action => 'account' }, :if => Proc.new { User.current.logged? }
|
||||
menu.push :logout, {:controller => 'account', :action => 'logout', :host => Setting.forge_domain}, :html => {:method => 'post'}, :if => Proc.new { User.current.logged? }
|
||||
menu.push :logout, {:controller => 'account', :action => 'logout'}, :html => {:method => 'post'}, :if => Proc.new { User.current.logged? }
|
||||
end
|
||||
########fq
|
||||
Redmine::MenuManager.map :bid_menu do |menu|
|
||||
|
@ -341,29 +341,29 @@ Redmine::MenuManager.map :course_menu do |menu|
|
|||
|
||||
end
|
||||
Redmine::MenuManager.map :user_menu do |menu|
|
||||
menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.forge_domain }
|
||||
menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.user_domain }
|
||||
menu.push :user_course, {:controller => 'users', :action => 'user_courses', :host => Setting.course_domain}
|
||||
#menu.push :user_homework, {:controller => 'users', :action => 'user_homeworks'} by huang
|
||||
menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain}
|
||||
# menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids'} by huang
|
||||
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.forge_domain}
|
||||
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.user_domain}
|
||||
|
||||
end
|
||||
Redmine::MenuManager.map :user_enterprise_menu do |menu|
|
||||
menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.forge_domain }
|
||||
menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.user_domain }
|
||||
|
||||
menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain}
|
||||
|
||||
menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.forge_domain}
|
||||
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.forge_domain}
|
||||
menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.user_domain}
|
||||
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.user_domain}
|
||||
|
||||
end
|
||||
Redmine::MenuManager.map :user_menu_self do |menu|
|
||||
menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.forge_domain }
|
||||
menu.push :user_information, {:controller => 'users', :action => 'info', :host => Setting.forge_domain}
|
||||
menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.forge_domain}
|
||||
menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.forge_domain}
|
||||
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.forge_domain}
|
||||
menu.push :activity, {:controller => 'users', :action => 'show', :host => Setting.project_domain }
|
||||
menu.push :user_information, {:controller => 'users', :action => 'info', :host => Setting.user_domain}
|
||||
menu.push :user_project, {:controller => 'users', :action => 'user_projects', :host => Setting.project_domain}
|
||||
menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids', :host => Setting.user_domain}
|
||||
menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback', :host => Setting.user_domain}
|
||||
|
||||
end
|
||||
#end
|
||||
|
|
Loading…
Reference in New Issue