From 6bb649e831d7ab3dbb3bf869028a1c3e9f004eca Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 27 May 2015 08:36:32 +0800 Subject: [PATCH 1/6] =?UTF-8?q?issue=E5=BC=95=E7=94=A8=E5=9C=A8=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=8A=A8=E6=80=81=E7=9A=84=E6=98=BE=E7=A4=BA=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/show.html.erb | 2 +- app/views/projects/show.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 88bbb4a71..987b92570 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -103,11 +103,11 @@
+ <% if @issue.editable? %>
<%= render :partial => 'edit' %>
-

<%= l(:button_submit) %> diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index f3c453019..ffeeaef82 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -51,7 +51,7 @@ <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.project_issues_index}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"}, :class => "problem_tit fl fb" %>
-

<%= textAreailizable act,:notes %>
+

<%= textilizable act,:notes %>
<%= l :label_activity_time %> :<%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %>

From 10e24bebd50c9e4e3bc63ca68f87266e65e7e8ce Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 27 May 2015 08:56:34 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=8A=A8=E6=80=81=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=94=B9=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/courses_service.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 26d8df16f..49170bf30 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -364,19 +364,20 @@ class CoursesService latest_course_dynamics = [] latest_news = course.news.order("created_on desc").first unless latest_news.nil? - latest_course_dynamics << {:type => 1,:time => latest_news.created_on,:message => l(:label_recently_updated_notification,:locale => get_user_language(current_user))} + latest_course_dynamics << {:type => 1,:time => latest_news.created_on, + :message =>latest_news.author.realname<< l(:label_recently_updated_notification,:locale => get_user_language(current_user))<<":"<< latest_news.title } end latest_message = course.journals_for_messages.order("created_on desc").first unless latest_message.nil? - latest_course_dynamics << {:type => 2,:time => latest_message.created_on,:message => l(:label_recently_updated_message,:locale => get_user_language(current_user))} + latest_course_dynamics << {:type => 2,:time => latest_message.created_on,:message =>latest_message.user.realname << l(:label_recently_updated_message,:locale => get_user_language(current_user))<<":"< 3,:time => latest_attachment.created_on,:message => l(:label_recently_updated_courseware,:locale => get_user_language(current_user))} + latest_course_dynamics << {:type => 3,:time => latest_attachment.created_on,:message =>latest_attachment.author.realname<< l(:label_recently_updated_courseware,:locale => get_user_language(current_user))<<":"< 4,:time => latest_bid.updated_on,:message => l(:label_recently_updated_homework,:locale => get_user_language(current_user))} + latest_course_dynamics << {:type => 4,:time => latest_bid.updated_on,:message => latest_bid.author.realname< get_user_language(current_user))<<":"< 4,:time => latest_homework_attach.updated_at,:message => l(:label_recently_updated_homework,:locale => get_user_language(current_user))} + latest_course_dynamics << {:type => 4,:time => latest_homework_attach.updated_at,:message =>latest_homework_attach.user.realname<< l(:label_recently_updated_homework,:locale => get_user_language(current_user))<<":"<<(latest_homework_attach.name.nil? ? latest_homework_attach.description : latest_homework_attach.name)} end latest_course_dynamics.sort!{|order,newer| newer[:time] <=> order[:time]} latest_course_dynamic = latest_course_dynamics.first From 95f3d89afa9896d091d5d5603611940b0b09470d Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 27 May 2015 14:45:36 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=96=B0=E9=97=BB?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BC=96=E8=BE=91=E5=99=A8=EF=BC=9A=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=A1=B5=E9=9D=A2=E3=80=81=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=96=B0=E6=A0=B7=E5=BC=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_form.html.erb | 14 ++++++------ app/views/news/_project_form.html.erb | 33 +++++++++++++++++---------- app/views/news/_project_news.html.erb | 2 +- public/javascripts/project.js | 1 + public/stylesheets/project.css | 1 + 5 files changed, 31 insertions(+), 20 deletions(-) diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index 27ac07d64..41fca87eb 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -53,13 +53,13 @@ <%= f.label_for_field :description, :required => @issue.required_attribute?('description'), :no_label => true, :class => "label" %> <%#= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %> <%#= content_tag 'span', :id => "issue_description_and_toolbar" do %> - <%= f.kindeditor :description,:editor_id => "issue_desc_editor", - # :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min), - # :accesskey => accesskey(:edit), - # :class => "w583", - :width=>'87%', - :resizeType => 0, - :no_label => true %> + <%= f.kindeditor :description,:editor_id => "issue_desc_editor", + # :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min), + # :accesskey => accesskey(:edit), + # :class => "w583", + :width=>'87%', + :resizeType => 0, + :no_label => true %> <%# end %> <%#= wikitoolbar_for 'issue_description' %> <% end %> diff --git a/app/views/news/_project_form.html.erb b/app/views/news/_project_form.html.erb index 37f11d3f0..33613e5a7 100644 --- a/app/views/news/_project_form.html.erb +++ b/app/views/news/_project_form.html.erb @@ -1,26 +1,35 @@ -
  • +<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> +
  • - +

  • -
  • - - -

    +
  • + <% if is_new %> + <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> + + <%= f.kindeditor :description,:width=>'91%',:editor_id=>'project_news_description_editor' %> +

    + <% else %> + + <%= f.kindeditor :description,:width=>'91%', :editor_id=>'project_news_description_editor', :owner_id => @news.id, :owner_type => OwnerTypeHelper::NEWS %> +

    + <% end %> +
  • -
  • - +
  • + <%= render :partial => 'attachments/new_form', :locals => {:container => @news} %>
  • -
  • +
  • <% if is_new %> - <%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %> + <%= link_to l(:button_create), "javascript:void(0)", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %> <%= link_to l(:button_cancel), project_news_index_path(@project), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %> <% else %> - <%= link_to l(:button_save), "#", :onclick => 'submitNews();',:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %> - <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'blue_btn grey_btn fl c_white' %> + <%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %> + <%= link_to l(:button_cancel), news_path(@news), :class => 'blue_btn grey_btn fl c_white' %> <% end %>
  • diff --git a/app/views/news/_project_news.html.erb b/app/views/news/_project_news.html.erb index 75b51ab6c..7b6a16e38 100644 --- a/app/views/news/_project_news.html.erb +++ b/app/views/news/_project_news.html.erb @@ -29,7 +29,7 @@ <%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %> <%= l(:label_add_news) %>:<%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %>
    -

    <%= news.description %>

    +

    <%=textAreailizable news.description %>

    <%= l(:label_create_time) %> :<%= format_time(news.created_on) %> diff --git a/public/javascripts/project.js b/public/javascripts/project.js index f9f88703d..e30c08b43 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -212,6 +212,7 @@ function regexTitle() { } function regexDescription() { + project_news_description_editor.sync(); var name = $("#news_description").val(); if (name.length == 0) { $("#description_notice_span").text("描述不能为空"); diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index d6bef6524..5a6d98fbe 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -330,6 +330,7 @@ a:hover.st_add{ color:#ff8e15;} .hwork_new{ color:#4c4c4c;} .c_red{ color:#F00;} .hwork_input{ border:1px solid #64bdd9; height:22px; width:555px; background:#fff; margin-bottom:10px; padding:5px;} +.hwork_input_news{ border:1px solid #64bdd9; height:22px; width:594px; background:#fff; margin-bottom:10px; padding:5px;} .hwork_input02{ border:1px solid #64bdd9; height:15px; width:120px; background:#fff; margin-bottom:10px; padding:5px;} .hwork_text{ border:1px solid #64bdd9; height:100px;width:555px; background:#fff; margin-left:5px; padding:5px; margin-bottom:10px;} .hwork_new ul li{ } From 04c54d4f6ee9a751210b432aecbd1a5322a4f72c Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 27 May 2015 14:50:09 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=96=B0=E9=97=BB?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=A1=B5=E9=9D=A2=E6=97=B6=E9=97=B4=E5=92=8C?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=8D=A2=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/news/_project_show.html.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/news/_project_show.html.erb b/app/views/news/_project_show.html.erb index 9d598f0b5..f95192d64 100644 --- a/app/views/news/_project_show.html.erb +++ b/app/views/news/_project_show.html.erb @@ -82,8 +82,9 @@ :onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @project) %> <%= delete_link news_path(@news),:class => 'talk_edit fr' if User.current.allowed_to?(:manage_news, @project) %>
    -
    <%= textAreailizable(@news, :description) %>
    <%= l(:label_create_time) %> : <%= format_time(@news.created_on) %>
    - <%= link_to_attachments_course @news %> +
    <%= textAreailizable(@news, :description) %>
    + <%= link_to_attachments_course @news %>
    + <%= l(:label_create_time) %> : <%= format_time(@news.created_on) %>
    From df5c040aab9d389a5d75d81568fd6b8558593818 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 27 May 2015 16:00:11 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AEissue?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_action_menu.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb index a5823ede3..2643c93e7 100644 --- a/app/views/issues/_action_menu.html.erb +++ b/app/views/issues/_action_menu.html.erb @@ -1,6 +1,6 @@ <%#= watcher_link_issue(@issue, User.current) %> -<%#= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:add_issues, @project) %> +<%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'talk_edit fr' if User.current.allowed_to?(:add_issues, @project) %> <%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %> <%= link_to l(:button_edit), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("all_attributes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %> <%= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %> From 5279c2d3e5123abb02571f8415df99f0434194e2 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Thu, 28 May 2015 09:51:32 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=89=80=E6=9C=89?= =?UTF-8?q?=E7=9A=84=E5=9F=9F=E7=9A=84autologin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 02b2f0d1d..88cd51d67 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -199,7 +199,7 @@ class ApplicationController < ActionController::Base # Logs out current user def logout_user if User.current.logged? - cookies.delete(autologin_cookie_name, domain: Redmine::Configuration['cookie_domain']) + cookies.delete(autologin_cookie_name, domain: :all) # Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) self.logged_user = nil end