diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index 85f57917b..d182640ed 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -239,6 +239,13 @@ class OrganizationsController < ApplicationController
end
end
+ def logout
+ logout_user
+ respond_to do |format|
+ format.html {redirect_to organization_path(params[:id])}
+ end
+ end
+
def search_projects
@organization = Organization.find(params[:id])
condition = '%%'
diff --git a/app/models/forge_activity.rb b/app/models/forge_activity.rb
index 115575289..c98c5475b 100644
--- a/app/models/forge_activity.rb
+++ b/app/models/forge_activity.rb
@@ -46,20 +46,24 @@ class ForgeActivity < ActiveRecord::Base
end
def add_org_activity
- if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil?
- org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{self.forge_act.parent.id}").first
- if org_activity
+ org_activity = OrgActivity.where("org_act_type = '#{self.forge_act_type.to_s}' and org_act_id = #{self.forge_act_id}").first
+ if org_activity
+ org_activity.created_at = self.created_at
+ org_activity.save
+ else
+ if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil?
+ org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{self.forge_act.parent.id}").first
org_activity.created_at = self.created_at
org_activity.save
+ else
+ OrgActivity.create(:user_id => self.user_id,
+ :org_act_id => self.forge_act_id,
+ :org_act_type => self.forge_act_type,
+ :container_id => self.project_id,
+ :container_type => 'Project',
+ :created_at => self.created_at,
+ :updated_at => self.updated_at)
end
- else
- OrgActivity.create(:user_id => self.user_id,
- :org_act_id => self.forge_act_id,
- :org_act_type => self.forge_act_type,
- :container_id => self.project_id,
- :container_type => 'Project',
- :created_at => self.created_at,
- :updated_at => self.updated_at)
end
end
diff --git a/app/models/message.rb b/app/models/message.rb
index 92ec0235e..d8f62171a 100644
--- a/app/models/message.rb
+++ b/app/models/message.rb
@@ -186,7 +186,7 @@ class Message < ActiveRecord::Base
# Description
def act_as_forge_activity
# 如果project为空,那么就是课程相关的消息
- if !self.board.project.nil?
+ if !self.board.project.nil? && self.parent_id.nil?
self.forge_acts << ForgeActivity.new(:user_id => self.author_id,
:project_id => self.board.project.id)
end
diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb
index 5af5c9ad0..4c33dcca5 100644
--- a/app/views/layouts/base_org.html.erb
+++ b/app/views/layouts/base_org.html.erb
@@ -46,12 +46,13 @@
-
+
<% else %>
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb
index 1d68c9fa0..9e9bd688f 100644
--- a/app/views/layouts/base_projects.html.erb
+++ b/app/views/layouts/base_projects.html.erb
@@ -12,7 +12,7 @@
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
- <%= stylesheet_link_tag 'public', 'pleft', 'project','courses','prettify','jquery/jquery-ui-1.9.2','header','repository' %>
+ <%= stylesheet_link_tag 'public', 'pleft', 'project','prettify','jquery/jquery-ui-1.9.2','header','repository' %>
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','attachments' %>
<%= call_hook :view_layouts_base_html_head %>
diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb
index a0f6dc60f..6ba60245a 100644
--- a/app/views/organizations/_subfield_list.html.erb
+++ b/app/views/organizations/_subfield_list.html.erb
@@ -4,11 +4,6 @@
状态
-
- 动态
- 默认
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb
index be303a2ab..259e8c185 100644
--- a/app/views/repositories/show.html.erb
+++ b/app/views/repositories/show.html.erb
@@ -28,10 +28,9 @@
<% unless User.current.id == @project.user_id %>
<%= link_to "".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn"%>
+ <%= @project.forked_count.to_i %>
+
<% end %>
- <%#= link_to "My span #{@user.profile.my_data}".html_safe, "#", class: 'button white' %>
-
- <%= @project.forked_count.to_i %>
<% if @changesets && !@changesets.empty? %>
@@ -53,12 +52,14 @@
- <%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %> 提交
-
+ <%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project,
+ :repository_id => @repository.identifier_param,
+ :rev => @rev,:page=>1 ,
+ :commit_count =>"#{@changesets_all_count}"} %> 提交
<% end %>
-
+
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
@@ -67,14 +68,14 @@
<%# end %>
<%= render :partial => 'dir_list' %>
<% end %>
-<%= render_properties(@properties) %>
+<%#= render_properties(@properties) %>
-<%= render_properties(@properties) %>
+<%#= render_properties(@properties) %>
如何提交代码
-
+
<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
<% end %>
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb
index 4e8553ee8..309b8b95a 100644
--- a/app/views/users/_course_homework.html.erb
+++ b/app/views/users/_course_homework.html.erb
@@ -142,7 +142,7 @@
});
<% replies_all_i = replies_all_i + 1 %>
- -
+
-
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
@@ -154,10 +154,12 @@
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
- <% if User.current.admin? ||is_teacher || comment.user == User.current%>
- <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity},
- :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "replyGrey fr ml10", :title => l(:button_delete)) %>
- <% end %>
+
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb
index 23f65e03e..5bf406c59 100644
--- a/app/views/users/_user_homework_detail.html.erb
+++ b/app/views/users/_user_homework_detail.html.erb
@@ -149,7 +149,7 @@
});
<% replies_all_i = replies_all_i + 1 %>
- -
+
-
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
@@ -161,10 +161,12 @@
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
- <% if User.current.admin? ||is_teacher || comment.user == User.current%>
- <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course,:course_activity=>-1},
- :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "replyGrey fr ml10", :title => l(:button_delete)) %>
- <% end %>
+
diff --git a/config/routes.rb b/config/routes.rb
index 4e64ca505..15e41955d 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -46,6 +46,7 @@ RedmineApp::Application.routes.draw do
get 'search_projects'
post 'join_project_menu'
post 'join_projects'
+ post 'logout'
end
collection do
get 'check_uniq'
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css
index 3dedf1396..32ee5a7c6 100644
--- a/public/stylesheets/project.css
+++ b/public/stylesheets/project.css
@@ -907,3 +907,160 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}
border: 1px solid #e4e4e4;
}
+/*项目动态新样式*/
+.homepageRight {
+ width: 750px;
+ float: left;
+ margin-top: 15px;
+ margin-bottom: 10px;
+}
+.homepageRightBanner {
+ width: 718px;
+ margin: 0px auto;
+ float: right;
+ background-color: #FFF;
+ padding: 10px 15px;
+ border: 1px solid #DDD;
+}
+.resources {
+ width: 718px;
+ background-color: #FFF;
+ padding: 15px;
+ border: 1px solid #DDD;
+ float: right;
+}
+.homepagePostBrief {
+ width: 720px;
+ margin: 0px auto;
+ position: relative;
+}
+.homepagePostPortrait {
+ float: left;
+ width: 50px;
+}
+.homepagePostDes {
+ float: left;
+ width: 655px;
+ margin-left: 15px;
+}
+.homepagePostTo {
+ font-size: 14px;
+ color: #484848;
+ margin-bottom: 5px;
+}
+.m_w600 {
+ max-width: 600px;
+}
+.hidden {
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+.homepagePostTitle {
+ font-size: 14px;
+ color: #484848;
+ margin-bottom: 5px;
+ font-weight: bold;
+}
+.maxh360 {
+ max-height: 360px;
+}
+.lh18 {
+ line-height: 18px;
+}
+.homepagePostIntro {
+ font-size: 14px;
+ color: #484848;
+ overflow: hidden;
+}
+.homepagePostReply {
+ width: 710px;
+ margin: 10px auto 0px;
+ background-color: #F1F1F1;
+}
+.topBorder {
+ border-top: 1px solid #E4E4E4;
+}
+.homepagePostReplyBanner {
+ width: 708px;
+ height: 33px;
+ border: 1px solid #E4E4E4;
+ line-height: 33px;
+ vertical-align: middle;
+ font-size: 12px;
+ color: #888;
+}
+.homepagePostReplyBannerCount {
+ width: 255px;
+ display: inline-block;
+ margin-left: 15px;
+}
+.homepagePostReplyBannerTime {
+ width: 85px;
+ display: inline-block;
+}
+.homepagePostReplyContainer {
+ border-bottom: 1px solid #E3E3E3;
+ width: 680px;
+ margin: 15px auto 0px;
+ min-height: 60px;
+}
+.borderBottomNone {
+ border-bottom: medium none !important;
+}
+.homepagePostReplyPortrait {
+ float: left;
+ width: 33px;
+}
+.homepagePostReplyInputContainer {
+ width: 630px;
+ float: left;
+}
+.homepagePostType {
+ width: 90px;
+ background-color: #FFF;
+ float: left;
+ list-style: outside none none;
+ position: absolute;
+ border: 1px solid #EAEAEA;
+ border-radius: 5px;
+ top: 15px;
+ padding: 5px 10px;
+ left: -80px;
+ font-size: 12px;
+ color: #4B4B4B;
+ line-height: 2;
+ z-index: 9999;
+ display: none;
+}
+.homepagePostTypeHomework {
+ width: 90px;
+}
+a.homepagePostTypeAll {
+ background: transparent url("../images/homepage_icon.png") no-repeat scroll -189px -308px;
+ padding-left: 23px;
+}
+a.homepagePostTypeAssignment {
+ background: transparent url("../images/homepage_icon.png") no-repeat scroll -93px -318px;
+ padding-left: 23px;
+}
+a.homepagePostTypeNotice {
+ background: transparent url("../images/homepage_icon.png") no-repeat scroll -87px -280px;
+ padding-left: 23px;
+}
+a.homepagePostTypeResource {
+ background: transparent url("images/homepage_icon.png") no-repeat scroll -86px -517px;
+ padding-left: 23px;
+}
+a.homepagePostTypeForum {
+ background: transparent url("../images/homepage_icon.png") no-repeat scroll -10px -310px;
+ padding-left: 23px;
+}
+a.homepagePostTypeMessage {
+ background: transparent url("images/homepage_icon.png") no-repeat scroll -3px -518px;
+ padding-left: 23px;
+}
+a.homepagePostTypeQuiz {
+ background: transparent url("../images/homepage_icon.png") no-repeat scroll -90px -124px;
+ padding-left: 23px;
+ }
\ No newline at end of file