This commit is contained in:
sw 2014-08-20 10:47:42 +08:00
commit f396a45e1f
7 changed files with 48 additions and 14 deletions

View File

@ -418,6 +418,8 @@ class ProjectsController < ApplicationController
@jour = @jours[@offset, @limit] @jour = @jours[@offset, @limit]
@state = false @state = false
@base_courses_tag = @project.project_type @base_courses_tag = @project.project_type
respond_to do |format| respond_to do |format|
format.html{render :layout => 'base_courses' if @base_courses_tag==1} format.html{render :layout => 'base_courses' if @base_courses_tag==1}
format.api format.api

View File

@ -89,6 +89,14 @@ class WordsController < ApplicationController
end end
end end
def destroyJournal
@journalP=JournalsForMessage.find(params[:object_id])
@journalP.destroy
respond_to do |format|
format.js
end
end
def new def new
@jour = JournalsForMessage.find(params[:journal_id]) if params[:journal_id] @jour = JournalsForMessage.find(params[:journal_id]) if params[:journal_id]
if @jour if @jour

View File

@ -44,6 +44,13 @@
<% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%> <% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%>
<% hasCourse=true%> <% hasCourse=true%>
<% _bool=false %>
<% User.current.courses.each do |course| %>
<% if !course_endTime_timeout?(course) %>
<% _bool=true %>
<% end %>
<% end %>
<% if _bool %>
<li id="course_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id} %> <li id="course_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id} %>
<ul class="course_sub_menu"> <ul class="course_sub_menu">
<% User.current.courses.each do |course| %> <% User.current.courses.each do |course| %>
@ -53,11 +60,14 @@
<% end %> <% end %>
</ul> </ul>
</li> </li>
<% end %>
<% end -%> <% end -%>
<% end %> <% end %>
<li id="project_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%= 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 %>
<li id="project_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
<% if hasCourse %> <% if hasCourse %>
<ul class="project_sub_menu" style="top: 35px"> <ul class="project_sub_menu" style="top: 35px">
<% else %> <% else %>
@ -65,9 +75,10 @@
<% end %> <% end %>
<% User.current.projects.each do |project| %> <% User.current.projects.each do |project| %>
<li><%= link_to project.name.truncate(10, omission: '...'), {:controller => 'projects', :action => 'show',id: project.id, host: Setting.project_domain } %></li> <li><%= link_to project.name.truncate(10, omission: '...'), {:controller => 'projects', :action => 'show',id: project.id, host: Setting.project_domain } %></li>
<% end %> <% end %>
</ul> </ul>
</li> </li>
<% end %>
<li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%> <li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%>
</li> </li>
</ul> </ul>

View File

@ -78,6 +78,13 @@ function checkMaxLength() {
'#{l(:label_reply_plural)} #{journal.user.name}: '); '#{l(:label_reply_plural)} #{journal.user.name}: ');
return false;"} %> return false;"} %>
<% end %> <% 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 %>
</span> </span>
</span> </span>
<div style="clear: both;"></div> <div style="clear: both;"></div>

View File

@ -6,11 +6,8 @@
<!-- 上左下右 --> <!-- 上左下右 -->
<div class='desc_item'> <div class='desc_item'>
<span class=''> <span class=''>
<% if (course.school == nil) %> <%= link_to(course.name.truncate(30, omission: '...')+":", course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% else %>
<%= link_to course.school.name.try(:gsub, /(.+)$/, '\1:'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
<% end %>
</span> </span>
<span class='font_bolder'> <span class='font_bolder'>
<%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %> <%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %>
@ -19,7 +16,11 @@
</div> </div>
<div class='desc_item text_nowrap'> <div class='desc_item text_nowrap'>
[<%= get_course_term course %>] [<%= 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) %>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% 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 %>人) (<%= course.members.count %>人)
<%# files_count = course.attachments.count.to_s %> <%# files_count = course.attachments.count.to_s %>
(<%= link_to "#{course.attachments.count.to_s}份", course_files_path(course) %>资料) (<%= link_to "#{course.attachments.count.to_s}份", course_files_path(course) %>资料)

View File

@ -0,0 +1,3 @@
<% if @journalP!=nil %>
$(".message-for-user").children("#word_li_<%=@journalP.id%>").remove();
<% end %>

View File

@ -652,6 +652,7 @@ RedmineApp::Application.routes.draw do
delete 'words/destroy', :to => 'words#destroy' delete 'words/destroy', :to => 'words#destroy'
get 'words/more', :to => 'words#more' get 'words/more', :to => 'words#more'
get 'words/back', :to=> 'words#back' get 'words/back', :to=> 'words#back'
get 'words/destroyJournal', :to => 'words#destroyJournal'
############## fq ############## fq
post 'calls/create', :to => 'bids#create' post 'calls/create', :to => 'bids#create'
delete 'calls/destroy', :to => 'bids#destroy' 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' match 'words/add_brief_introdution', :controller => 'words', :action => 'add_brief_introdution'
Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir| Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|
file = File.join(plugin_dir, "config/routes.rb") file = File.join(plugin_dir, "config/routes.rb")
if File.exists?(file) if File.exists?(file)