forked from jacknudt/trustieforge
Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop
This commit is contained in:
commit
3484632ce8
|
@ -108,7 +108,7 @@ module WelcomeHelper
|
|||
# or
|
||||
searchStudent(project).count
|
||||
end
|
||||
def find_new_forum_topics limit=9
|
||||
def find_new_forum_topics limit=7
|
||||
Memo.where('memos.parent_id IS NULL').reorder('memos.created_at DESC').limit(limit)
|
||||
# activity = Redmine::Activity::Fetcher.new(nil)
|
||||
# activity.scope=['memos']
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Added by young
|
||||
class JournalsForMessageObserver < ActiveRecord::Observer
|
||||
def after_create(journal_for_message)
|
||||
Mailer.journals_for_message_add(User.current, journal_for_message).deliver
|
||||
def after_create(journals_for_message)
|
||||
Mailer.journals_for_message_add(User.current, journals_for_message).deliver
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -29,12 +29,14 @@ class Mailer < ActionMailer::Base
|
|||
|
||||
# Builds a Mail::Message object used to email recipients of the added journals for message.
|
||||
#
|
||||
# def journals_for_message_add(user, journals_for_message)
|
||||
# @user = User.current
|
||||
# @url = url_for(:controller => 'users', :action => 'user_newfeedback')
|
||||
# mail :to => user.mail,
|
||||
# :subject => "hello"
|
||||
# end
|
||||
def journals_for_message_add(user, journals_for_message)
|
||||
@user = User.current
|
||||
@mail = journals_for_message.jour
|
||||
@message = journals_for_message.notes
|
||||
@url = url_for(:controller => 'users', :action => 'user_newfeedback', :id => @mail)
|
||||
mail :to => @mail.mail,
|
||||
:subject => "You have a new message"
|
||||
end
|
||||
|
||||
# Builds a Mail::Message object used to email recipients of the added issue.
|
||||
#
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<h1><%= link_to("hello", @url) %></h1>
|
||||
<em><%=h @user %></em>
|
||||
<div><%= @message %></div>
|
|
@ -0,0 +1,3 @@
|
|||
<%= link_to("hello", @url) %>
|
||||
<%=h @user %>
|
||||
<%= @message %>
|
|
@ -171,17 +171,18 @@
|
|||
<%= link_to_attachments message, :author => false %> -->
|
||||
|
||||
<% end %>
|
||||
<div class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></div>
|
||||
<% end %>
|
||||
|
||||
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
|
||||
<p><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></p>
|
||||
<p style="float: right;"><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></p>
|
||||
<div id="reply" style="display:none;">
|
||||
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
|
||||
<%= submit_tag l(:button_submit) %>
|
||||
<%= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %>
|
||||
<% end %>
|
||||
<div class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></div>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div id="preview" class="wiki"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -60,12 +60,12 @@
|
|||
<table width="580px" border="0">
|
||||
<% if @project.project_type == 1 %>
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong><%= link_to_user(news.author)if news.respond_to?(:author) %></strong><span class="font_lighter"><%= l(:label_project_notice)%></span><span><%= link_to h(news.title), news_path(news) %></span>
|
||||
<td colspan="2" valign="top"><strong><%= link_to_user(news.author)if news.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_notice)%></span><span><%= link_to h(news.title), news_path(news) %></span>
|
||||
<span style="float: right"><%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span></td>
|
||||
</tr>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong><%= link_to_user(news.author)if news.respond_to?(:author) %></strong><span class="font_lighter"><%= l(:label_project_newshare)%></span><span> <%= link_to h(news.title), news_path(news) %></span>
|
||||
<td colspan="2" valign="top"><strong><%= link_to_user(news.author)if news.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_newshare)%></span><span> <%= link_to h(news.title), news_path(news) %></span>
|
||||
<span style="float: right"> <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<!--add by huang-->
|
||||
<div style="height:220px;">
|
||||
<div style="height:200px;">
|
||||
<div class="welcome_left" style="margin-top: 60px">
|
||||
<table width="388px">
|
||||
<tr><td><span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %> </span><span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_description) %></span></td></tr>
|
||||
|
@ -205,10 +205,10 @@
|
|||
<%= stylesheet_link_tag 'welcome' %>
|
||||
<div class="body_resize">
|
||||
|
||||
<div class="left" style="float: left; height: 445px; width: 50%;">
|
||||
<div class="left" style="float: left; height: 445px; width: 50%; margin-left: 30px;">
|
||||
<ul class="welcome-message-list" style="width: 90%; ">
|
||||
<div class="forum-topic" style="height: 25px;">
|
||||
<h3 style="color: rgb(21, 188, 207);margin-left: 8px;"><strong>论坛动态</strong></h3>
|
||||
<h3 style="color: rgb(21, 188, 207);margin-left: 8px;"><strong>贴吧动态</strong></h3>
|
||||
<!-- <ul class="inner-content">
|
||||
<li>
|
||||
<a href="#" id="hot-topic">最热帖子</a>
|
||||
|
@ -220,6 +220,7 @@
|
|||
<a href="#">更多主题</a>
|
||||
</li>
|
||||
</ul> -->
|
||||
<span style="margin-top: -30px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span>
|
||||
</div>
|
||||
<!-- <div class="welcome-box-list">
|
||||
<% find_hot_forum_topics.each do |topic|%>
|
||||
|
@ -240,16 +241,16 @@
|
|||
</div> -->
|
||||
|
||||
<div class="welcome-box-list-new">
|
||||
<% find_new_forum_topics.each do |topic|%>
|
||||
<li class="message-brief-intro" style="min-height: 25px;">
|
||||
<% find_new_forum_topics(8).each do |topic|%>
|
||||
<li class="message-brief-intro" style="min-height: 25px;padding-bottom:3px;">
|
||||
<div style="display: inline-block; width: 100%;">
|
||||
<span style="color:gray; display: inline-block; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">
|
||||
<span style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">
|
||||
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;"%>
|
||||
</span>
|
||||
<br>
|
||||
<span style="margin-left: 20px; color: rgb(172, 174, 177); white-space: nowrap; font-size: 9pt !important;;"><!-- <%=l(:field_updated_on)%> --><%=time_tag_welcome(topic_last_time topic)%>前</span>
|
||||
<span style="margin-left: 5px; color: rgb(172, 174, 177) !important; white-space: nowrap;">
|
||||
由<%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);"%>发表
|
||||
<span style="margin-left: 24px; color: rgb(172, 174, 177); white-space: nowrap; font-size: 9pt !important;;"><!-- <%=l(:field_updated_on)%> --><%=time_tag_welcome(topic_last_time topic)%>前</span>
|
||||
<span style="margin-left: 8px; margin-bottom: 0px; color: rgb(172, 174, 177) !important; white-space: nowrap;">
|
||||
由 <%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);"%> 发表
|
||||
</span>
|
||||
<span style="float: right; color: rgb(172, 174, 177); white-space: nowrap; font-size: 9pt !important;;">回复(<%= link_to topic.replies_count, topic.event_url %>)</span>
|
||||
</div>
|
||||
|
@ -259,19 +260,19 @@
|
|||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="right" style="float: right; margin-right: -20px; height: 445px; width: 50%; ">
|
||||
<ul class="user-welcome-message-list" style="width: 80%; margin-top: 0px;">
|
||||
<div class="right" style="float: right; margin-right: 10px; height: 445px; width: 45%; ">
|
||||
<ul class="user-welcome-message-list" style="width: 94%; margin-top: 0px;">
|
||||
<h3 style="margin-left: -5px; color: rgb(21, 188, 207)"><strong>用户动态</strong></h3>
|
||||
<div class="user-message-box-list">
|
||||
<% find_all_activities.each do |event| %>
|
||||
<li style="display: block;height:60px;">
|
||||
<li style="display: block;height:60px; padding-bottom: 4px;">
|
||||
<div class="inner-right" style="float: left; height: 100%; ">
|
||||
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
|
||||
</div>
|
||||
<div class="inner-right" style="float: right; width:86%; height: 100%; ">
|
||||
<span style="color: green;"><%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;" %></span><!-- 发表了<%= find_all_event_type event %>:<span style="color: blue;"><%= link_to truncate(event.event_title, length: 30, omission:'...'), event.event_url %>
|
||||
</span> --><%= show_user_content event %>
|
||||
<p><span style="color: rgb(172, 174, 177)"><%= time_tag_welcome event.event_datetime %>前</span> <span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
|
||||
<p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= time_tag_welcome event.event_datetime %>前</span> <span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
|
@ -280,7 +281,8 @@
|
|||
</div>
|
||||
|
||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
|
||||
<h3 style="margin-left: 5px; color: #e8770d;"><strong>热门项目</strong></h2>
|
||||
<h3 style="margin-left: 5px; color: #e8770d;"><strong>热门项目</strong></h2>
|
||||
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0} %></span>
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_all_hot_project.map do |project| break if(project == find_all_hot_project[15]) %>
|
||||
|
@ -290,7 +292,7 @@
|
|||
</div>
|
||||
<div style="float: left; margin-left: 10px; width: 360px;">
|
||||
<p class="layout">
|
||||
<%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :title => "#{project.name}")%>
|
||||
<span style="display: inline-block; width: 250px;"><%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :title => "#{project.name}")%></span>
|
||||
<!-- <span style="cursor: help; display: inline-block; float: right; color: #ec6300; background: url('/images/score.png') no-repeat scroll ;background-position: left center;" title="项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度" class="tooltip-#{project.project_id}"><%= show_grade project %></span> -->
|
||||
<%= content_tag "span", show_grade(project),
|
||||
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300; ",
|
||||
|
@ -310,6 +312,7 @@
|
|||
|
||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
||||
<h3 style="margin-left: 5px; color: #e8770d;"><strong>热门课程</strong></h3>
|
||||
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :project_sort_type => 1} %></span>
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_all_hot_course.map do |project| break if(project == find_all_hot_course[5]) %>
|
||||
|
@ -339,6 +342,7 @@
|
|||
|
||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
||||
<h3 style="margin-left: 5px; color: color: (51, 119, 51);"><strong>热门竞赛</strong></h3>
|
||||
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", {:controller => 'bids', :action => 'contest', :project_type => 1} %></span>
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
|
||||
|
@ -358,6 +362,7 @@
|
|||
|
||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
||||
<h3 style="margin-left: 5px; color: color: (51, 119, 51);"><strong>热门众包</strong></h3>
|
||||
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", {:controller => 'bids', :action => 'index'} %></span>
|
||||
<div class="d-p-projectlist-box">
|
||||
<ul class="d-p-projectlist">
|
||||
<% find_all_hot_bid.map do |bid| break if(bid == find_all_hot_bid[5]) %>
|
||||
|
|
|
@ -23,7 +23,7 @@ module RedmineApp
|
|||
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
||||
|
||||
# Activate observers that should always be running.
|
||||
config.active_record.observers = :message_observer, :issue_observer, :journal_observer, :news_observer, :document_observer, :wiki_content_observer, :comment_observer
|
||||
config.active_record.observers = :journals_for_message_observer, :message_observer, :issue_observer, :journal_observer, :news_observer, :document_observer, :wiki_content_observer, :comment_observer
|
||||
|
||||
config.active_record.store_full_sti_class = true
|
||||
config.active_record.default_timezone = :local
|
||||
|
|
|
@ -129,7 +129,7 @@ ul.welcome-message-list{
|
|||
}
|
||||
.d-p-index-hotproject{
|
||||
width: 48%;
|
||||
margin-top: 30px;
|
||||
margin-top: 40px;
|
||||
float: left;
|
||||
}
|
||||
ul.d-p-index-hdright{
|
||||
|
@ -198,6 +198,7 @@ p.layout {
|
|||
|
||||
.right ul li {
|
||||
margin-bottom: 6px;
|
||||
border-bottom: 1px dashed rgb(229,229,229);
|
||||
}
|
||||
|
||||
.avatar-3 {
|
||||
|
@ -206,7 +207,7 @@ p.layout {
|
|||
margin-top: 5px;
|
||||
}
|
||||
.message-brief-intro a.gray{
|
||||
color: #07a;
|
||||
color: rgb(17, 102, 173);
|
||||
}
|
||||
|
||||
.message-brief-intro a.gray:visited{
|
||||
|
@ -302,9 +303,3 @@ div#tooltip::after {
|
|||
border-bottom: 1px solid #FFFFFF;
|
||||
border-right: 1px solid #FFFFFF;
|
||||
}
|
||||
{
|
||||
border-top: 1px solid #717171;
|
||||
border-left: 1px solid #717171;
|
||||
border-bottom: 1px solid #FFFFFF;
|
||||
border-right: 1px solid #FFFFFF;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue