diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index 383da0bbe..67355fdfa 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -57,6 +57,7 @@ class BoardsController < ApplicationController def show respond_to do |format| + format.js format.html { sort_init 'updated_on', 'desc' sort_update 'created_on' => "#{Message.table_name}.created_on", diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index 932ffaa7a..545d61155 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -61,6 +61,10 @@ class DocumentsController < ApplicationController if @project.project_type ==1 render :action => 'show', :layout => 'base_courses' end + respond_to do |format| + format.html + format.api + end end def new diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 56f760e13..8421e9be1 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -148,7 +148,11 @@ class FilesController < ApplicationController show_attachments @containers - render :layout => !request.xhr? + + respond_to do |format| + format.html + format.js + end elsif params[:course_id] @isproject = false diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index c0d83fdcd..4e3c28468 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -90,6 +90,7 @@ class IssuesController < ApplicationController respond_to do |format| + format.js format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young format.api { Issue.load_visible_relations(@issues) if include_in_api_response?('relations') @@ -103,6 +104,7 @@ class IssuesController < ApplicationController format.html { render(:template => 'issues/index', :layout => @project_base_tag) }#by young format.any(:atom, :csv, :pdf) { render(:nothing => true) } format.api { render_validation_errors(@query) } + format.js end end rescue ActiveRecord::RecordNotFound diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 02bfc9e19..c67b5197b 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -278,7 +278,7 @@ class ProjectsController < ApplicationController :with_subprojects => @with_subprojects, :author => @author) @activity.scope_select {|t| !has["show_#{t}"].nil?} - + # 根据私密性,取出符合条件的所有数据 if User.current.member_of?(@project) || User.current.admin? events = @activity.events(@date_from, @date_to) @@ -286,7 +286,6 @@ class ProjectsController < ApplicationController events = @activity.events(@date_from, @date_to, :is_public => 1) end - @offset, @limit = api_offset_and_limit({:limit => 10}) @events_count = events.count @events_pages = Paginator.new @events_count, @limit, params['page'] @@ -295,11 +294,14 @@ class ProjectsController < ApplicationController events = events.slice(@offset,@limit) # 按天分组 @events_by_day = events.group_by {|event| User.current.time_to_date(event.event_datetime)} - + # 获取讨论区总数 + boards = @project.boards.includes(:last_message => :author).all + @topic_count = @project.boards.count # 根据对应的请求,返回对应的数据 respond_to do |format| format.html format.api + format.js end end @@ -311,6 +313,20 @@ class ProjectsController < ApplicationController @wiki ||= @project.wiki end + + #发送邮件邀请新用户 + def invite_members_by_mail + + end + + # 邀请Trustie注册用户 + def invite_members_had_loged + @member ||= @project.members.new + respond_to do |format| + format.js + end + end + def edit end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5579fe79b..dbe292f76 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -48,7 +48,7 @@ module ApplicationHelper def authorize_for(controller, action) User.current.allowed_to?({:controller => controller, :action => action}, @project) end - + # add by nwb def authorize_for_course(controller, action) User.current.allowed_to?({:controller => controller, :action => action}, @course) diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 842e1f1b7..f47ced545 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -283,6 +283,6 @@ module WatchersHelper def exit_project_link(project) link_to(l(:label_exit_project),exit_cur_project_path(project.id), - :remote => true, :confirm => l(:lable_sure_exit_project) ) + :remote => true, :confirm => l(:lable_sure_exit_project), :style => "color: #fff; display:block; padding: 0px 5px;margin-right:10px;height:20px;text-aligh:center;" ) end end diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index 1a5cbd2fa..97ed903d9 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -9,9 +9,7 @@
-<%= l(:label_no_data) %> diff --git a/app/views/documents/show.html.erb b/app/views/documents/show.html.erb index 45f54ad9b..5632c9d63 100644 --- a/app/views/documents/show.html.erb +++ b/app/views/documents/show.html.erb @@ -1,3 +1,6 @@ +
<%#=h @document.category.name %>
<%= format_date @document.created_on %>
+ <%= l(:label_no_data) %> +
+ <% else %> + <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %> +- <%= l(:label_no_data) %> -
- <% else %> - <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %> -