Merge branch 'sw_new_course' into dev_hjq

Branch_szzh
huang 10 years ago
commit 4fd90464d9

@ -6,6 +6,7 @@ unless RUBY_PLATFORM =~ /w32/
gem 'iconv'
end
gem 'grack', path:'./lib/grack'
gem 'rest-client'
gem "mysql2", "= 0.3.18"
gem 'redis-rails'

@ -127,19 +127,18 @@ update
end
else # 原逻辑
##xianbo
params[:repository_scm] = "Git"
@root_path=RepositoriesHelper::ROOT_PATH
@repository_name=User.current.login.to_s+"/"+params[:repository][:identifier]+".git"
@project_path=@root_path+"htdocs/"+@repository_name
@repository_tag=params[:repository][:upassword] || params[:repository][:password]
@repository_tag=params[:repository][:upassword] || params[:repository][:password] || '1234'
@repo_name=User.current.login.to_s+"_"+params[:repository][:identifier]
logger.info "htpasswd -mb "+@root_path+"htdocs/user.passwd "+@repo_name+": "+@repository_tag
logger.info "the value of create repository"+@root_path+": "+@repository_name+": "+@project_path+": "+@repo_name
attrs = pickup_extra_info
if((@repository_tag!="")&&params[:repository_scm]=="Git")
params[:repository][:url]=@project_path
end
params[:repository][:url]=@project_path
###xianbo
@repository = Repository.factory(params[:repository_scm])
@repository = Repository.factory(params[:repository_scm]||"Git")
@repository.safe_attributes = params[:repository]
if attrs[:attrs_extra].keys.any?
@repository.merge_extra_info(attrs[:attrs_extra])
@ -278,7 +277,8 @@ update
@course_tag = params[:course]
project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
ip = RepositoriesHelper::REPO_IP_ADDRESS
@repos_url = "http://"+@repository.login.to_s+"_"+@repository.identifier.to_s+"@"+ip.to_s+
# @repos_url = "http://"+@repository.login.to_s+"_"+@repository.identifier.to_s+"@"+ip.to_s+
@repos_url = "http://#{Setting.host_name}/#{@repository.login.to_s}/#{@repository.identifier.to_s}.git"
@repository.url.slice(project_path_cut, @repository.url.length).to_s
if @course_tag == 1
render :action => 'show', :layout => 'base_courses'

