Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
eb6deed682
|
@ -249,7 +249,7 @@ class ProjectsController < ApplicationController
|
|||
# Author lizanle
|
||||
# Description 项目动态展示方法,删除了不必要的代码
|
||||
def show
|
||||
=begin
|
||||
|
||||
# 试图跳转到请求的按钮
|
||||
if params[:login]
|
||||
login = params[:login]
|
||||
|
@ -265,7 +265,7 @@ class ProjectsController < ApplicationController
|
|||
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
|
||||
return
|
||||
end
|
||||
|
||||
=begin
|
||||
cond = @project.project_condition(Setting.display_subprojects_issues?)
|
||||
has = {
|
||||
"show_issues" => true ,
|
||||
|
|
|
@ -442,16 +442,24 @@ class UsersController < ApplicationController
|
|||
watcher.push(User.current)
|
||||
activity = Activity.where(where_condition).where('user_id in (?)', watcher).order('id desc')
|
||||
else
|
||||
activity = Activity.where(where_condition).where('user_id = ?', @user.id).order('id desc')
|
||||
activity = Activity.where(where_condition).where('user_id = ?', @user.id).order('id desc')
|
||||
end
|
||||
activity = activity.reject { |e|
|
||||
!User.current.admin? &&
|
||||
(((e.act_type == "Issue") && !e.act.project.visible?(User.current)) ||
|
||||
(e.act_type == "Bid" && e.act.courses.first.is_public == 0 && !User.current.member_of_course?(e.act.courses.first)) ||
|
||||
(e.act_type == "Journal" && e.act.respond_to?("Project") && !e.act.project.visible?(User.current)) ||
|
||||
(e.act_type == "News" && ((!e.act.project.nil? && !e.act.project.visible?(User.current)) || (!e.act.course.nil? && e.act.course.is_public == 0 && !User.current.member_of_course?(e.act.course)))) ||
|
||||
(e.act_type == "Message" && !e.act.board.nil? && ((!e.act.board.project.nil? && !e.act.board.project.visible?(User.current)) || (!e.act.board.course.nil? && e.act.board.course.is_public == 0 && !User.current.member_of_course?(e.act.board.course)))))
|
||||
}
|
||||
@activity_count = activity.count
|
||||
@activity_pages = Paginator.new @activity_count, pre_count, params['page']
|
||||
@activity = activity.slice(@activity_pages.offset,@activity_pages.per_page )
|
||||
@activity = @activity.reject { |e|
|
||||
((e.act_type=="Issue") && ( !e.act.visible?(User.current))) ||
|
||||
((e.act_type == "Journal") && (!e.act.project.visible?(User.current))) ||
|
||||
((e.act_type == "Bid") && ((!User.current.member_of_course?(e.act.courses.first) || !User.current.admin?)))
|
||||
}
|
||||
@activity = activity.slice(@activity_pages.offset,@activity_pages.per_page)
|
||||
# @activity = @activity.reject { |e|
|
||||
# ((e.act_type=="Issue") && ( !e.act.visible?(User.current))) ||
|
||||
# ((e.act_type == "Journal") && (!e.act.project.visible?(User.current))) ||
|
||||
# ((e.act_type == "Bid") && ((!User.current.member_of_course?(e.act.courses.first) || !User.current.admin?)))
|
||||
# }
|
||||
@state = 0
|
||||
end
|
||||
|
||||
|
|
|
@ -31,10 +31,11 @@ class Mailer < ActionMailer::Base
|
|||
# 发送邀请未注册用户加入项目邮件
|
||||
# 功能: 在加入项目的同时自动注册用户
|
||||
def send_invite_in_project(email, project, invitor)
|
||||
@email = email
|
||||
@subject = "#{invitor.name} #{l(:label_invite_project)} #{project.name} "
|
||||
password = newpass(6)
|
||||
@password = newpass(6)
|
||||
@project_url = url_for(:controller => 'projects', :action => 'show', :id => project.id,
|
||||
:password => password, :login => email)
|
||||
:password => @password, :login => email)
|
||||
mail :to => email, :subject => @subject
|
||||
end
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<%= link_to @topic_count,:controller => 'boards',:action => 'index' %>
|
||||
个贴子
|
||||
</span>
|
||||
<% if @project.enabled_modules.where("name = 'boards'").count > 0 %>
|
||||
<% if @project.enabled_modules.where("name = 'boards'").count > 0 && User.current.member_of?(@project) %>
|
||||
<span>
|
||||
<%= link_to l(:label_message_new),
|
||||
new_board_message_path(@board),
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
<span style="float: left; width: 526px">
|
||||
<p><%= @subject %> </p>
|
||||
<p> <%= link_to @project_url, @project_url%></p>
|
||||
<p>点击链接后,将自动为您注册账号</p>
|
||||
<p>您的账号为:<%= @email %></p>
|
||||
<p>密码为: <%= @password %></p>
|
||||
|
||||
</span>
|
||||
</li>
|
||||
|
||||
|
|
|
@ -70,11 +70,11 @@
|
|||
<span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;">
|
||||
<%= label_tips %>
|
||||
</span>
|
||||
<% if @project.enabled_modules.where("name = 'news'").count > 0 %>
|
||||
<%= link_to(btn_tips,
|
||||
new_project_news_path(@project),
|
||||
:class => 'icon icon-add',
|
||||
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
|
||||
<% if @project.enabled_modules.where("name = 'news'").count > 0 && User.current.member_of?(@project) %>
|
||||
<%= link_to(btn_tips,
|
||||
new_project_news_path(@project),
|
||||
:class => 'icon icon-add',
|
||||
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
|
||||
<% end %>
|
||||
<% if @project && User.current.allowed_to?(:manage_news, @project) %>
|
||||
<div id="add-news" class="add_frame" style="display:none;">
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
<div class="scroll">
|
||||
<% unless @events_pages.empty? %>
|
||||
<% @events_pages.each do |e| -%>
|
||||
<% act = e.forge_act %>
|
||||
<% act = e.forge_act;
|
||||
next if act.nil? %>
|
||||
<% if e.forge_act_type == "Issue" %>
|
||||
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;margin-top: 10px;">
|
||||
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
Kaminari.configure do |config|
|
||||
# config.default_per_page = 25
|
||||
# config.max_per_page = nil
|
||||
# config.window = 4
|
||||
config.window = 2
|
||||
# config.outer_window = 3
|
||||
# config.left = 0
|
||||
# config.right = 0
|
||||
# config.left = 2
|
||||
# config.right = 2
|
||||
# config.page_method_name = :page
|
||||
# config.param_name = :page
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue