diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb
index 3459ef7fa..93c941518 100644
--- a/app/helpers/welcome_helper.rb
+++ b/app/helpers/welcome_helper.rb
@@ -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']
diff --git a/app/models/journals_for_message_observer.rb b/app/models/journals_for_message_observer.rb
index 3bca47791..f0dce08c2 100644
--- a/app/models/journals_for_message_observer.rb
+++ b/app/models/journals_for_message_observer.rb
@@ -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
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index ed942f0d3..5f71ce456 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -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.
#
diff --git a/app/views/mailer/journals_for_message_add.html.erb b/app/views/mailer/journals_for_message_add.html.erb
new file mode 100644
index 000000000..cef20b5c4
--- /dev/null
+++ b/app/views/mailer/journals_for_message_add.html.erb
@@ -0,0 +1,3 @@
+
<%= link_to("hello", @url) %>
+<%=h @user %>
+<%= @message %>
diff --git a/app/views/mailer/journals_for_message_add.text.erb b/app/views/mailer/journals_for_message_add.text.erb
new file mode 100644
index 000000000..0ac80dfe1
--- /dev/null
+++ b/app/views/mailer/journals_for_message_add.text.erb
@@ -0,0 +1,3 @@
+<%= link_to("hello", @url) %>
+<%=h @user %>
+<%= @message %>
\ No newline at end of file
diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb
index 50feacb7a..d2ff856f2 100644
--- a/app/views/messages/show.html.erb
+++ b/app/views/messages/show.html.erb
@@ -171,17 +171,18 @@
<%= link_to_attachments message, :author => false %> -->
<% end %>
-
-<% end %>
-
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
-<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
+<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
<%= 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 %>
+
+<% end %>
+
+
<% end %>
diff --git a/app/views/news/index.html.erb b/app/views/news/index.html.erb
index 39fcfd7da..0e67766db 100644
--- a/app/views/news/index.html.erb
+++ b/app/views/news/index.html.erb
@@ -60,12 +60,12 @@
<% if @project.project_type == 1 %>
- <%= link_to_user(news.author)if news.respond_to?(:author) %><%= l(:label_project_notice)%><%= link_to h(news.title), news_path(news) %>
+ | <%= link_to_user(news.author)if news.respond_to?(:author) %><%= l(:label_project_notice)%><%= link_to h(news.title), news_path(news) %>
<%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> |
<% else %>
- <%= link_to_user(news.author)if news.respond_to?(:author) %><%= l(:label_project_newshare)%> <%= link_to h(news.title), news_path(news) %>
+ | <%= link_to_user(news.author)if news.respond_to?(:author) %><%= l(:label_project_newshare)%> <%= link_to h(news.title), news_path(news) %>
<%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> |
<% end %>
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb
index 5aa2cdb76..99cbed970 100644
--- a/app/views/welcome/index.html.erb
+++ b/app/views/welcome/index.html.erb
@@ -1,5 +1,5 @@
-
+
<%= l(:label_welcome_trustie) %> , <%= l(:label_welcome_trustie_description) %> |
@@ -205,10 +205,10 @@
<%= stylesheet_link_tag 'welcome' %>
-
+
-
论坛动态
+ 贴吧动态
+ <%= link_to "更多>>", forums_path %>
- <% find_new_forum_topics.each do |topic|%>
-
-
+ <% find_new_forum_topics(8).each do |topic|%>
+
-
-
+
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;"%>
- <%=time_tag_welcome(topic_last_time topic)%>前
-
- 由<%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);"%>发表
+ <%=time_tag_welcome(topic_last_time topic)%>前
+
+ 由 <%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);"%> 发表
回复(<%= link_to topic.replies_count, topic.event_url %>)
@@ -259,19 +260,19 @@
-
-
+
+
用户动态
<% find_all_activities.each do |event| %>
-
-
+
-
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
<%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;" %><%= show_user_content event %>
-
<%= time_tag_welcome event.event_datetime %>前 <%= show_event_reply event %>
+
<%= time_tag_welcome event.event_datetime %>前 <%= show_event_reply event %>
<% end %>
@@ -280,7 +281,8 @@
-
热门项目
+ 热门项目
+ <%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0} %>
<% find_all_hot_project.map do |project| break if(project == find_all_hot_project[15]) %>
@@ -290,7 +292,7 @@
- <%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :title => "#{project.name}")%>
+ <%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :title => "#{project.name}")%>
<%= content_tag "span", show_grade(project),
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300; ",
@@ -310,6 +312,7 @@
热门课程
+
<%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :project_sort_type => 1} %>
<% find_all_hot_course.map do |project| break if(project == find_all_hot_course[5]) %>
@@ -339,6 +342,7 @@
热门竞赛
+
<%= link_to "更多>>", {:controller => 'bids', :action => 'contest', :project_type => 1} %>
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
@@ -358,6 +362,7 @@
热门众包
+
<%= link_to "更多>>", {:controller => 'bids', :action => 'index'} %>
<% find_all_hot_bid.map do |bid| break if(bid == find_all_hot_bid[5]) %>
diff --git a/config/application.rb b/config/application.rb
index e434bd2a3..593eed64e 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -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
diff --git a/public/stylesheets/welcome.css b/public/stylesheets/welcome.css
index 85249e614..e4af4e71f 100644
--- a/public/stylesheets/welcome.css
+++ b/public/stylesheets/welcome.css
@@ -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;
-}