Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop

exceptionHandle
Wen 11 years ago
commit 4448fdfaca

@ -0,0 +1,11 @@
app\models\setting.rb :165
# fixed domain url in development. tantantan's bug
if Rails.env.development?
methods.map do |m|
define_singleton_method m do; nil; end if m.to_s =~ /([a-zA-Z]+_domain)$/
end
end
程序部分链接中制定了subdomain参数使链接在二级域名中来回跳转。
为了开发方便使之功能在development模式下失效。
# => nyan
================================================================================

@ -26,14 +26,15 @@ class FilesController < ApplicationController
include SortHelper
def index
sort_init 'filename', 'asc'
sort_update 'filename' => "#{Attachment.table_name}.filename",
'created_on' => "#{Attachment.table_name}.created_on",
'size' => "#{Attachment.table_name}.filesize",
'downloads' => "#{Attachment.table_name}.downloads"
@containers = [ Project.includes(:attachments).reorder(sort_clause).find(@project.id)]
@containers += @project.versions.includes(:attachments).reorder(sort_clause).all.sort.reverse
#sort_init 'filename', 'asc'
sort_init 'created_on', 'desc'
sort_update 'created_on' => "#{Attachment.table_name}.created_on",
'filename' => "#{Attachment.table_name}.filename",
'size' => "#{Attachment.table_name}.filesize",
'downloads' => "#{Attachment.table_name}.downloads"
@containers = [ Project.includes(:attachments).reorder("attachments.created_on DESC").find(@project.id)] #modify by Long Jun
@containers += @project.versions.includes(:attachments).reorder("created_on DESC").all.sort
if @project.project_type == 1
render :layout => 'base_courses'

@ -160,7 +160,8 @@ class IssuesController < ApplicationController
respond_to do |format|
format.html {
render_attachment_warning_if_needed(@issue)
flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("##{@issue.id}", issue_path(@issue), :title => @issue.subject))
flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("#{@issue.source_from}", issue_path(@issue), :title => @issue.subject))
#flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("##{@issue.id}", issue_path(@issue), :title => @issue.subject))
if params[:continue]
attrs = {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?}
redirect_to new_project_issue_path(@issue.project, :issue => attrs)

@ -87,6 +87,7 @@ class MemosController < ApplicationController
respond_to do |format|
format.html # show.html.erb
format.json { render json: @memo }
format.xml { render xml: @memo }
end
end

@ -28,7 +28,7 @@ class ProjectsController < ApplicationController
# menu_item l(:label_homework), :only => :homework
# menu_item l(:label_course_feedback), :only => :feedback
menu_item :homework, :only => :homework
menu_item :homework, :only => [:homework, :new_homework]
menu_item :feedback, :only => :feedback
menu_item l(:label_course_file), :only => :index
menu_item l(:label_course_news), :only => :index
@ -296,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
@ -632,7 +639,7 @@ class ProjectsController < ApplicationController
## 有角色参数的才是课程,没有的就是项目
@render_file = 'member_list'
# 判断是否课程
if @project.project_type == 1
if @project.project_type == Project::ProjectType_course
case params[:role]
when '1'
@subPage_title = l :label_teacher_list
@ -644,7 +651,7 @@ class ProjectsController < ApplicationController
@subPage_title = ''
@members = @project.member_principals.includes(:roles, :principal).all.sort
end
else
else # @project.project_type == Project::ProjectType_project
roles = Role.find_all_givable
@subPage_title = l :label_member_list
@members = @project.member_principals.includes(:roles, :principal).all
@ -656,7 +663,10 @@ class ProjectsController < ApplicationController
def sort_project_members project, members
#userGrade = UserGrade.where(:project_id => project.id)
users = UserGrade.where(:project_id => project.id).order('grade DESC').joins("LEFT JOIN users ON users.id = user_grades.id")
users = UserGrade.where(:project_id => project.id).
order('grade DESC').
joins("LEFT JOIN users ON users.id = user_grades.id").
select("DISTINCT user_grades.user_id")
memberlist = []
users.each do |user|
members.each do |member|
@ -840,7 +850,8 @@ class ProjectsController < ApplicationController
def select_project_layout
project = Project.find_by_id(params[:id])
project ||= @project
(project.project_type == Project::ProjectType_project) ? 'base_projects' : 'base_courses'
project ||= @course
(project.try(:project_type) == Project::ProjectType_project) ? 'base_projects' : 'base_courses'
end
# Validates parent_id param according to user's permissions

