Conflicts:
	app/views/contests/index.html.erb
This commit is contained in:
alan 2014-09-17 15:33:47 +08:00
commit 02470491bd
43 changed files with 828 additions and 477 deletions

View File

@ -110,6 +110,8 @@ class AccountController < ApplicationController
@cache_city = params[:city]||"" #城市
@cache_enterprise_name = params[:enterprise_name]||"" #企业
firstname_code = ""
lastname_code = ""
(redirect_to(home_url); return) unless Setting.self_registration? || session[:auth_source_registration]
if request.get?
session[:auth_source_registration] = nil
@ -119,6 +121,8 @@ class AccountController < ApplicationController
@user = User.new
@user.safe_attributes = user_params
if params[:identity] == "2" # 2 企业
firstname_code = @user.firstname
lastname_code = @user.lastname
@user.firstname = params[:enterprise_name]
@user.lastname = l(:field_enterprise)
end
@ -141,10 +145,18 @@ class AccountController < ApplicationController
end
if(@cache_identityy == "")
if params[:identity] == "2"
@user.firstname = firstname_code
@user.lastname = lastname_code
end
flash.now[:error]= l(:label_identity)+l(:'activerecord.errors.messages.empty')
return
end
if(@cache_city == "")
if params[:identity] == "2"
@user.firstname = firstname_code
@user.lastname = lastname_code
end
flash.now[:error]= l(:label_location)+l(:'activerecord.errors.messages.empty')
return
end
@ -174,6 +186,10 @@ class AccountController < ApplicationController
end
end
if params[:identity] == "2"
@user.firstname = firstname_code
@user.lastname = lastname_code
end
end
# Token based account activation

View File

@ -361,7 +361,7 @@ private
def login_without_softapplication
referer = request.headers['Referer']
require_login unless referer =~ /softapplication/
require_login unless referer =~ /softapplication/ || referer =~ /memos/
end
def renderTag

View File

@ -1,4 +1,5 @@
class ContestNotificationController < ApplicationController
layout 'contest_base'
def show
@notification = ContestNotification.find(params[:id])
end

View File

@ -54,6 +54,11 @@ class JournalsController < ApplicationController
end
(render_404; return false) unless @issue && @detail
@diff = Redmine::Helpers::Diff.new(@detail.value, @detail.old_value)
respond_to do |format|
format.html {
render :layout => 'project_base'
}
end
end
def new

View File

@ -62,7 +62,7 @@ class MemosController < ApplicationController
format.html { redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}" }
format.json { render json: @memo, status: :created, location: @memo }
else
flash[:error] = "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}"
flash.now[:error] = "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}"
# back_error_page = @memo.parent_id.nil? ? forum_path(@forum) : forum_memo_path(@forum, @memo.parent_id)
pre_count = REPLIES_PER_PAGE

View File

@ -75,6 +75,7 @@ class MyController < ApplicationController
# Edit user's account
def account
@user = User.current
lg=@user.login
@pref = @user.pref
diskfile = disk_filename('User', @user.id)
diskfile1 = diskfile + 'temp'
@ -137,7 +138,7 @@ class MyController < ApplicationController
if File.exist?(diskfile1)
File.delete(diskfile1)
end
@user
@user.login = lg
end
else
# 确保文件被删除

View File

@ -555,7 +555,6 @@ class ProjectsController < ApplicationController
# Show @project
def show
@project_type = params[:project_type]
# try to redirect to the requested menu item
@ -842,7 +841,6 @@ class ProjectsController < ApplicationController
@project = nil
end
# added by bai
def show_projects_score
render :layout => false
end

View File

@ -110,7 +110,7 @@ class WelcomeController < ApplicationController
def contest
@contest_page = FirstPage.where("page_type = 'contest'").first
@contest_notifications = ContestNotification.order("id desc")
@contest_notifications = Contestnotification.order("created_at desc").limit(5)
end
def search

View File

@ -122,6 +122,18 @@ module ApplicationHelper
s
end
# Generates a link to an attachment.
# Options:
# * :text - Link text (default to attachment filename)
# * :download - Force download (default: false)
def link_to_short_attachment(attachment, options={})
text = h(truncate(options.delete(:text) || attachment.filename, length: 25, omission: '...'))
route_method = options.delete(:download) ? :download_named_attachment_path : :named_attachment_path
html_options = options.slice!(:only_path)
url = send(route_method, attachment, attachment.filename, options)
link_to text, url, html_options
end
# Generates a link to an attachment.
# Options:
# * :text - Link text (default to attachment filename)
@ -635,6 +647,11 @@ module ApplicationHelper
end
def html_title(*args)
#點擊項目版本庫 多觸發一次 字符串為"/"
#暫時解決方法 直接判斷
if(args == ["/"])
args = []
end
first_page = FirstPage.where("page_type = 'project'").first
if args.empty?
title = @html_title || []

View File

@ -0,0 +1,27 @@
module LoggerHelper
#输出日志
def OutLogger
#日志输出级别
#Rails.logger.level = Logger::INFO
if(!File.exist?("database"))
Dir.mkdir("database")
end
if(!File.exist?("database/get"))
Dir.mkdir("database/get")
end
if(!File.exist?("database/sql"))
Dir.mkdir("database/sql")
end
if(!File.exist?("database/controller"))
Dir.mkdir("database/controller")
end
Rails.logger = Logger.new("database/get/#{Date.today.to_s}.log", "daily")
ActiveRecord::Base.logger = Logger.new("database/sql/#{Date.today.to_s}.log", "daily")
ActionController::Base.logger = Logger.new("database/controller/#{Date.today.to_s}.log", "daily")
end
end

View File