@ -52,7 +52,7 @@ class UsersController < ApplicationController
:watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index,
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages]
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction]
before_filter :auth_user_extension, only: :show
#before_filter :rest_user_score, only: :show
#before_filter :select_entry, only: :user_projects
@ -177,7 +177,7 @@ class UsersController < ApplicationController
return
end
respond_to do |format|
format.html{render :layout=>'base_users_new'}
format.html{render :layout=>'new_base_user'}
end
end
@ -584,7 +584,7 @@ class UsersController < ApplicationController
end
def show
render :layout=>'base_users_new'
render :layout=>'new_base_user'
end
def show_old
@ -933,13 +933,13 @@ class UsersController < ApplicationController
end
end
@type = params[:type] || 1
@limit = 10
@limit = 15
@is_remote = true
@obj_count = @attachments.count
@obj_pages = Paginator.new @obj_count, @limit, params['page'] || 1
@offset ||= @obj_pages.offset
@atta_count = @attachments.count
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
@offset ||= @atta_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@attachments = paginateHelper @attachments,10
@attachments = paginateHelper @attachments,15
respond_to do |format|
format.js
end
@ -989,13 +989,13 @@ class UsersController < ApplicationController
end
end
@type = params[:type]
@limit = 10
@limit = 15
@is_remote = true
@obj_count = @attachments.count
@obj_pages = Paginator.new @obj_count, @limit, params['page'] || 1
@offset ||= @obj_pages.offset
@atta_count = @attachments.count
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
@offset ||= @atta_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@attachments = paginateHelper @attachments,10
@attachments = paginateHelper @attachments,15
respond_to do |format|
format.js
end
@ -1362,6 +1362,16 @@ class UsersController < ApplicationController
@user = User.find(params[:id])
end
#修改个人简介
def edit_brief_introduction
if @user && @user.extensions
@user.extensions.update_column("brief_introduction",params[:brief_introduction])
end
respond_to do |format|
format.js
end
end
# 资源库 分为全部 课程资源 项目资源 附件
def user_resource
#确定container_type
@ -1405,13 +1415,13 @@ class UsersController < ApplicationController
end
end
@type = params[:type]
@limit = 10
@limit = 15
@is_remote = true
@obj_count = @attachments.count
@obj_pages = Paginator.new @obj_count, @limit, params['page'] || 1
@offset ||= @obj_pages.offset
@atta_count = @attachments.count
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
@offset ||= @atta_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@attachments = paginateHelper @attachments,10
@attachments = paginateHelper @attachments,15
respond_to do |format|
format.js
format.html {render :layout => 'base_users_new'}
@ -1436,7 +1446,7 @@ class UsersController < ApplicationController
elsif params[:type] == "2" #课程资源
if User.current.id.to_i == params[:id].to_i
user_course_ids = User.current.courses.map { |c| c.id}
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) ").order("created_on desc")
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) and (filename like '%#{search}%') ").order("created_on desc")
else
user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中
@attachments = Attachment.where("((author_id = #{params[:id]} and is_public = 1 and container_type = 'Course') "+
@ -1457,13 +1467,13 @@ class UsersController < ApplicationController
end
end
@type = params[:type]
@limit = 10
@limit = 15
@is_remote = true
@obj_count = @attachments.count
@obj_pages = Paginator.new @obj_count, @limit, params['page'] || 1
@offset ||= @obj_pages.offset
@atta_count = @attachments.count
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
@offset ||= @atta_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@attachments = paginateHelper @attachments,10
@attachments = paginateHelper @attachments,15
respond_to do |format|
format.js
end

@ -19,7 +19,7 @@
module RepositoriesHelper
if Rails.env.development?
ROOT_PATH="/tmp/" if Rails.env.development?
ROOT_PATH="/private/tmp/"
else
ROOT_PATH="/home/pdl/redmine-2.3.2-0/apache2/"
end

@ -4,4 +4,27 @@ class CourseActivity < ActiveRecord::Base
belongs_to :course_act ,:polymorphic => true
belongs_to :course
belongs_to :user
has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
after_save :add_user_activity
before_destroy :destroy_user_activity
#在个人动态里面增加当前动态
def add_user_activity
user_activity = UserActivity.where("act_type = '#{self.class.to_s}' and act_id = '#{self.id}'").first
if user_activity
user_activity.save
else
user_activity = UserActivity.new
user_activity.act_id = self.id
user_activity.act_type = self.class.to_s
user_activity.container_type = "Course"
user_activity.container_id = self.course_id
user_activity.save
end
end
def destroy_user_activity
user_activity = UserActivity.where("act_type = '#{self.class.to_s}' and act_id = '#{self.id}'")
user_activity.destroy_all
end
end

@ -19,5 +19,27 @@ class ForgeActivity < ActiveRecord::Base
validates :project_id,presence: true
validates :forge_act_id,presence: true
validates :forge_act_type, presence: true
has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
after_save :add_user_activity
before_destroy :destroy_user_activity
#在个人动态里面增加当前动态
def add_user_activity
user_activity = UserActivity.where("act_type = '#{self.class.to_s}' and act_id = '#{self.id}'").first
if user_activity
user_activity.save
else
user_activity = UserActivity.new
user_activity.act_id = self.id
user_activity.act_type = self.class.to_s
user_activity.container_type = "Project"
user_activity.container_id = self.project_id
user_activity.save
end
end
def destroy_user_activity
user_activity = UserActivity.where("act_type = '#{self.class.to_s}' and act_id = '#{self.id}'")
user_activity.destroy_all
end
end

@ -0,0 +1,7 @@
class UserActivity < ActiveRecord::Base
attr_accessible :act_type,:act_id,:container_type,:container_id
# 虚拟关联---项目动态表/课程动态表
belongs_to :act ,:polymorphic => true
# 虚拟关联---项目/课程
belongs_to :container ,:polymorphic => true
end

@ -0,0 +1,47 @@
<div class="navHomepage">
<div class="navHomepageLogo fl">
<%=link_to image_tag("../images/logo.png",width:"51px", height: "45px",class: "mt3"), user_activities_path(User.current.id)%>
</div>
<div class="fl">
<ul>
<li class="navHomepageMenu fl">
<a href="javascript:void(0);" class="homepageWhite f16">首页</a>
</li>
<li class="navHomepageMenu fl">
<a href="javascript:void(0);" class="homepageWhite f16">资源库</a></li>
<li class="navHomepageMenu fl">
<a href="javascript:void(0);" class="homepageWhite f16">作业</a>
</li>
<li class="navHomepageMenu fl">
<a href="javascript:void(0);" class="homepageWhite f16">联系人</a>
</li>
</ul>
</div>
<div class="fl">
<form class="navHomepageSearchBox">
<input type="text" name="navHomepageSearch" class="navHomepageSearchInput" />
<a href="javascript:void(0);" class="homepageSearchIcon"></a>
</form>
</div>
<div class="navHomepageProfile">
<ul>
<li class="homepageProfileMenuIcon">
<%= link_to "<div class='mt5 mb8'>#{image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:alt=>"头像", :id => "nh_user_logo")}</div>".html_safe,user_activities_path(User.current.id)%>
<ul class="topnav_login_list">
<li><a href="javascript:void(0);" class="menuGrey">修改资料</a> </li>
<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>
<li><a href="javascript:void(0);" class="menuGrey">退出</a></li>
</ul>
</li>
</ul>
</div>
<div class="navHomepageNews">
<%= link_to image_tag("/images/news_icon_small.png" , :width => "21", :height => "24"), {:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user} %>
<% if User.current.count_new_message >0 %>
<div class="newsActive"></div>
<% end %>
<div class="newsActive"></div>
</div>
</div>

@ -21,14 +21,15 @@
</a>
<% end %>
</div>
<div class="msgserver">
<div class="mt5">
<a target="hiddentab" href="http://wpa.qq.com/msgrd?v=1&uin=1554253403&site=qq&menu=yes" style="color: #15BCCF;">
<%= l(:label_technical_support) %>白&nbsp;&nbsp;&nbsp;羽</a>
<iframe name="hiddentab" style="display: none"></iframe>
</div>
</div>
<div class="side_bottom"></div>
</div>
</div>
<div class="show_btn"><span>在线客服</span></div>
<div class="show_btn">
<span>在线客服</span>
</div>
</div>

@ -0,0 +1,40 @@
<div class="navHomepage">
<div class="navHomepageLogo fl">
<%=link_to image_tag("../images/logo.png",weight:"51px", height: "45px",class: "mt3")%>
</div>
<div class="fl">
<ul>
<li class="navHomepageMenu fl"><a href="javascript:void(0);" class="homepageWhite f16">首页</a></li>
<li class="navHomepageMenu fl"><a href="javascript:void(0);" class="homepageWhite f16">资源库</a></li>
<li class="navHomepageMenu fl"><a href="javascript:void(0);" class="homepageWhite f16">作业</a></li>
<li class="navHomepageMenu fl"><a href="javascript:void(0);" class="homepageWhite f16">联系人</a></li>
</ul>
</div>
<div class="fl">
<form class="navHomepageSearchBox">
<input type="text" name="navHomepageSearch" class="navHomepageSearchInput" />
<a href="javascript:void(0);" class="homepageSearchIcon"></a>
</form>
</div>
<div class="navHomepageProfile">
<ul>
<li class="homepageProfileMenuIcon">
<a href="javascript:void(0);">
<div class="mt5 mb8">
<img src="images/homepageProfileImage.png" width="40" height="40" />
</div>
</a>
<ul class="topnav_login_list">
<li><a href="javascript:void(0);" class="menuGrey">修改资料</a> </li>
<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>
<li><a href="javascript:void(0);" class="menuGrey">退出</a></li>
</ul>
</li>
</ul>
</div>
<div class="navHomepageNews">
<a href="javascript:void(0);" class="homepageNewsIcon">
<div class="newsActive"></div>
</a>
</div>
</div>

@ -0,0 +1,10 @@
<% if user.user_extensions && user.user_extensions.brief_introduction && !user.user_extensions.brief_introduction.empty? %>
<%= user.user_extensions.brief_introduction %>&nbsp;
<% else%>
这位童鞋很懒,什么也没有留下~&nbsp;
<% end %>
<% if User.current == user%>
<a href="javascript:void(0);" onclick="show_edit_user_introduction();">
<img src="../images/signature_edit.png" width="12" height="12" />
</a>
<% end%>

@ -1,11 +1,7 @@
<% if User.current.logged?%>
<% if User.current == target%>
<a href="<%= url_for(:controller => 'my', :action => 'account') %>" class="fr gz_btn mr10 ">编辑资料</a>
<%else%>
<%if(target.watched_by?(User.current))%>
<a id="user_watch_id" href="<%= watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr qx_btn mr10" data-method="delete" data-remote="true" title="取消关注">取消关注</a>
<% else %>
<a id="user_watch_id" href="<%= watch_path(:object_type=>'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr gz_btn mr10" data-method="post" data-remote="true" title="添加关注">添加关注</a>
<% end %>
<% end%>
<%if(target.watched_by?(User.current))%>
<%= link_to "",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "homepageFollow", :method => "delete",:remote => "true", :title => "取消关注"%>
<% else %>
<%= link_to "",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "homepageFollowCancel", :method => "post",:remote => "true", :title => "添加关注"%>
<% end %>
<% end %>

@ -0,0 +1,212 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_public', 'user_leftside', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user"%>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
</head>
<body>
<div class="navContainer">
<% is_current_user = User.current.logged? && User.current == @user%>
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %>
<% else%>
<%= render :partial => 'layouts/unlogin_header' %>
<% end%>
</div>
<div class="homepageContentContainer">
<div class="homepageContent">
<div class="homepageLeft" id="LSide">
<div class="homepagePortraitContainer">
<div class="homepagePortraitImage" id="homepage_portrait_image">
<%= image_tag(url_to_avatar(@user),width:"206", height: "206", :id=>'nh_user_tx') %>
<% if User.current.logged?%>
<% if is_current_user%>
<div id="edit_user_file_btn" class="none">
<div class="homepageEditProfile">
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="homepageEditProfileIcon"></a>
</div>
</div>
<% else %>
<div id="watch_user_btn" class="none">
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
</div>
<% end %>
<% end%>
</div>
<div>
<div class="homepageImageName hidden">
<%= @user.login %>
</div>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
<div class="<%= @user.user_extensions.gender == 1 ? 'homepageImageSexWomen' : 'homepageImageSexMan' %> "></div>
<% end %>
<%= link_to("编辑资料", my_account_path, :class => "fr gz_btn mr10") if is_current_user%>
<div class="cl"></div>
</div>
<div>
<div class="homepageSignature">
<p id="user_brief_introduction_show">
<%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %>
</p>
</div>
<textarea class="homepageSignatureTextarea none" placeholder="请输入回复" id="user_brief_introduction_edit" onblur="edit_user_introduction('<%= edit_brief_introduction_user_path(@user.id)%>');"><%= @user.user_extensions.brief_introduction %></textarea>
</div>
<div>
<div class="homepageImageBlock">
<div>
<%= link_to User.watched_by(@user.id).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"homepageImageNumber" %>
</div>
<div class="homepageImageText">关注</div>
</div>
<div class="homepageVerDiv"></div>
<div class="homepageImageBlock">
<div>
<%= link_to @user.watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"homepageImageNumber", :id => "user_fans_number"%>
</div>
<div class="homepageImageText">粉丝</div>
</div>
<div class="homepageVerDiv"></div>
<div class="homepageImageBlock">
<div>
<%= link_to(format("%.2f" ,get_option_number(@user,1).total_score ).to_i,
{:controller => 'users', :action => 'show_new_score', :remote => true, :id => @user.id }, :class => 'homepageImageNumber',:id => 'user_score') %>
</div>
<div class="homepageImageText">积分</div>
</div>
<div class="cl"></div>
</div>
</div>
<div class="homepageLeftMenuContainer">
<div class="homepageLeftMenuBlock">
<%= link_to "动态",user_activities_path(@user.id),:class => "homepageMenuText"%>
</div>
<div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText">课程</a>
<a href="javascript:void(0);" class="homepageMenuSetting">
<img src="../images/menu_setting.png" width="14" height="14" />
</a>
</div>
<div class="homepageLeftMenuCourses">
<ul>
<% courses = @user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5)%>
<% courses.each do |course|%>
<li class="homepageLeftMenuCoursesLine">
<a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>course.id, :host=>Setting.host_course) %>" class="coursesLineGrey">
<%= course.name %>
</a>
</li>
<% end %>
<% if courses.size == 5%>
<li class="homepageLeftMenuMore">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon"></a>
</li>
<% end%>
</ul>
</div>
<div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText">项目</a>
<a href="javascript:void(0);" class="homepageMenuSetting">
<img src="../images/menu_setting.png" width="14" height="14" />
</a>
</div>
<div class="homepageLeftMenuCourses">
<ul>
<% projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
<% projects.each do |project|%>
<li class="homepageLeftMenuCoursesLine">
<a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>project.id, :host=>Setting.host_name) %>" class="coursesLineGrey">
<%= project.name %>
</a>
</li>
<% end %>
<% if projects.size == 5%>
<li class="homepageLeftMenuMore">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon"></a>
</li>
<% end%>
</ul>
</div>
<div class="homepageLeftMenuBlock">
<a href="javascript:void(0);" class="homepageMenuText">留言</a>
</div>
</div>
<div class="homepageLeftLabelContainer">
<div class="project_Label_New">
<span class="homepageLabelText">标签</span>
<div class="tag_h ml10" >
<%= render :partial => 'tags/user_tag', :locals => {:obj => @user,:object_flag => "1"}%>
</div>
<div class="cl"></div>
</div>
</div>
</div>
<div class="homepageRight">
<%= yield %>
</div>
</div>
<%= render :partial => 'layouts/new_feedback' %>
</div>
<div id="ajax-modal" style="display:none;"></div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<div>
<div><a href="javascript:hideModal();" class="box_close"></a></div>
<div class="cl"></div>
<div class="pro_new">
<h3 class="box_h3 mb10">头像设置</h3>
<div class="uppicBox">
<%= file_field_tag 'avatar[image]',
:id => nil,
:class => 'uppic_btn',
:style => 'width:70px;',#added by young
:size => "1",
:multiple => false,
:onchange => 'addInputAvatar(this);',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:file_type => Redmine::Configuration['pic_types'].to_s,
:type_support_message => l(:error_pic_type),
:upload_path => upload_avatar_path(:format => 'js'),
:description_placeholder => nil ,# l(:label_optional_description)
:source_type => @user.class.to_s,
:source_id => @user.id.to_s
} %>
<!--<br/>-->
<!--<span>只支持jpg,png,gif,大小不超过5M</span>-->
</div>
<div class="showpicBox">
<p>预览</p>
<%= image_tag(url_to_avatar(@user), :style=>"width:96px;height:96px;",:class=>"mb5 mt10",:nhname=>'avatar_image') %>
<span >96px*96px</span> <br />
<div class="mb20"></div>
<%= image_tag(url_to_avatar(@user), :style=>"width:48px;height:48px;",:class=>"mb5",:nhname=>'avatar_image') %>
<br />
<span>48px*48px</span> <br />
</div>
<div class="cl mb10"></div>
<a href="javascript:hideModal();" class=" fr grey_btn mr15"> 取&nbsp;&nbsp;消</a>
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10">确&nbsp;&nbsp;定</a>
</div><!--talknew end-->
<div class="cl"></div>
</div><!--floatbox end-->
</div>
</body>
</html>

