From e1afdab98852d5fda91a6dd75eb54b9fadcf6a27 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 26 Mar 2015 17:41:25 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E7=95=99=E8=A8=80=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_courses_jours.html.erb | 6 ++-- app/views/courses/_history.html.erb | 8 ++--- app/views/courses/feedback.html.erb | 5 +-- app/views/words/_journal_reply_items.html.erb | 33 +++++++++---------- app/views/words/_new_respond_course.html.erb | 10 +++--- public/stylesheets/courses.css | 4 ++- 6 files changed, 32 insertions(+), 34 deletions(-) diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index 680bafb46..385b945d9 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -12,10 +12,10 @@ <% else %> <%= form_for('new_form', :method => :post, :url => {:controller => 'words', :action => 'leave_course_message'}) do |f|%> - <%= f.text_area 'course_message',:id => "leave_meassge", :rows => 3, :cols => 65, + <%= f.text_area 'course_message',:id => "leave_meassge", :placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250%> - 取  消 - <%= l(:button_leave_meassge)%> + 取  消 + <%= l(:button_leave_meassge)%> <% end %> <% end %> diff --git a/app/views/courses/_history.html.erb b/app/views/courses/_history.html.erb index 23d4909d9..01990602d 100644 --- a/app/views/courses/_history.html.erb +++ b/app/views/courses/_history.html.erb @@ -3,17 +3,15 @@ <% for journal in journals %>
- - <%= image_tag(url_to_avatar(journal.user),:width => '46',:height => '46') %> - + <%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %>
- <%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%> + <%= link_to journal.user, user_path(journal.user),:class => 'c_blue fb fl mb10', :target => "_blank"%> - + <%= format_time(journal.created_on) %>
diff --git a/app/views/courses/feedback.html.erb b/app/views/courses/feedback.html.erb index b7713c4a9..0a8458a22 100644 --- a/app/views/courses/feedback.html.erb +++ b/app/views/courses/feedback.html.erb @@ -1,9 +1,10 @@ <% reply_allow = JournalsForMessage.create_by_user? User.current %>
-

用户留言

+

<%= l(:label_contest_userresponse) %>