@ -152,9 +152,9 @@ module ProjectsHelper
tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
end
# Ended by young
def parent_project_select_tag(project)
selected = project.parent
@ -175,18 +175,15 @@ module ProjectsHelper
render_project_nested_lists(projects) do |project|
#Modified by young
if project.try(:project_type) == Project::ProjectType_course
# modified by longjun
# never use unless and else
# unless project.is_public == 1
if project.is_public != 1
s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe
s = "<span class='private_project'>#{l(:label_private)}</span>".html_safe
else
s = "".html_safe
end
# end longjun
# modified by Longjun
s += link_to_project(project, {},
:class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe
@ -194,10 +191,9 @@ module ProjectsHelper
else
# modified by longjun
# unless project.is_public
if !project.is_public
# end longjun
s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe
s = "<span class='private_project'>#{l(:label_private)}</span>".html_safe
else
s = "".html_safe
end

View File

@ -22,7 +22,6 @@ class EnabledModule < ActiveRecord::Base
validates_uniqueness_of :name, :scope => :project_id
after_create :module_enabled
private
# after_create callback used to do things when a module is enabled
@ -35,4 +34,6 @@ class EnabledModule < ActiveRecord::Base
end
end
end
end

View File

@ -3,13 +3,15 @@
<% if attachments.count > 1 && attachment != attachments.first%>
<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% end %>
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
<% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'),
:controller => 'attachments', :action => 'show',
:id => attachment, :filename => attachment.filename %>
<% end %>
<%= h(" - #{attachment.description}") unless attachment.description.blank? %>
<span title="<%= attachment.description%>">
<%= h(truncate(" - #{attachment.description}", length: 20, omission: '...')) unless attachment.description.blank? %>
</span>
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
<% end -%>

View File

@ -2,14 +2,18 @@
<% for attachment in attachments %>
<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<span title="<%= attachment.filename%>">
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
</span>
<% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'),
:controller => 'attachments', :action => 'show',
:id => attachment, :filename => attachment.filename %>
:controller => 'attachments',
:action => 'show',
:id => attachment,
:filename => attachment.filename%>
<% end %>
<%= h(" - #{attachment.description}") unless attachment.description.blank? %>
<span title="<%= attachment.description%>">
<%= h(truncate(" - #{attachment.description}", length: 20, omission: '...')) unless attachment.description.blank? %>
</span>
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
<% if options[:deletable] %>
<% if attachment.container_type == 'HomeworkAttach' %>
@ -18,13 +22,6 @@
:method => :delete,
:class => 'delete',
:title => l(:button_delete) %>
<%# elsif attachment.container_type == 'Softapplication'%>
<%#= link_to image_tag('delete.png'), delete_softapplications_attachments_path(:id => attachment.id),
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:class => 'delete',
:remote => true,
:title => l(:button_delete) %>
<% else %>
<%= link_to image_tag('delete.png'), attachment_path(attachment),
:data => {:confirm => l(:text_are_you_sure)},

View File

@ -1,16 +1,12 @@
<span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;">
<%= l(:label_notification) %>
</span>
<% if User.current.logged? && User.current == @contest.author %>
<% if User.current.logged? && (User.current.admin? ||User.current == @contest.author) %>
<%= link_to(l(:bale_news_notice),
new_contest_contestnotification_path(@contest),
:class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-contestnotifications", "contestnotifications_title"); return false;') %>
<% end %>
<% if @contest %>
<div id="add-contestnotifications" class="add_frame" style="display:none;">
<%= labelled_form_for @contestnotification, :url => contest_contestnotifications_path(@contest),
@ -31,7 +27,6 @@
</p>
<% else %>
<% @contestnotificationss.each do |contestnotifications| %>
<table class="content-text-list">
<tr>
<td colspan="2" valign="top" width="50"><%= link_to image_tag(url_to_avatar(contestnotifications.author), :class => "avatar"), user_path(contestnotifications.author) %></td>

View File

@ -7,6 +7,7 @@
<td rowspan="2">
<% if User.current.logged? %>
<% unless User.current.user_extensions.identity == 1 %>
<<<<<<< HEAD
<!--
modified by longjun
<%#link_to l(:label_newtype_contest), :controller => 'contests', :action => 'new_contest' %>
@ -16,6 +17,9 @@
:class => 'icon icon-add',
:target => "_blank")
%>
=======
<%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add', :target => "_blank") %>
>>>>>>> 5a14798290ec4fe5a5aeedb507e7f0077df96efc
<!-- end longjun -->
<% end %>
<% end %>
@ -34,18 +38,25 @@
<tr>
<td style="padding-left: 8px">
<a>
<<<<<<< HEAD
<!--modified by longjun-->
=======
>>>>>>> 5a14798290ec4fe5a5aeedb507e7f0077df96efc
<%= link_to request.host()+"/contests", contests_path %>
<!-- end longjun -->
</a>
</td>
<td >
<%=link_to l(:field_homepage), home_path %> >
<<<<<<< HEAD
<!--
modified by longjun
<%#link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %>
-->
<%=link_to l(:label_contest_innovate), contests_path %>
=======
<%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %>
>>>>>>> 5a14798290ec4fe5a5aeedb507e7f0077df96efc
<!-- end longjun -->
</td>
</tr>

View File

@ -2,12 +2,14 @@
<% if attachments.count > 1 && attachment != attachments.first%>
<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% end %>
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
<% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'),
:controller => 'attachments', :action => 'show',
:id => attachment, :filename => attachment.filename %>
<% end %>
<%= h(" - #{attachment.description}") unless attachment.description.blank? %>
<span title="<%= attachment.description%>">
<%= h(truncate(" - #{attachment.description}", length: 20, omission: '...')) unless attachment.description.blank? %>
</span>
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
<% end -%>

View File

@ -65,7 +65,7 @@
<td>
<table>
<tr>
<td class="info_font" title="<%= @contest.name%>"><%= link_to h(truncate(@contest.name, length: 13, omission: '...')), show_contest_contest_path(@contest) %></td>
<td class="info_font" title="<%= @contest.name%>"><%= link_to @contest.name, show_contest_contest_path(@contest) %></td>
</tr>
<% if User.current.login? %>
<tr colspan='3'>

View File

@ -27,8 +27,7 @@
<p><%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %></p>
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
<br/>
<%= f.submit :value => l(:button_change) %>
<%= f.submit :value => l(:button_change) %>&nbsp;&nbsp;<%= link_to l(:button_back), back_url ,:class => "button-canel",:style => "color: #ffffff;"%>
</div>
<% end %>
<%= link_to l(:button_back), back_url %>
</div>

View File

@ -23,7 +23,8 @@
)if !@memo.locked? && User.current.logged? %>
<%= link_to(
image_tag('edit.png'),
#image_tag('edit.png'),
l(:button_edit),
{:action => 'edit', :id => @memo},
:method => 'get',
:title => l(:button_edit)
@ -42,11 +43,14 @@
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if @memo.destroyable_by?(User.current) %>
</div>
<div class="memo-title <%= @memo.sticky ? 'sticky' : '' %> <%= @memo.locked? ? 'locked' : '' %>" style="word-break: break-all;word-wrap: break-word;"><%= label_tag l(:field_subject) %>: <%=h @memo.subject %></div>
<div>&nbsp;</div>
<div class="memo-title <%= @memo.sticky ? 'sticky' : '' %> <%= @memo.locked? ? 'locked' : '' %>"
style="word-break: break-all;word-wrap: break-word;">
<%= label_tag l(:field_subject) %>: <%=h @memo.subject %>
</div>
<div class="memo-content">
<%= textAreailizable(@memo,:content) %>
<p>

View File

@ -173,10 +173,6 @@
<%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %>
</div>
<% end %>
<% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
<div id="reply" style="display:none;">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>

View File

@ -1,8 +1,9 @@
<script src="/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
<%= error_messages_for 'message' %>
<% replying ||= false %>
<div class="box ph10_5">
<!--[form:message]-->
<!--[form:message]-->
<% unless replying %>
<p><label for="message_subject"><%= l(:field_subject) %><span class="required"> *&nbsp;&nbsp;</span></label><br/>
<%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject" %><!--by young-->
@ -13,27 +14,33 @@
</p>
<% end %>
<p>
<% unless replying %>
<% if @message.safe_attribute? 'sticky' %>
<%= f.check_box :sticky %> <%= label_tag 'message_sticky', l(:label_board_sticky) %>
<% end %>
<% if @message.safe_attribute? 'locked' %>
<%= f.check_box :locked %> <%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %>
<% end %>
</p>
<p><label for="message_subject"><%= l(:field_description) %><span class="required"> *&nbsp;&nbsp;</span></label>
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
<%= text_area :quote,:quote,:style => 'display:none' %>
<% unless replying %>
<% if @message.safe_attribute? 'sticky' %>
<%= f.check_box :sticky %> <%= label_tag 'message_sticky', l(:label_board_sticky) %>
<% end %>
<% if @message.safe_attribute? 'locked' %>
<%= f.check_box :locked %> <%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %>
<% end %>
</p>
<p>
<label for="message_subject"><%= l(:field_description) %>
<span class="required"> *&nbsp;&nbsp;</span></label>
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
<%= text_area :quote,:quote,:style => 'display:none' %>
</p>
<p>
<%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %>
<%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content' %>
</p>
<p>
<%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %>
<%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content' %></p>
<!--[eoform:message]-->
<!--[eoform:message]-->
<p><%= l(:label_attachment_plural) %><br />
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %></p>
<p>
<%= l(:label_attachment_plural) %>
<br />
<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %>
</p>
</div>

View File

@ -1,6 +1,4 @@
<!-- added by bai -->
<div><%= l(:label_issue_number) %> * 4 = <%= issue_num(@project) %> * 4 = <%= format("%.2f" , issue_num(@project) * 4).to_i %></div>
<div><%= l(:label_issue_journal_number) %> * 1 = <%= issue_journal_num(@project) %> * 1 = <%= format("%.2f" , issue_journal_num(@project)).to_i %></div>
<div><%= l(:label_issue_score) %> = <%= format("%.2f" , issue_num(@project) * 4).to_i %> + <%= format("%.2f" , issue_journal_num(@project)).to_i %>
= <%= format("%.2f" , issue_score(@project)).to_i %></div>
<!-- end -->
<div><%= l(:label_issue_number) %> * 4 = <%= issue_num(project) %> * 4 = <%= format("%.2f" , issue_num(project) * 4).to_i %></div>
<div><%= l(:label_issue_journal_number) %> * 1 = <%= issue_journal_num(project) %> * 1 = <%= format("%.2f" , issue_journal_num(project)).to_i %></div>
<div><%= l(:label_issue_score) %> = <%= format("%.2f" , issue_num(project) * 4).to_i %> + <%= format("%.2f" , issue_journal_num(project)).to_i %>
= <%= format("%.2f" , issue_score(project)).to_i %></div>

View File

@ -1,5 +1,2 @@
<!-- added by bai -->
<div><%= l(:label_new_number) %> * 1 = <%= news_num(@project) %> * 1 = <%= format("%.2f" , news_score(@project)).to_i %></div>
<div><%= l(:label_news_score) %> = <%= format("%.2f" , news_score(@project)).to_i %></div>
<!-- end -->
<div><%= l(:label_news_score) %> = <%= format("%.2f" , news_score(@project)).to_i %></div>

View File

@ -3,8 +3,8 @@
<%= l(:label_projects_score) %>
<div> = <%= l(:label_issue_score) %> + <%= l(:label_news_score) %> + <%= l(:label_file_score) %> +
<%= l(:label_code_submit_score) %> + <%= l(:label_topic_score) %></div>
<div> = <%= format("%.2f" , issue_score(@project)).to_i %> + <%= format("%.2f" , news_score(@project)).to_i %> +
<%= format("%.2f" , documents_score(@project)).to_i %> + <%= format("%.2f" , changesets_score(@project)).to_i %> +
<%= format("%.2f" , board_message_score(@project)).to_i %></div>
<div> = <%= format("%.2f" , project_scores(@project)).to_i %></div>
<div> = <%= format("%.2f" , issue_score(project)).to_i %> + <%= format("%.2f" , news_score(project)).to_i %> +
<%= format("%.2f" , documents_score(project)).to_i %> + <%= format("%.2f" , changesets_score(project)).to_i %> +
<%= format("%.2f" , board_message_score(project)).to_i %></div>
<div> = <%= format("%.2f" , project_scores(project)).to_i %></div>
<!-- end -->

View File

@ -21,35 +21,65 @@
</table>
</div>
<script type="text/javascript">
function show_div(url)
{
if(url == 'project_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/project_score_index', :locals => {:project => @project}) %>');
}
else if(url == 'issue_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/issue_score_index', :locals => {:project => @project}) %>');
}
else if(url == 'news_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/news_score_index', :locals => {:project => @project}) %>');
}
else if(url == 'file_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/file_score_index', :locals => {:project => @project}) %>');
}
else if(url == 'code_submit_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/code_submit_score_index', :locals => {:project => @project}) %>');
}
else if(url == 'projects_topic_score_index')
{
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'projects/projects_topic_score_index', :locals => {:project => @project}) %>');
}
}
</script>
<div class="tabs_new">
<ul>
<li>
<%= link_to l(:label_projects_score), {:controller => 'projects', :action => 'show_projects_score', :remote => true}%> :
<%= link_to l(:label_projects_score),"javascript:void(0)", :onclick => "show_div('project_score_index')"%> :
<%= format("%.2f" , project_scores(@project) ).to_i %>
</li>
<li>
<%= link_to l(:label_issue_score), {:controller => 'projects', :action => 'issue_score_index', :remote => true}%> :
<%= link_to l(:label_issue_score), "javascript:void(0)", :onclick => "show_div('issue_score_index')"%> :
<%= format("%.2f" , issue_score(@project)).to_i %>
</li>
<li>
<%= link_to l(:label_news_score), {:controller => 'projects', :action => 'news_score_index', :remote => true}%> :
<%= link_to l(:label_news_score), "javascript:void(0)", :onclick => "show_div('news_score_index')"%> :
<%= format("%.2f" , news_score(@project)).to_i %>
</li>
<li>
<%= link_to l(:label_file_score), {:controller => 'projects', :action => 'file_score_index', :remote => true}%> :
<%= link_to l(:label_file_score), "javascript:void(0)", :onclick => "show_div('file_score_index')"%> :
<%= format("%.2f" , documents_score(@project)).to_i %>
</li>
<li>
<%= link_to l(:label_code_submit_score), {:controller => 'projects', :action => 'code_submit_score_index', :remote => true}%> :
<%= link_to l(:label_code_submit_score), "javascript:void(0)", :onclick => "show_div('code_submit_score_index')" %> :
<%= format("%.2f" , changesets_score(@project)).to_i %>
</li>
<li>
<%= link_to l(:label_topic_score), {:controller => 'projects', :action => 'projects_topic_score_index', :remote => true}%> :
<%= link_to l(:label_topic_score), "javascript:void(0)", :onclick => "show_div('projects_topic_score_index')"%> :
<%= format("%.2f" , board_message_score(@project)).to_i %>
</li>
</ul>
</div>
<div id="show_score_detail">
<%= render :partial => 'projects/project_score_index', :locals => {:index => 0 } %>
<%= render :partial => 'projects/project_score_index', :locals => {:project => @project } %>
</div>
<!-- end -->

