From 6df40be30e0efe687205a494be5cea385576ac0c Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Tue, 21 Jul 2015 10:38:38 +0800 Subject: [PATCH 001/162] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=EF=BC=9A=E5=A6=82=E5=9B=BE=E2=80=9C=E5=8F=96=E6=B6=88=E2=80=9D?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E2=80=9C=E5=8F=96=E6=B6=88=E5=85=B3=E6=B3=A8?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_user_watch_btn.html.erb | 2 +- app/views/users/show.html.erb | 2 +- public/stylesheets/users.css | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/_user_watch_btn.html.erb b/app/views/layouts/_user_watch_btn.html.erb index 71eea7166..234b81152 100644 --- a/app/views/layouts/_user_watch_btn.html.erb +++ b/app/views/layouts/_user_watch_btn.html.erb @@ -1,7 +1,7 @@ <% if(User.current.logged? && User.current!=target)%> <%if(target.watched_by?(User.current))%> 取消 + 'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr qx_btn mr10" data-method="delete" data-remote="true" title="取消关注">取消关注 <% else %> 关注 <% end %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index efe5d0539..e8db87a7e 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -32,7 +32,7 @@
- +

取消 diff --git a/public/stylesheets/users.css b/public/stylesheets/users.css index 81529288c..446f0e607 100644 --- a/public/stylesheets/users.css +++ b/public/stylesheets/users.css @@ -97,7 +97,7 @@ a.select_btn_select{ background:#64bddb; color:#fff;} /* 个人主页*/ a.gz_btn{display:block; background:url(../images/pic_uersall.png) -318px -25px no-repeat; width:33px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;} a:hover.gz_btn{ color:#ff5722;} -a.qx_btn{display:block; background:url(../images/pic_uersall.png) -318px -47px no-repeat; width:33px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;} +a.qx_btn{display:block; background:url(../images/pic_uersall.png) -318px -47px no-repeat; width:53px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;} a:hover.qx_btn{color:#64bdd9;} a.c_lgrey{ color:#CCC;} a:hover.c_lgrey{ color:#3ca5c6;} From 3b6d6596c0f92c028e89fc3963db4e34a8740502 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 21 Jul 2015 11:59:15 +0800 Subject: [PATCH 002/162] =?UTF-8?q?3218=203219=E7=BC=BA=E9=99=B7=E7=9A=84?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_users_new.html.erb | 4 ++-- app/views/my/clear_user_avatar_temp.js.erb | 3 ++- app/views/my/save_user_avatar.js.erb | 2 +- db/schema.rb | 8 +------- public/stylesheets/users.css | 2 +- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/app/views/layouts/base_users_new.html.erb b/app/views/layouts/base_users_new.html.erb index ef6d82245..3d0052b25 100644 --- a/app/views/layouts/base_users_new.html.erb +++ b/app/views/layouts/base_users_new.html.erb @@ -116,7 +116,7 @@ $(".subNav").click(function(){
- <%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:216px;height:216px;",:alt=>"头像") %> + <%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:214px;height:214px;overflow:hidden",:alt=>"头像") %> <% if @center_flag %> <% end %> @@ -320,7 +320,7 @@ $(".subNav").click(function(){ 48px*48px
- 取  消 + 取  消 确  定
diff --git a/app/views/my/clear_user_avatar_temp.js.erb b/app/views/my/clear_user_avatar_temp.js.erb index 9513bdac4..788678673 100644 --- a/app/views/my/clear_user_avatar_temp.js.erb +++ b/app/views/my/clear_user_avatar_temp.js.erb @@ -4,4 +4,5 @@ $('#ajax-modal').siblings().hide(); $('#ajax-modal').parent().removeClass("alert_praise"); //$('#ajax-modal').parent().css("top","").css("left",""); - $('#ajax-modal').parent().addClass("alert_box"); \ No newline at end of file + $('#ajax-modal').parent().addClass("alert_box"); + $('#ajax-modal').parent().css("border", "2px solid #15bccf").css("border-radius", "0").css(" -webkit-border-radius", "0").css(" -moz-border-radius", "0"); \ No newline at end of file diff --git a/app/views/my/save_user_avatar.js.erb b/app/views/my/save_user_avatar.js.erb index ce4bae501..54cb3de48 100644 --- a/app/views/my/save_user_avatar.js.erb +++ b/app/views/my/save_user_avatar.js.erb @@ -1,2 +1,2 @@ -$("#nh_user_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:216px;height:216px;",:alt=>"头像") %>'); +$("#nh_user_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:214px;height:214px;overflow:hidden",:alt=>"头像") %>'); hideModal(); \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 243079ed8..276989788 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -454,13 +454,6 @@ ActiveRecord::Schema.define(:version => 20150719092427) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - create_table "discuss_demos", :force => true do |t| - t.string "title" - t.text "body" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "documents", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.integer "category_id", :default => 0, :null => false @@ -861,6 +854,7 @@ ActiveRecord::Schema.define(:version => 20150719092427) do t.datetime "created_on" t.integer "comments_count", :default => 0, :null => false t.integer "course_id" + t.datetime "updated_on" end add_index "news", ["author_id"], :name => "index_news_on_author_id" diff --git a/public/stylesheets/users.css b/public/stylesheets/users.css index 81529288c..25ac1cbb5 100644 --- a/public/stylesheets/users.css +++ b/public/stylesheets/users.css @@ -113,7 +113,7 @@ a:hover.c_lgrey{ color:#3ca5c6;} /* 20150506上传头像*/ .uppicBox{ width:265px; height:265px; background:#f2f2f5; float:left; color:#666; text-align:center;} .showpicBox{width:133px; height:250px; background:#f2f2f5; float:left; margin-left:20px; text-align:center; padding-top:15px; color:#666;} -.mr2{ margin-right:2px;} +.mr15{ margin-right:15px;} .uppic_btn{border:none; width:150px; background:none; margin-bottom:5px; color:#666; margin-top:105px;} /* 新建作品*/ .mr8{ margin-right:8px;} From 266e936d6734f79fb51f1a390c991ccc35f5c146 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 21 Jul 2015 14:10:56 +0800 Subject: [PATCH 003/162] =?UTF-8?q?3227=E7=BC=BA=E9=99=B7=E5=B7=B2?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_fans_item.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_user_fans_item.html.erb b/app/views/users/_user_fans_item.html.erb index 66181d23b..4ca8fbefc 100644 --- a/app/views/users/_user_fans_item.html.erb +++ b/app/views/users/_user_fans_item.html.erb @@ -1,6 +1,6 @@
From 8c47e6ca1fe2a065e6add78279aa90f69b3f98f8 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Tue, 21 Jul 2015 15:47:54 +0800 Subject: [PATCH 004/162] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5--?= =?UTF-8?q?=E2=80=9C=E6=88=91=E7=9A=84=E8=AF=BE=E7=A8=8B=E2=80=9D=E3=80=81?= =?UTF-8?q?=E2=80=9C=E6=88=91=E7=9A=84=E9=A1=B9=E7=9B=AE=E2=80=9D=E4=B8=8D?= =?UTF-8?q?=E6=98=AF=E4=B8=8B=E6=8B=89=E6=A1=86=E5=8D=B4=E5=81=9A=E6=88=90?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=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/base_users_new.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/base_users_new.html.erb b/app/views/layouts/base_users_new.html.erb index ef6d82245..3c61916a2 100644 --- a/app/views/layouts/base_users_new.html.erb +++ b/app/views/layouts/base_users_new.html.erb @@ -200,7 +200,7 @@ $(".subNav").click(function(){ <% if @center_flag %> \ No newline at end of file +
+ +
+
+ \ No newline at end of file diff --git a/app/views/poll/create_poll_question.js.erb b/app/views/poll/create_poll_question.js.erb index ac44ebb4c..8a597514e 100644 --- a/app/views/poll/create_poll_question.js.erb +++ b/app/views/poll/create_poll_question.js.erb @@ -1,4 +1,8 @@ +<% if @is_insert %> + $("#poll_content").html('<%= escape_javascript(render :partial => 'poll_content', :locals => {:poll => @poll})%>'); +<% else %> $("#new_poll_question").html(""); + $("#poll_content").append("
" + "
" + "<% if @poll_questions.question_type == 1%>" + @@ -23,4 +27,4 @@ $("#poll_content").append("
" + "<% end%>" + "
" + "
"); - +<% end %> diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index 353ec3937..83fa5089b 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -28,7 +28,7 @@ a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;} #polls div{word-break: break-all;word-wrap: break-word;} .ur_prefix_content{ color:#656565; text-indent:30px; margin-top:10px; } .ur_card{border-top:1px solid #dcdcdc;margin-top:20px; color:#3a3a3a;} -.ur_title{ padding:20px 0px ; float:left; width:604px; } +.ur_title{ padding:20px 0px ; float:left; width:564px; } .ur_required{ font-weight: bold; color:red;} .ur_inputs{ color:#666;} .ur_table{border-top:1px solid #dcdcdc; background:#fff;} @@ -101,10 +101,13 @@ a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;} .ur_editor02{width:648px; border:1px solid #cbcbcb; padding:10px; margin-bottom:10px;} a.ur_button_submit{ display:block; width:106px; height:31px; margin:0 auto; background:#15bccf; color:#fff; font-size:16px; text-align:center; padding-top:4px; margin-bottom:10px; } a:hover.ur_button_submit{ background:#0fa9bb; text-decoration:none;} + a.ur_icon_de{ background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px;} a:hover.ur_icon_de{ background:url(images/icons.png) -20px -338px no-repeat;} .ur_icon_edit{ background:url(images/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px; margin-right:10px;} a:hover.ur_icon_edit{ background:url(images/icons.png) -21px -272px no-repeat;} +.ur_icon_add{ background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px; margin-right:10px;} +a:hover.ur_icon_add{background:url(images/icons.png) -20px -310px no-repeat;} /***弹框***/ .popbox_polls{width:300px;height:100px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} From 6b45702f8c403a7f5b37393ae26b9cb8cbf664d0 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 28 Jul 2015 11:20:21 +0800 Subject: [PATCH 102/162] =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=A9=BA=E7=99=BD?= =?UTF-8?q?=E5=A4=84=E5=8F=AF=E4=BB=A5=E8=AE=A9=E5=BC=B9=E5=87=BA=E6=A1=86?= =?UTF-8?q?=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_poll_form.html.erb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index 0a15143fb..b081f4d18 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -2,11 +2,24 @@ - diff --git a/public/javascripts/user.js b/public/javascripts/user.js new file mode 100644 index 000000000..7c7189066 --- /dev/null +++ b/public/javascripts/user.js @@ -0,0 +1,238 @@ +$(function(){ + if($(".top_new").length==0){ + $("#RSide").css("min-height",$("#LSide").height()-30); + } + else{ + $("#RSide").css("min-height",$("#LSide").height()-87); + } + +}); + +//个人动态 +$(function(){ + + function init_editor(params){ + var editor = params.kindutil.create(params.textarea, { + resizeType : 1,minWidth:"1px",width:"100%",height:"80px", + items:['emoticons'], + afterChange:function(){//按键事件 + nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); + }, + afterCreate:function(){ + var toolbar = $("div[class='ke-toolbar']",params.div_form); + $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情'); + params.toolbar_container.append(toolbar); + } + }).loadPlugin('paste'); + return editor; + } + + function nh_check_field(params){ + var result=true; + if(params.content!=undefined){ + if(params.content.isEmpty()){ + result=false; + } + if(params.content.html()!=params.textarea.html() || params.issubmit==true){ + params.textarea.html(params.content.html()); + params.content.sync(); + if(params.content.isEmpty()){ + params.contentmsg.html('内容不能为空'); + params.contentmsg.css({color:'#ff0000'}); + }else{ + params.contentmsg.html('填写正确'); + params.contentmsg.css({color:'#008000'}); + } + params.contentmsg.show(); + } + } + return result; + } + function init_form(params){ + params.form.submit(function(){ + var flag = false; + if(params.form.attr('data-remote') != undefined ){ + flag = true + } + var is_checked = nh_check_field({ + issubmit:true, + content:params.editor, + contentmsg:params.contentmsg, + textarea:params.textarea + }); + if(is_checked){ + if(flag){ + return true; + }else{ + $(this)[0].submit(); + return false; + } + } + return false; + }); + } + function nh_reset_form(params){ + params.form[0].reset(); + params.textarea.empty(); + if(params.editor != undefined){ + params.editor.html(params.textarea.html()); + } + params.contentmsg.hide(); + } + + KindEditor.ready(function(K){ + $("a[nhname='reply_btn']").live('click',function(){ + var params = {}; + params.kindutil = K; + params.container = $(this).parent('div'); + params.div_form = $("div[nhname='div_form']",params.container); + params.form = $("form",params.div_form); + params.textarea = $("textarea[name='user_notes']",params.div_form); + params.contentmsg = $("p[nhname='contentmsg']",params.div_form); + params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); + params.cancel_btn = $("a[nhname='cancel_btn']",params.div_form); + params.submit_btn = $("a[nhname='submit_btn']",params.div_form); + if(params.textarea.data('init') == undefined){ + params.editor = init_editor(params); + init_form(params); + params.cancel_btn.click(function(){ + nh_reset_form(params); + toggleAndSettingWordsVal(params.div_form, params.textarea); + }); + params.submit_btn.click(function(){ + params.form.submit(); + }); + params.textarea.data('init',1); + } + params.cancel_btn.click(); + setTimeout(function(){ + if(!params.div_form.is(':hidden')){ + params.textarea.show(); + params.textarea.focus(); + params.textarea.hide(); + } + },300); + + }); + + $("div[nhname='new_message']").each(function(){ + var params = {}; + params.kindutil = K; + params.div_form = $(this); + params.form = $("form",params.div_form); + if(params.form==undefined || params.form.length==0){ + return; + } + params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form); + params.contentmsg = $("p[nhname='contentmsg']",params.div_form); + params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); + params.cancel_btn = $("#new_message_cancel_btn"); + params.submit_btn = $("#new_message_submit_btn"); + + if(params.textarea.data('init') == undefined){ + params.editor = init_editor(params); + init_form(params); + params.cancel_btn.click(function(){ + nh_reset_form(params); + }); + params.submit_btn.click(function(){ + params.form.submit(); + }); + params.textarea.data('init',1); + $(this).show(); + } + }); + }); +}); +function init_list_more_div(params){ + var p=params; + p.exbtn.click(function(){ + var isclose = p.container.data('isclose'); + var hasmore = p.container.data('hasmore'); + if(isclose == '1'){ + $("div[nhname='rec']",p.container).show(); + p.container.data('isclose','0'); + change_status_4_list_more_div(params); + return; + } + if(hasmore == '0'){ + change_status_4_list_more_div(params,'get'); + return; + } + var url = p.container.data('url'); + if($("div[nhname='rec']",p.container).length > 0){ + var lastid = $("div[nhname='rec']",p.container).filter(':last').data('id'); + url += "?lastid="+lastid; + var lasttime = $("div[nhname='rec']",p.container).filter(':last').data('time'); + if(lasttime != undefined){ + url += "&lasttime="+lasttime; + } + } + $.ajax( {url:url,dataType:'text',success:function(data){ + var html = $("
"+data+"
"); + var lens = $("div[nhname='rec']",html).length; + if(lens < p.size){ + p.container.data('hasmore','0'); + } + if(lens>0){ + var currpage = parseInt(p.container.data('currpage'))+1; + p.container.data('currpage',currpage); + p.container.append(html.html()) + } + change_status_4_list_more_div(params,'get'); + p.div.show(); + }} ); + }); + p.clbtn.click(function(){ + var i=0; + $("div[nhname='rec']",p.container).each(function(){ + i++; + if(i> p.size){ + $(this).hide(); + } + }); + p.container.data('isclose','1'); + change_status_4_list_more_div(params); + }); + p.exbtn.click(); +} +function change_status_4_list_more_div(params,opt){ + var p=params; + if($("div[nhname='rec']",p.container).length == 0 && opt != 'get'){ + p.exbtn.click(); + return; + } + var show_lens = $("div[nhname='rec']",p.container).length - $("div[nhname='rec']",p.container).filter(':hidden').length; + if( show_lens > p.size ){ + p.clbtn.show(); + }else{ + p.clbtn.hide(); + } + if($("div[nhname='rec']",p.container).length == 0){ + p.exbtn.html(p.nodatamsg); + }else if( p.container.data('hasmore') == '1' || p.container.data('isclose')=='1' ){ + p.exbtn.html('点击展开更多'); + }else{ + p.exbtn.html('没有更多了'); + } +} +function init_list_more_div_params(div){ + var params = {}; + params.div = div; + params.container = $("div[nhname='container']",div); + params.exbtn = $("a[nhname='expand']",div); + params.clbtn = $("a[nhname='close']",div); + params.size = params.container.data('pagesize'); + params.nodatamsg = params.container.data('nodatamsg'); + if( params.size == undefined ){ + params.size = 13; + } + return params; +} +$(function(){ + $("div[nhname='list_more_div']").each(function(){ + var params = init_list_more_div_params($(this)); + init_list_more_div(params) + }); +}); +//个人动态 end \ No newline at end of file diff --git a/public/stylesheets/users.css b/public/stylesheets/users.css index 30e6594f5..7c3dad383 100644 --- a/public/stylesheets/users.css +++ b/public/stylesheets/users.css @@ -8,7 +8,7 @@ .icon_female{ background:url(../images/pic_uersall.png) 0 -24px no-repeat; width:15px; height:15px;} .pf_intro{ width:222px; margin-top:5px; color:#696969;word-break: break-all; } .leftbox{ width:230px; padding:10px; padding-right:0px; padding-bottom:5px;background:#fff; margin-bottom:10px; margin-right:10px;} -.pic_members{ background:url(../images/pic_users.jpg) 0 0 no-repeat; display:block; width:38px; height:38px; border:1px solid #e9edf0; margin-right:5px; margin-bottom:5px;float:left;} +.pic_members{ display:block; width:38px; height:38px; border:1px solid #e9edf0; margin-right:5px; margin-bottom:5px;float:left;} .pic_members:hover{border:1px solid #c9c9c9;} /*新建*/ .top_new{ height:26px; border-bottom:10px solid #eaebed; padding:10px; background:#fff; float:left; margin-left:10px; width:730px; } @@ -89,7 +89,7 @@ a.select_btn_select{ background:#64bddb; color:#fff;} .users_ctt input,.users_ctt select,.users_ctt textarea{ border:1px solid #CCC;} .users_ctt input,.users_ctt select,.users_ctt option{ height:26px;} .users_ctt input,.users_ctt textarea{ margin-left:2px;} -.users_ctt textarea{ margin-bottom:none;} +/*.users_ctt textarea{ margin-bottom:nor;}*/ .w450{ width:450px;} .w210{ width:200px;} .w70{ width:70px;} @@ -124,4 +124,12 @@ a:hover.c_lgrey{ color:#3ca5c6;} .newhwork_div textarea{border:1px solid #CCC;} .w460{ width:460px;} -a.hidepic>img{display:none;} \ No newline at end of file +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;} \ No newline at end of file From 6a9cb0db5d51ca5c996f13849a1d94291267b867 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 28 Jul 2015 17:17:52 +0800 Subject: [PATCH 113/162] =?UTF-8?q?=E7=BC=BA=E9=99=B7=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E7=94=A8=E6=88=B7=E8=87=AA=E5=B7=B1=E6=9C=AC?= =?UTF-8?q?=E8=BA=AB=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attachments/_project_file_links.html.erb | 56 +++++++++++-------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/app/views/attachments/_project_file_links.html.erb b/app/views/attachments/_project_file_links.html.erb index b6d934c64..b644fb9fa 100644 --- a/app/views/attachments/_project_file_links.html.erb +++ b/app/views/attachments/_project_file_links.html.erb @@ -29,32 +29,32 @@ <% is_float ||= false %> <% for attachment in attachments %>
-

- <%if is_float%> -

- <% end%> - +

+ <%if is_float%> +

+ <% end%> + <% if options[:length] %> <%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true,:length => options[:length] -%> <% else %> - <%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true -%> + <% end %> - <%if is_float%> -
- <% end%> + <%if is_float%> +
+ <% end%> - <% if attachment.is_text? %> - <%= link_to image_tag('magnifier.png'), - :controller => 'attachments', - :action => 'show', - :id => attachment, - :filename => attachment.filename%> - <% end %> + <% if attachment.is_text? %> + <%= link_to image_tag('magnifier.png'), + :controller => 'attachments', + :action => 'show', + :id => attachment, + :filename => attachment.filename%> + <% end %>
- <%= h(" - #{attachment.description}") unless attachment.description.blank? %> -
+ <%= h(" - #{attachment.description}") unless attachment.description.blank? %> +
( <%= number_to_human_size attachment.filesize %>) @@ -66,6 +66,16 @@ :class => 'delete delete-homework-icon', :remote => true, :title => l(:button_delete) %> + <% elsif attachment.container_type == 'Issue' %> + <% if User.current == attachment.author %> + <%= link_to image_tag('delete.png'), attachment_path(attachment), + :data => {:confirm => l(:text_are_you_sure)}, + :method => :delete, + :class => 'delete', + #:remote => true, + #:id => "attachments_" + attachment.id.to_s, + :title => l(:button_delete) %> + <% end %> <% else %> <%= link_to image_tag('delete.png'), attachment_path(attachment), :data => {:confirm => l(:text_are_you_sure)}, @@ -89,13 +99,13 @@

<% end %>
- <% if defined?(thumbnails) && thumbnails %> - <% images = attachments.select(&:thumbnailable?) %> - <% if images.any? %> + <% if defined?(thumbnails) && thumbnails %> + <% images = attachments.select(&:thumbnailable?) %> + <% if images.any? %> <% images.each do |attachment| %>
<%= thumbnail_issue_tag(attachment) %>
<% end %> - <% end %> - <% end %> + <% end %> + <% end %>
From a0a5f3410847752d2c28c535a801976558046546 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 29 Jul 2015 10:07:00 +0800 Subject: [PATCH 114/162] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E4=BB=A5=E5=89=8D?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/poll_controller.rb | 31 +++++++++++++++++++++ app/views/poll/_poll_form.html.erb | 43 +++++++++++++++++++++++++++++- app/views/poll/_show_head.html.erb | 3 +++ 3 files changed, 76 insertions(+), 1 deletion(-) diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 8f81bc2c6..dda5b81b2 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -336,6 +336,37 @@ class PollController < ApplicationController end end + + def import_poll + @poll = Poll.find(params[:to_id]) + question_num = @poll.poll_questions.select("max(question_number) question_number").first.question_number + import_poll = Poll.find(params[:import_id]) + import_poll.poll_questions.each_with_index do |question,index| + option = { + :is_necessary => question.is_necessary, + :question_title => question.question_title, + :question_type => question.question_type, + :question_number => question_num + index+1 + } + poll_questions = @poll.poll_questions.new option + for i in 1..question.poll_answers.count + answer = question.poll_answers[i-1][:answer_text] + question_option = { + :answer_position => i, + :answer_text => answer + } + poll_questions.poll_answers.new question_option + end + @poll.poll_questions << poll_questions + end + if @poll.save + @poll = Poll.find(params[:to_id]) + respond_to do |format| + format.js + end + end + end + #重新发布问卷 def republish_poll @poll.poll_questions.each do |poll_question| diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index d784edab3..c5c016583 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -3,6 +3,7 @@ diff --git a/public/javascripts/project.js b/public/javascripts/project.js index 98c148372..c7a615ba3 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -491,3 +491,8 @@ function judgeprojectname(){ } }); } + +//用户反馈 +function submitProjectFeedback() { + $("#project_feedback_form").submit(); +} \ No newline at end of file From e4e99df1135f721da79932e481098af835b687d8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 29 Jul 2015 17:41:10 +0800 Subject: [PATCH 121/162] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E7=95=99=E8=A8=80=E7=95=8C=E9=9D=A2=E6=98=BE=E7=A4=BA=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E7=95=99=E8=A8=80=E7=9A=84=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_jours_new.html.erb | 53 +++++++++++++ app/views/users/user_newfeedback.html.erb | 91 +++++------------------ app/views/words/destroy.js.erb | 7 +- public/javascripts/user.js | 1 - public/stylesheets/public.css | 1 + public/stylesheets/users.css | 17 +++-- 6 files changed, 86 insertions(+), 84 deletions(-) create mode 100644 app/views/users/_user_jours_new.html.erb diff --git a/app/views/users/_user_jours_new.html.erb b/app/views/users/_user_jours_new.html.erb new file mode 100644 index 000000000..81bbce319 --- /dev/null +++ b/app/views/users/_user_jours_new.html.erb @@ -0,0 +1,53 @@ +
+
+ <%= link_to image_tag(url_to_avatar(jour.user),:width => '46',:height => '46'), user_path(jour.user),:class => "users_pic fl" %> +
+
+ <%= link_to "#{jour.user.login} : ".html_safe, user_path(jour.user),:class => 'fl c_blue02 f14 fb mb5', :target => "_blank"%> +
+
+
+ <%= jour.notes.html_safe %> +
+
+ + <%= time_tag(jour.created_on).html_safe %> + +
+ <%= link_to l(:button_reply),'javascript:void(0);',:nhname=>"reply_btn", :class => "ml5 c_purple" %> + <% if User.current.admin? || jour.user == User.current%> + <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => jour, :user_id => jour.user}, + :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "ml5 c_purple", :title => l(:button_delete)) %> + <% end %> +
+
+
+ + <% fetch_user_leaveWord_reply(jour).each do |reply|%> +
+ <% parent_jour = JournalsForMessage.where("id = #{reply.m_reply_id}").first %> +
+ <%= link_to image_tag(url_to_avatar(reply.user),:width => '32',:height => '32'), user_path(reply.user),:class => "users_pic_sub fl mr5" %> +
+ <%= link_to "#{reply.user.login} : ".html_safe, user_path(reply.user),:class => 'course_name fl c_blue02 ', :target => "_blank"%> +  回复:  + <%= link_to "#{parent_jour.user.login} : ".html_safe, user_path(parent_jour.user),:class => 'course_name fl c_blue02 mr5 ', :target => "_blank"%> +
+ <%= reply.notes.html_safe %> +
+
+ + <%= time_tag(reply.created_on).html_safe%> + +
+ <%= link_to l(:button_reply),'javascript:void(0);',:nhname=>"reply_btn", :class => "ml5 c_purple" %> + <% if User.current.admin? || reply.user == User.current%> + <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user}, + :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "c_purple ml5", :title => l(:button_delete)) %> + <% end %> +
+
+
+
+ <% end %> +
\ No newline at end of file diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb index de0bfbd60..52fc0aaa2 100644 --- a/app/views/users/user_newfeedback.html.erb +++ b/app/views/users/user_newfeedback.html.erb @@ -1,82 +1,27 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>

用户留言

- - 表情 - 取消 - 发布 +
+ + +

+
+ 取消 + 留言 + +
-
-
- 头像 -
- 黄井泉 :  -

上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。回复删除

-
- 50分钟前 -
-
- - 表情 - 取消 - 发布 -
-
-
- 头像 -
- 尹刚尹刚尹刚 -  回复:  - 黄井泉 -

非常好!删除

-
- 30分钟前 -
-
-
-
- 头像 -
- 白羽 :  -

什么时候放暑假啊?回复删除

-
- 50分钟前 -
-
-
- 头像 -
- 黄井泉 :  -

上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。回复删除

-
- 50分钟前 -
-
- 头像 -
- 尹刚尹刚尹刚 -  回复:  - 黄井泉 -

非常好!删除

-
- 30分钟前 -
-
-
-
- 头像 -
- 白羽 :  -

什么时候放暑假啊?回复删除

-
- 50分钟前 -
-
- - -
+
+ <%if @jour%> + <% @jour.each do |jour|%> + <%= render :partial => 'user_jours_new', :locals => {:jour => jour} %> + <%end%> + <% end%> +
+
\ No newline at end of file diff --git a/app/views/words/destroy.js.erb b/app/views/words/destroy.js.erb index 92e15ab93..c138a7ea7 100644 --- a/app/views/words/destroy.js.erb +++ b/app/views/words/destroy.js.erb @@ -2,9 +2,10 @@ alert('<%=l(:notice_failed_delete)%>'); <% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication'].include? @journal_destroyed.jour_type)%> <% if @is_user%> - $("#nh_jours_<%= @journal_destroyed.id %>",$("div[nhname='container']",$("#nh_messages"))).remove(); - var params = init_list_more_div_params($("#nh_messages")); - change_status_4_list_more_div(params); + var destroyedItem = $('#<%=@journal_destroyed.id%>'); + destroyedItem.fadeOut(600,function(){ + destroyedItem.remove(); + }); <% else %> <% if @bid && @jours_count %> $('#jours_count').html("<%= @jours_count %>"); diff --git a/public/javascripts/user.js b/public/javascripts/user.js index 7c7189066..9ad3d1588 100644 --- a/public/javascripts/user.js +++ b/public/javascripts/user.js @@ -10,7 +10,6 @@ $(function(){ //个人动态 $(function(){ - function init_editor(params){ var editor = params.kindutil.create(params.textarea, { resizeType : 1,minWidth:"1px",width:"100%",height:"80px", diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index d0893ca3d..c1e47c787 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -87,6 +87,7 @@ h4{ font-size:14px; color:#3b3b3b;} .mt10{ margin-top:10px;} .mt30{ margin-top: 30px;} .mb5{ margin-bottom:5px;} +.mb8{ margin-bottom:8px;} .mb10{ margin-bottom:10px;} .mb20{ margin-bottom:20px;} .pl15{ padding-left:15px;} diff --git a/public/stylesheets/users.css b/public/stylesheets/users.css index 3e17f1f7b..bdc6db47c 100644 --- a/public/stylesheets/users.css +++ b/public/stylesheets/users.css @@ -24,12 +24,14 @@ a.icon_face{background:url(../images/public_icon.png) 0px -671px no-repeat; dis a:hover.icon_face{background:url(../images/public_icon.png) -79px -671px no-repeat; } .inputUsers_message{ border:1px solid #d2d2d2; width:718px; height:48px; color:#666; padding:5px; margin-bottom:5px;} .inputUsers_message02{ border:1px solid #d2d2d2; width:618px; height:26px; color:#666; padding:5px; margin-bottom:5px; } -.message_list_box{ background:#f5f5f5; padding:10px;} -.users_pic{ width:27px; height:27px; border:1px solid #e3e3e3;} +.message_list_box{ background:#f5f5f5; padding:10px;margin-top: 10px;} +.users_pic{ width:46px; height:46px; border:1px solid #e3e3e3;} .users_pic:hover{ border:1px solid #a5a5a5;} +.users_pic_sub{width:32px; height:32px; border:1px solid #e3e3e3;} +.users_pic_sub:hover{ border:1px solid #a5a5a5;} .massage_txt{ max-width:360px; color: #666;word-break:break-all;} .massage_time{ color:#8d8d8d; margin-top:5px;} -.message_list{ border-bottom:1px dashed #c9c9c9; padding-bottom:10px; margin-bottom:10px;} +.message_list{ border-bottom:1px dashed #c9c9c9; margin-bottom:10px;color: #5f5f5f;} .message_list_more{ text-align:center; width:720px;} /*课程动态*/ .line_box{ width:728px; border:1px solid #d9d9d9; padding-bottom:10px;} @@ -124,9 +126,9 @@ a:hover.c_lgrey{ color:#3ca5c6;} .newhwork_div textarea{border:1px solid #CCC;} .w460{ width:460px;} /* 留言新增*/ -.mes_box{ width:600px;} -.mes_box02{ margin-left:80px; border-top:1px dashed #c9c9c9; padding-top:10px;} -.mes_box02_info{ width:500px; margin-left:5px;} +.mes_box{ width:590px;} +.mes_box02{ margin-left:50px; border-top:1px dashed #c9c9c9; padding-top:10px;margin-bottom: 10px;} +.mes_box02_info{ width:540px; margin-left:5px;} .users_r_top{ width:730px; height:40px; background:#eaeaea; margin-bottom:10px;} .users_r_h2{background:#64bdd9; color:#fff; height:33px; width:90px; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;} @@ -139,4 +141,5 @@ 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;} \ No newline at end of file +div.ke-toolbar .ke-outline{border:none;} +.cr{clear: right;} \ No newline at end of file From 9bcc633d19c34f0497c64f5467bcdef4d0995388 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 29 Jul 2015 17:56:40 +0800 Subject: [PATCH 122/162] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=B7=BB=E5=8A=A0tag?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=BC=BA=E9=99=B7=201=E3=80=81=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0ajax=E8=87=AA=E8=BA=AB=E5=88=B7=E6=96=B0=202=E3=80=81?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/tags/_project_tag.html.erb | 17 +++-------- app/views/tags/_tag_project_new_name.html.erb | 30 +++++++++++++++++++ app/views/tags/remove_tag.js.erb | 3 ++ app/views/tags/tag_save.js.erb | 4 +++ 4 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 app/views/tags/_tag_project_new_name.html.erb diff --git a/app/views/tags/_project_tag.html.erb b/app/views/tags/_project_tag.html.erb index ce80e36ab..408f3ba1d 100644 --- a/app/views/tags/_project_tag.html.erb +++ b/app/views/tags/_project_tag.html.erb @@ -1,15 +1,6 @@ -
- <%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %> +
+
+ <%= render :partial => "tags/tag_project_new_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %> +
-<% if User.current.logged?%> - <%= l(:label_add_tag)%> - -<% end%> diff --git a/app/views/tags/_tag_project_new_name.html.erb b/app/views/tags/_tag_project_new_name.html.erb new file mode 100644 index 000000000..e657071bc --- /dev/null +++ b/app/views/tags/_tag_project_new_name.html.erb @@ -0,0 +1,30 @@ +<% @tags = obj.reload.tag_list %> +<% if non_list_all && @tags.size > 0 %> + +<% else %> + + <% if @tags.size > 0 %> + <% @tags.each do |tag| %> + + <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id, :class => 'pt5' %> + + <%= link_to('x', remove_tag_path(:tag_name => tag,:taggable_id => obj.id, :taggable_type => object_flag), :remote => true, :confirm => l(:text_are_you_sure) ) if (ProjectInfo.find_by_project_id(obj.id)).try(:user_id) == User.current.id %> + + + <% end %> + <% end %> +<% end %> + +<% if User.current.logged?%> + <%= l(:label_add_tag)%> + +<% end%> + + diff --git a/app/views/tags/remove_tag.js.erb b/app/views/tags/remove_tag.js.erb index b8c65c13e..cd56fef1a 100644 --- a/app/views/tags/remove_tag.js.erb +++ b/app/views/tags/remove_tag.js.erb @@ -2,6 +2,9 @@ <% if @object_flag == '3'%> $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name', :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>'); +<% elsif @object_flag == '2'%> +$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_project_new_name', + :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>'); <% elsif @object_flag == '6'%> $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_name', diff --git a/app/views/tags/tag_save.js.erb b/app/views/tags/tag_save.js.erb index 74a38c99d..992c472ed 100644 --- a/app/views/tags/tag_save.js.erb +++ b/app/views/tags/tag_save.js.erb @@ -4,6 +4,10 @@ $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_n :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>'); //$('#put-tag-form-issue').hide(); $('#name-issue').val(""); +<% elsif @obj_flag == '2'%> +$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_project_new_name', + :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>'); +$('#tags_name2').val(""); <% elsif @obj_flag == '6'%> <%if @course%> $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); From d790fb31e497198d906dab090a59eb2a797dfdae Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 29 Jul 2015 18:00:35 +0800 Subject: [PATCH 123/162] =?UTF-8?q?=E5=8C=BF=E5=90=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E5=9C=A8=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E7=95=99=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 161791954..4b99224ca 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -4,7 +4,7 @@ class WordsController < ApplicationController include ApplicationHelper before_filter :find_user, :only => [:new, :create, :destroy, :more, :back] def create - if params[:new_form][:user_message].size>0 + if params[:new_form][:user_message].size>0 && User.current.logged? unless params[:user_id].nil? if params[:reference_content] message = params[:new_form][:user_message] + "\n" + params[:reference_content] @@ -31,9 +31,7 @@ class WordsController < ApplicationController # @jour = paginateHelper @jours,10 respond_to do |format| - # format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}} format.js - #format.api { render_api_ok } end end From ce89c7d1191dcc79b8ef6f49fa7af60b8c40f8f6 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 29 Jul 2015 18:26:04 +0800 Subject: [PATCH 124/162] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=95=99=E8=A8=80?= =?UTF-8?q?=E5=90=8E=E7=95=8C=E9=9D=A2=E7=9A=84=E5=88=B7=E6=96=B0=EF=BC=8C?= =?UTF-8?q?=E7=95=99=E8=A8=80=E7=9A=84=E5=88=86=E9=A1=B5=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 20 ++++++++++---------- app/views/users/_user_jours_new.html.erb | 1 + app/views/users/user_newfeedback.html.erb | 21 +++++++++++++-------- config/routes.rb | 1 + 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 4b99224ca..fc723d5d5 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -18,17 +18,10 @@ class WordsController < ApplicationController list = User.find(refer_user_id).add_jour(User.current, message, refer_user_id) end @jour = list.last - # @user.count_new_jour - # if a_message.size > 5 - # @message = a_message[-5, 5] - # else - # @message = a_message - # end - # @message_count = a_message.count end end - # @jours = @user.journals_for_messages.where('m_parent_id IS NULL').reverse - # @jour = paginateHelper @jours,10 + jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') + @jour = paginateHelper jours,10 respond_to do |format| format.js @@ -91,7 +84,6 @@ class WordsController < ApplicationController end respond_to do |format| format.js - #format.api { render_api_ok } end end @@ -204,7 +196,15 @@ class WordsController < ApplicationController flash[:error] = feedback.errors.full_messages[0] redirect_to project_feedback_url(params[:id]) end + end + #给用户留言 + def leave_user_message + @user = User.find(params[:id]) + if params[:new_form][:user_message].size>0 && User.current.logged? && @user + @user.add_jour(User.current, params[:new_form][:user_message]) + end + redirect_to feedback_path(@user) end # add by nwb diff --git a/app/views/users/_user_jours_new.html.erb b/app/views/users/_user_jours_new.html.erb index 81bbce319..7aa9d97ff 100644 --- a/app/views/users/_user_jours_new.html.erb +++ b/app/views/users/_user_jours_new.html.erb @@ -15,6 +15,7 @@
<%= link_to l(:button_reply),'javascript:void(0);',:nhname=>"reply_btn", :class => "ml5 c_purple" %> + <% if User.current.admin? || jour.user == User.current%> <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => jour, :user_id => jour.user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "ml5 c_purple", :title => l(:button_delete)) %> diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb index 52fc0aaa2..d594e47e4 100644 --- a/app/views/users/user_newfeedback.html.erb +++ b/app/views/users/user_newfeedback.html.erb @@ -5,22 +5,27 @@
-
- -

-
- 取消 - 留言 -
+ <%= form_for('new_form',:url => leave_user_message_path(@user.id),:method => "post") do |f|%> + +

+
+ 取消 + 留言 + <% end%>
-
+
<%if @jour%> <% @jour.each do |jour|%> <%= render :partial => 'user_jours_new', :locals => {:jour => jour} %> <%end%> <% end%> + +
    + <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> +
+
diff --git a/config/routes.rb b/config/routes.rb index 7c1096303..1536340da 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -791,6 +791,7 @@ RedmineApp::Application.routes.draw do match 'words/:id/leave_project_message', :to => 'words#leave_project_message' match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback' match 'project/:id/share', :to => 'projects#share', :as => 'share_show' #share + post 'words/:id/leave_user_message', :to => 'words#leave_user_message', :as => "leave_user_message" post 'join_in/join', :to => 'courses#join', :as => 'join' delete 'join_in/join', :to => 'courses#unjoin' From 206d1a38f7484d50a0273da56001902643679948 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 30 Jul 2015 09:07:11 +0800 Subject: [PATCH 125/162] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E7=BC=BA=E9=99=B7=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/project.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index fa1bec754..621e0c556 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -74,7 +74,11 @@ a:hover.problem_pic{border:1px solid #64bdd9;} .issues_icon{ background:url(../images/public_icon.png) 0 -342px no-repeat; width:16px; height:21px;} .problem_txt{ width:600px; margin-left:10px; color:#777777; } .pro_txt_w{width:610px;} -a.problem_name{ color:#ff5722; } +a.problem_name{ color:#ff5722;max-width: 80px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} a:hover.problem_name{ color:#d33503;} a.problem_tit{ color:#0781b4; max-width:430px; font-weight:bold; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} a.problem_tit02{ color:#0781b4; font-weight:bold;max-width:400px;} From 023f51260a2cee67fa1e4bc83e7f5fe74d4d7eb1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 30 Jul 2015 09:12:43 +0800 Subject: [PATCH 126/162] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=95=8C=E9=9D=A2js=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=97=B6=E5=80=99=E7=BB=99=E5=87=BA?= =?UTF-8?q?=E7=AD=89=E5=BE=85=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_users_new.html.erb | 3 +++ public/stylesheets/users.css | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/base_users_new.html.erb b/app/views/layouts/base_users_new.html.erb index ec2c18602..70106e4a3 100644 --- a/app/views/layouts/base_users_new.html.erb +++ b/app/views/layouts/base_users_new.html.erb @@ -269,6 +269,9 @@ <%= render :partial => 'layouts/new_feedback' %> +