@ -20,6 +20,9 @@ class TagsController < ApplicationController
# $selected_tags = Array.new
# $related_tags = Array.new
NUMBERS = Setting.tags_show_search_results
# 预设几个可以添加的tag
@preTags = %w|预设A 预设B 预设C 预设D 预设E 预设F |
# 接收参数解释:
# params[:q]这是在其他页面点击tag跳转到该页面后的结果显示 ;params[:selected_tags]这是在过滤页面增删tag进行过滤传过来的参数

@ -17,7 +17,7 @@
class WelcomeController < ApplicationController
caches_action :robots
before_filter :entry_select, :only => [:index]
before_filter :entry_select_course, :entry_select_contest, :entry_select_user, :only => [:index]
def index
# @news = News.latest User.current
@ -79,12 +79,56 @@ class WelcomeController < ApplicationController
@teacher = User.teacher
@student = User.student
end
def contest
end
def search
search_condition = params[:q]
search_type = params[:search_type].to_sym unless search_condition.blank?
respond_to do |format|
format.html{
case search_type
when :projects
redirect_to projects_search_path(:name => search_condition,
:project_type => Project::ProjectType_project)
when :courses
redirect_to projects_search_path(:name => search_condition,
:project_type => Project::ProjectType_course)
when :users
redirect_to users_search_path(:name => search_condition)
when :users_teacher
redirect_to users_search_path(:name => search_condition, :role => :teacher)
when :users_student
redirect_to users_search_path(:name => search_condition, :role => :student)
else
redirect_to home_path, :alert => l(:label_sumbit_empty)
end
}
end
end
private
# 判断网站的入口,是课程 course 则跳过index去渲染 course 方法
def entry_select
def entry_select_course
(course() and render :course and return 0) if request.original_url.match(/course\.trustie\.net/)
end
def entry_select_contest
if request.original_url.match(/contest\.trustie\.net/)
contest
render :contest, layout: false
return 0
end
end
def entry_select_user
if request.original_url.match(/user\.trustie\.net/)
redirect_to(:controller => "users", :action => "index")
return 0
end
end
end

@ -36,13 +36,11 @@ module ApplicationHelper
#Added by young
#Define the course menu's link class
# 不是数组的转化成数组然后判断当前menu_item是否在给定的列表
# REVIEW: 目测menu的机制貌似不是很需要转换再说
def link_class(label)
if current_menu_item == label
@class = 'selected'
else
@class = ''
end
return @class
labels = label.is_a?(Array) ? label : ([] << label)
labels.include?(current_menu_item) ? 'selected' : ''
end
#Ended by young
# Return true if user is authorized for controller/action, otherwise false
@ -65,7 +63,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
@ -1479,16 +1477,7 @@ module ApplicationHelper
user.watcher_users.count
end
#end
#author : nyan
def stringCut240(str)
(str.length > 240) ? (str[0,240]<<"......") : str
end
#author : xianbo
def objCut12(obj)
for obj1 in obj[0..11]
obj2 = obj1
end
end
def hadcommittedhomework(cur,curb)
@attaches=HomeworkAttach.find_by_sql("select * from homework_attaches where(bid_id = #{curb})")
@ -1501,29 +1490,35 @@ module ApplicationHelper
def render_dynamic_nav
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}
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 }
main_course_link = link_to l(:label_course_practice), {:controller => 'welcome', :action => 'index', :host => Setting.course_domain}
main_project_link = link_to l(:label_project_deposit), {:controller => 'welcome', :action => 'index', :host => Setting.project_domain}
course_all_course_link = link_to l(:label_course_all), {:controller => 'projects', :action => 'course', :project_type => 1, :host => Setting.course_domain}
course_teacher_all_link = link_to l(:label_teacher_all), {:controller => 'users', :action => 'index', :role => 'teacher', :host => Setting.course_domain}
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}
users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :host => Setting.user_domain}
contest_link = link_to l(:label_contest_innovate), {:controller => 'bids', :action => 'contest', :project_type => 1 , :host => Setting.contest_domain}
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"}
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) if !@nav_dispaly_home_path_label
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
nav_list.push(main_project_link) if @nav_dispaly_main_project_label
nav_list.push(main_course_link) if @nav_dispaly_main_course_label
nav_list.push(courses_link) if @nav_dispaly_course_label
nav_list.push(projects_link) if @nav_dispaly_project_label
nav_list.push(users_link) if @nav_dispaly_user_label
nav_list.push(contest_link) if @nav_dispaly_contest_label
nav_list.push(bids_link) if @nav_dispaly_bid_label
nav_list.push(forum_link) if @nav_dispaly_forum_label
nav_list.push(stores_link) if !@nav_dispaly_course_all_label
nav_list.push(stores_link) if @nav_dispaly_store_all_label
content_li = ''
nav_list.collect do |nav_item|

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