+ <%= render :partial => 'courses_jours', :locals => { :contest => @contest, :journals => @jour, :state => false} %> @@ -12,7 +13,7 @@ diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 0d995d095..6069c4a14 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -19,7 +19,7 @@ a:hover.project_name{ color:#016f33;} a.project_txt02{ color:#0781b4; width:618px; display:block; float:left; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} a:hover.project_txt{ color:#066e9a;} .noline{ border-bottom:none;} -.news_description{max-height: 38px;overflow:hidden; } +.news_description{max-height: 60px;overflow:hidden; } .news_description_none{max-height: none;} a.news_foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:600px; height:20px; padding-top:3px; cursor:pointer;} a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;} From cb498a44a60e13ffd6f9038609e4fe85b6ddca32 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 26 Mar 2015 19:04:47 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=A4=9A=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E5=8F=91=E5=B8=83=E9=80=9A=E7=9F=A5=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/news/_course_news.html.erb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/news/_course_news.html.erb b/app/views/news/_course_news.html.erb index a1f94ab27..07e21c52c 100644 --- a/app/views/news/_course_news.html.erb +++ b/app/views/news/_course_news.html.erb @@ -20,23 +20,23 @@
-<% if @course && User.current.allowed_to?(:manage_news, @course) %> - <%= link_to(btn_tips, new_course_news_path(@course), +
<% if @newss.empty? %> From b8ab3770f10923acbf6c1bf2dd5a42def844d119 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 26 Mar 2015 19:10:27 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=86=B2=E7=AA=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/words/_new_respond_course.html.erb | 2 +- public/stylesheets/courses.css | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/words/_new_respond_course.html.erb b/app/views/words/_new_respond_course.html.erb index d32f5de85..77e40783d 100644 --- a/app/views/words/_new_respond_course.html.erb +++ b/app/views/words/_new_respond_course.html.erb @@ -10,6 +10,6 @@ <%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %> <%= submit_tag l(:button_feedback_respond), :name => nil , - :class => "sub_btn"%> + :class => "reply_btn"%> <% end %> \ No newline at end of file diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 6069c4a14..812b00866 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -342,8 +342,9 @@ a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; col blockquote {background: #eeeeee;padding: 10px;margin-bottom: 10px;} .respond-form{display: none;margin: auto;clear: both;} -.sub_btn{display: block;margin-left: 470px;} +.reply_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #ccc; color:#999; border-radius:3px; padding:2px 10px; margin-bottom:10px;display: block;margin-left: 470px;} +.reply_btn:hover{ background:#999; color:#fff; } From ddecd61926ff7720ffc7d5af6ed1ef6bd2810014 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 26 Mar 2015 20:17:47 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=87=E7=AD=BE=E6=97=B6=E6=97=A0=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tags_controller.rb | 2 + app/views/files/_course_list.html.erb | 4 +- .../tags/_course_attachment_tag_name.erb | 56 +++++++++++++++++++ app/views/tags/_tag_list.html.erb | 7 ++- app/views/tags/_tag_new.html.erb | 7 +++ app/views/tags/tag_save.js.erb | 6 ++ 6 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 app/views/tags/_course_attachment_tag_name.erb diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 6738d2135..2a0d0445d 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -248,6 +248,8 @@ class TagsController < ApplicationController @obj = OpenSourceProject.find_by_id(@obj_id) when '9' @obj = Course.find_by_id(@obj_id) + when '10' + @obj = Attachment.find_by_id(@obj_id) else @obj = nil end diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index 8af369558..7dc047c5e 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -44,8 +44,8 @@
- <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %> - <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %> + <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "10"} %> + <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "10"} %>
diff --git a/app/views/tags/_course_attachment_tag_name.erb b/app/views/tags/_course_attachment_tag_name.erb new file mode 100644 index 000000000..699f7208f --- /dev/null +++ b/app/views/tags/_course_attachment_tag_name.erb @@ -0,0 +1,56 @@ + + +<% @tags = obj.reload.tag_list %> +<% if non_list_all and (@tags.size > 0) %> + + <% if @tags.size > Setting.show_tags_length.to_i then %> + <% i = 0 %> + <% until i>Setting.show_tags_length.to_i do %> +
+ <%= link_to @tags[i], :controller => "tags", :action => "index", :q => @tags[i], :object_flag => object_flag, :obj_id => obj.id %> +
+ <% i += 1 %> + <% end %> + <%= more_tags(obj.id,object_flag)%> + <% else %> + <% @tags.each do |tag| %> +
+ <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> +
+ <% end %> + <% end %> +<% 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 %> + + <% case object_flag %> + <% when '10' %> + <%# if (User.current.logged? && + User.current.admin? + # && (@project && User.current.member_of?(@project)) + ) + %> + <% if obj.author_id == User.current.id || User.current.admin?%> + + <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag, + :taggable_id => obj.id, :taggable_type => object_flag %> + + <% end %> + <% end %> + +
+ <% end %> + <% end %> +<% end %> \ No newline at end of file diff --git a/app/views/tags/_tag_list.html.erb b/app/views/tags/_tag_list.html.erb index 549ed1751..e18dafd7d 100644 --- a/app/views/tags/_tag_list.html.erb +++ b/app/views/tags/_tag_list.html.erb @@ -5,7 +5,12 @@ <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> <% case object_flag %> - <% when '6' %> + <% when '10' %> + <% if obj.author_id == User.current.id || User.current.admin?%> + <%= link_to 'x', :controller => "tags", :action => "remove_tag_new", :remote => true, :tag_name => tag, + :taggable_id => obj.id, :taggable_type => object_flag %> + <% end %> + <% when '6' %> <% if obj.author_id == User.current.id || User.current.admin?%> <%= link_to 'x', :controller => "tags", :action => "remove_tag_new", :remote => true, :tag_name => tag, :taggable_id => obj.id, :taggable_type => object_flag %> diff --git a/app/views/tags/_tag_new.html.erb b/app/views/tags/_tag_new.html.erb index eb49005ae..0d5d371e3 100644 --- a/app/views/tags/_tag_new.html.erb +++ b/app/views/tags/_tag_new.html.erb @@ -12,6 +12,13 @@ <% if object_flag == '3' %> + <% elsif object_flag == '10' %> +
+ <%= render :partial => "tags/tag_list",:locals => {:obj => obj,:object_flag => object_flag} %> +
+ <% elsif object_flag == '6' %>
<%= render :partial => "tags/tag_list",:locals => {:obj => obj,:object_flag => object_flag} %> diff --git a/app/views/tags/tag_save.js.erb b/app/views/tags/tag_save.js.erb index b4866bb89..2bef1a3a3 100644 --- a/app/views/tags/tag_save.js.erb +++ b/app/views/tags/tag_save.js.erb @@ -14,6 +14,12 @@ $("#put-tag-form-<%=@obj.class%>-<%=@obj.id%> #name").val(""); $('#tags_show').html('<%= escape_javascript(render :partial => 'tags/new_tag_name', :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>'); $('#tags_name').val(""); +<% elsif @obj_flag == '10'%> +$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); +$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/course_attachment_tag_name', + :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>'); +//$("#put-tag-form-<%#=@obj.class%>-<%#=@obj.id%>").hide(); +$("#tags_name_<%=@obj.id%>").val(""); <% else%> $('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name', :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>'); From b3acbec2e1142d92e1fac52a2dd2b7589d9f1b05 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 26 Mar 2015 20:35:40 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_upload_show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/files/_upload_show.html.erb b/app/views/files/_upload_show.html.erb index 7db9b6b21..ca3eda73c 100644 --- a/app/views/files/_upload_show.html.erb +++ b/app/views/files/_upload_show.html.erb @@ -1,5 +1,5 @@ -
+

