diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 2efaf591a..09ae5ad79 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -150,11 +150,15 @@ class ProjectsController < ApplicationController end def new - @issue_custom_fields = IssueCustomField.sorted.all - @trackers = Tracker.sorted.all - @project = Project.new - @project.safe_attributes = params[:project] - render :layout => 'base' + if User.current.login? + @issue_custom_fields = IssueCustomField.sorted.all + @trackers = Tracker.sorted.all + @project = Project.new + @project.safe_attributes = params[:project] + render :layout => 'base' + else + redirect_to signin_url + end end def share @@ -167,6 +171,10 @@ class ProjectsController < ApplicationController end def create + unless User.current.login? + redirect_to signin_url + return + end @issue_custom_fields = IssueCustomField.sorted.all @trackers = Tracker.sorted.all @project = Project.new @@ -280,11 +288,11 @@ class ProjectsController < ApplicationController # 根据私密性,取出符合条件的所有数据 if User.current.member_of?(@project) || User.current.admin? - @events_pages = ForgeActivity.where("project_id = ?",@project).order("created_at desc").page(params['page'|| 1]).per(20); + @events_pages = ForgeActivity.where("project_id = ? and forge_act_type != ?",@project, "Document" ).order("created_at desc").page(params['page'|| 1]).per(20); #events = @activity.events(@date_from, @date_to) else @events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public - = ?",@project,1).order("created_at desc") + = ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc") .page(params['page'|| 1]).per(10); # @events = @activity.events(@date_from, @date_to, :is_public => 1) end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index f68ae7f34..5553990e6 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -475,7 +475,7 @@ module UsersHelper when "Issue" return '发表了问题' when "Journal" - return '回复了问题' + return '更新了问题' when "JournalsForMessage" return e.class.to_s == 'Course' ? '发表了留言' : '提交了反馈' #return ( activity.act.reply_id == nil || activity.act.reply_id == 0 ) ? '' : '' diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 5ae9df001..a25aff6bb 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -388,7 +388,8 @@ class Mailer < ActionMailer::Base @user = applied.user recipients = @project.manager_recipients s = l(:text_applied_project, :id => "##{@user.show_name}", :project => @project.name) - @applied_url = url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'members') + @token = Token.get_token_from_user(@user, 'autologin') + @applied_url = url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'members', :token => @token.value) mail :to => recipients, :subject => s end diff --git a/app/views/attachments/_project_file_links.html.erb b/app/views/attachments/_project_file_links.html.erb index b6d934c64..b644fb9fa 100644 --- a/app/views/attachments/_project_file_links.html.erb +++ b/app/views/attachments/_project_file_links.html.erb @@ -29,32 +29,32 @@ <% is_float ||= false %> <% for attachment in attachments %>
-

- <%if is_float%> -

- <% end%> - +

+ <%if is_float%> +

+ <% end%> + <% if options[:length] %> <%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true,:length => options[:length] -%> <% else %> - <%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true -%> + <% end %> - <%if is_float%> -
- <% end%> + <%if is_float%> +
+ <% end%> - <% if attachment.is_text? %> - <%= link_to image_tag('magnifier.png'), - :controller => 'attachments', - :action => 'show', - :id => attachment, - :filename => attachment.filename%> - <% end %> + <% if attachment.is_text? %> + <%= link_to image_tag('magnifier.png'), + :controller => 'attachments', + :action => 'show', + :id => attachment, + :filename => attachment.filename%> + <% end %>
- <%= h(" - #{attachment.description}") unless attachment.description.blank? %> -
+ <%= h(" - #{attachment.description}") unless attachment.description.blank? %> + ( <%= number_to_human_size attachment.filesize %>) @@ -66,6 +66,16 @@ :class => 'delete delete-homework-icon', :remote => true, :title => l(:button_delete) %> + <% elsif attachment.container_type == 'Issue' %> + <% if User.current == attachment.author %> + <%= link_to image_tag('delete.png'), attachment_path(attachment), + :data => {:confirm => l(:text_are_you_sure)}, + :method => :delete, + :class => 'delete', + #:remote => true, + #:id => "attachments_" + attachment.id.to_s, + :title => l(:button_delete) %> + <% end %> <% else %> <%= link_to image_tag('delete.png'), attachment_path(attachment), :data => {:confirm => l(:text_are_you_sure)}, @@ -89,13 +99,13 @@

<% end %>
- <% if defined?(thumbnails) && thumbnails %> - <% images = attachments.select(&:thumbnailable?) %> - <% if images.any? %> + <% if defined?(thumbnails) && thumbnails %> + <% images = attachments.select(&:thumbnailable?) %> + <% if images.any? %> <% images.each do |attachment| %>
<%= thumbnail_issue_tag(attachment) %>
<% end %> - <% end %> - <% end %> + <% end %> + <% end %>
diff --git a/app/views/layouts/_user_watch_list.html.erb b/app/views/layouts/_user_watch_list.html.erb index 00c0cdc40..7ccc8660d 100644 --- a/app/views/layouts/_user_watch_list.html.erb +++ b/app/views/layouts/_user_watch_list.html.erb @@ -1,5 +1,5 @@ <% watcher_count,watcher_list = get_watcher_users(user) %> -
+

关注

更多
diff --git a/app/views/layouts/base_users_new.html.erb b/app/views/layouts/base_users_new.html.erb index a0b4a442f..1f8e10bc9 100644 --- a/app/views/layouts/base_users_new.html.erb +++ b/app/views/layouts/base_users_new.html.erb @@ -70,7 +70,7 @@ <% end %>
-
+
  • 最近登录 :
  • <% if @user.user_extensions!=nil && @user.user_extensions.identity == 2 %> @@ -133,19 +133,19 @@ 动态
- <% if @center_flag %> + <% if @center_flag %> + + 我的课程 + (<%=@user.courses.count%>) + +
+ + 我的项目 + (<%=@user.projects.count%>) + +
@@ -166,12 +166,12 @@ -
+
-
+