diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index ccbff8e50..ea37766b6 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -418,6 +418,8 @@ class ProjectsController < ApplicationController
@jour = @jours[@offset, @limit]
@state = false
@base_courses_tag = @project.project_type
+
+
respond_to do |format|
format.html{render :layout => 'base_courses' if @base_courses_tag==1}
format.api
diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb
index 110f81537..af850d626 100644
--- a/app/controllers/words_controller.rb
+++ b/app/controllers/words_controller.rb
@@ -88,7 +88,15 @@ class WordsController < ApplicationController
#format.api { render_api_ok }
end
end
-
+
+ def destroyJournal
+ @journalP=JournalsForMessage.find(params[:object_id])
+ @journalP.destroy
+ respond_to do |format|
+ format.js
+ end
+ end
+
def new
@jour = JournalsForMessage.find(params[:journal_id]) if params[:journal_id]
if @jour
diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb
index d7d579dd1..a3412142b 100644
--- a/app/views/courses/show.html.erb
+++ b/app/views/courses/show.html.erb
@@ -2,7 +2,7 @@
- <%= l(:label_date_from_to, :start => format_date(@date_from), :end => format_date(@date_to - 1)) %>
+ <%#= l(:label_date_from_to, :start => format_date(@date_from), :end => format_date(@date_to - 1)) %>
<% @events_by_day.keys.sort.reverse.each do |day| %>
diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb
index 3116a9a68..b943cf565 100644
--- a/app/views/layouts/_base_header.html.erb
+++ b/app/views/layouts/_base_header.html.erb
@@ -44,6 +44,13 @@
<% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%>
<% hasCourse=true%>
+ <% _bool=false %>
+ <% User.current.courses.each do |course| %>
+ <% if !course_endTime_timeout?(course) %>
+ <% _bool=true %>
+ <% end %>
+ <% end %>
+ <% if _bool %>
<%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id} %>
+ <% end %>
<% end -%>
<% end %>
-
<%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
+ <% if User.current.projects.count>0 %>
+
+ <%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
<% if hasCourse %>
+ <% end %>
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%>
diff --git a/app/views/projects/feedback.html.erb b/app/views/projects/feedback.html.erb
index 5de3ceb4a..13e123b35 100644
--- a/app/views/projects/feedback.html.erb
+++ b/app/views/projects/feedback.html.erb
@@ -72,13 +72,20 @@ function checkMaxLength() {
<% if reply_allow %>
<%= link_to l(:label_projects_feedback_respond),'#',
- {:focus => 'project_respond',
- :onclick => "toggleAndSettingWordsVal($('##{id}'),
- $('##{id} textarea'),
- '#{l(:label_reply_plural)} #{journal.user.name}: ');
+ {:focus => 'project_respond',
+ :onclick => "toggleAndSettingWordsVal($('##{id}'),
+ $('##{id} textarea'),
+ '#{l(:label_reply_plural)} #{journal.user.name}: ');
return false;"} %>
<% end %>
-
+
+ <% if User.current.logged? %>
+ <% if journal.user_id==User.current.id|| User.current.admin? %>
+ <%= link_to(l(:button_delete),{:controller => 'words', :action => 'destroyJournal', :object_id => journal.id},
+ :remote => true, :title => l(:button_delete)) %>
+ <% end %>
+ <% end %>
+
<% if reply_allow %>
diff --git a/app/views/welcome/_course_list.html.erb b/app/views/welcome/_course_list.html.erb
index f590cf868..8d31f7c4c 100644
--- a/app/views/welcome/_course_list.html.erb
+++ b/app/views/welcome/_course_list.html.erb
@@ -6,11 +6,8 @@
- <% if (course.school == nil) %>
-
- <% else %>
- <%= link_to course.school.name.try(:gsub, /(.+)$/, '\1:'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
- <% end %>
+ <%= link_to(course.name.truncate(30, omission: '...')+":", course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
+
<%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %>
@@ -19,7 +16,11 @@
[<%= get_course_term course %>]
- <%= link_to(course.name.truncate(30, omission: '...'), course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
+ <% if (course.school == nil) %>
+
+ <% else %>
+ <%= link_to course.school.name.try(:gsub, /(.+)$/, '\1'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
+ <% end %>
(<%= course.members.count %>人)
<%# files_count = course.attachments.count.to_s %>
(<%= link_to "#{course.attachments.count.to_s}份", course_files_path(course) %>资料)
diff --git a/app/views/words/destroyJournal.js.erb b/app/views/words/destroyJournal.js.erb
new file mode 100644
index 000000000..5c91c6053
--- /dev/null
+++ b/app/views/words/destroyJournal.js.erb
@@ -0,0 +1,3 @@
+<% if @journalP!=nil %>
+ $(".message-for-user").children("#word_li_<%=@journalP.id%>").remove();
+<% end %>
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 9d9b9d13b..f93318c7d 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -652,6 +652,7 @@ RedmineApp::Application.routes.draw do
delete 'words/destroy', :to => 'words#destroy'
get 'words/more', :to => 'words#more'
get 'words/back', :to=> 'words#back'
+ get 'words/destroyJournal', :to => 'words#destroyJournal'
############## fq
post 'calls/create', :to => 'bids#create'
delete 'calls/destroy', :to => 'bids#destroy'
@@ -746,6 +747,7 @@ RedmineApp::Application.routes.draw do
match 'words/add_brief_introdution', :controller => 'words', :action => 'add_brief_introdution'
+
Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|
file = File.join(plugin_dir, "config/routes.rb")
if File.exists?(file)