diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 1839dd1fd..4124472e1 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -137,7 +137,7 @@ class MyController < ApplicationController @se.identity = params[:identity].to_i if params[:identity] @se.technical_title = params[:technical_title] if params[:technical_title] @se.student_id = params[:no] if params[:no] - @se.brief_introduction = params[:brief_introduction] + # @se.brief_introduction = params[:brief_introduction] @se.description = params[:description] if @user.save && @se.save diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e1e606f9c..f5a5c75f2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -45,7 +45,7 @@ class UsersController < ApplicationController :activity_new_score_index, :influence_new_score_index, :score_new_index,:update_score,:user_activities,:user_projects_index, :user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist, :user_resource,:user_resource_create,:user_resource_delete,:rename_resource,:search_user_course,:add_exist_file_to_course, - :search_user_project,:resource_preview,:resource_search,:add_exist_file_to_project,:user_messages] + :search_user_project,:resource_preview,:resource_search,:add_exist_file_to_project,:user_messages,:edit_brief_introduction] #edit has been deleted by huang, 2013-9-23 before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :user_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, @@ -1280,8 +1280,8 @@ class UsersController < ApplicationController @obj_count = query.count(); @obj_pages = Paginator.new @obj_count,limit,params['page'] @list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); - - render :template=>'users/user_fanslist',:layout=>'base_users_new' + @action = 'watch' + render :template=>'users/user_fanslist',:layout=>'new_base_user' end ###add by huang def user_fanslist @@ -1291,7 +1291,7 @@ class UsersController < ApplicationController @obj_pages = Paginator.new @obj_count,limit,params['page'] @list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); @action = 'fans' - render :layout=>'base_users_new' + render :layout=>'new_base_user' end def user_visitorlist limit = 10; @@ -1315,47 +1315,6 @@ class UsersController < ApplicationController end end -# added by bai - def topic_score_index - - end - - def project_score_index - - end - - def activity_score_index - - end - - def influence_score_index - - end - - def score_index - - end -# end - def topic_new_score_index - - end - - def project_new_score_index - - end - - def activity_new_score_index - - end - - def influence_new_score_index - - end - - def score_new_index - - end - def update_score @user = User.find(params[:id]) end diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb index 35e1d5ba4..6e7f0adc6 100644 --- a/app/controllers/watchers_controller.rb +++ b/app/controllers/watchers_controller.rb @@ -22,9 +22,26 @@ class WatchersController < ApplicationController def watch s = WatchesService.new watchables = s.watch params.merge(:current_user_id => User.current.id) + if params[:action_name] == 'watch' + limit = 10; + query = User.watched_by(params[:target_id]); + @obj_count = query.count(); + @obj_pages = Paginator.new @obj_count,limit,params['page'] + @list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); + @action = 'watch' + elsif params[:action_name] == 'fans' + limit = 10; + query = User.find(params[:target_id]).watcher_users; + @obj_count = query.count(); + @obj_pages = Paginator.new @obj_count,limit,params['page'] + @list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); + @action = 'fans' + else + + end respond_to do |format| format.html { redirect_to_referer_or {render :text => (true ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} - format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables,:params=>params,:opt=>'add'} } + format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables,:params=>params,:opt=>'add',:list => @list,:action_name=>params[:action_name],:page=>params[:page],:count=>@obj_count} } end rescue Exception => e if e.message == "404" @@ -38,9 +55,25 @@ class WatchersController < ApplicationController def unwatch s = WatchesService.new watchables = s.unwatch params.merge(:current_user_id => User.current.id) + if params[:action_name] == 'watch' + limit = 10; + query = User.watched_by(params[:target_id]); + @obj_count = query.count(); + @obj_pages = Paginator.new @obj_count,limit,params['page'] + @list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); + @action = 'watch' + elsif params[:action_name] == 'fans' + limit = 10; + query = User.find(params[:target_id]).watcher_users; + @obj_count = query.count(); + @obj_pages = Paginator.new @obj_count,limit,params['page'] + @list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); + @action = 'fans' + else + end respond_to do |format| format.html { redirect_to_referer_or {render :text => (false ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} - format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables,:params=>params,:opt=>'delete'} } + format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables,:params=>params,:opt=>'delete',:list=>@list,:action_name=>params[:action_name],:page=>params[:page],:count=>@obj_count} } end rescue Exception => e if e.message == "404" diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb index f2ac18084..85db7f695 100644 --- a/app/views/account/login.html.erb +++ b/app/views/account/login.html.erb @@ -66,7 +66,7 @@ } function register(){ - if($login_correct && $mail_correct && $passwd_correct && $passwd_comfirm_correct){ + if($login_correct && $mail_correct && $passwd_correct && $passwd_comfirm_correct && $("#read_and_confirm").attr("checked") == 'checked'){ $("#main_reg_form").submit(); }else{ $('#user_login').blur(); @@ -168,7 +168,7 @@
@@ -206,7 +206,7 @@
<% end %>
- 登陆 + 登录
@@ -242,6 +242,11 @@ <%= f.text_field :login, :size => 25,:placeholder=>"请输入用户昵称",:class=>'loginSignBox'%> +
+
+ +
+ 我已阅读并接受Trustie服务协议条款
注册 diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 18ac7f752..85cab957a 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -19,10 +19,10 @@ diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 6e9c98b95..adec9e6fd 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -51,16 +51,16 @@ <%= link_to @course.name, course_path(@course) %>

