From 4cb22f2437f198fd2d8b6b8273fcfff04f485bac Mon Sep 17 00:00:00 2001 From: whimlex Date: Wed, 22 Apr 2015 15:49:38 +0800 Subject: [PATCH 01/26] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E3=80=81=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E3=80=81=E4=B8=AA=E4=BA=BA=E5=A4=B4=E5=83=8F=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/avatar/_avatar_form.html.erb | 3 ++- app/views/avatar/_new_avatar_form.html.erb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/avatar/_avatar_form.html.erb b/app/views/avatar/_avatar_form.html.erb index fef9f7bdb..f5ecfeadd 100644 --- a/app/views/avatar/_avatar_form.html.erb +++ b/app/views/avatar/_avatar_form.html.erb @@ -47,7 +47,6 @@ <%= l(:button_upload_photo) %> - (个人头像建议90*90大小,课程和项目logo建议60*60大小,或者等比图像) <%= file_field_tag 'avatar[image]', @@ -69,6 +68,8 @@ :source_id => source.id.to_s } %> +(个人头像建议90*90大小,或者等比图像) + <% content_for :header_tags do %> <%= javascript_include_tag 'avatars' %> diff --git a/app/views/avatar/_new_avatar_form.html.erb b/app/views/avatar/_new_avatar_form.html.erb index 8b81ebf66..627de34be 100644 --- a/app/views/avatar/_new_avatar_form.html.erb +++ b/app/views/avatar/_new_avatar_form.html.erb @@ -3,7 +3,6 @@ <%#= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "upbtn fl" %> <%= l(:button_upload_photo) %> -(个人头像建议90*90大小,课程和项目logo建议60*60大小,或者等比图像) <%= file_field_tag 'avatar[image]', :id => nil, :class => 'upload_file ', @@ -22,6 +21,7 @@ :source_id => source.id.to_s } %> +(课程和项目logo建议60*60大小,或者等比图像) <% content_for :header_tags do %> <%= javascript_include_tag 'avatars' %> <% end %> From 36f2643ad8dbd41ddd31ed0fa263b94b2d9e43dc Mon Sep 17 00:00:00 2001 From: whimlex Date: Wed, 22 Apr 2015 16:33:12 +0800 Subject: [PATCH 02/26] =?UTF-8?q?=E4=B8=8A=E4=BC=A0logo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/avatar/_new_avatar_form.html.erb | 2 +- public/stylesheets/courses.css | 1 + public/stylesheets/project.css | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/avatar/_new_avatar_form.html.erb b/app/views/avatar/_new_avatar_form.html.erb index 627de34be..c94f9f87a 100644 --- a/app/views/avatar/_new_avatar_form.html.erb +++ b/app/views/avatar/_new_avatar_form.html.erb @@ -5,7 +5,7 @@ <%= l(:button_upload_photo) %> <%= file_field_tag 'avatar[image]', :id => nil, - :class => 'upload_file ', + :class => 'upload_avatar ', :size => "1", :multiple => false, :onchange => 'addInputAvatar(this);', diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 1fed23fc1..904f6a3a8 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -331,6 +331,7 @@ a:hover.st_add{ color:#ff8e15;} .upbtn{ margin:40px 0 0 15px; display:block; padding:2px 5px; border:1px solid #eaeaea;} .upbtn:hover{border:1px solid #64bdd9; color:#64bdd9;cursor: pointer;} .upload_file{margin-left: -60px;margin-top: 40px;width: 50px;position: absolute;height: 24px;opacity: 0;cursor: pointer} +.upload_avatar{margin-left: -350px;margin-top: 40px;width: 60px;position: absolute;height: 24px;opacity: 0;cursor: pointer} /* 功能倒计时*/ .w_img{ float:left; margin:10px 10px 15px 0px;} .w_p{ float:left; color:#15bccf; font-size:16px; font-weight:bold; margin-top:70px; } diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 2f6a4babe..abd748dce 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -368,6 +368,7 @@ blockquote { } /*上传项目图片*/ .upload_file{margin-left: -60px;margin-top: 40px;width: 50px;position: absolute;height: 24px;opacity: 0;cursor: pointer} +.upload_avatar{margin-left: -350px;margin-top: 40px;width: 60px;position: absolute;height: 24px;opacity: 0;cursor: pointer} /*配置*/ .pro_st_ttl{ height:24px;} .pro_st_ctt{height:auto; clear:both;} From 427f26b0584e2776cc1c0e0f0dfa796fab6a2b7c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 22 Apr 2015 16:37:24 +0800 Subject: [PATCH 03/26] =?UTF-8?q?header=E7=9A=84login=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_new_header.html.erb | 2 +- app/views/messages/_course_show.html.erb | 4 ++-- public/stylesheets/public.css | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/views/layouts/_new_header.html.erb b/app/views/layouts/_new_header.html.erb index a430a8e8f..758386f2d 100644 --- a/app/views/layouts/_new_header.html.erb +++ b/app/views/layouts/_new_header.html.erb @@ -18,7 +18,7 @@ <% if User.current.logged? -%>
  • - <%= link_to_user_header(User.current,false,:class =>'parent')%> + <%= link_to "#{User.current.login}".html_safe, {:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.user_domain}, :class => "uses_name"%>
      <% unless User.current.projects.empty? %>
    • diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 50a97d9ba..256c41b99 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -8,8 +8,8 @@ <%= link_to image_tag(url_to_avatar(@topic.author),:width => '46',:height => '46'), user_path(@topic.author) %>
      -

      - <%= link_to @topic.subject, course_boards_path(@topic.course),title: @topic.subject.to_s %> +

      + <%= @topic.subject %>


      diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 2f45bbd69..ae5dd3702 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -218,9 +218,10 @@ div#menu a {position: relative;z-index: 10; height: 41px; display: block; float: div#menu a:hover, div#menu a:hover span { color: #a1ebff; } div#menu li.current a {} div#menu {display: block; cursor: pointer; background-repeat: no-repeat;background-position: 95% 0;padding-right: 15px; _padding-right: 20px;} -div#menu ul a.parent {background: url(../images/item.png) -20px -30px no-repeat; width:60px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} -div#menu ul a.parent:hover {background: url(../images/item.png) -20px -60px no-repeat;} -div#menu ul ul a.parent {background: url(../images/item.png) -20px 6px no-repeat;} +div#menu ul a.user_name { width:170px; text-align:right; margin:0; } +.pic_triangle{background: url(../images/item.png) -90px -48px no-repeat; float:right; display:block; width:10px; height:10px; margin-top:12px; margin-left:7px;} +.pic_triangle:hover{background: url(../images/item.png) -90px -78px no-repeat; } +div#menu ul ul a.parent {background: url(../images/item.png) -20px 6px no-repeat;width:60px;} div#menu ul ul a.parent:hover {background: url(../images/item.png) -20px -11px no-repeat;} /* menu::level1 */ div#menu a { padding: 5px 12px 0 10px;line-height: 30px; color: #fff;} @@ -288,6 +289,7 @@ a.close_btn {background-position:-44px 0;} a:hover.close_btn {background-position:-66px 0;} .show_btn {background-position:-119px 0;} .msgserver a {color:#15bccf; } +.msgserver a:hover { text-decoration:underline; } .hiddent{ overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} From 1985d1c84bfa23b6f33df7d30565ae6c2a41026b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 22 Apr 2015 16:47:13 +0800 Subject: [PATCH 04/26] =?UTF-8?q?=E8=B0=83=E6=95=B4header=E4=B8=8B?= =?UTF-8?q?=E5=95=A6=E5=88=97=E8=A1=A8=E6=A1=86=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_new_header.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_new_header.html.erb b/app/views/layouts/_new_header.html.erb index 758386f2d..687c59094 100644 --- a/app/views/layouts/_new_header.html.erb +++ b/app/views/layouts/_new_header.html.erb @@ -19,7 +19,7 @@

    • <%= link_to "#{User.current.login}".html_safe, {:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.user_domain}, :class => "uses_name"%> -
        +
          <% unless User.current.projects.empty? %>
        • <%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain}, :class => "parent" %> From 681546b860c2e1924221954a1b391e8517771c93 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 22 Apr 2015 16:49:07 +0800 Subject: [PATCH 05/26] =?UTF-8?q?=E7=BC=BA=E9=99=B7=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=98=BE=E7=A4=BA=20=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=82=AE=E4=BB=B6=E9=82=80=EF=BC=88=E6=9C=AA=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E9=9C=80=E5=88=87=E6=8D=A2=E5=88=86=E6=94=AF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 7 +++++-- app/models/mailer.rb | 3 ++- app/services/users_service.rb | 8 +++++--- app/views/attachments/_project_file_links.html.erb | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 5e67e0a2c..845f32dab 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -243,8 +243,10 @@ class ProjectsController < ApplicationController # Author lizanle # Description 项目动态展示方法,删除了不必要的代码 def show - - # 试图跳转到请求的按钮 + # params[:login]为邮箱邀请用户加入,主要功能: + # 1、自动注册 + # 2、加入项目、创建角色 + # 3、用户得分 if params[:login] login = params[:login] login = login.sub(/%40/,'@') @@ -252,6 +254,7 @@ class ProjectsController < ApplicationController password = params[:password] us = UsersService.new user = us.register_auto(login,mail, password) + Member.create(:role_ids => [4], :user_id => user.id,:project_id => @project.id) UserGrade.create(:user_id => user.id, :project_id => @project.id) User.current = user unless User.current.nil? diff --git a/app/models/mailer.rb b/app/models/mailer.rb index ce3924119..acc268275 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -53,7 +53,8 @@ class Mailer < ActionMailer::Base @subject = "#{invitor.name} #{l(:label_invite_project)} #{project.name} " @password = newpass(6) @project_url = url_for(:controller => 'projects', :action => 'show', :id => project.id, - :password => @password, :login => email) + :password => @password, + :login => email) mail :to => email, :subject => @subject end diff --git a/app/services/users_service.rb b/app/services/users_service.rb index c1f716fd1..75dd316c0 100644 --- a/app/services/users_service.rb +++ b/app/services/users_service.rb @@ -44,13 +44,16 @@ class UsersService #location = get_user_location @user #{:id => @user.id, :img_url => img_url, :nickname => @user.login, :gender => gender, :work_unit => work_unit, :mail => @user.mail, :location => location, :brief_introduction => @user.user_extensions.brief_introduction} end + + # 自动注册功能 FOR:邮件邀请 def register_auto(login,mail,password) @user = User.new @user.admin = false @user.register @user.login = login - @user.mail =mail + @user.mail = mail password_confirmation = password + # 自动注册,跳过代码验证 should_confirmation_password = true if !password.blank? && !password_confirmation.blank? && should_confirmation_password @user.password, @user.password_confirmation = password, password_confirmation @@ -59,9 +62,7 @@ class UsersService else @user.password = "" end - @user = automatically_register(@user) - if @user.id != nil ue = @user.user_extensions ||= UserExtensions.new ue.user_id = @user.id @@ -69,6 +70,7 @@ class UsersService end @user end + #显示用户 #id用户id def show_user(params) diff --git a/app/views/attachments/_project_file_links.html.erb b/app/views/attachments/_project_file_links.html.erb index 9a65556d8..0135ee239 100644 --- a/app/views/attachments/_project_file_links.html.erb +++ b/app/views/attachments/_project_file_links.html.erb @@ -64,7 +64,7 @@ <% images = attachments.select(&:thumbnailable?) %> <% if images.any? %> <% images.each do |attachment| %> -
          <%= thumbnail_issue_tag(attachment) %>
          +
          <%= thumbnail_issue_tag(attachment) %>
          <% end %> <% end %> <% end %> From 9a07989917181b753278c535d6db4a179ad917ea Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 22 Apr 2015 17:01:36 +0800 Subject: [PATCH 06/26] =?UTF-8?q?=E8=B0=83=E6=95=B4header=E7=9A=84login?= =?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_new_header.html.erb | 2 +- public/stylesheets/public.css | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/_new_header.html.erb b/app/views/layouts/_new_header.html.erb index 687c59094..489612c9a 100644 --- a/app/views/layouts/_new_header.html.erb +++ b/app/views/layouts/_new_header.html.erb @@ -19,7 +19,7 @@
        • <%= link_to "#{User.current.login}".html_safe, {:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.user_domain}, :class => "uses_name"%> -
            +