@ -58,7 +58,8 @@ module IssuesHelper
end
def issue_heading(issue)
h("#{issue.tracker} ##{issue.id}")
#h("#{issue.tracker} ##{issue.id}")
h("#{issue.tracker} #{issue.source_from}")
end
def render_issue_subject_with_tree(issue)

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

@ -258,6 +258,22 @@ module ProjectsHelper
end
end
def rolesToLanguage rolesArray
rolesArray = ([] << rolesArray) unless rolesArray.is_a?(Array)
rolesArray.map{ |roleName|
case roleName.to_sym
when :Manager
l :default_role_manager
when :Developer
l :default_role_developer
when :Reporter
l :default_role_reporter
else
'Unkown'
end
}
end
def sort_project_by_hot
return sort_project_by_hot_rails
@projects_status = ProjectStatus.visible.where("project_statuses.project_type <> ? or project_statuses.project_type is null", 1)
@ -285,6 +301,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/0'
end
end
# 前略·天国の首页君/Earth has been unable stop to welcomePage's.
# sum - 要搜索的项目数量
# max_rate - 新项目所占所有项目的比重10分制
@ -50,16 +57,33 @@ module WelcomeHelper
#
# Returns project&courses array
def find_miracle_course(sum=10, max_rate=7)
Project.active.visible.course_entities.
joins(:course_extra).
joins(:memberships).
group('members.project_id').
reorder("courses.time DESC, COUNT(members.project_id) DESC").take sum
# max = sum*(max_rate.to_f/10)
# c1 = find_new_course(sum).to_a.dup
# c2 = find_all_hot_course(sum).to_a.dup
# 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_course(sum).to_a.dup
c2 = find_all_hot_course(sum).to_a.dup
c2 = c2 - c1
(c1.take(max)+c2).take(sum)
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 +238,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

@ -56,8 +56,11 @@ class Issue < ActiveRecord::Base
:include => [:project, :visible_journals],
# 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}},
acts_as_event :title => Proc.new {|o|
#"#{o.tracker.name} ##{o.id} (#{o.status}): #{o.subject}"
"#{o.tracker.name} #{o.source_from} (#{o.status}): #{o.subject}"
},
: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 +215,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).to_i+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) : []
@ -1139,6 +1147,12 @@ class Issue < ActiveRecord::Base
Project.all(:conditions => Project.allowed_to_condition(user, :move_issues))
end
# back string obj which is belong to project.
def source_from
"" << self.project.name.to_s <<
"#" << (self.project.issues.index(self).to_i + 1).to_s
end
private
def after_project_change

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

@ -152,8 +152,8 @@ class Project < ActiveRecord::Base
where("LOWER(identifier) LIKE :p OR LOWER(name) LIKE :p ", :p => pattern)
end
}
scope :project_entities, -> { where(project_type: 0) }
scope :course_entities, -> { where(project_type: 1) }
scope :project_entities, -> { where(project_type: ProjectType_project) }
scope :course_entities, -> { where(project_type: ProjectType_course) }
def new_course
self.where('project_type = ?', 1)