@ -1,2 +1,3 @@
$("#nh_user_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:214px;height:214px;overflow:hidden",:alt=>"头像") %>');
$("#nh_user_logo").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_logo',:width =>"40",:height => "40",:alt=>"头像") %>');
hideModal();

@ -62,15 +62,6 @@
<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post"} do |f| %>
<div id="pro_st_edit_ku" class="pro_st_edit_ku">
<ul>
<li >
<label class="label02"><%=l(:label_scm)%></label>
<%= select_tag('repository_scm',
options_for_select(["Git"],@repository.class.name.demodulize),
:data => {:remote => true, :method => 'get'})%>
<% if @repository && ! @repository.class.scm_available %>
<span class="c_grey"><%= l(:text_scm_command_not_available) %></span>
<% end %>
</li>
<% unless judge_main_repository(@project) %>
<li>
<label class="label02"><%=l(:field_repository_is_default)%></label>
@ -84,14 +75,9 @@
<span class="c_grey"><%=l(:text_length_between,:min=>1,:max=>254)<<l(:text_project_identifier_info) %></span>
<% end %>
</li>
<li >
<label class="label02"><span class="c_red">*</span><%=l(:label_password)%></label>
<%= f.password_field :upassword, :label=> "", :no_label => true %>
<span class="c_grey"><%= l(:label_upassword_info)%></span>
</li>
<div class="cl"></div>
</ul>
<a href="#" onclick="$('#repository-form').submit();" class="blue_btn fl ml110"><%=l(:button_save)%></a>
<a href="<%= settings_project_path(@project, :tab => 'repositories')%>" class="grey_btn fl ml10"><%=l(:button_cancel)%></a>
</div><!--pro_st_edit_issues end-->
<% end %>
<% end %>