- + + + + + + + + + +
@@ -185,9 +185,9 @@
-
-<%= render :partial => 'layouts/footer' %> -
+
+ <%= render :partial => 'layouts/footer' %> +
<%= render :partial => 'layouts/new_feedback' %> - + + + + + + + + + +
diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index 2944dd9cf..315960a4c 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -7,7 +7,7 @@ <%= csrf_meta_tag %> <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_user', 'user_leftside','users', :media => 'all' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_user', 'user_leftside','users',:media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %> <%= javascript_include_tag "bootstrap","avatars","new_user"%> @@ -47,7 +47,7 @@ <% end%>
-
-
+
<%= link_to User.watched_by(@user.id).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"homepageImageNumber" %>
关注
-
+
<%= link_to @user.watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"homepageImageNumber", :id => "user_fans_number"%>
粉丝
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index c23266afd..c25363323 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -1,9 +1,4 @@ - - -
+
    @@ -30,7 +25,7 @@
  • 工作单位 : 
  • 地区 : 
  • 邮件通知 : 
  • -
  • 个人签名 : 
  • +
  • 个人简介 : 
  •   
@@ -141,7 +136,7 @@ <%= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %> -
  • +
  • <%= f.select :language, :Chinese => :zh, :English => :en %>
  • diff --git a/app/views/users/_user_fans_item.html.erb b/app/views/users/_user_fans_item.html.erb index 4ca8fbefc..b3fc7905c 100644 --- a/app/views/users/_user_fans_item.html.erb +++ b/app/views/users/_user_fans_item.html.erb @@ -1,3 +1,5 @@ +<% unless list.nil?%> +<% for item in list %> + <% if(User.current.logged? && User.current != item )%> <%if(item.watched_by?(User.current))%> - 取消关注 + 取消关注 <% else %> - 添加关注 + 添加关注 <% end %> <% end %>
  • +<% end %> +<% end %> \ No newline at end of file diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb new file mode 100644 index 000000000..9e198a762 --- /dev/null +++ b/app/views/users/_user_homework_attachment.html.erb @@ -0,0 +1,65 @@ +
    + + <% if defined?(container) && container && container.saved_attachments %> + <% container.attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%> + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> + <%= l(:field_is_public)%>: + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> + <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + + <% end %> + <% container.saved_attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> + <%= l(:field_is_public)%>: + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> + <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + + <% end %> +<% end %> + + <% project = project %> + + <%= button_tag l(:button_browse), :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()',:class => 'sub_btn', :style => ie8? ? 'display:none' : '' %> + <%= file_field_tag 'attachments[dummy][file]', + :id => '_file', + :class => ie8? ? '' : 'file_selector', + :multiple => true, + :onchange => 'addInputFiles(this);', + :style => ie8? ? '' : 'display:none', + :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, + :upload_path => uploads_path(:format => 'js',:project =>project), + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :delete_all_files => l(:text_are_you_sure_all) + } %> + + <%= l(:label_no_file_uploaded)%> + + (<%= l(:label_max_size) %>: + <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) + + + <% content_for :header_tags do %> + <%= javascript_include_tag 'attachments' %> + <% end %> +
    + + + + + + + + + \ No newline at end of file diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb new file mode 100644 index 000000000..3a4c3496c --- /dev/null +++ b/app/views/users/_user_homework_form.html.erb @@ -0,0 +1,56 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> +
    +
    + +
    +
    + +
    + 导入作业 + + <%= calendar_for('homework_end_time')%> + + + + + + + +
    +
    + +
    + <% if edit_mode %> + <%= f.kindeditor :description,:editor_id => 'homework_description_editor',:height => "150px",:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %> + <% else %> + <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> + <%= f.kindeditor :description,:editor_id => 'homework_description_editor',:height => "150px" %> + <% end %> +
    +
    + +
    + +
    +
    + +
    + <%= render :partial => 'attachments/new_form', :locals => {:container => homework} %> +
    +
    + + +
    + + + + + +
    +
    \ No newline at end of file diff --git a/app/views/users/search.html.erb b/app/views/users/search.html.erb index 13979f79f..a8401c406 100644 --- a/app/views/users/search.html.erb +++ b/app/views/users/search.html.erb @@ -28,14 +28,14 @@ - + + + + + + + + diff --git a/app/views/users/user_fanslist.html.erb b/app/views/users/user_fanslist.html.erb index 0b42da9f8..350875f8b 100644 --- a/app/views/users/user_fanslist.html.erb +++ b/app/views/users/user_fanslist.html.erb @@ -1,25 +1,35 @@ -
    -
    + + +
    <% if @action == 'fans' %>

    粉丝

    -
    共有<%=@obj_count%>名粉丝
    +
    共有<%=@obj_count%>名粉丝
    <% elsif @action == 'visitor' %>

    访客

    共有<%=@obj_count%>访客
    <% else %>

    关注

    -
    一共关注<%=@obj_count%>
    +
    一共关注<%=@obj_count%>
    <% end %>
    - <% for item in @list %> - <%= render :partial => 'users/user_fans_item', :locals => {:item => item,:target=>@user} %> - <% end %> +
    + <%# for item in @list %> + <%= render :partial => 'users/user_fans_item', :locals => {:list => @list,:target=>@user,:action_name=>@action,:page=>params[:page]} %> + <%# end %> +

    <%= l(:label_no_data) %>

      <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
    -
    + diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index 19ecf3588..48666a0cb 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -19,41 +19,10 @@
    发布作业
    - + <% homework = HomeworkCommon.new %> + <%= labelled_form_for homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %> + <%= render :partial => 'users/user_homework_form', :locals => { :homework => homework,:f => f,:edit_mode => false } %> + <% end%>
    <% end%> diff --git a/app/views/watchers/_set_watcher.js.erb b/app/views/watchers/_set_watcher.js.erb index 1efa8a4a1..1365468cc 100644 --- a/app/views/watchers/_set_watcher.js.erb +++ b/app/views/watchers/_set_watcher.js.erb @@ -5,10 +5,16 @@ $("#user_fans_number").html("<%= watched.first.watcher_users.count.to_s%>"); //在当前用户的粉丝、关注页面 <% elsif( params[:target_id] == User.current.id.to_s )%> - + $("#users_list").html("<%= escape_javascript (render :partial => 'users/user_fans_item', :locals => {:list => list,:target=>User.current,:action_name=>action_name,:page=>params[:page]}) %>"); + $("#watch_user_number_div").html('<%= escape_javascript ( link_to User.watched_by(params[:target_id]).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>params[:target_id]},:class=>"homepageImageNumber") %>'); + $("#fans_user_number_div").html('<%= escape_javascript ( link_to User.find(params[:target_id]).watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>params[:target_id]},:class=>"homepageImageNumber", :id => "user_fans_number") %>'); + $("#fans_span").html('<%= count %>'); + $("#watch_span").html('<%= count %>'); //在其他用户的粉丝、关注页面 <% else %> - +$("#users_list").html("<%= escape_javascript (render :partial => 'users/user_fans_item', :locals => {:list => list,:target=>User.find(params[:target_id]),:action_name=>action_name,:page=>params[:page]}) %>"); +//在他人的用户分析下关注,不会改变他人的关注数,所以不必要刷新 + //$("#watch_user_number").html('<%#= escape_javascript ( link_to User.watched_by(params[:target_id]).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>params[:target_id]},:class=>"homepageImageNumber") %>'); <% end %> <% else %> diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index 377842b66..42a1271cd 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -1,6 +1,7 @@ $(function(){ //右侧最小高度 = 左侧高度 - 15px 保证两边高度基本一样,页面美观 $("#RSide").css("min-height",$("#LSide").height()-15); + $("#users_setting").css("min-height",$("#LSide").height()-35); //头像相关 $("#homepage_portrait_image").live("mouseover",function(){ @@ -10,6 +11,9 @@ $(function(){ $("#edit_user_file_btn").hide(); $("#watch_user_btn").hide(); }); + + //日历选择样式 + //$(".ui-datepicker-trigger").replaceWith("
    ") }); //编辑个人简介 diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index fb16d39c5..df47c9e77 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -10,6 +10,7 @@ a:hover,a:active{color:#000;} /*常用*/ /*#RSide{ background:#fff;}*/ +#users_setting{clear:both;width:730px;background: #fff;padding: 10px;/*滑动门的宽度*/} /*上传图片处理*/ .upload_img img{max-width: 100%;} blockquote img{max-width: 100%;} @@ -342,7 +343,7 @@ a.resourcesBlack:hover {font-size:12px; color:#000000;} a.sendButtonBlue {color:#15bccf;} a.sendButtonBlue:hover {color:#ffffff;} .resourcesSelectSendButton:hover {background-color:#15bccf;} -.db {display:block;} +.db {display:block !important;} .dropdown-menu { position: absolute; @@ -619,6 +620,14 @@ a.loginChooseTab {color:#484848; height:30px; display:block;} .loginSignAlert {font-size:12px; margin-left:60px;} .loginSignRow {height:60px; min-height:60px;} +/*关注列表*/ +.inf_user_image{ padding-left:8px; margin:0px; background-color:#fff; height: auto;padding-bottom: 8px;} +ul.list_watch{ + padding-left: 0px; + list-style-type:none; + height:auto; + border-bottom: 1px dashed rgb(204, 204, 204); +} /*底部*/ @@ -834,6 +843,17 @@ a.FilesName02{ max-width:665px;overflow:hidden; white-space:nowrap; text-overflo .ProResultUl li{ line-height:35px; border-bottom:1px solid #dddddd; } .DateBorder{border:1px solid #d9d9d9; border-left:none; padding:7px 6px 6px 6px;} +/*日历选择图*/ +img.ui-datepicker-trigger { + display:block; + background:url(../images/public_icon.png) -31px 0 no-repeat; + cursor: pointer; + vertical-align: middle; + width:16px; + height:15px; + float:left; +} + diff --git a/public/stylesheets/users.css b/public/stylesheets/users.css index 9a809b7ce..eb9309eab 100644 --- a/public/stylesheets/users.css +++ b/public/stylesheets/users.css @@ -69,8 +69,6 @@ a.select_btn_select{ background:#64bddb; color:#fff;} .wlist a{ float:left; border:1px solid #64bdd9; padding:0 5px; margin-left:3px; color:#64bdd9;} .wlist a:hover{border:1px solid #64bdd9; background-color:#64bdd9; color:#fff; text-decoration:none;} .wlist_select a { background-color:#48aac9; color:#fff;} -/* 设置 */ -#users_setting{clear:both;width:730px;/*滑动门的宽度*/} /* TAB 切换效果 */ .users_tb_{ border-bottom:3px solid #CCC; height:26px; } .users_tb_ ul{height:26px; } @@ -135,13 +133,16 @@ a:hover.c_lgrey{ color:#3ca5c6;} .users_r_h2{background:#64bdd9; color:#fff; height:33px; width:90px; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;} -a.hidepic>img{display:none;} +/*a.hidepic>img{display:none;}*/ -div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;} -span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;} -span.ke-toolbar-icon-url{background-image:url( ../images/public_icon.png )} -div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;} -span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;} -span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;} -div.ke-toolbar .ke-outline{border:none;} -.cr{clear: right;} \ No newline at end of file +/*div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}*/ +/*span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}*/ +/*span.ke-toolbar-icon-url{background-image:url( ../images/public_icon.png )}*/ +/*div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}*/ +/*span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}*/ +/*span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}*/ +/*div.ke-toolbar .ke-outline{border:none;}*/ +/*.cr{clear: right;}*/ + +div.content{padding-top:10px;} +.pcontent>.school_list,.content>.school_list { padding-left: 5px;} \ No newline at end of file