<%= l(:label_upload_files)%>

From d8da3bb73cb52be0f21041effa018c8f6e9c3d09 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 27 Mar 2015 09:05:43 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E5=A4=9A=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E7=A9=BA=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/news/_course_news.html.erb | 4 ++-- public/stylesheets/courses.css | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/news/_course_news.html.erb b/app/views/news/_course_news.html.erb index 07e21c52c..aa286b540 100644 --- a/app/views/news/_course_news.html.erb +++ b/app/views/news/_course_news.html.erb @@ -51,7 +51,7 @@ <%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %> <%= l(:label_release_news) %>:<%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %>
-
<%= textilizable(news, :description) %>
<%= l(:label_create_time) %> :<%= format_time(news.created_on) %>
+

<%= news.description %>
<%= l(:label_create_time) %> :<%= format_time(news.created_on) %>

@@ -92,7 +92,7 @@ }); $(function(){ $('.news_description').each(function () { - if($(this).height() >= 60) + if($(this).height() >= 38) { $('#news_foot_'+$(this).attr('id').replace('news_description_','')).css("display","block"); } diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 812b00866..fae52a850 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -19,7 +19,7 @@ a:hover.project_name{ color:#016f33;} a.project_txt02{ color:#0781b4; width:618px; display:block; float:left; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} a:hover.project_txt{ color:#066e9a;} .noline{ border-bottom:none;} -.news_description{max-height: 60px;overflow:hidden; } +.news_description{max-height: 38px;overflow:hidden; } .news_description_none{max-height: none;} a.news_foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:600px; height:20px; padding-top:3px; cursor:pointer;} a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;} @@ -52,7 +52,7 @@ a:hover.problem_new_btn{ background:#ff7143; color:#fff;} .problem_p span{ color:#ff3e00;} a.problem_pic{ display:block; width:42px; height:42px; padding:3px; border:1px solid #e3e3e3;} a:hover.problem_pic{border:1px solid #64bdd9;} -.problem_txt{ width:610px; margin-left:10px; color:#777777;} +.problem_txt{ width:610px; margin-left:10px; color:#777777;word-break: break-all;word-wrap: break-word;} a.problem_name{ color:#ff5722;} a:hover.problem_name{ color:#d33503;} a.problem_tit{ color:#0781b4; width:430px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}