@ -215,6 +215,7 @@ div.pagination{
<tr>
<td class='description' colspan="5">
<div class="tags_area">
<% @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %>
<%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"}%>
<div class="tags_gradint"></div>
</div>

@ -30,7 +30,8 @@
<ul class="list-group-item-meta">
<span> <%= link_to issue.author.name, user_path(issue.author), :class => "bid_user_u" %></span><%= l(:label_post_on)%> <% a = [] %>
<% a << column_content[1] %>
<% a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %>
<%# a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %>
<% a << "#{issue.source_from}" << "(#{raw column_content[2]}):" << column_content[4] %>
<%= link_to a.join(' '), issue_path(issue), :class => "issue-link" %>
</ul>
<% end -%>

@ -4,7 +4,7 @@
:html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, :class => 'icon icon-add' %>
<%= link_to l(:label_query), '#', :class => 'icon icon-help',
:onclick => '$("#custom_query").slideToggle(400); ' if User.current.logged? %>
:onclick => '$("#custom_query").slideToggle(400); ' if true || User.current.logged? %>
</div>
</div>

@ -1,3 +1,6 @@
<%# html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
<% html_title "#{@issue.tracker.name} #{@issue.source_from}: #{@issue.subject}" %>
<%= render :partial => 'action_menu' %>
<h3><%= issue_heading(@issue) %></h3>
@ -9,14 +12,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 +90,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>
@ -152,7 +155,6 @@ end %>
<%= f.link_to 'PDF' %>
<% end %>
<% html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
<% content_for :sidebar do %>
<%= render :partial => 'issues/sidebar' %>

@ -1,6 +1,39 @@
<%
request.headers['REQUEST_URI'] = "" if request.headers['REQUEST_URI'].nil?
realUrl = request.original_url
if (realUrl.match(/users/))
@nav_dispaly_home_path_label = 1
@nav_dispaly_main_course_label = 1
@nav_dispaly_main_project_label = 1
elsif (realUrl.match(/contest/))
@nav_dispaly_contest_label = 1
elsif (realUrl.match(/calls/))
@nav_dispaly_home_path_label = 1
@nav_dispaly_bid_label = 1
elsif (realUrl.match(/forums/))
@nav_dispaly_forum_label = 1
elsif (realUrl.match(/forge\.trustie\.net\/*/))
@nav_dispaly_project_label = 1
@nav_dispaly_forum_label = 1
elsif (realUrl.match(/course\.trustie\.net\/*/))
@nav_dispaly_course_all_label = 1
@nav_dispaly_forum_label = 1
@nav_dispaly_store_all_label = 1
elsif (realUrl.match(/user\.trustie\.net\/*/))
@nav_dispaly_home_path_label = 1
@nav_dispaly_main_course_label = 1
@nav_dispaly_main_project_label = 1
else
@nav_dispaly_course_all_label = 1
@nav_dispaly_forum_label = 1
@nav_dispaly_bid_label = 1
@nav_dispaly_contest_label = 1
@nav_dispaly_store_all_label = 1
end
%>
<div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;">
<div class="welcome_logo">
<%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px"), home_path %>
<%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px")%>
</div>
<div id="account">
<%= render_menu :account_menu -%>
@ -15,11 +48,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>

@ -1,39 +1,3 @@
<%
request.headers['REQUEST_URI'] = "" if request.headers['REQUEST_URI'].nil?
realUrl = request.original_url
if (realUrl.match(/project\/course/))
@nav_dispaly_course_label = 1
elsif (realUrl.match(/projects/))
@nav_dispaly_project_label = 1
elsif (realUrl.match(/users/))
@nav_dispaly_user_label = 1
elsif (realUrl.match(/contest/))
@nav_dispaly_contest_label = 1
elsif (realUrl.match(/calls/))
@nav_dispaly_bid_label = 1
elsif (realUrl.match(/forums/))
@nav_dispaly_forum_label = 1
elsif (realUrl.match(/[^projects]\/course[^\.]/))
@nav_dispaly_course_label = 1
@nav_dispaly_project_label = 1
@nav_dispaly_contest_label = 1
elsif (realUrl.match(/course\.trustie\.net/))
@nav_dispaly_course_all_label = 1
@nav_dispaly_teacher_all_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
@nav_dispaly_user_label = 1
@nav_dispaly_contest_label = 1
@nav_dispaly_bid_label = 1
@nav_dispaly_forum_label = 1
end
%>
<!DOCTYPE html>
<html lang="<%= current_language %>">
<head>

@ -218,13 +218,13 @@
<%= link_to l(:label_homework), homework_project_path(@project), :class => link_class(:homework) ,:project_type => 1 %>
</li>
<li>
<%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news) %>
<%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%>
</li>
<li>
<%= link_to l(:label_course_board), { :controller => 'boards', :action => 'index', :project_id => @project}, :class => link_class(:boards) %>
<%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news) %>
</li>
<li>
<%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%>
<%= link_to l(:label_course_board), { :controller => 'boards', :action => 'index', :project_id => @project}, :class => link_class(:boards) %>
</li>
<li>
<%= link_to l(:label_course_feedback), project_feedback_path(@project), :class => link_class(:feedback)%>

@ -19,8 +19,8 @@ hr {
border: 0;
}
.footer {
font-size: 0.8em;
font-style: italic;
/*font-size: 0.8em;*/
/*font-style: italic;*/
}
</style>
</head>

@ -21,8 +21,7 @@
</p>
</div>
<% else%>
<!-- TODO: member.roles unsafe #nyan -->
<%= content_tag "div", content_tag("p", member.roles.sort.collect(&:to_s).join(', ')), :class => "clear avatar_name" %>
<%= content_tag "div", content_tag("p", rolesToLanguage(member.roles.sort.collect(&:to_s)).join(', ')), :class => "clear avatar_name" %>
<div class="clear avatar_user">
<p>
<%= l(:label_user_for_project_grade) %>: <span style="color:#ec6300"><%= UserGrade.find_by_user_id_and_project_id(member[:user_id], @project.id).grade %></span>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save