邮件text页面并不调整

This commit is contained in:
huang 2015-06-16 11:45:30 +08:00
parent c8884c6fd4
commit f3f0a9847f
2 changed files with 183 additions and 295 deletions

View File

@ -2,7 +2,7 @@
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" > <h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
<%= @subject %> <%= @subject %>
</h4> </h4>
<% if @attachments.first || @course_news.first || @bids.first || <% if @attachments.first || @course_news.first || @course_news_comments.first || @bids.first ||
@course_journal_messages.first|| @course_messages.first || @attachments.first %> @course_journal_messages.first|| @course_messages.first || @attachments.first %>
<div class="wmail_main" style="padding:20px 10px 0px;"> <div class="wmail_main" style="padding:20px 10px 0px;">
<h3 class="wmail_h2" style="color:#15bccf; "><%= l(:label_course_overview)%></h3> <h3 class="wmail_h2" style="color:#15bccf; "><%= l(:label_course_overview)%></h3>
@ -65,7 +65,7 @@
</li> </li>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</ul><!--课程通知 end--> </ul><!--课程通知回复 end-->
<% end %> <% end %>
<!--课程作业--> <!--课程作业-->
@ -194,7 +194,8 @@
<% end %> <% end %>
<!--项目相关--> <!--项目相关-->
<% if @issues.first || @project_messages.first || @wiki_contents.first || @project_news.first || @project_journal_messages.first || @project_news_comments.first %> <% if @issues.first || @project_messages.first || @issues_journals.first || @wiki_contents.first || @project_news.first || @project_news_comments.first || @project_journal_messages.first ||
@project_news_comments.first %>
<div class="wmail_main" style="padding:20px 10px 0px;"> <div class="wmail_main" style="padding:20px 10px 0px;">
<h3 class="wmail_h2" style="color:#15BCCF; "><%= l(:label_project_overview_new)%></h3> <h3 class="wmail_h2" style="color:#15BCCF; "><%= l(:label_project_overview_new)%></h3>
<% unless @issues.first.nil? %> <% unless @issues.first.nil? %>

View File

