From 64c6fa1f37ce082e41ce140255bc4b6978087f78 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 28 Dec 2016 09:55:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E5=8C=97=E4=BA=AC=EF=BC=8C=E6=8D=A2=E6=88=90=E7=81=B0=E5=BA=A6?= =?UTF-8?q?=E8=83=8C=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/new_base_user.html.erb | 4 ++-- public/images/user/user_bg_info2.jpg | Bin 0 -> 17602 bytes public/stylesheets/css/user.css | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 public/images/user/user_bg_info2.jpg diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index fdbf2f3db..42912fcd5 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -101,10 +101,10 @@
-
+
<% if User.current.logged? && User.current == @user%>
- <%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id => 'nh_source_tx'), + <%= link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id => 'nh_source_tx'), my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true %>
<%=link_to '', my_clear_user_avatar_temp_path, :class => 'homepageEditProfileIcon', :remote => true, :title => '点击编辑Logo' %> diff --git a/public/images/user/user_bg_info2.jpg b/public/images/user/user_bg_info2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f2f676ee73eb3bf50566124cfd75d4c369451af8 GIT binary patch literal 17602 zcmeHtcUV)+)96Wo&^w4C5SldU9R;Kb0Rl+3At4D6N`gt~Vi&~%Qba{Xr57tISSSi8 zDkvf#C>D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R zx3_>JBuf=K6TEi&9bSd{7Ey>vIfDBt zPWYz_`Q#tI*ZO+XJ3M%)=50rvkgs6Nw-PV-lrLBJGMrpT< zjD%Q5MA?Ob?<&hC;()fC+Rt3QT=Z}Fw3+ideP7CJ2q^}J8uptR2Ci-)BJn;kz zdKbj`wiD>fIG2%9lx-ZLYrFrN(W488zlltLy%U(ZrZWyi5BE+!>qqn_I_Zb7=e}25 z?R5VT4Z8_(-_^F=LyD>E6I~-?@+$25PVmO926zRvt1Er<4{>fz`E-kGG(zm&wk8oP z6SGM`DPcjEzDAyIJP=o(fc}0LEJ>7-KLN|Ad=kCGv+u&h^>;ec@CrKIC9C@L5&WP* z@<**numdV|xhtULX#dqmT}MZw;>0JP9-oVh^MyzCM0-I@2d~FZ!PR}q7PDgDSf&Vs zkP5ZeDR+2J3Lbft&VsmO`bV9T@b3aJhohf-oK(8ML(YiwBM>t(PPP>ap9KX^$l zVde$a=bB?8UKhGOz*F%0N_*XFct?VFXjE)8BnTxAfElfErabaRrwi!S?R}`>x+$Nl zJhX^Q{$XFrAB-(2?+5JGN&7kCt2K_a)&7(odR+U{$vL)i9dVm=ybVs=-Mx5UL2>c- zC0n8XN4GNTdw~1p_m4e3BDUoPxi+Wh4%ZXE0@LV?Z&$nnJ80KcHii@Sup=YaX8WaNlz-=3U%%uyg#3Lb%J0H@@I4u)4sI q=-^=7SJ?NlhBrNF{W5X+Pw)JQ{&mSj*go8SW9@yi@N1Lx@_zvjP^54G literal 0 HcmV?d00001 diff --git a/public/stylesheets/css/user.css b/public/stylesheets/css/user.css index abff72629..575379f87 100644 --- a/public/stylesheets/css/user.css +++ b/public/stylesheets/css/user.css @@ -87,6 +87,7 @@ a:hover.pro_new_topbtn_left{background-image: linear-gradient(#ededed, #dddddd); /* 个人主页左侧信息 */ .user_leftinfo{ width:238px;border:1px solid #e5e5e5; background:#fff url(/images/user/user_bg_info.jpg) 0 0 no-repeat; position:relative; } +.user_leftdata_background{ width:238px;border:1px solid #e5e5e5; background:#fff url(/images/user/user_bg_info2.jpg) 0 0 no-repeat; position:relative; } a.user_leftinfo_img { display:block; width:80px; height:80px; margin:15px auto;} .user_leftinfo_img img{ width:74px; height:74px;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px; border:3px solid #dcdcdc; } .user_leftinfo_female{ display:block; width:20px; height:20px;background:url(/images/user/icons_user_leftnav.png) 5px -378px no-repeat; position:absolute; top:80px; left:160px;} From fc439e562d6640ea84078f5ac27d5ece5c13f794 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 28 Dec 2016 13:46:01 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E8=B5=84=E6=96=99=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E2=80=9C=E9=82=AE=E4=BB=B6=E9=80=9A=E7=9F=A5=E2=80=9D=E4=B8=80?= =?UTF-8?q?=E9=A1=B9=EF=BC=8C=E6=9C=AA=E5=AE=8C=E5=96=84=E8=B5=84=E6=96=99?= =?UTF-8?q?=E7=9A=84=E7=94=A8=E6=88=B7=E9=9A=90=E8=97=8F=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 10 + app/models/user.rb | 10 +- app/views/my/account.html.erb | 1103 +++++++++++++++-------------- app/views/users/_form.html.erb | 10 +- 4 files changed, 576 insertions(+), 557 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a2e69c846..a69442297 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -227,6 +227,16 @@ module ApplicationHelper xls_report.string end + # 用户资料是否完善 + def user_data_complete user + user_extension = UserExtensions.where(:user_id => user.id).first + data = true + if user_extension.gender.nil? || user_extension.school_id.nil? || user.lastname.blank? || (user_extension.identity == 3 && user_extension.school_id.nil?) + data = false + end + return data + end + # 获取用户单位 # 优先获取高校信息,如果改信息不存在则获取occupation def get_occupation_from_user user diff --git a/app/models/user.rb b/app/models/user.rb index d6722274c..8d9751a38 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -80,12 +80,12 @@ class User < Principal #每日一报、一事一报、不报 - MAIL_NOTIFICATION_OPTIONS = [ + # MAIL_NOTIFICATION_OPTIONS = [ #['week', :label_user_mail_option_week], # ['day', :label_user_mail_option_day], - ['all', :label_user_mail_option_all], - ['none', :label_user_mail_option_none] - ] + # ['all', :label_user_mail_option_all], + # ['none', :label_user_mail_option_none] + # ] has_many :homework_users has_many :homework_attaches, :through => :homework_users @@ -244,7 +244,7 @@ class User < Principal validates_format_of :mail, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, :allow_blank => true validates_length_of :mail, :maximum => MAIL_LENGTH_LIMIT, :allow_nil => true validates_confirmation_of :password, :allow_nil => true - validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true + # validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true validate :validate_password_length # validates_email_realness_of :mail before_create :set_mail_notification diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 166a95ccb..0b6e51f6b 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -1,73 +1,73 @@ - <% if @force %> - <% message = AppliedMessage.where(:status => 3, :user_id => User.current.id, :viewed => 0).first %> - <% unless message.nil? %> -
+<% if @force %> + <% message = AppliedMessage.where(:status => 3, :user_id => User.current.id, :viewed => 0).first %> + <% unless message.nil? %> +
  消息:  您添加新的单位“<%= message.name %>”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!
<% message.update_attribute(:viewed, true)%> -
- <% end %> -
-
  提示:  您尚未完善您的基本资料,完善后可使用更多功能
-
- <% end %> -
-
-
    -
  • 基本资料
  • -
  • 密码管理
  • -
-
-
-
- <%= labelled_form_for :user, @user, :url => {:action => "account"}, :html => {:id => 'my_account_form', :method => :post} do |f| %> -
- <% if( @act.nil? || @act != 'password') %> +
+ <% end %> +
+
  提示:  您尚未完善您的基本资料,完善后可使用更多功能
+
+<% end %> +
+
+
    +
  • 基本资料
  • +
  • 密码管理
  • +
+
+
+
+<%= labelled_form_for :user, @user, :url => {:action => "account"}, :html => {:id => 'my_account_form', :method => :post} do |f| %> +
+ <% if( @act.nil? || @act != 'password') %> <%= render_flash_messages %> <%= error_messages_for 'user',@user.user_extensions %> + <% end %> +
    +
  • *  登录名 : 
  • +
  • *  邮箱 : 
  • +
  • *  职业 : 
  • +
  • *  姓名 : 
  • +
  • 组织名 : *
  • +
  • *  性别 : 
  • +
  • *  单位名称 : 
  • +
  • 地区 : 
  • + + +
  • 个人主页 : 
  • +
  •   
  • +