@ -33,8 +33,9 @@
<div id="repos_git_more">
<br>
<div class=" c_dark f14">
<p color="red">git 克隆和提交的用户名和密码为登录用户名和密码 </p>
<p>项目代码请设置好正确的编码方式utf-8否则中文会出现乱码。</p>
<p>通过cmd命令提示符进入代码对应文件夹的根目录假设当前用户的登录名为user版本库名称为demo需要操作的版本库分支为branch。
<p>通过cmd命令提示符进入代码对应文件夹的根目录
如果是首次提交代码,执行如下命令:</p>
</div>
<div class="repos_explain">
@ -45,19 +46,19 @@
<p>git commit -m "first commit"</p>
<p>git remote add origin
http://user_demo@repository.trustie.net/user/demo.git
<%= @repos_url %>
</p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u origin branch:branch</p>
<p>git push -u origin master</p>
</div>
<!--repos_explain end-->
<div class="c_dark f14">
<p>已经有本地库,还没有配置远程地址,打开命令行执行如下:</p>
</div>
<div class="repos_explain">
<p>git remote add origin http://user_demo@repository.trustie.net/user/demo.git</p>
<p>git remote add origin <%= @repos_url %></p>
<p>git add .</p>
@ -65,14 +66,14 @@
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u origin branch:branch</p>
<p>git push -u origin master</p>
</div>
<!--repos_explain end-->
<div class="c_dark f14">
<p>已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:</p>
</div>
<div class="repos_explain">
<p>git clone http://user_demo@repository.trustie.net/user/demo.git</p>
<p>git clone <%= @repos_url %></p>
<p>git push</p>
@ -86,7 +87,7 @@
</div>
<div class="repos_explain">
<p>git remote add trustie
http://user_demo@repository.trustie.net/user/demo.git
<%= @repos_url %>
</p>
<p>git add .</p>