@ -1,344 +1,231 @@
<%= @subject %> <%= @subject %>
<% if @attachments.first || @course_news.first || @bids.first || <% if @attachments.first || @course_news.first || @course_news_comments.first || @bids.first ||
@course_journal_messages.first|| @course_messages.first %> @course_journal_messages.first|| @course_messages.first || @attachments.first %>
<%= l(:label_course_overview)%> <%= l(:label_course_overview)%>
<% unless @course_news.first.nil? %> <% unless @course_news.first.nil? %>
<%= l(:label_course_news) %> <%= l(:label_course_news) %>
<% @course_news.each do |course_new|%> <% @course_news.each do |course_new|%>
▪[<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value)%> ]
[
<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value)%>
]
<%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value)
%>
<%= l(:label_project_notice) %>
<%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value)
%> <%= format_time(course_new.created_on) %>
<%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value) %>
<%= l(:label_project_notice) %>
<%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value) %>
<%= format_time(course_new.created_on) %>
<% end %> <% end %>
<% end %>
<% end %> <% unless @course_news_comments.first.nil? %>
<% unless @bids.empty? %> <%= l(:label_course_news) %>
<%= l(:label_homework_overview) %> <% @course_news_comments.each do |course_news_comment|%>
▪[ <% unless course_news_comment.commented.nil? %>
<%= link_to truncate(course_news_comment.commented.course.name,length: 30,omission: '...'), course_url(course_news_comment.commented.course, :token => @token.value) %>
<% end %>
]
<%= link_to course_news_comment.author, user_activities_url(course_news_comment.author,:token => @token.value) %>
<%= l(:label_project_notice) %>
<%= link_to truncate(course_news_comment.comments,length: 30,omission: '...'), news_url(course_news_comment.commented,:token => @token.value) %>
<%= format_time(course_news_comment.created_on) %>
<% end %>
<% end %>
<% unless @bids.empty? %>
<%= l(:label_homework_overview) %>
<% unless @bids.first.nil?%> <% unless @bids.first.nil?%>
<% @bids.each do |bid| %> <% @bids.each do |bid| %>
▪[<%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course, :token => @token.value) %>]
[ <%= link_to bid.user, user_activities_url(bid.user,:token => @token.value) %>
<%= l(:label_course_homework) %>
<%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course, :token => @token.value) <%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value) %>
<%= format_time(bid.created_at) %>
%>
]
<%= link_to bid.user, user_activities_url(bid.user,:token => @token.value)
%>
<%= l(:label_course_homework) %>
<%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value)
%>
<%= format_time(bid.created_at) %>
<% end %> <% end %>
<% end %> <% end %>
<!--作业动态 end-->
<% end %>
<% unless @course_journal_messages.first.nil? %>
<!--作业动态 end--> <%= l(:view_course_journals_for_messages) %>
<% end %>
<% unless @course_journal_messages.first.nil? %>
<%= l(:view_course_journals_for_messages) %>
<% @course_journal_messages.each do |course_journal_message|%> <% @course_journal_messages.each do |course_journal_message|%>
[ <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value) %>]
[ <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value) %>
<%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value)
%>
]
<%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value)
%>
<%= l(:label_send_course_journals_for_messages) %> <%= l(:label_send_course_journals_for_messages) %>
<%= link_to truncate(course_journal_message.notes,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value) %>
<%= link_to truncate(course_journal_message.notes,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value) <%= format_time(course_journal_message.created_on) %>
%>
<%= format_time(course_journal_message.created_on) %>
<% end %> <% end %>
<% end %>
<% unless @course_messages.first.nil? %>
<% end %> <%= l(:view_borad_course) %>
<% unless @course_messages.first.nil? %>
<%= l(:view_borad_course) %>
<% @course_messages.each do |course_message|%> <% @course_messages.each do |course_message|%>
▪[<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course, :token => @token.value)%>]
<%= link_to course_message.author, user_activities_url(course_message.author,:token => @token.value) %>
[ <%= l(:label_send_course_messages) %>
<%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value) %>
<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course, :token => @token.value) <%= format_time(course_message.created_on) %>
%>
]
<%= link_to course_message.author, user_activities_url(course_message.author,:token => @token.value)
%>
<%= l(:label_send_course_messages) %>
<%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value)
%>
<%= format_time(course_message.created_on) %>
<% end %> <% end %>
<% end %>
<% unless @attachments.first.nil? %>
<% end %> <%= l(:label_course_attendingcontestwork_download) %>
<% unless @attachments.first.nil? %>
<%= l(:label_course_attendingcontestwork_download) %>
<% @attachments.each do |attachment|%> <% @attachments.each do |attachment|%>
▪[ ▪[<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value) %>]
<%= link_to attachment.author, user_activities_url(attachment.author,:token => @token.value) %>
<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value) <%= l(:label_course_file_upload) %>
<%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value) %>
%> <%= format_time(attachment.created_on) %>
]
<%= link_to attachment.author, user_activities_url(attachment.author,:token => @token.value)
%>
<%= l(:label_course_file_upload) %>
<%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value)
%>
<%= format_time(attachment.created_on) %>
</li>
<% end %> <% end %>
<!--课件下载 end-->
</ul><!--课件下载 end--> <% end %>
<% end %>
<% end %><!--课程动态 end--> <% end %><!--课程动态 end-->
<% @issues.first || @project_messages.first || @wiki_contents.first || @project_news.first || @project_journal_messages.first %> <!-- 项目动态 -->
<%= l(:label_project_overview_new)%> <!--项目相关-->
<% unless @issues.first.nil? %> <% if @issues.first || @project_messages.first || @issues_journals.first || @wiki_contents.first || @project_news.first || @project_news_comments.first || @project_journal_messages.first ||
@project_news_comments.first %>
<%= l(:label_issue_tracking) %> <%= l(:label_project_overview_new)%>
<% unless @issues.first.nil? %>
<%= l(:label_issue_tracking) %>
<% @issues.each do |issue|%> <% @issues.each do |issue|%>
▪[<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value) %>]
[ <%= link_to issue.author, user_activities_url(issue.author,:token => @token.value) %>
<%= l(:label_project_issue) %>
<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value) <%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value) %>
<%= format_time(issue.created_on) %>
%>
]
<%= link_to issue.author, user_activities_url(issue.author,:token => @token.value)
%>
<%= l(:label_project_issue) %>
<%= link_to truncate(issue. subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value)
%>
<%= format_time(issue.created_on) %>
<% end %> <% end %>
<!--问题跟踪 end-->
<% end %>
<!-- issues回复 -->
<% unless @issues_journals.first.nil? %>
<%= l(:label_issue_tracking) %>
<% @issues_journals.each do |issues_journal| %>
▪[<%= link_to truncate(issues_journal.issue.project.name,length: 30,omission: '...'), project_url(issues_journal.issue.project, :token => @token.value) %>]
<%= link_to issues_journal.user, user_activities_url(issues_journal.user,:token => @token.value) %>
<%= l(:label_project_issue) %>
<% if issues_journal.notes.nil? %>
<%= link_to truncate(issues_journal.issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value) %>
<% else %>
<%= link_to truncate(issues_journal.notes,length: 30,omission: '...'),issue_url(issues_journal.issue, :token => @token.value) %>
<% end %>
<%= format_time(issues_journal.created_on) %>
<% end %>
<% end %>
<% end %> <!-- 讨论区 -->
<% unless @project_messages.first.nil? %>
<% unless @project_messages.first.nil? %> <%= l(:project_moule_boards_show) %>
<%= l(:project_moule_boards_show) %>
<% @project_messages.each do |project_message|%> <% @project_messages.each do |project_message|%>
▪[ ▪[<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value) %>]
<%= link_to project_message.author, user_activities_url(project_message.author,:token => @token.value) %>
<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value) <%= l(:label_send_course_messages) %>
<%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value) %>
%> <%= format_time(project_message.created_on) %>
]
<%= link_to project_message.author, board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value)
%>
<%= l(:label_send_course_messages) %>
<%= link_to truncate(project_message. subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value)
%>
<%= format_time(project_message.created_on) %>
<% end %> <% end %>
<!--项目论坛 end-->
<% end %>
<!--项目wiki-->
<% unless @wiki_contents.first.nil? %> <% unless @wiki_contents.first.nil? %>
<%= l(:label_wiki) %>
<%= l(:label_wiki) %> <% @wiki_contents.each do |wikicontent|%>
▪[<% unless wikicontent.page.nil? %>
<% @wiki_contents.each do |wikicontent|%> <%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project, :token => @token.value) %>
▪[ <% end %>
<% unless wikicontent.page.nil? %> ]
<%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project, :token => @token.value) <%= link_to wikicontent.author, user_activities_url(wikicontent.author,:token => @token.value) %>
%> <%= l(:label_wiki_mail_notification) %>
<% end %> <% unless wikicontent.page.nil? %>
] <%= link_to truncate(wikicontent.text.html_safe, length: 30,omission: '...'), project_wiki_url(wikicontent.page.wiki,:token => @token.value) %>
<%= link_to wikicontent.author, user_activities_url(wikicontent.author,:token => @token.value) %> <% end %>
<%= l(:label_project_notice) %> <%= format_time(wikicontent.updated_on) %>
<% unless wikicontent.page.nil? %> <% end %>
<%= link_to truncate(wikicontent.text.html_safe, length: 30,omission: '...'), project_wiki_url(wikicontent.page.wiki,:token => @token.value) %>
<% end %>
<%= format_time(wikicontent.updated_on) %>
<% end %>
<% end %> <% end %>
<!--项目新闻--> <!--项目新闻-->
<% unless @project_news.first.nil? %> <% unless @project_news.first.nil? %>
<%= l(:label_project_news) %>
<% @project_news.each do |project_new|%>
▪[<%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value) %> ]
<%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value) %>
<%= l(:label_project_mail_notice) %>
<%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new,:token => @token.value) %>
<%= format_time(project_new.created_on) %>
<% end %>
<% end %>
<%= l(:label_project_news) %> <!-- 项目新闻回复 -->
<% unless @project_news_comments.first.nil? %>
<% @project_news.each do |project_new|%> <%= l(:label_project_news) %>
▪[ <% @project_news_comments.each do |project_news_comment|%>
▪[ <% unless project_news_comment.commented.nil? %>
<%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value) <%= link_to truncate(project_news_comment.commented.project.name,length: 30,omission: '...'), project_url(project_news_comment.commented.project, :token => @token.value) %>
%> <% end %>]
] <%= link_to project_news_comment.author, user_activities_url(project_news_comment.author,:token => @token.value) %>
<%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value) <%= l(:label_project_mail_notice) %>
%> <%= link_to truncate(project_news_comment.comments.html_safe,length: 30,omission: '...'), news_url(project_news_comment.commented,:token => @token.value) %>
<%= l(:label_project_notice) %> <%= format_time(project_news_comment.created_on) %>
<% end %>
<%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new,:token => @token.value) <!-- 项目新闻回复end -->
%>
<%= format_time(project_new.created_on) %>
<% end %>
<% end %> <% end %>
<!--项目留言--> <!--项目留言-->
<% unless @project_journal_messages.first.nil? %> <% unless @project_journal_messages.first.nil? %>
<%= l(:label_project_mail_feedback) %> <%= l(:label_project_mail_feedback) %>
<% @project_journal_messages.each do |project_journal_message|%>
<% @project_journal_messages.each do |project_journal_message|%> ▪[<%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project, :token => @token.value) %> ]
▪[ <%= link_to project_journal_message.user, user_activities_url(project_journal_message.user,:token => @token.value) %>
<%= l(:label_send_course_journals_for_messages) %>
<%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project, :token => @token.value) <%= link_to truncate(project_journal_message.notes.html_safe,length: 30,omission: '...'), project_feedback_url(project_journal_message.project,:token => @token.value) %>
%> <%= format_time(project_journal_message.created_on) %>
] <% end %>
<!--项目留言 end-->
<%= link_to project_journal_message.user, user_activities_url(project_journal_message.user,:token => @token.value) %>
<%= l(:label_send_course_journals_for_messages) %>
<%= link_to truncate(project_journal_message.notes.html_safe,length: 30,omission: '...'), project_feedback_url(project_journal_message.project,:token => @token.value)
%>
<%= format_time(project_journal_message.created_on) %>
<% end %>
<% end %> <% end %>
</div>
<% end %><!-- 项目动态end -->
<% end %>
<% unless @user_journal_messages.first.nil? %> <% unless @user_journal_messages.first.nil? %>
<%= l(:label_activities) %> <%= l(:label_activities) %>
<%= l(:label_user_message) %>
(<%= @user_journal_messages.count %>)
<%= l(:label_user_message) %> <% @user_journal_messages.each do |user_journal_message|%>
(<%= @user_journal_messages.count %>) ▪ <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value)%>
<%= l(:label_show_your_message) %>
<% @user_journal_messages.each do |user_journal_message|%> <%= link_to truncate(user_journal_message.notes,length: 30,omission: '...'), feedback_url(@user,:token => @token.value) %>
<%= format_time(user_journal_message.created_on) %>
<% end %>
<%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value)
%>
<%= l(:label_show_your_message) %>
<%= link_to truncate(user_journal_message.notes,length: 30,omission: '...'), feedback_url(@user,:token => @token.value)
%>
<%= format_time(user_journal_message.created_on) %>
<% end %>
<% end %> <% end %>
<% if @forums.first || @memos.first %> <% if @forums.first || @memos.first %>
<%= l(:lable_bar_active) %> <%= l(:lable_bar_active) %>
<% unless @forums.first.nil? %> <% unless @forums.first.nil? %>
<%= l(:label_user_forum) %>
<%= l(:label_user_forum) %> <% @forums.each do |forum|%>
▪<%= link_to forum.creator, user_activities_url(forum.creator,:token => @token.value) %>
<%= l(:label_forum_new) %>
<% @forums.each do |forum|%> <%= link_to truncate(forum.name,length: 30,omission: '...'),forum_url(forum,:token => @token.value) %>
<%= format_time(forum.created_at) %>
<% end %>
<%= link_to forum.creator, user_activities_url(forum.creator,:token => @token.value) %> <!-- 新建贴吧 end-->
<%= l(:label_forum_new) %> <% end %>
<% unless @memos.first.nil? %>
<%= link_to truncate(forum.name,length: 30,omission: '...'),forum_url(forum,:token => @token.value) <%= l(:label_user_message_forum) %>
%> <% @memos.each do |memo|%>
<%= format_time(forum.created_at) %> ▪<%= link_to memo.author, user_activities_url(memo.author,:token => @token.value)%>
<%= memo.parent_id.nil? ? l(:label_memo_new_from_forum) : l(:label_reply) %>
<% end %> <%= link_to truncate(memo.subject,length: 30,omission: '...'),forum_memo_url(memo.forum, (memo.parent_id.nil? ? memo : memo.parent_id))%>
<%= format_time(memo.created_at) %>
<!-- 新建贴吧 end--> <% end %>
<% end %> <!-- 新建贴吧 end-->
<% unless @memos.first.nil? %> <% end %>
<%= l(:label_user_message_forum) %>
<% @memos.each do |memo|%>
<%= link_to memo.author, user_activities_url(memo.author,:token => @token.value)%>
<%= memo.parent_id.nil? ? l(:label_memo_new_from_forum) : l(:label_reply) %>
<%= link_to truncate(memo.subject,length: 30,omission: '...'),forum_memo_url(memo.forum, (memo.parent_id.nil? ? memo : memo.parent_id))
%>
<%= format_time(memo.created_at) %>
<% end %>
<!-- 新建贴吧 end-->
<% end %>
<!--贴吧动态 end--> <!--贴吧动态 end-->
<% end %> <% end %>
<% [:label_user_mail_option_all, :label_user_mail_option_day, :label_user_mail_option_none].each do |mail_option| %> <% [:label_user_mail_option_all, :label_user_mail_option_day, :label_user_mail_option_none].each do |mail_option| %>
<% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %>
<%= l(mail_option) %> <%= l(mail_option) %>
<% else %> <% else %>
<%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %>
<% end %> <% end %>
<% end %> <% end %>