+
    +
  • <%= f.text_field :login,:no_label=>true, :required => true, :style => "color:grey", :nh_required => "1", :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 %> -
      -
    • *  登录名 : 
    • -
    • *  邮箱 : 
    • -
    • *  职业 : 
    • -
    • *  姓名 : 
    • -
    • 组织名 : *
    • -
    • *  性别 : 
    • -
    • *  单位名称 : 
    • -
    • 地区 : 
    • -
    • 邮件通知 : 
    • - -
    • 个人主页 : 
    • -
    •   
    • -
    -
      -
    • <%= f.text_field :login,:no_label=>true, :required => true, :style => "color:grey", :nh_required => "1", :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 %> -
    • - + + + - - - + + + <% if !User.current.user_extensions.nil? && !User.current.user_extensions.student_id.nil? %> <%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => l(:label_account_identity_studentID),:style => "width:127px;" %> @@ -76,159 +76,168 @@ <% end %> -
    • + -
    • <%= text_field_tag :lastname, @user.lastname+@user.firstname, :no_label => true, :required => true, :nh_required => "1",:class => "w210" %>姓名不能为空 +
    • <%= text_field_tag :lastname, @user.lastname+@user.firstname, :no_label => true, :required => true, :nh_required => "1",:class => "w210" %>姓名不能为空 -
    • - <% if User.current.user_extensions && User.current.user_extensions.gender && User.current.user_extensions.gender == 1 %> - - <% else %> - - <% end %> - -
    • +
    • + <% if User.current.user_extensions && User.current.user_extensions.gender && User.current.user_extensions.gender == 1 %> + + <% else %> + + <% end %> + +
    • -
    • - - <% if User.current.user_extensions.nil? %> - - -

      - - -

      - - - <% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %> - <% if User.current.user_extensions.school_id.nil? %> - - - <% else %> - - +
    • + + <% if User.current.user_extensions.nil? %> + + +

      + + +

      + + + <% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %> + <% if User.current.user_extensions.school_id.nil? %> + + + <% else %> + + + <% end %> +

      + + +

      + + <% elsif User.current.user_extensions.school.nil? %> + + +

      + + +

      + + <% else %> + + +

      + + +

      + + <% end %> +
    • + +
    • + + +
    • + + + +
    • + <% if @user.homepage && !@user.homepage.article_homepages.empty? %> + <% if @user.base_homepage %> + <%=link_to '查看', homepage_user_path(@user.login), :class => 'linkBlue',:target => '_blank' %> + <% else %> + <%=link_to '查看', user_homepages_path(:user_id => @user.id),:target => '_blank', :class => 'linkBlue' %> + <% end %> + <% else %> +

      您还没有创建属于自己的个人主页。 + <% if user_data_complete @user %> + <%= link_to '新建', new_user_homepage_article_homepage_path(:user_id => @user.id, + :homepage_id => @user.homepage.id), + :onclick=>"my_account_form_submit();", + :target => "_blank", + :class => 'linkBlue' %> <% end %> -

      - - -

      - - <% elsif User.current.user_extensions.school.nil? %> - - -

      - - -

      - - <% else %> - - -

      - - -

      - - <% end %> -
    • +

      -
    • - - -
    • + <% end %> + + +
    • <%= f.select :language, :Chinese => :zh, :English => :en %>
    • +
    • + 确定 + + +
    • +
    +
    +
