diff --git a/Gemfile b/Gemfile index 0125e9d60..38364b556 100644 --- a/Gemfile +++ b/Gemfile @@ -44,7 +44,9 @@ group :development do gem 'grape-swagger' gem 'better_errors', '~> 1.1.0' gem 'rack-mini-profiler', '~> 0.9.3' - gem 'win32console' + if RUBY_PLATFORM =~ /w32/ + gem 'win32console' + end end group :development, :test do diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index edf055370..7cdc838e2 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -142,6 +142,13 @@ class IssuesController < ApplicationController @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young @available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq + #id name email + #1. issues list persons + #2. project persons + @at_persons = @journals.map(&:user) + @issue.project.users + @at_persons = @at_persons.uniq{|u| u.id}.delete_if{|u| u.id == User.current.id} + @at_persons = nil + respond_to do |format|`` format.html { retrieve_previous_and_next_issue_ids diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0d2f53820..5a9563b73 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1934,6 +1934,8 @@ module ApplicationHelper candown = true elsif attachment.container.class.to_s=="StudentWork" candown = true + elsif attachment.container.class.to_s=="BlogComment" + candown = true elsif attachment.container.class.to_s == "User" candown = (attachment.is_public == 1 || attachment.is_public == true || attachment.author_id == User.current.id) elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses @@ -2659,4 +2661,38 @@ int main(int argc, char** argv){ true end end + + def import_ke(default_opt={}) + opt = {enable_at: true, prettify: false, init_activity: false}.merge default_opt + ss = '' + if opt[:enable_at] + ss = '" + end + + ss += javascript_include_tag("/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg') + if opt[:enable_at] + ss += javascript_include_tag('/assets/kindeditor/at/jquery.caret.min.js', '/assets/kindeditor/at/jquery.atwho.js', '/assets/kindeditor/at/config.js') + ss += stylesheet_link_tag("/assets/kindeditor/at/jquery.atwho.css") + end + + if opt[:prettify] + ss += javascript_include_tag 'prettify' + ss += stylesheet_link_tag 'prettify' + end + + if opt[:init_activity] + ss += javascript_include_tag "init_activity_KindEditor" + end + + ss.html_safe + end + end diff --git a/app/models/user.rb b/app/models/user.rb index 6e6d58f86..0c8d65481 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -410,10 +410,14 @@ class User < Principal else name = lastname+firstname end - name = name.empty? || name.nil? ? login : name - name + name.empty? || name.nil? ? login : name end ## end + + def get_at_show_name + name = show_name + name = "#{name} #{self.login}" if name != self.login + end #added by nie def count_new_journal_reply diff --git a/app/views/admin/messages.html.erb b/app/views/admin/messages.html.erb index f87741dd9..e4d053d49 100644 --- a/app/views/admin/messages.html.erb +++ b/app/views/admin/messages.html.erb @@ -1,4 +1,6 @@ -<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %> +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false) %> +<% end %>

<%=l(:label_system_message)%>


diff --git a/app/views/bids/edit.html.erb b/app/views/bids/edit.html.erb index 554702d97..9fb8cbc59 100644 --- a/app/views/bids/edit.html.erb +++ b/app/views/bids/edit.html.erb @@ -1,5 +1,7 @@ -<%= javascript_include_tag "/assets/kindeditor/kindeditor",'prettify','/assets/kindeditor/pasteimg' %> -<%= stylesheet_link_tag 'prettify'%> +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: true) %> +<% end %> + <%= labelled_form_for @bid,:html => { :multipart => true } do |f| %> <%= render :partial => 'new_homework_form', :locals => { :bid => @bid, :bid_id => "edit_bid_#{@bid.id}",:f=>f,:edit_mode => true} %> <% end %> diff --git a/app/views/blog_comments/_edit.html.erb b/app/views/blog_comments/_edit.html.erb index 375c948d4..c7065ece4 100644 --- a/app/views/blog_comments/_edit.html.erb +++ b/app/views/blog_comments/_edit.html.erb @@ -1,9 +1,13 @@ -<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'blog' %> +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false) %> + <%= javascript_include_tag 'blog' %> +<% end %> +
- +

diff --git a/app/views/blog_comments/_new.html.erb b/app/views/blog_comments/_new.html.erb index 48f152c4e..e336c7d01 100644 --- a/app/views/blog_comments/_new.html.erb +++ b/app/views/blog_comments/_new.html.erb @@ -1,9 +1,12 @@ -<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'blog' %> +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false) %> + <%= javascript_include_tag 'blog' %> +<% end %>
- +