View File

@ -1,5 +1,3 @@
<!-- added by bai -->
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/show_projects_score') %>');
showModal('ajax-modal', '400px');
$('#ajax-modal').addClass('new-watcher');
<!-- end -->

View File

@ -2,9 +2,9 @@
<%= render 'search_bar' %>
<% end %>
<div class="resource_sum">
<div class="resource_sum" id="IE_resource_sum_css">
<% @attach_array.each do |k|%>
<div class="line_block">
<div class="line_block" >
<p>
<%= @str_arr.shift %>
</p>
@ -64,5 +64,8 @@
$(this).find('img').attr("src", "/images/button/download.png")
});
});
if(navigator.appName=="Microsoft Internet Explorer"){
$("#IE_resource_sum_css").children(".line_block").css("width","45%");
}
});
</script>

View File

@ -1,61 +1,72 @@
<% if User.current.id == @user.id %>
<div class="menu-div">
<div class="menu">
<span style="color: #000; font-weight: bold;"><%= "#{@user.name}的动态" %></span>
<ul><%#链接绑定在页面最下方的jQuery%>
<li mode='all' class="<%= "on" if @state.eql?(0) %>"><%= l :label_user_all_activity %></li>
<li mode='myself' class="<%= "on" if @state.eql?(1) %>"><%= l :label_user_activity_myself %></li>
<li mode='respond' class="<%= "on" if @state.eql?(2) %>"><%= l :label_user_all_respond %></li>
</ul>
</div>
<script type="text/javascript">
</script>
<% if User.current.id == @user.id %>
<div class="menu-div">
<div class="menu">
<span style="color: #000; font-weight: bold;"><%= "#{@user.name}的动态" %></span>
<ul><%#链接绑定在页面最下方的jQuery%>
<li mode='all' class="<%= "on" if @state.eql?(0) %>"><%= l :label_user_all_activity %></li>
<li mode='myself' class="<%= "on" if @state.eql?(1) %>"><%= l :label_user_activity_myself %></li>
<li mode='respond' class="<%= "on" if @state.eql?(2) %>"><%= l :label_user_all_respond %></li>
</ul>
</div>
<script type="text/javascript">
</script>
</div>
<div style="height:20px"></div>
<%= form_tag(:controller => 'users', :action => "show") do %>
<div class="user-search-block hidden" style="float:right;margin-top:-55px">
<table width="100%" valign="center">
<tr>
<td align="right">
<div class="project-search">
<%= text_field_tag 'user', params[:user], :size => 30 %>
<%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %>
</div>
</td>
</tr>
</table>
</div>
<div style="height:20px"></div>
<%= form_tag(:controller => 'users', :action => "show") do %>
<div class="user-search-block hidden" style="float:right;margin-top:-55px">
<table width="100%" valign="center">
<tr>
<td align="right">
<div class="project-search">
<%= text_field_tag 'user', params[:user], :size => 30 %>
<%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %>
</div>
</td>
</tr>
</table>
</div>
<% end %>
<% end %>
<% end %>
<% unless @state == 2 %>
<% unless @activity.empty? %>
<div id="activity">
<% @activity.each do |e| %>
<%# 以下一行代码解决有未知的活动无法转换成Model报错%>
<% (Rails.logger.error "[Error] =========================================================> NameError: uninitialized constant " + e.act_type.to_s; next;) if e.act_type.safe_constantize.nil? %>
<% act = e.act %>
<% unless act.nil? %>
<% if e.act_type == 'JournalsForMessage' || e.act_type == 'Bid' || e.act_type == 'Journal'|| e.act_type == 'Changeset' || e.act_type == 'Message' || e.act_type == 'Principal' || e.act_type == 'News' || e.act_type == 'Issue' || e.act_type == 'Contest'%>
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td>
<td>
<% unless @state == 2 %>
<% unless @activity.empty? %>
<div id="activity">
<% @activity.each do |e| %>
<%# 以下一行代码解决有未知的活动无法转换成Model报错%>
<% (Rails.logger.error "[Error] =========================================================> NameError: uninitialized constant " + e.act_type.to_s; next;) if e.act_type.safe_constantize.nil? %>
<% act = e.act %>
<% unless act.nil? %>
<% if e.act_type == 'JournalsForMessage' || e.act_type == 'Bid' || e.act_type == 'Journal'|| e.act_type == 'Changeset' || e.act_type == 'Message' || e.act_type == 'Principal' || e.act_type == 'News' || e.act_type == 'Issue' || e.act_type == 'Contest'%>
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td>
<td>
<table width="580" border="0" class="info-break">
<% case e.act_type %>
<% case e.act_type %>
<% when 'JournalsForMessage' %>
<tr>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_have_feedback) %>
<%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %></span>
<% if User.current.login == e.user.try(:login) %>
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<% else %>
<strong><%= link_to("#{e.user.name}", user_path(e.user_id)) %></strong>
<% end %>
<span class="font_lighter">
<%= l(:label_have_feedback) %>
<%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %>
</span>
</td>
</tr>
<tr>
<td colspan="2" width="580">
<p class="font_description"> <%= textAreailizable act.notes %> </p>
<div style="display: inline-block; float: right; margin-top: 0px">
<span><%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %></span>
<span>
<%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %>
</span>
</div>
</td>
</tr>
@ -70,13 +81,41 @@
<% when 'Bid' %>
<tr>
<% if act.reward_type == 3 && @show_course == 1%>
<td colspan="2" valign="top">
<strong> <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong><span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
</td>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
<%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>&nbsp;
<%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
</td>
<% end %>
<% else %>
<td colspan="2" valign="top">
<strong> <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong><span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
</td>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong> <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>
<span class="font_lighter"><%= l(:label_i_new_activity) %></span>
<%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;
<%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
</td>
<% end %>
<% end %>
</tr>
<tr>
@ -89,15 +128,30 @@
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span><%= link_to l(:label_find_all_comments), respond_path(e.act_id) %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.commit) %></a>
<span><%= link_to l(:label_find_all_comments), respond_path(e.act_id) %></span>
<a class="font_lighter"><%= l(:label_comments_count, :count => e.act.commit) %></a>
</div>
</td>
</tr>
<% when 'Journal' %>
<tr>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
</td>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;
<%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id)) %>
<%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"),
{:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;
<%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier)) %>
<%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"),
{:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
</td>
<% end %>
</tr>
<tr>
<% if act.notes.nil? %>
@ -118,9 +172,29 @@
</tr>
<% when 'Changeset' %>
<tr>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></span>
</td>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;
<%= link_to format_activity_title(act.title),
{:controller => 'repositories',
:action => 'revision',
:id => act.repository.project,
:repository_id => act.repository.identifier_param,
:rev => act.identifier} %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;
<%= link_to format_activity_title(act.title),
{:controller => 'repositories',
:action => 'revision',
:id => act.repository.project,
:repository_id => act.repository.identifier_param,
:rev => act.identifier} %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" width="580">
@ -132,15 +206,38 @@
<span class="font_lighter"> <%= format_time(e.act.committed_on) %></span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span><%= link_to l(:label_find_all_comments), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.count) %></a>
<span><%= link_to l(:label_find_all_comments),
{:controller => 'repositories',
:action => 'revision',
:id => act.repository.project,
:repository_id => act.repository.identifier_param,
:rev => act.identifier} %>
</span>
<a class="font_lighter"><%= l(:label_comments_count, :count => e.act.count) %></a>
</div>
</td>
</tr>
<% when 'Message' %>
<tr>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %>
</td>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
{:controller => 'messages',
:action => 'show',
:board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
{:controller => 'messages',
:action => 'show',
:board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" width="580">
@ -157,9 +254,17 @@
</tr>
<% when 'Principal' %>
<tr>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_user) %></span>
</td>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_new_user) %></span>
</td>
<% else %>
<td colspan="2" valign="top">
<strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_new_user) %></span>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" width="580"><p class="font_description"></p></td>
@ -174,9 +279,19 @@
</tr>
<% when 'News' %>
<tr>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %>
</td>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;
<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;
<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" width="580">
@ -188,21 +303,44 @@
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span><%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.comments_count) %></a>
<span>
<%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %>
</span>
<a class="font_lighter">
<%= l(:label_comments_count, :count => e.act.comments_count) %>
</a>
</div>
</td>
</tr>
<% when 'Issue' %>
<tr>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>&nbsp;
<%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %>
</td>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>&nbsp;
<%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"),
{:controller => 'issues',
:action => 'show',
:id => act.id} %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>&nbsp;
<span class="font_lighter">
<%= l(:label_new_activity) %>
</span>&nbsp;
<%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"),
{:controller => 'issues',
:action => 'show',
:id => act.id} %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" width="580" style="WORD-BREAK: break-all; WORD-WRAP: break-word">
@ -215,15 +353,26 @@
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span><%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.journals.count) %></a>
<span><%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %></span>
<a class="font_lighter"><%= l(:label_comments_count, :count => e.act.journals.count) %></a>
</div>
</td>
</tr>
<% when 'Contest' %>
<tr>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %>
</td>
<% if e.user == User.current && @show_contest == 1%>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;
<%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %>
</td>
<% else %>
<td colspan="2" valign="top">
<strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;
<%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" width="580"><p class="font_description"> <%= textAreailizable act, :description %> </p>
@ -236,101 +385,98 @@
</div>
</tr>
<% else %>
<%# f=1 %>
<% end %><!-- < % #case end %> -->
<% end %><!-- < % #case end %> -->
</table>
</td>
</tr>
</td>
</tr>
</table>
<% end %>
<% end %><!-- < % #unless act.nil? end %> -->
<% end %><!-- < % #@activity.each do |e| end%> -->
</div>
<div class="pagination" style="float:left;">
<ul> <%= pagination_links_full @activity_pages %> </ul>
</div>
<% else %> <!-- < %# unless @activity.empty? %> -->
<% if @user == User.current %>
<%= l(:label_user_activities) %>
<% else %>
<p class="font_description">
<%= l(:label_user_activities_other) %>
</p>
<% end %>
<% end %><!-- < %# unless @activity.empty? end %> -->
</table>
<% end %>
<% end %><!-- < % #unless act.nil? end %> -->
<% else %>
<% unless @message.empty? %>
<div id="activity">
<% @message.each do |e| -%>
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;">
<tr>
<td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top">
<strong> <%= link_to(h(e.user), user_path(e.user)) %></strong><span class="font_lighter">
<% if e.instance_of?(JournalsForMessage) %>
<% if e.reply_id == User.current.id %>
<% if e.jour_type == 'Bid' %>
<%= l(:label_in_bids) %><%= link_to(e.jour.name, respond_path(e.jour)) %>&nbsp;<%= l(:label_quote_my_words) %>
<% elsif e.jour_type == 'User' %>
<%= l(:label_in_users) %><%= link_to(e.jour.firstname, feedback_path(e.jour)) %>&nbsp;<%= l(:label_quote_my_words) %>
<% elsif e.jour_type == 'Project' %>
<%= '在'<<l(:field_project) %><%= link_to(e.jour.name, feedback_path(e.jour)) %>&nbsp;<%= l(:label_reply_plural) %>
<% end %>
<% else %>
<%= l(:label_about_requirement) %><%= link_to(e.jour.name, respond_path(e.jour_id)) %>&nbsp;<%= l(:label_have_respond) %>
<% end %>
<% else %>
<% if e.journal_reply.nil? || e.journal_reply.reply_id != User.current.id %>
<%= l(:label_about_issue) %><%= link_to(e.issue.subject, issue_path(e.journalized_id)) %><%= l(:label_have_respond) %>
<% end %><!-- < % #@activity.each do |e| end%> -->
</div>
<div class="pagination" style="float:left;">
<ul> <%= pagination_links_full @activity_pages %> </ul>
</div>
<% else %> <!-- < %# unless @activity.empty? %> -->
<% if @user == User.current %>
<%= l(:label_user_activities) %>
<% else %>
<p class="font_description">
<%= l(:label_user_activities_other) %>
</p>
<% end %>
<% end %><!-- < %# unless @activity.empty? end %> -->
<% else %>
<%= l(:label_in_issues) %><%= link_to(e.issue.subject, issue_path(e.issue)) %><%= l(:label_quote_my_words) %>
<% end %>
<% end %> </span>
</td>
</tr>
<tr>
<td colspan="2" width="580"><p class="font_description"> <%= textAreailizable e.notes %> </p></td>
</tr>
<tr>
<td align="left"><a class="font_lighter"></a></td>
<td width="200" align="right" class="a">
<span class="font_lighter"><%= format_time e.created_on %></span></td>
</tr>
</table>
</td>
</tr>
</table>
<% end %>
</div>
<div class="pagination" style="float:left;">
<ul> <%= pagination_links_full @info_pages %> </ul>
</div>
<% else %>
<% unless @message.empty? %>
<div id="activity">
<% @message.each do |e| -%>
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;">
<tr>
<td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top">
<strong> <%= link_to(h(e.user), user_path(e.user)) %></strong><span class="font_lighter">
<% if e.instance_of?(JournalsForMessage) %>
<% if e.reply_id == User.current.id %>
<% if e.jour_type == 'Bid' %>
<%= l(:label_in_bids) %><%= link_to(e.jour.name, respond_path(e.jour)) %>&nbsp;<%= l(:label_quote_my_words) %>
<% elsif e.jour_type == 'User' %>
<%= l(:label_in_users) %><%= link_to(e.jour.firstname, feedback_path(e.jour)) %>&nbsp;<%= l(:label_quote_my_words) %>
<% elsif e.jour_type == 'Project' %>
<%= '在'<<l(:field_project) %><%= link_to(e.jour.name, feedback_path(e.jour)) %>&nbsp;<%= l(:label_reply_plural) %>
<% end %>
<% else %>
<%= l(:label_about_requirement) %><%= link_to(e.jour.name, respond_path(e.jour_id)) %>&nbsp;<%= l(:label_have_respond) %>
<% end %>
<% else %>
<% if e.journal_reply.nil? || e.journal_reply.reply_id != User.current.id %>
<%= l(:label_about_issue) %><%= link_to(e.issue.subject, issue_path(e.journalized_id)) %><%= l(:label_have_respond) %>
<% else %>
<%= l(:label_in_issues) %><%= link_to(e.issue.subject, issue_path(e.issue)) %><%= l(:label_quote_my_words) %>
<% end %>
<% end %> </span>
</td>
</tr>
<tr>
<td colspan="2" width="580"><p class="font_description"> <%= textAreailizable e.notes %> </p></td>
</tr>
<tr>
<td align="left"><a class="font_lighter"></a></td>
<td width="200" align="right" class="a">
<span class="font_lighter"><%= format_time e.created_on %></span></td>
</tr>
</table>
</td>
</tr>
</table>
<% end %>
</div>
<div class="pagination" style="float:left;">
<ul> <%= pagination_links_full @info_pages %> </ul>
</div>
<% else %>
<p class="font_description"><%= l(:label_no_user_respond_you) %></p>
<% end %>
<p class="font_description"><%= l(:label_no_user_respond_you) %></p>
<% end %>
<script type="text/javascript" language="javascript">
$(document).ready(function ($) {
$("#content .menu-div:first~ div").first().find("a").attr("target", "_blank");
$('[mode=all]').click(function (event) {
window.location.href = '<%=user_url(@user)%>';
});
$('[mode=myself]').click(function (event) {
window.location.href = '<%=user_url(@user, type: 1)%>';
});
$('[mode=respond]').click(function (event) {
window.location.href = '<%=user_url(@user, type: 2)%>';
});
<% end %>
<script type="text/javascript" language="javascript">
$(document).ready(function ($) {
$("#content .menu-div:first~ div").first().find("a").attr("target", "_blank");
$('[mode=all]').click(function (event) {
window.location.href = '<%=user_url(@user)%>';
});
</script>
$('[mode=myself]').click(function (event) {
window.location.href = '<%=user_url(@user, type: 1)%>';
});
$('[mode=respond]').click(function (event) {
window.location.href = '<%=user_url(@user, type: 2)%>';
});
});
</script>

View File

@ -5,4 +5,4 @@
<% end %>
<% end %>
&nbsp;&nbsp;&nbsp;&nbsp;
<%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => school_id} %>
<%= link_to l(:label_more), {:controller => 'courses', :action => 'index', :school_id => school_id} %>

View File

@ -0,0 +1,4 @@
<div id="identifier-pannel" style="display:none">
<%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
<div class="weixin-content">微信扫码</div>
</div>

View File

@ -111,14 +111,16 @@
fixedBar('backTopBtn' , {autoHidden: true, top : 186});
fixedBar('identifier-pannel' , {autoHidden: false , top : 956 , show : true});
//修改微信扫码样式布局后添加微信扫码跟随滚动处理
$(window).scroll(function(){
var vtop=$(document).scrollTop();
$("#identifier-pannel").css('top',vtop+"px");
})
}
})();
</script>
<div class='top_bar'>
<div id="identifier-pannel" style="display:none">
<%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
<div class="weixin-content"><%=l(:label_weixin)%></div>
</div>
<%#= render partial: 'wei_xin' %>
<div class="main-content-bar" id="main-content-bar">
<!--文字-->
<div style="float: left;padding-left:15px;">
@ -150,22 +152,26 @@
<div style="clear:both"></div>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" >
<h3 style="margin-left: 5px; color: #e8770d;"><strong><%=l(:label_current_hot_contest)%></strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to l(:label_more_information), {:controller => 'contests', :action => 'index'}, :target => "_blank" %></span>
<span style="margin-top: -20px;float: right; display: block;">
<% if User.current.logged? %>
<% unless User.current.user_extensions.identity == 1 %>
<%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add') %>
<% end %>
<% end %>
&nbsp;&nbsp;
<%= link_to l(:label_more), {:controller => 'contests', :action => 'index'}, :target => "_blank" %>
</span>
<div class="d-p-projectlist-box">
<div class="d-p-projectlist">
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
<li style="overflow:auto;word-break:break-all;height:100%;word-wrap: break-word;" class='<%= cycle("odd", "even") %>'>
<div class="avatar-4" style="float: left; margin-top: 7px">
<%= image_tag('/images/contest1.png')%>
</div>
<div style="float: left; margin-left: 12px; margin-top: 10px; margin-bottom: -4px; width: 380px;">
<!-- <%= link_to(contest.name, contest.event_url, :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %> -->
<%= link_to(contest.name, contest_contestnotifications_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
<%= link_to(contest.name.truncate(50, omission: '...'), contest_contestnotifications_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
<% if contest.id == 2 or contest.id == 3 or contest.id == 6 %>
<span class="font_lighter">(<span style="font-size: 13px"><%= link_to("#{contest.projects.where('is_public=1').count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span>
<% else %>
@ -178,29 +184,35 @@
</div><br />
<div style="padding-left: 57px; clear: left;">
<span class="font_lighter"><%=l(:label_release_time)%>:&nbsp;<%=format_time contest.created_on %></span>
</div>
</li>
<% end; reset_cycle %>
</div>
</div>
</div>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<h3 style="margin-left: 5px; color: rgb(21, 188, 207);">
<h3 style="margin-left: 5px; color: #e8770d;">
<strong><%=l(:label_notification)%></strong>
</h3>
<ul class="contest-notification-list">
<% @contest_notifications.each do |notification| %>
<li>
<span class="title"><%= link_to notification.title, notification %></span>
<span class="font_lighter content"><%= truncate(strip_tags(notification.content).gsub( '&nbsp;',' '), length:60) %></span>
<span class="font_lighter time"><%=l(:label_release_time)%>:&nbsp;<%=format_time notification.created_at %></span>
<div class="inner-right" style="float: left; margin-top: 7px ">
<%= link_to image_tag(url_to_avatar(notification.author), :class => "avatar"), user_path(notification.author) %>
</div>
<div class="font_lighter" style="padding-top: 7px;padding-left: 55px;" title="<%= notification.title%>">
<span>
<strong><%= link_to_user(notification.author) %></strong>
<%= l(:label_project_notice) %>
<%= link_to notification.title.truncate(35, omission: '...'), contest_contestnotifications_path(notification.contest_id) %>
</span>
</div>
<div class="font_lighter" style="padding-left: 55px;" title="<%= notification.description%>"><%= notification.description.truncate(30, omission: '...') %></div>
<div class="font_lighter" style="padding-left: 55px;"><%=l(:label_release_time)%>:&nbsp;<%=format_time notification.created_at %></div>
</li>
<% end %>
</ul>
@ -215,7 +227,7 @@
<span style="margin-top: -20px;float: right; display: block;"><%= link_to l(:label_more_information), forums_path %></span>
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<% find_new_forum_topics(8).each do |topic|%>
<% find_new_forum_topics(9 - @contest_notifications.count).each do |topic|%>
<li class="message-brief-intro" style="height: auto; line-height:2em; padding-bottom: 1px ">
<div style="display: inline-block; width: 100%;">
<span class="memo_activity text_nowrap" style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

View File

@ -32,10 +32,7 @@
</script>
<div class='top_bar'>
<div id="identifier-pannel" style="display:none">
<%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
<div class="weixin-content">微信扫码</div>
</div>
<%#= render partial: 'wei_xin' %>
<div class="main-content-bar" id="main-content-bar">
<div style="float: left;padding-left:15px">
<%= image_tag(@logoLink, width:@course_page.image_width,height: @course_page.image_height) %>
@ -78,7 +75,7 @@
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
<h3><strong>新开课程</strong></h3>
<h3><strong><%= l(:lable_hot_course)%></strong></h3>
<% if @school_id %>
<% school_course = find_miracle_course(10,7, @school_id) %>
<% else %>

View File

@ -1,164 +1,195 @@
<% @nav_dispaly_project_label = 1
@nav_dispaly_forum_label = 1 %>
<%= stylesheet_link_tag 'welcome' %>
<%= javascript_include_tag 'welcome' %>
<script type="text/javascript" language="javascript">
$(function(){
$("#main").find("a").attr("target", "_blank");
setCss();
});
//设置div居中
function setCss()
{
var mainBar = $('#main-content-bar')[0];
var topHeight = mainBar.offsetHeight;
var welcomeLeft = $('#welcome_left')[0];
var leftHeight = welcomeLeft.offsetHeight;
var searchbar = $('#search-bar')[0];
var searchHeight = searchbar.offsetHeight;
welcomeLeft.style.marginTop = (topHeight - leftHeight)/2 + "px";
searchbar.style.marginTop = (topHeight - searchHeight)/2 + "px";
//alert((topHeight - leftHeight)/2 );
}
// 给主页用户弹新页面
$(document).ready(function($) {
$("#loggedas").find("a").attr("target", "_blank");
//$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
});
</script>
<div class='top_bar'>
<div id="identifier-pannel" style="display:none">
<%= 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" id="main-content-bar">
<div style="float: left;padding-left:15px ">
<!-- <#%= image_tag(get_project_avatar(@first_page), size: "75x75") %> -->
<% if get_avatar?(@first_page) %>
<%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %>
<% else %>
<%= image_tag '/images/transparent.png', width:@first_page.image_width,height: @first_page.image_height %>
<% end %>
</div>
<div class="welcome_left" id="welcome_left">
<% unless @first_page.nil? %>
<!-- <span class="font_welcome_trustie"><#%= @first_page.title %></span> <span class="font_welcome_tdescription">, <#%= @first_page.description %></span> -->
<%= @first_page.description.html_safe %>
<% end %>
</div>
<div class="search-bar" id="search-bar">
<%= render :partial => "search_project", :locals => {:project_type => 0}%>
</div>
<div style="clear: both;"></div>
</div>
</div>
<div style="clear:both"></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">
<% #projects = find_miracle_project(10, 3) %>
<% @projects.map do |project| %>
<!--<%# cache cache_key_for_project(project) do %> -->
<li style="overflow:auto;word-break:break-all;height:100%;word-wrap: break-word;" 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;">
<% unless project.is_public %>
<span class="private_project"><%= l(:label_private) %></span>
<% end %>
<%= 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.short_description%>'><%=project.description.truncate(100, omission: '...')%></span>
</div>
<div >
<%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s,
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
:class => "tooltip",
:id => "tooltip-#{project.id}" %>
</div>
</li>
<!--<%#end %> -->
<% 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;">
<%activities = find_all_activities%>
<% activities.each do |event| %>
<!--<%# cache cache_key_for_event(event) do %> -->
<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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
</div>
</li>
<!--<%#end %> --><!-- cache -->
<% end %>
</div>
</ul>
</div>
<div class="right" style="float: right; width: 48%; ">
<ul class="welcome-message-list">
<!--<%# cache 'forum_links' do %> -->
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
<h3 style="color: rgb(21, 188, 207);">
<strong>贴吧动态</strong>
<%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
<%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%></h3>
<span style="margin-top: -30px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span>
</div>
<!--<%#end %> -->
<div class="welcome-box-list-new memo_activity">
<% topics = find_new_forum_topics(7) %>
<% topics.includes(:forum, :last_reply, :author).each do |topic|%>
<!--<%# cache cache_key_for_topic(topic) do %> -->
<li class="message-brief-intro">
<div class='memo_title text_nowrap'>
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
</div>
<div class='memo_attr'>
<span class='memo_timestamp'>
<%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %>
</span>
<span class="memo_author">
楼主: <%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
</span>
<span class="memo_last_person">
最后回复:<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %><%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%><% end %>
</span>
<span class="memo_reply">
回复(<%= link_to topic.try(:replies_count), topic.event_url %>)
</span>
</div>
</li>
<!--<%#end %> --> <!-- cache -->
<% end %>
</div>
</ul>
</div>
<div class="clearfix"></div>
<% @nav_dispaly_project_label = 1
@nav_dispaly_forum_label = 1 %>
<%= stylesheet_link_tag 'welcome' %>
<%= javascript_include_tag 'welcome' %>
<script type="text/javascript" language="javascript">
$(function(){
$("#main").find("a").attr("target", "_blank");
setCss();
});
//设置div居中
function setCss()
{
var mainBar = $('#main-content-bar')[0];
var topHeight = mainBar.offsetHeight;
var welcomeLeft = $('#welcome_left')[0];
var leftHeight = welcomeLeft.offsetHeight;
var searchbar = $('#search-bar')[0];
var searchHeight = searchbar.offsetHeight;
welcomeLeft.style.marginTop = (topHeight - leftHeight)/2 + "px";
searchbar.style.marginTop = (topHeight - searchHeight)/2 + "px";
//alert((topHeight - leftHeight)/2 );
}
// 给主页用户弹新页面
$(document).ready(function($) {
$("#loggedas").find("a").attr("target", "_blank");
//$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
});
</script>
<div class='top_bar'>
<%#= render partial: 'wei_xin' %>
<div class="main-content-bar" id="main-content-bar">
<div style="float: left;padding-left:15px ">
<!-- <#%= image_tag(get_project_avatar(@first_page), size: "75x75") %> -->
<% if get_avatar?(@first_page) %>
<%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %>
<% else %>
<%= image_tag '/images/transparent.png', width:@first_page.image_width,height: @first_page.image_height %>
<% end %>
</div>
<div class="welcome_left" id="welcome_left">
<% unless @first_page.nil? %>
<%= @first_page.description.html_safe %>
<% end %>
</div>
<div class="search-bar" id="search-bar">
<%= render :partial => "search_project", :locals => {:project_type => 0}%>
</div>
<div style="clear: both;"></div>
</div>
</div>
<div style="clear:both"></div>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
<h3 style="margin-left: 5px; color: #e8770d;">
<strong><%= l(:lable_hot_projects)%></strong>
</h3>
<span style="margin-top: -20px;float: right; display: block;">
<% if User.current.logged? %>
<%= link_to(l(:label_project_new), {:controller => 'projects',
:action => 'new',
:course => 0,
:project_type =>( @project_type||=0)},
:class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
<% end %>
&nbsp;&nbsp;
<%= link_to l(:label_more), { :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">
<% #projects = find_miracle_project(10, 3) %>
<% @projects.map do |project| %>
<!--<%# cache cache_key_for_project(project) do %> -->
<li style="overflow:auto;word-break:break-all;height:100%;word-wrap: break-word;" 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;">
<% unless project.is_public %>
<span class="private_project"><%= l(:label_private) %></span>
<% end %>
<%= 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.short_description%>'>
<%=project.description.truncate(100, omission: '...')%>
</span>
</div>
<div >
<%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s,
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
:class => "tooltip",
:id => "tooltip-#{project.id}" %>
</div>
</li>
<!--<%#end %> -->
<% 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><%= l(:lable_user_active)%></strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to l(:label_more), { :controller => 'users', :action => 'index'}, :target => "_blank" %></span>
<div class="user-message-box-list" style="margin-top: 10px;">
<%activities = find_all_activities%>
<% activities.each do |event| %>
<!--<%# cache cache_key_for_event(event) do %> -->
<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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; width: 48%; ">
<ul class="welcome-message-list">
<!--<%# cache 'forum_links' do %> -->
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
<h3 style="color: rgb(21, 188, 207);">
<strong><%= l(:lable_bar_active)%></strong>
<%= link_to l(:label_my_question) , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
<%= link_to l(:label_my_feedback) , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
</h3>
<span style="margin-top: -30px;float: right; display: block;"><%= link_to l(:label_more), forums_path %></span>
</div>
<div class="welcome-box-list-new memo_activity">
<% topics = find_new_forum_topics(7) %>
<% topics.includes(:forum, :last_reply, :author).each do |topic|%>
<!--<%# cache cache_key_for_topic(topic) do %> -->
<li class="message-brief-intro">
<div class='memo_title text_nowrap'>
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %>
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
</div>
<div class='memo_attr'>
<span class='memo_timestamp'>
<%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %>
</span>
<span class="memo_author">
<%= l(:label_question_sponsor)%>
<%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
</span>
<span class="memo_last_person">
<%= l(:label_final_reply)%>
<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %>
<%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%>
<% end %>
</span>
<span class="memo_reply">
<%= l(:label_reply)%>
(<%= link_to topic.try(:replies_count), topic.event_url %>)
</span>
</div>
</li>
<!--<%#end %> --> <!-- cache -->
<% end %>
</div>
</ul>
</div>
<div class="clearfix"></div>
<%= render partial: 'link_to_another' %>

View File

@ -22,7 +22,7 @@
<% if User.current.logged? %>
<% if journal.user_id==User.current.id|| User.current.admin? %>
<%= link_to(l(:button_delete),{:controller => 'words', :action => 'destroyJournal', :object_id => journal.id, :project_id=>@project.id, :page=>@page},
:remote => true, :title => l(:button_delete)) %>
:remote => true, :title => l(:button_delete), :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete") %>
<% end %>
<% end %>
</span>

View File

@ -13,3 +13,16 @@ end
# Initialize the rails application
RedmineApp::Application.initialize!
#日志格式
class Logger
def format_message(level, time, progname, msg)
"#{time.to_s(:db)} #{level} -- #{msg}\r\n"
end
end
#输出日志(database文件夹下get、sql、controller按照日期 分别输出路由信息、SQL语句、调用页面)[影响系统效率使用完请注释掉]
#include LoggerHelper
#LoggerHelper.OutLogger

View File

@ -232,9 +232,6 @@ zh:
mail_body_wiki_content_added: "'%{id}' wiki页面已由 %{author} 添加。"
mail_subject_wiki_content_updated: "'%{id}' wiki页面已更新。"
mail_body_wiki_content_updated: "'%{id}' wiki页面已由 %{author} 更新。"
field_name: 名称
#added by huang
field_tea_name: 教师
@ -1940,7 +1937,7 @@ zh:
label_forum_edit: 编辑讨论区
label_memo_create: 发布
label_memo_new: 新建主题
label_memo_edit: 修改主题label_board_new
label_memo_edit: 修改主题
label_memo_new_from_forum: 发布帖子
label_forum: 公共贴吧
label_forum_new: 新建贴吧
@ -2080,7 +2077,7 @@ zh:
label_current_hot_contest: 最新热门竞赛
label_current_attendingcontest_work: 最新参赛作品
label_issue_feedback_activities: 问题和反馈动态
label_more_information: 更多...
label_more_information: 更多>>
label_my_question: 我要提问
label_my_feedback: 我要反馈
label_release_time: 发布时间
@ -2126,4 +2123,9 @@ zh:
label_my_school: 我的学校
label_all_schol: 全部学校
label_select_province: 请选择省份
label_search_conditions_not_null: 搜索条件不能为空
label_search_conditions_not_null: 搜索条件不能为空
lable_hot_course: 活跃课程
lable_hot_projects: 热门项目
lable_user_active: 用户动态
lable_bar_active: 贴吧动态

View File

@ -724,7 +724,7 @@ RedmineApp::Application.routes.draw do
# added by young
match 'calls', :to => 'bids#index'
match 'calls/:id', :to => 'bid#show', :as => 'respond'
match 'calls/:id', :to => 'bids#show', :as => 'respond'
# modified by longjun
# bids#contests is not exist
# match 'contest', :to => 'bids#contests', :as => 'contest' #modified @20140403

View File

@ -0,0 +1,26 @@
# -*coding:utf-8 -*-
class UpdateWorksCategories < ActiveRecord::Migration
def up
WorksCategory.all.each do |wc|
wc.destroy
end
workscategory1 = WorksCategory.new
workscategory1.category = "开源软件"
workscategory1.save
workscategory2 = WorksCategory.new
workscategory2.category = "移动APP"
workscategory2.save
workscategory3 = WorksCategory.new
workscategory3.category = "其他"
workscategory3.save
end
def down
WorksCategory.all.each do |wc|
wc.destroy
end
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140826072838) do
ActiveRecord::Schema.define(:version => 20140916005319) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -878,18 +878,18 @@ ActiveRecord::Schema.define(:version => 20140826072838) do
create_table "relative_memos", :force => true do |t|
t.integer "osp_id"
t.integer "parent_id"
t.string "subject", :null => false
t.text "content", :null => false
t.string "subject", :null => false
t.text "content", :limit => 16777215, :null => false
t.integer "author_id"
t.integer "replies_count", :default => 0
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
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
t.string "url"
t.string "username"
t.string "userhomeurl"
@ -976,10 +976,11 @@ ActiveRecord::Schema.define(:version => 20140826072838) do
t.string "url"
t.string "title"
t.integer "share_type"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "project_id"
t.integer "user_id"
t.string "description"
end
create_table "softapplications", :force => true do |t|
@ -1085,8 +1086,8 @@ ActiveRecord::Schema.define(:version => 20140826072838) do
t.integer "zip_code"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "identity"
t.string "technical_title"
t.integer "identity"
t.string "student_id"
t.string "teacher_realname"
t.string "student_realname"
@ -1144,9 +1145,6 @@ ActiveRecord::Schema.define(:version => 20140826072838) do
t.integer "active"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "level"
t.integer "file"
t.integer "issue"
end
create_table "user_statuses", :force => true do |t|

View File

@ -60,5 +60,10 @@
fixedBar('backTopBtn' , {autoHidden: true, top : 186});
fixedBar('identifier-pannel' , {autoHidden: false , top : 956 , show : true});
//修改微信扫码样式布局后添加微信扫码跟随滚动处理
$(window).scroll(function(){
var vtop=$(document).scrollTop();
$("#identifier-pannel").css('top',vtop+"px");
})
}
})();

View File

@ -2794,3 +2794,19 @@ div.repos_explain{
padding-top: 20px;
padding-bottom: 20px;
}
.button-canel{
padding-bottom: 5px;
width: auto;
height: 25px;
font-family: '微软雅黑',Arial,Helvetica,sans-serif;
font-size: 12px;
color: #ffffff;
padding: 3px 9px;
background: #15bccf;
border-radius: 4px;
border: 1px solid #15bccf;
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2), 0px 0px 2px rgb(255, 255, 255) inset;
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.2), 0px 1px 0px rgb(255, 255, 255);
cursor: pointer;
}

View File

@ -340,7 +340,7 @@ a.attachments_list_color {
}
#identifier-pannel{
position:fixed;
position:absolute;
left: 50%;
bottom:0;
z-index:9999;