+<% end %> -
  • - <%= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %> - -
  • - -
  • - <% if @user.homepage && !@user.homepage.article_homepages.empty? %> - <% if @user.base_homepage %> - <%=link_to '查看', homepage_user_path(@user.login), :class => 'linkBlue',:target => '_blank' %> - <% else %> - <%=link_to '查看', user_homepages_path(:user_id => @user.id),:target => '_blank', :class => 'linkBlue' %> - <% end %> - <% else %> -

    您还没有创建属于自己的个人主页。<%=link_to '新建', new_user_homepage_article_homepage_path(:user_id=> @user.id, :homepage_id => @user.homepage.id),:onclick=>"my_account_form_submit();", :target => "_blank", :class => 'linkBlue' %>

    - <% end %> - -
  • -
  • <%= f.select :language, :Chinese => :zh, :English => :en %>
  • -
  • - 确定 - - -
  • - -
    -
    - <% end %> - - <%= form_tag({:action => "password"},:id => 'my_password_form') do %> -
    - <% if( !@act.nil? && @act == 'password') %> +<%= form_tag({:action => "password"},:id => 'my_password_form') do %> +
    + <% if( !@act.nil? && @act == 'password') %> <%= render_flash_messages %> <%= error_messages_for 'user' %> - <% end %> -
      -
    • 原始密码 : 
    • -
    • 新密码 : 
    • -
    • 确认密码 : 
    • -
    -
      - -
    • -
    • 请输入8-12个字符
    • -
    • -
    • - 确认 - - -
    • -
    -
    -
    -
    <% end %> -
    +
      +
    • 原始密码 : 
    • +
    • 新密码 : 
    • +
    • 确认密码 : 
    • +
    +
      + +
    • +
    • 请输入8-12个字符
    • +
    • +
    • + 确认 + + +
    • +
    +
    +
    +
    +<% end %> +
    @@ -243,10 +252,10 @@
    @@ -262,322 +271,322 @@ <%= stylesheet_link_tag 'nyan' %> <%= javascript_include_tag '/javascripts/jquery.leanModal.min.js' %> <% if !User.current.user_extensions.nil? %> - <% province = User.current.user_extensions.location %> - <% city = User.current.user_extensions.location_city %> - <% identity = User.current.user_extensions.identity %> - <% occupation1 = User.current.user_extensions.occupation %> - <% occupation = User.current.user_extensions.occupation %> - <% title = User.current.user_extensions.technical_title %> - <% gender = User.current.user_extensions.gender %> - <% language = User.current.language %> + <% province = User.current.user_extensions.location %> + <% city = User.current.user_extensions.location_city %> + <% identity = User.current.user_extensions.identity %> + <% occupation1 = User.current.user_extensions.occupation %> + <% occupation = User.current.user_extensions.occupation %> + <% title = User.current.user_extensions.technical_title %> + <% gender = User.current.user_extensions.gender %> + <% language = User.current.language %> <% else %> - <% province = "湖南省" %> - <% city = "长沙"%> - <% identity = ""%> - <% occupation1 = ""%> - <% title = "" %> - <% language = ""%> + <% province = "湖南省" %> + <% city = "长沙"%> + <% identity = ""%> + <% occupation1 = ""%> + <% title = "" %> + <% language = ""%> <% end %> \ No newline at end of file diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index 287c5f202..afbd6f360 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -42,13 +42,13 @@
    -
    - <%=l(:field_mail_notification)%> - <%= render :partial => 'users/mail_notifications' %> -
    +
    - <%=l(:label_preferences)%> + <%= l(:label_preferences) %> <%= render :partial => 'users/preferences' %>
    From 880c66c659550bf4d3fa725fccd4c6ecd17a1f95 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 28 Dec 2016 14:40:42 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E8=B5=84=E6=96=99?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=8D=95=E4=BD=8D=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E8=A2=AB=E6=B8=85=E6=A5=9A=E5=90=8E=EF=BC=8C=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 0b6e51f6b..560c10d8f 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -665,6 +665,12 @@ $('#my_account_form').submit(); } + $("#province").blur(function(){ + if($(this).val() == ""){ + $(this).attr("placeholder","--请搜索您所在的高校(单位)--"); + } + }) +