@ -0,0 +1,3 @@
$("#user_brief_introduction_show").html("<%= escape_javascript render(:partial => "layouts/user_brief_introduction", :locals => {:user => @user}) %>");
$("#user_brief_introduction_show").show();
$("#user_brief_introduction_edit").hide();

@ -1,2 +1,2 @@
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
$("#pages").html('<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');

File diff suppressed because it is too large Load Diff

@ -105,7 +105,7 @@
</div>
<div>
<ul class="wlist" id="pages">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul>
</div>
<div class="cl"></div>

@ -1,3 +1,3 @@
$("#search_div").html('<%= escape_javascript( render :partial => 'resource_search_form',:locals => {:user=>@user,:type=>@type} ) %>');
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
$("#pages").html('<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');

@ -2,3 +2,4 @@
closeModal();
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');

@ -1,2 +1,2 @@
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
$("#pages").html('<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');

@ -1,57 +1,15 @@
<% if( params[:object_type] == 'user') %>
//点击头像下面的添加关注按钮
<% if( params[:target_id] == params[:object_id] ) %>
<% target = User.find_by_id(params[:target_id]) %>
//btn
var btn_html = "<%= escape_javascript( render( :partial => 'layouts/user_watch_btn', :locals => {:target => target} ) )%>";
$('#user_watch_id').replaceWith(btn_html);
//count
$("*[nh_name='fans_count']").html("<%= target.watcher_users.count.to_s %>");
//left list
var list_left_html = "<%= escape_javascript( render( :partial => 'layouts/user_fans_list', :locals => {:user => target} ) )%>";
$('#fans_nav_list').replaceWith(list_left_html);
//list
if( $("#nh_fans_list") != undefined && $("#nh_fans_list").length != 0 ){
<% if( opt == 'add') %>
var list_html = "<%= escape_javascript( render( :partial => 'users/user_fans_item', :locals => {:item=>User.current,:target => target} ) )%>";
$("#nh_fans_list").after(list_html);
$("#nodata").hide();
<% else %>
$("#fans_item_<%= User.current.id %>",$("#nh_fans_list").parent('div')).remove();
if( $('>div',$("#nh_fans_list").parent('div')).length == 1 ){
$("#nodata").show();
}
<% end %>
}
$("#watch_user_btn").html("<%= escape_javascript render(:partial => "layouts/user_watch_btn", :locals => {:target => watched.first}) %>");
$("#user_fans_number").html("<%= watched.first.watcher_users.count.to_s%>");
//在当前用户的粉丝、关注页面
<% elsif( params[:target_id] == User.current.id.to_s )%>
<% target = User.find_by_id(params[:target_id]) %>
<% item = User.find_by_id(params[:object_id]) %>
//count
$("*[nh_name='watcher_count']").html("<%= User.watched_by(target.id).count.to_s %>");
//left list
var list_left_html = "<%= escape_javascript( render( :partial => 'layouts/user_watch_list', :locals => {:user => target} ) )%>";
$('#watcher_nav_list').replaceWith(list_left_html);
//list
if( $("#nh_wacth_list") != undefined && $("#nh_wacth_list").length != 0 ){
<% if( opt == 'delete') %>
$("#fans_item_<%= item.id %>",$("#nh_wacth_list").parent('div')).remove();
if( $('>div',$("#nh_wacth_list").parent('div')).length == 1 ){
$("#nodata").show();
}
<% end %>
}else if($("#nh_fans_list") != undefined && $("#nh_fans_list").length != 0){
var list_html = "<%= escape_javascript( render( :partial => 'users/user_fans_item', :locals => {:item=>item,:target => target} ) )%>";
$('#fans_item_<%= item.id %>').replaceWith(list_html);
}
//在其他用户的粉丝、关注页面
<% else %>
<% target = User.find_by_id(params[:target_id]) %>
<% item = User.find_by_id(params[:object_id]) %>
//list
var list_html = "<%= escape_javascript( render( :partial => 'users/user_fans_item', :locals => {:item=>item,:target => target} ) )%>";
$('#fans_item_<%= item.id %>').replaceWith(list_html);
<% end %>
<% end %>
<% else %>
<% selector = ".#{watcher_css(watched)}" %>

@ -197,9 +197,12 @@ default:
#max_concurrent_ajax_uploads: 2
#pic_types: "bmp,jpeg,jpg,png,gif"
repository_root_path: '/tmp/htdocs'
# specific configuration options for production environment
# that overrides the default ones
production:
repository_root_path: '/home/pdl/redmine-2.3.2-0/apache2/htdocs'
cookie_domain: ".trustie.net"
rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf
email_delivery:

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

Loading…
Cancel
Save