diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb
index 8187055be..731a251f2 100644
--- a/app/controllers/account_controller.rb
+++ b/app/controllers/account_controller.rb
@@ -26,7 +26,13 @@ class AccountController < ApplicationController
if request.get?
@login = params[:login] || true
if User.current.logged?
- redirect_to user_path(User.current)
+ # 判断用户基本资料是否完善,不完善讲强制完善基本资料,完善进入主页
+ user = UserExtensions.where(:user_id => User.current.id).first
+ if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil?
+ redirect_to my_account_path(:tip => 1)
+ else
+ redirect_to user_path(User.current)
+ end
else
render :layout => 'login'
end
@@ -127,7 +133,7 @@ class AccountController < ApplicationController
session[:auth_source_registration] = nil
self.logged_user = @user
flash[:notice] = l(:notice_account_activated)
- redirect_to my_account_path
+ redirect_to my_account_path(:tip=>1)
end
else
us = UsersService.new
@@ -144,7 +150,7 @@ class AccountController < ApplicationController
if !@user.new_record?
self.logged_user = @user
flash[:notice] = l(:notice_account_activated)
- redirect_to my_account_url
+ redirect_to my_account_url(:tip=>1)
else
redirect_to signin_path
end
@@ -347,9 +353,15 @@ class AccountController < ApplicationController
else
#by young
#redirect_back_or_default my_page_path
- redirect_back_or_default User.current
+ # 基本资料不完善的用户,将强制用户完善基本资料。
+ user = UserExtensions.where(:user_id => User.current.id).first
+ if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil?
+ redirect_to my_account_path(:tip => 1)
+ else
+ redirect_back_or_default User.current
#redirect_to my_account_url
#redirect_to User.current
+ end
end
end
end
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 3c012fce7..25cc85ae2 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -698,7 +698,7 @@ class AdminController < ApplicationController
apply_school_ids = apply_schools.empty? ? "(-1)" : "(" + apply_schools.map{|sc| sc.school_id}.join(',') + ")"
if !params[:search].nil?
search = "%#{params[:search].to_s.strip.downcase}%"
- @schools = School.where("id not in #{apply_school_ids} and #{School.table_name}.name like :p",:p=>search)
+ @schools = School.where("id not in #{apply_school_ids} and #{School.table_name}.name like :p", :p => search)
#@schools = School.all
else
#@course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id}").select { |course| @user.allowed_to?(:as_teacher,course)}
diff --git a/app/controllers/at_controller.rb b/app/controllers/at_controller.rb
index 0e48cd962..66cbf27b8 100644
--- a/app/controllers/at_controller.rb
+++ b/app/controllers/at_controller.rb
@@ -10,7 +10,7 @@ class AtController < ApplicationController
@users = users.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id }.sort{|x,y| to_pinyin(x.show_name) <=> to_pinyin(y.show_name)} if users
#加上all
- if @user && @users.size > 0
+ if User.current.logged? && @users.size > 0
allUser = Struct.new(:id, :name).new
allUser.id = @users.map{|u| u.id}.join(",")
allUser.name = "all"
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb
index 05b93d302..3aefdfd1d 100644
--- a/app/controllers/my_controller.rb
+++ b/app/controllers/my_controller.rb
@@ -114,9 +114,15 @@ class MyController < ApplicationController
applied_message.update_attribute(:viewed, true)
end
+ # 基本资料不完善 @force为false, 完善 @force为true
+ @force = false
+ if params[:tip]
+ @force = true
+ end
+
@user = User.current
- lg=@user.login
+ lg = @user.login
@pref = @user.pref
diskfile = disk_filename('User', @user.id)
diskfile1 = diskfile + 'temp'
@@ -178,7 +184,12 @@ class MyController < ApplicationController
File.delete(diskfile1) if File.exist?(diskfile1)
end
- render :layout=>'new_base_user'
+ # 基本资料不完善,无法使用其他功能,完善着可继续使用
+ if @force
+ render :layout => 'new_base_user_show'
+ else
+ render :layout => 'new_base_user'
+ end
end
# Destroys user's account
diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb
index 5e21f9af0..b67a74439 100644
--- a/app/controllers/pull_requests_controller.rb
+++ b/app/controllers/pull_requests_controller.rb
@@ -1,8 +1,10 @@
class PullRequestsController < ApplicationController
+ before_filter :authorize_logged
before_filter :find_project_and_repository
before_filter :connect_gitlab, :only => [:index, :show, :create, :accept_pull_request, :pull_request_commits, :pull_request_changes, :new,
:update_pull_request, :pull_request_comments, :create_pull_request_comment]
+
layout "base_projects"
include PullRequestsHelper
include ApplicationHelper
@@ -235,6 +237,13 @@ class PullRequestsController < ApplicationController
end
private
+ def authorize_logged
+ if !User.current.logged?
+ redirect_to signin_path
+ return
+ end
+ end
+
def connect_gitlab
@g = Gitlab.client
end
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index 8f3ebff98..722845ef7 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -868,6 +868,7 @@ class StudentWorkController < ApplicationController
update_org_activity(@homework.class,@homework.id)
if @work.save
@work = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:id => @work.id).first
+ @count = @homework.student_works.has_committed.count
respond_to do |format|
format.js
end
diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb
index 6ccfbcce1..cfa5f4414 100644
--- a/app/controllers/wechats_controller.rb
+++ b/app/controllers/wechats_controller.rb
@@ -418,10 +418,15 @@ class WechatsController < ActionController::Base
logger.info "user_activities!!!!!!!!!!!!!!"
logger.info params
+
+ #保证下面的redirect_to "/wechat/user_activities##{@path}?id=...不会往下走
+ if params[:state] == nil
+ return
+ end
- # unless (user_binded?(open_id) || params[:state] == "invite_code" || params[:state] == "project_invite_code" || params[:state] == "blog_comment" || params[:state] == "course_notice" || params[:state] == "project_discussion" || params[:state] == "course_discussion" || params[:state] == "homework" || params[:state] == "issues" || params[:state] == "journal_for_message")
- # @path = '/login'
- # else
+ unless (user_binded?(open_id) || params[:state] == "invite_code" || params[:state] == "project_invite_code" || params[:state] == "blog_comment" || params[:state] == "course_notice" || params[:state] == "project_discussion" || params[:state] == "course_discussion" || params[:state] == "homework" || params[:state] == "issues" || params[:state] == "journal_for_message")
+ @path = '/login'
+ else
if params[:state] == 'myclass'
@course_id = params[:id];
elsif params[:state] == 'myproject'
@@ -439,7 +444,7 @@ class WechatsController < ActionController::Base
end
# redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
end
- # end
+ end
render 'wechats/user_activities', layout: nil
end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index da66f249b..0c0e0919e 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2169,7 +2169,7 @@ module ApplicationHelper
candown= User.current.member_of_course?(course) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2
elsif attachment.container.is_a?(OrgSubfield)
org = attachment.container.organization
- candown = User.current.member_of_org?(org) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2
+ candown = User.current.member_of_org?(org) || ((attachment.is_public == 1 || attachment.get_status_by_attach(User.current.id) == 2) && org.allow_guest_download == true)
elsif attachment.container.is_a?(OrgDocumentComment)
org = attachment.container.organization
candown = org.allow_guest_download || User.current.member_of_org?(org) || (org.is_public && attachment.is_public == 1)
@@ -3436,3 +3436,9 @@ def course_syllabus_option user = User.current
end
type
end
+
+# 获取项目动态更新时间
+def get_forge_act_message(act, type)
+ forge_act = ForgeActivity.where(:forge_act_id => act.id, :forge_act_type => type).first
+ format_time(forge_act.nil? ? act.created_on : forge_act.try(:updated_at))
+end
diff --git a/app/views/at/show.json.erb b/app/views/at/show.json.erb
index 6e2a244e4..3e49496f9 100644
--- a/app/views/at/show.json.erb
+++ b/app/views/at/show.json.erb
@@ -1,11 +1,11 @@
[
- <% @users && @users.each_with_index do |person,index| %>
- <% if index == 0 %>
- {"id":<%=index%>, "userid": "<%=person.id%>", "name": "所有人", "login": "<%=person.name%>", "searchKey": "<%=person.name%>"}
- <%= index != @users.size-1 ? ',' : '' %>
- <% else %>
- {"id":<%=index%>, "userid": <%=person.id%>, "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
- <%= index != @users.size-1 ? ',' : '' %>
- <% end %>
- <% end %>
+ <% @users && @users.each_with_index do |person,index| %>
+ <% if index == 0 %>
+ {"id":<%=index%>, "userid": "<%=person.id%>", "name": "所有人", "login": "<%=person.name%>", "searchKey": "<%=person.name%>"}
+ <%= index != @users.size-1 ? ',' : '' %>
+ <% else %>
+ {"id":<%=index%>, "userid": "<%=person.id%>", "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
+ <%= index != @users.size-1 ? ',' : '' %>
+ <% end %>
+ <% end %>
]
diff --git a/app/views/attachments/_activity_attach.html.erb b/app/views/attachments/_activity_attach.html.erb
index 3cc429185..b37c80dad 100644
--- a/app/views/attachments/_activity_attach.html.erb
+++ b/app/views/attachments/_activity_attach.html.erb
@@ -3,7 +3,7 @@
- <%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw380', :download => true -%>
+ <%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw380', :download => true %>
(
diff --git a/app/views/files/_org_subfield_list.html.erb b/app/views/files/_org_subfield_list.html.erb
index 1bbdc0e93..e567435a5 100644
--- a/app/views/files/_org_subfield_list.html.erb
+++ b/app/views/files/_org_subfield_list.html.erb
@@ -11,9 +11,9 @@
<%# 如果有历史版本则提供历史版本下载 %>
<% if file.attachment_histories.count == 0 %>
- <%= link_to file.is_public? ? truncate(file.filename, length: 45) : truncate(file.filename,length: 35, omission: '...'),
- download_named_attachment_path(file.id, file.filename),
- :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %>
+ <%= link_to file.is_public? ? truncate(file.filename, length: 45) : truncate(file.filename,length: 35, omission: '...'),
+ download_named_attachment_path(file.id, file.filename),
+ :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %>
<% else %>
<%= link_to truncate(file.filename,length: 35, omission: '...'), attachment_history_download_path(file.id),
:title => file.filename+"\n"+file.description.to_s,
diff --git a/app/views/layouts/_footer_show.html.erb b/app/views/layouts/_footer_show.html.erb
new file mode 100644
index 000000000..bb29956d3
--- /dev/null
+++ b/app/views/layouts/_footer_show.html.erb
@@ -0,0 +1,43 @@
+
\ No newline at end of file
diff --git a/app/views/layouts/_logined_header_show.html.erb b/app/views/layouts/_logined_header_show.html.erb
new file mode 100644
index 000000000..a6721501e
--- /dev/null
+++ b/app/views/layouts/_logined_header_show.html.erb
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+ <%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
+
+
+
diff --git a/app/views/layouts/_user_courses.html.erb b/app/views/layouts/_user_courses.html.erb
index b3b21547e..d5f877eea 100644
--- a/app/views/layouts/_user_courses.html.erb
+++ b/app/views/layouts/_user_courses.html.erb
@@ -82,7 +82,6 @@
<% end %>
<% if all_count > (page.to_i+1) * 10%>
-
diff --git a/app/views/layouts/_user_projects.html.erb b/app/views/layouts/_user_projects.html.erb
index caaaaf031..21b42decd 100644
--- a/app/views/layouts/_user_projects.html.erb
+++ b/app/views/layouts/_user_projects.html.erb
@@ -59,7 +59,6 @@
<% end %>
<% if all_count > (page.to_i+1) * 10%>
-
diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb
index f98585b77..a107bfe15 100644
--- a/app/views/layouts/new_base_user.html.erb
+++ b/app/views/layouts/new_base_user.html.erb
@@ -102,8 +102,10 @@
- <% if User.current.logged?%>
- <%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_user_tx'), my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true%>
+ <% if User.current.logged? && User.current == @user%>
+ <%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id => 'nh_user_tx'), my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true%>
+ <% elsif User.current.logged? %>
+
<%=image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_user_tx') %>
<% else %>
<% end %>
diff --git a/app/views/layouts/new_base_user_show.html.erb b/app/views/layouts/new_base_user_show.html.erb
new file mode 100644
index 000000000..37354d8d8
--- /dev/null
+++ b/app/views/layouts/new_base_user_show.html.erb
@@ -0,0 +1,335 @@
+
+
+
+
+
<%= h html_title %>
+
+
+ <%= csrf_meta_tag %>
+ <%= favicon %>
+ <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','syllabus',:media => 'all' %>
+ <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
+ <%= javascript_heads %>
+ <%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>
+ <%= heads_for_theme %>
+ <%= call_hook :view_layouts_base_html_head %>
+ <%= yield :header_tags -%>
+
+
+
+
+
+
+
+
+
+ <% is_current_user = User.current.logged? && User.current == @user%>
+ <% if User.current.logged? %>
+ <%= render :partial => 'layouts/logined_header_show' %>
+ <% else%>
+ <%= render :partial => 'layouts/unlogin_header' %>
+ <% end%>
+
+
+
+
+
+
+
+
+
+
+ <% hidden_courses = Setting.find_by_name("hidden_courses") %>
+ <% unvisiable = hidden_courses && hidden_courses.value == "1"%>
+ <% if !unvisiable %>
+
+
+ 课程
+ <% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10) %>
+ <% all_count = @user.courses.visible.where("is_delete =?", 0).count%>
+
+
+ <% if !courses.empty? %>
+
+
+
+ <% end %>
+
+
+ <% if is_current_user %>
+
+ 新建课程
+
+
+ 新建班级
+
+
+ 加入班级
+
+ <% if @user == User.current %>
+
+ 我的作业
+
+ <% end %>
+ <% end %>
+
+ <% end %>
+
+
+
+ 项目
+ <% all_count = @user.projects.visible.count%>
+ <% projects = @user.projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)%>
+
+
+ <% if !projects.empty? %>
+
+
+
+ <% end %>
+
+
+ <% if is_current_user %>
+
+ 新建项目
+
+
+ 加入项目
+
+
+
+
+ <% end %>
+
+
+
+
+
访问计数 <%= @user.visits.to_i %> (自2016年5月)
+
+
+
+ <%= render :partial => 'layouts/new_feedback' %>
+
+
+<%= render :partial => 'layouts/footer_show' %>
+
+
+
+
+ <%= l(:label_loading) %>
+
+
+
+
+
+
+
头像设置
+
+
+ <%= file_field_tag 'avatar[image]',
+ :id => "upload_user_image",
+ :style => 'display:none;',#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
+ } %>
+
+
+
+
+
预览
+ <%= image_tag(url_to_avatar(@user), :style=>"width:96px;height:96px;",:class=>"mb5 mt10",:nhname=>'avatar_image') %>
+
+
96px*96px
+
+ <%= image_tag(url_to_avatar(@user), :style=>"width:48px;height:48px;",:class=>"mb5",:nhname=>'avatar_image') %>
+
+
48px*48px
+
+
+
取 消
+
确 定
+
+
+
+
+
+
+
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb
index 5c8e13e3f..71694da60 100644
--- a/app/views/my/account.html.erb
+++ b/app/views/my/account.html.erb
@@ -1,4 +1,15 @@
-
+ <% if @force %>
+ <% message = AppliedMessage.where(:status => 3, :user_id => User.current.id, :viewed => 0).first %>
+ <% unless message.nil? %>
+
+ <% end %>
+
+ <% end %>
- <%= f.text_field :login,:no_label=>true, :required => true,:style=>"color:grey", :nh_required=>"1",:disabled=>'disabled', :name => "login",:class=>"w210"%>
- <%= f.text_field :mail,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210"%>
-
+ <%= f.text_field :login,:no_label=>true, :required => true,:style => "color:grey", :nh_required => "1",:disabled => 'disabled', :name => "login",:class => "w210"%>
+ <% if @force %>
+ <%= f.text_field :mail,:no_label=>true, :required => true,:nh_required => "1",:class=>"w210",:disabled=>'disabled'%>
+ <% else %>
+ <%= f.text_field :mail,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210"%>
+ <% end %>
@@ -81,7 +95,7 @@
- 平台找到了0 个包含"国防" 的高校
+
<% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %>
@@ -89,7 +103,7 @@
- 平台找到了0 个包含"国防" 的高校
+
<% elsif User.current.user_extensions.school.nil? %>
@@ -97,7 +111,7 @@
- 平台找到了0 个包含"国防" 的高校
+
<% else %>
@@ -105,7 +119,7 @@
- 平台找到了0 个包含"国防" 的高校
+
<% end %>
@@ -155,7 +169,7 @@
<%= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %>
- <%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified],:style=>"height:14px;" %>不要发送对我自己提交的修改的通知
+ <%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified],:style => "height:14px;" %>不要发送对我自己提交的修改的通知
@@ -466,7 +480,7 @@
}else{
$("#search_school_result_list").html('');
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value;
- $("#hint").html('如果找不到自己的单位,您可以添加单位 ');
+ $("#hint").html('如果找不到自己的单位,您可以 添加单位 ');
$("#hint").show();
$("#errortip").show();
}
@@ -477,7 +491,6 @@
if($(e.target).attr("id") != 'search_school_result_list' && $(e.target).attr("id") != 'province')
{
$("#search_school_result_list").hide();
- $("#hint").hide();
$("#errortip").hide();
}
});
@@ -516,7 +529,7 @@
}else{
$("#search_school_result_list").html('');
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value;
- $("#hint").html('您输入的名称尚不存在,申请添加 ');
+ $("#hint").html('如果找不到自己的单位,您可以 添加单位 ');
$("#hint").show();
$("#errortip").show();
}
diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb
index a2f8a8f29..f1a8da8e4 100644
--- a/app/views/organizations/setting.html.erb
+++ b/app/views/organizations/setting.html.erb
@@ -47,52 +47,52 @@
<%#= form_for( @organization,{:controller => 'organizations',:action => 'update',:id=>@organization,:html=>{:id=>'update_org_form',:method=>'put'}}) do %>
<%= labelled_form_for @organization do |f|%>
- <%= render :partial=>"new_org_avatar_form",:locals=> {source:@organization} %>
-
-
-
+ <%= render :partial=>"new_org_avatar_form",:locals=> {source:@organization} %>
+
+
+
-
-
- 组织URL:
-
http://
-
- .trustie.net
申请
- <% record = OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first %>
- <% if domain.present? and record.present? and record.content == domain.subname %>
-
(已批准)
- <% elsif record %>
-
(您申请了子域名<%= OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first.content %>,还未批准)
- <% end %>
-
-
-
-
-
- 显示模式 :
- />
- 简洁模式
- />
- 门户模式
-
- 公开 :
- class="ml3" />
-
- 下载支持 :
- name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />
- 允许游客下载
- <%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %>
-
-
-
-
-
-
- 保存
+
+
+ 组织URL:
+
http://
+
+ .trustie.net
申请
+ <% record = OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first %>
+ <% if domain.present? and record.present? and record.content == domain.subname %>
+
(已批准)
+ <% elsif record %>
+
(您申请了子域名<%= OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first.content %>,还未批准)
+ <% end %>
+
+
+
+
+
+ 显示模式 :
+ />
+ 简洁模式
+ />
+ 门户模式
+
+ 公开 :
+ class="ml3" />
+
+ 下载支持 :
+ name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />
+ 允许游客下载
+ <%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %>
+
+
+
+
+
+
+ 保存
<% end %>
diff --git a/app/views/projects/_development_group.html.erb b/app/views/projects/_development_group.html.erb
index 273fcf56a..82bcb5501 100644
--- a/app/views/projects/_development_group.html.erb
+++ b/app/views/projects/_development_group.html.erb
@@ -40,12 +40,12 @@
<% end %>
-<% if allow_pull_request(@project) %>
-
- <%= link_to "Pull Requests", project_pull_requests_path(@project), :class => "f14 c_blue02" %>
+
+ <%= link_to "Pull Requests", project_pull_requests_path(@project), :class => "f14 c_blue02" %>
+ <% if allow_pull_request(@project) %>
<%= link_to "+新建请求", new_project_pull_request_path(:project_id => @project.id), :class => "subnav_green" %>
-
-<% end %>
+ <% end %>
+
<%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %>
<% if visible_repository?(@project) %>
diff --git a/app/views/pull_requests/_show.html.erb b/app/views/pull_requests/_show.html.erb
index b750728a4..758f70878 100644
--- a/app/views/pull_requests/_show.html.erb
+++ b/app/views/pull_requests/_show.html.erb
@@ -5,8 +5,10 @@
<%= get_state(@request.state) %> 合并请求 由 <%= link_to @request.author.try(:username), user_path(get_user_by_login_and(@request.author.try(:username))), :class => "link-blue" %> 于 <%= time_tag(@request.created_at) %> 前提交 · 最后编辑时间 <%= time_tag(@request.updated_at) %> 前
- <% unless @request.state == "merged" %>
- <%= link_to "#{@request.state == 'closed' ? '重新打开' : '关闭'}", update_pull_request_project_pull_request_path(@request.id, :project_id => @project.id, :state => @request.state =="closed" ? "reopen" : "close"), :class => "BlueCirBtn fr" %>
+ <% if User.current.login == @request.author.try(:username) || is_project_manager?(User.current.id, @project.id) %>
+ <% unless @request.state == "merged" %>
+ <%= link_to "#{@request.state == 'closed' ? '重新打开' : '关闭'}", update_pull_request_project_pull_request_path(@request.id, :project_id => @project.id, :state => @request.state =="closed" ? "reopen" : "close"), :class => "BlueCirBtn fr" %>
+ <% end %>
<% end %>
diff --git a/app/views/pull_requests/index.html.erb b/app/views/pull_requests/index.html.erb
index 78c4759aa..f4fe0725e 100644
--- a/app/views/pull_requests/index.html.erb
+++ b/app/views/pull_requests/index.html.erb
@@ -3,8 +3,9 @@
<%= link_to "待处理#{@requests_opened_count} ".html_safe, project_pull_requests_path(:type => "1"), :remote => true %>
<%= link_to "已处理#{@requests_merged_count} ".html_safe, project_pull_requests_path(:type => "2"), :remote => true %>
<%= link_to "已关闭#{@requests_closed_count} ".html_safe, project_pull_requests_path(:type => "3"), :remote => true %>
-
- <%= link_to "创建Pull Request", new_project_pull_request_path, :class => "BlueCirBtn fr ml10 mt10", :style => "width:110px;" %>
+ <% if allow_pull_request(@project) %>
+ <%= link_to "创建Pull Request", new_project_pull_request_path, :class => "BlueCirBtn fr ml10 mt10", :style => "width:110px;" %>
+ <% end %>
diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb
index cc078bf9c..e05df2892 100644
--- a/app/views/student_work/_student_work_list.html.erb
+++ b/app/views/student_work/_student_work_list.html.erb
@@ -2,7 +2,7 @@
作品
- (<%= @student_work_count%>人已交)
+ (<%= @student_work_count%> 人已交)
<%# my_work = @homework.student_works.where("user_id = #{User.current.id}").first %>
<% my_work = cur_user_works_for_homework @homework %>
diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb
index e4341869f..c961fb077 100644
--- a/app/views/student_work/add_score.js.erb
+++ b/app/views/student_work/add_score.js.erb
@@ -17,3 +17,5 @@ $("#score_list_<%= @work.id%>").removeAttr("style");
$("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work, :index => 1}) %>");
$("#work_num_<%= @work.id%>").html(num);
<% end%>
+
+$("#student_work_count").html("<%=@count %>");
diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb
index 0a5c18a9b..afc45efde 100644
--- a/app/views/users/_project_message.html.erb
+++ b/app/views/users/_project_message.html.erb
@@ -29,7 +29,7 @@
发帖时间:<%= format_time(activity.created_on) %>
- 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
+ 更新时间:<%= get_forge_act_message(activity, activity.class.to_s) %>
<% if activity.parent_id.nil? %>
diff --git a/app/views/users/_user_message_applied.html.erb b/app/views/users/_user_message_applied.html.erb
index 414b13cf7..89084d30b 100644
--- a/app/views/users/_user_message_applied.html.erb
+++ b/app/views/users/_user_message_applied.html.erb
@@ -1,11 +1,12 @@
<% if ma.class == AppliedMessage %>
-
+
<% if ma.applied_type == "ApplyAddSchools" %>
<% if ma.status == 0 %>
- <%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %>
+ <% applied_user = User.find(ma.applied_user_id) %>
+ <%= link_to image_tag(url_to_avatar(applied_user), :width => "30", :height => "30"), user_path(applied_user), :target => '_blank' %>
<% else %>
<%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
<% end %>
@@ -19,6 +20,7 @@
<%= time_tag(ma.created_at).html_safe %>
+
<% elsif ma && ma.applied_type == "AppliedProject" %>
<%= render :partial => "users/applied_project_content", :locals =>{:ma => ma} %>
diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js
index 8db3fbc20..1013dd749 100644
--- a/public/javascripts/new_user.js
+++ b/public/javascripts/new_user.js
@@ -38,7 +38,6 @@ function edit_user_introduction(url){
function show_more_course(url){
$.get(
url,
- { page: $("#course_page_num").val() },
function (data) {
}
);
@@ -48,7 +47,6 @@ function show_more_course(url){
function show_more_project(url){
$.get(
url,
- { page: $("#project_page_num").val() },
function (data) {
}
diff --git a/public/javascripts/syllabus.js b/public/javascripts/syllabus.js
index 24b997496..0319bd4d1 100644
--- a/public/javascripts/syllabus.js
+++ b/public/javascripts/syllabus.js
@@ -2,7 +2,6 @@
function show_more_course(url){
$.get(
url,
- { page: $("#course_page_num").val() },
function (data) {
}
);
diff --git a/public/javascripts/wechat/controllers/activity.js b/public/javascripts/wechat/controllers/activity.js
index 3f75d9e99..e646da5b9 100644
--- a/public/javascripts/wechat/controllers/activity.js
+++ b/public/javascripts/wechat/controllers/activity.js
@@ -3,7 +3,7 @@ app.controller('ActivityController',
['$anchorScroll', '$location','$scope', '$http', '$timeout', 'auth', 'rms', 'common','alertService',
function($anchorScroll, $location,$scope, $http, $timeout, auth, rms, common, alertService){
- common.checkLogin();
+// common.checkLogin();
$scope.replaceUrl = function(url){
diff --git a/public/javascripts/wechat/controllers/class.js b/public/javascripts/wechat/controllers/class.js
index 1e03277a2..d372f6826 100644
--- a/public/javascripts/wechat/controllers/class.js
+++ b/public/javascripts/wechat/controllers/class.js
@@ -1,5 +1,5 @@
app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location','$routeParams','alertService','rms','common', function($scope, config, $http, auth, $location, $routeParams,alertService,rms,common){
- common.checkLogin();
+// common.checkLogin();
var vm = $scope;
var courseid = $routeParams.id;
diff --git a/public/javascripts/wechat/controllers/class_list.js b/public/javascripts/wechat/controllers/class_list.js
index cc5b12ff6..cc5250970 100644
--- a/public/javascripts/wechat/controllers/class_list.js
+++ b/public/javascripts/wechat/controllers/class_list.js
@@ -5,7 +5,7 @@
app.controller('ClassListController', ['$scope', 'config', 'auth', '$http', '$location', 'alertService','rms','common',
function ($scope, config, auth, $http, $location, alertService,rms,common) {
- common.checkLogin();
+// common.checkLogin();
var vm = $scope;
vm.syllabuses = rms.get('syllabuses') || [];
diff --git a/public/javascripts/wechat/controllers/edit_class.js b/public/javascripts/wechat/controllers/edit_class.js
index 30c78e35a..d61c25353 100644
--- a/public/javascripts/wechat/controllers/edit_class.js
+++ b/public/javascripts/wechat/controllers/edit_class.js
@@ -1,7 +1,7 @@
app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
- common.checkLogin();
+// common.checkLogin();
var vm = $scope;
diff --git a/public/javascripts/wechat/controllers/edit_class_member.js b/public/javascripts/wechat/controllers/edit_class_member.js
index 7b28e1f4a..e00e36f20 100644
--- a/public/javascripts/wechat/controllers/edit_class_member.js
+++ b/public/javascripts/wechat/controllers/edit_class_member.js
@@ -1,7 +1,7 @@
app.controller('EditClassMemberController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
- common.checkLogin();
+// common.checkLogin();
var vm = $scope;
diff --git a/public/javascripts/wechat/controllers/edit_project_member.js b/public/javascripts/wechat/controllers/edit_project_member.js
index d5b8788d8..511db35bb 100644
--- a/public/javascripts/wechat/controllers/edit_project_member.js
+++ b/public/javascripts/wechat/controllers/edit_project_member.js
@@ -1,7 +1,7 @@
app.controller('EditProjectMemberController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
- common.checkLogin();
+// common.checkLogin();
var vm = $scope;
diff --git a/public/javascripts/wechat/controllers/join_class.js b/public/javascripts/wechat/controllers/join_class.js
index 3992a8ae3..1a9710bc1 100644
--- a/public/javascripts/wechat/controllers/join_class.js
+++ b/public/javascripts/wechat/controllers/join_class.js
@@ -1,7 +1,7 @@
app.controller('JoinClassController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','wx','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,wx,common){
- common.checkLogin();
+// common.checkLogin();
var vm = $scope;
diff --git a/public/javascripts/wechat/controllers/join_project.js b/public/javascripts/wechat/controllers/join_project.js
index 915277d3b..d942e8859 100644
--- a/public/javascripts/wechat/controllers/join_project.js
+++ b/public/javascripts/wechat/controllers/join_project.js
@@ -1,7 +1,7 @@
app.controller('JoinProjectController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','wx','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,wx,common){
- common.checkLogin();
+// common.checkLogin();
var vm = $scope;
diff --git a/public/javascripts/wechat/controllers/myresource.js b/public/javascripts/wechat/controllers/myresource.js
index 706827b8e..089b63dfc 100644
--- a/public/javascripts/wechat/controllers/myresource.js
+++ b/public/javascripts/wechat/controllers/myresource.js
@@ -1,5 +1,5 @@
app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$location', 'rms','common', function($scope, $http, auth, config, $location,rms,common){
- common.checkLogin();
+// common.checkLogin();
var vm = $scope;
// vm.menus = ['课件', '作业', '测验'];
diff --git a/public/javascripts/wechat/controllers/new_class.js b/public/javascripts/wechat/controllers/new_class.js
index 0a8ea25b2..54bc396b6 100644
--- a/public/javascripts/wechat/controllers/new_class.js
+++ b/public/javascripts/wechat/controllers/new_class.js
@@ -1,7 +1,7 @@
app.controller('NewClassController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','rms','common', function($scope, $http, auth, config, alertService, $location,rms,common){
- common.checkLogin();
+// common.checkLogin();
var vm = $scope;
diff --git a/public/javascripts/wechat/controllers/new_project.js b/public/javascripts/wechat/controllers/new_project.js
index a73da1419..03a1b451f 100644
--- a/public/javascripts/wechat/controllers/new_project.js
+++ b/public/javascripts/wechat/controllers/new_project.js
@@ -1,7 +1,7 @@
app.controller('NewProjectController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','rms','common', function($scope, $http, auth, config, alertService, $location,rms,common){
- common.checkLogin();
+// common.checkLogin();
var vm = $scope;
diff --git a/public/javascripts/wechat/controllers/project.js b/public/javascripts/wechat/controllers/project.js
index 3c487eeb5..08987e491 100644
--- a/public/javascripts/wechat/controllers/project.js
+++ b/public/javascripts/wechat/controllers/project.js
@@ -1,5 +1,5 @@
app.controller('ProjectController', ['$scope', 'config','$http','$timeout', 'auth','$location','$routeParams','alertService','rms','common', function($scope, config, $http,$timeout, auth, $location, $routeParams,alertService,rms,common){
- common.checkLogin();
+// common.checkLogin();
$scope.replaceUrl = function(url){
return url;
diff --git a/public/javascripts/wechat/controllers/project_list.js b/public/javascripts/wechat/controllers/project_list.js
index 395215b25..e716de0a9 100644
--- a/public/javascripts/wechat/controllers/project_list.js
+++ b/public/javascripts/wechat/controllers/project_list.js
@@ -5,7 +5,7 @@
app.controller('ProjectListController', ['$scope', 'config', 'auth', '$http', '$location', 'alertService','rms','common',
function ($scope, config, auth, $http, $location, alertService,rms,common) {
- common.checkLogin();
+// common.checkLogin();
var vm = $scope;
// vm.projects = rms.get('projects') || [];
diff --git a/public/javascripts/wechat/controllers/review_class_member.js b/public/javascripts/wechat/controllers/review_class_member.js
index 5bf8a36fd..aee8d683a 100644
--- a/public/javascripts/wechat/controllers/review_class_member.js
+++ b/public/javascripts/wechat/controllers/review_class_member.js
@@ -1,7 +1,7 @@
app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
- common.checkLogin();
+// common.checkLogin();
var vm = $scope;
diff --git a/public/javascripts/wechat/controllers/review_project_member.js b/public/javascripts/wechat/controllers/review_project_member.js
index 2254a8340..5c652050f 100644
--- a/public/javascripts/wechat/controllers/review_project_member.js
+++ b/public/javascripts/wechat/controllers/review_project_member.js
@@ -1,7 +1,7 @@
app.controller('ReviewProjectMemberController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
- common.checkLogin();
+// common.checkLogin();
var vm = $scope;
diff --git a/public/javascripts/wechat/controllers/send_class_list.js b/public/javascripts/wechat/controllers/send_class_list.js
index 0e7b912c6..ead0860f5 100644
--- a/public/javascripts/wechat/controllers/send_class_list.js
+++ b/public/javascripts/wechat/controllers/send_class_list.js
@@ -1,5 +1,5 @@
app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'config','auth','alertService', 'rms','common', function($scope, $http, $routeParams, config, auth, alertService,rms,common){
- common.checkLogin();
+// common.checkLogin();
var vm = $scope;
var send_id = $routeParams.id;
diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css
index f704a3f0d..fbce13354 100644
--- a/public/stylesheets/css/common.css
+++ b/public/stylesheets/css/common.css
@@ -4,7 +4,7 @@
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5; background:#eaebec;}
div,img,tr,td,table{ border:0;}
-table,tr,td{border:0;cellspacing:0; cellpadding:0;}
+table,tr,td{border:0;}
ol,ul,li{ list-style-type:none}
blockquote {
border:1px solid #d4d4d4;
diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css
index 95891d365..1c7563a58 100644
--- a/public/stylesheets/css/project.css
+++ b/public/stylesheets/css/project.css
@@ -372,7 +372,7 @@ tr.entry td.filename_no_report { width: 40%; }
tr.entry td.size { text-align: right; font-size: 90%; }
tr.entry td.revision, tr.entry td.author { text-align: center; }
tr.entry td.age { text-align: right; }
-tr.entry.file td.filename a { margin-center: 16px; }
+tr.entry.file td.filename a { }
tr.entry.file td.filename_no_report a { margin-left: 16px; }
tr span.expander {background-image: url(/images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;}
diff --git a/public/stylesheets/css/structure.css b/public/stylesheets/css/structure.css
index c9a4059e0..1d2c106e2 100644
--- a/public/stylesheets/css/structure.css
+++ b/public/stylesheets/css/structure.css
@@ -1,5 +1,3 @@
-/*将header.css文件和public.css,new_user.css中的内容统一*/
-
@charset "utf-8";
/* CSS Document */
@@ -34,7 +32,7 @@ a:hover.search_btn{ background: #0fa9bb;}
a.parent {background: url(/images/arrowList.png) -30px 3px no-repeat; width:95px; padding-right:50px;}
a.parent:hover {background: url(/images/arrowList.png) -30px -14px no-repeat; width:95px; padding-right:50px; color:#fe7d68;}
a.linkToOrange:hover {color:#fe7d68;}
-#userInfo ul li {positon: relative;}
+#userInfo ul li {position: relative;}
#userInfo ul li ul {display:none;}
#userInfo ul li:hover ul {display:block; position:absolute;}
#userInfo ul li:hover ul li ul {display:none;}
@@ -383,7 +381,7 @@ ul.subNavArrow:hover li ul {display:block;}
.currentDd{color:#0781b4;}
.currentDt{background-color:#fff;}
.navContent{display: none;border-bottom:solid 1px #e5e3da; }
-.navContent li a{display:block;width:240px;heigh:28px;text-align:center;font-size:12px;line-height:28px;color:#333}
+.navContent li a{display:block;width:240px;height:28px;text-align:center;font-size:12px;line-height:28px;color:#333}
.navContent li a:hover{color:#fff;background-color:#b3e0ee}
a.subnav_num{ font-weight:normal; color:#ff7143; font-size:12px;}
a.subnav_green{ background:#28be6c; color:#fff; font-size:12px; font-weight:normal;height:18px; padding:0px 5px; padding-top:2px; display:block; margin-top:2px; margin-bottom:5px; float:right; margin-right:5px;line-height:1.4 !important;}
diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css
index 2fbf9c082..7375fc80c 100644
--- a/public/stylesheets/weui/weixin.css
+++ b/public/stylesheets/weui/weixin.css
@@ -220,7 +220,7 @@ a.underline {text-decoration:underline;}
.amount-arrow {height:14px; line-height:14px; vertical-align:middle; margin-top:12px;}
.new-class-btn {font-size:15px; color:#fff; background-color:#3b94d6; padding:10px 40px; border-radius:20px; display:inline-block; margin:0 auto;}
.join-class-btn {font-size:15px; color:#444; background-color:#ccc; padding:10px 40px; border-radius:20px; display:inline-block; margin:0 auto;}
-.new-class-input {width:60%; color:#555; height:16px; line-height:16px; vertical-align:middle; border:none; outline:none; padding:8px 0;}
+.new-class-input {width:60%; color:#555; height:16px; line-height:16px; border:none; outline:none; padding:11px 0;}
.class-list-setting {position:absolute; top:11px; right:10px;}
.class-setting-wrap {width:38px; height:38px; position:absolute; top:0; right:0;}
@@ -253,4 +253,8 @@ a.underline {text-decoration:underline;}
/*20160810绑定说明*/
.ac-wrap {text-align:center;}
.ac-content {display:inline-block; line-height:2;}
-.ac-content li {position:relative; text-align:left; padding-left:5px;}
\ No newline at end of file
+.ac-content li {position:relative; text-align:left; padding-left:5px;}
+
+/*发布帖子,通知*/
+.full-width-wrap {padding:5px 15px; background-color:#fff; border-top:1px solid #ddd; border-bottom:1px solid #ddd;}
+.full-width-textarea {width:100%; height:180px; line-height:18px; max-height:180px; border:none; resize:none; font-size:13px; color:#555;}
\ No newline at end of file