邮件系统界面重置

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2015-01-17 14:19:54 +08:00
parent 1602d2e439
commit ade0720331
8 changed files with 47 additions and 38 deletions

View File

@ -15,8 +15,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class UsersController < ApplicationController
layout :setting_layout
#Added by young
before_filter :auth_login1, :only => [:show, :user_activities]
menu_item :activity
menu_item :user_information, :only => :info
menu_item :user_course, :only => :user_courses
@ -30,7 +32,7 @@ class UsersController < ApplicationController
#Ended by young
# edit
before_filter :auth_login1, :only => [:show]
#
before_filter :can_show_course, :only => [:user_courses,:user_homeworks]
before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :tag_saveEx,:user_projects, :user_newfeedback, :user_comments, :watch_bids, :watch_contests, :info,

View File

@ -105,18 +105,18 @@ class Mailer < ActionMailer::Base
@author = issue.author
@issue = issue
user = User.find_by_mail(recipients)
token = Token.new(:user => User.find_by_mail(recipients), :action => 'autologin')
token = Token.new(:user =>user , :action => 'autologin')
token.save
@token = token
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :token => @token.value)
# edit
@issue_author_url = url_for(:controller => 'users', :action => 'show', :id => issue.author_id, :token => @token.value)
@issue_author_url = url_for(user_activities_url(@author,:token => @token.value))
@project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value)
@user_url = url_for(:controller => 'my', :action => 'account', :user => User.find_by_mail(recipients) , :token => @token.value)
#
@user_url = url_for(my_account_url(user,:token => @token.value))
cc = issue.watcher_recipients - issue.recipients
subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}"
@ -149,10 +149,18 @@ class Mailer < ActionMailer::Base
references issue
@author = journal.user
user = User.find_by_mail(recipients)
token = Token.new(:user =>user , :action => 'autologin')
token.save
@token = token
# edit
@issue_author_url = url_for(:controller => 'users', :action => 'show', :id => issue.author_id, :token => @token.value)
@project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value)
@user_url = url_for(my_account_url(user,:token => @token.value))
token = Token.new(:user => User.find_by_mail(recipients), :action => 'autologin')
token.save
@token = token
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :anchor => "change-#{journal.id}", :token => @token.value)

View File

@ -14,7 +14,7 @@ ol,ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; }
a:hover{ text-decoration:underline; }
.mail_box,ul,li{ list-style-type:none}
.mail{ width:600px; margin:20px; height:auto; color:#4b4b4b; font-size:14px; }
.mail a{color:#1b55a7; font-weight: bold; }
.mail_content{ margin-top:30px;}

View File

@ -6,23 +6,26 @@
<span class="c_blue"><%= link_to(h("#{@issue.project.name}"),@project_url) %></span>中有了一个与您相关的最新活动,请您关注!</p>
<div class="mail_box">
<ul>
<li><strong>标题:</strong><%= link_to(issue.subject, issue_url) %></li>
<li><strong>来源:</strong><%= link_to(h("#{issue.project.name}"),@project_url) %><b>|&nbsp;</b>项目缺陷</li>
<li><strong style="float:left;">内容:</strong>
<p class="mail_box_p"><%= textilizable(issue, :description, :only_path => false) %></p>
<li style="list-style-type:none"><span style="float: left"><strong>标题:</strong></span><span style="float: left; width: 500px"><%= link_to(issue.subject, issue_url) %></span></li>
<li style="list-style-type:none"><span style="float: left"> <strong>来源:</strong></span><span style="float: left; width: 500px"><%= issue.project.name %><b>|&nbsp;</b>项目缺陷</span></li>
<li style="list-style-type:none"><span style="float: left"> <strong >内容:</strong></span><span style="float: left; width: 500px">
<%= issue.description %></span>
</li>
<li><strong style="float:left;">附件:</strong>
<p class="mail_fujian">
<% unless @issue.attachments.nil? %>
<li style="list-style-type:none">
<% unless @issue.attachments.nil? %>
<span style="float: left"> <strong>附件:</strong>
</span><span style="float: left; width: 500px">
<% @issue.attachments.each do |attach| %>
<%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %><%= l(:label_added) %></br>
<% end %>
<p><%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %></p>
<% end %></span>
<% end %>
</p>
</li>
</ul>
<label class="mail_reply"><%= link_to( "我要回复", issue_url) %></label>
<div class="cl"></div>
<label class="mail_reply"><%= link_to( "我要回复", issue_url, :class => "mail_reply") %></label>
<div class="cl"></div>
</div>
<!-- <li><%#=l(:field_author)%>: <%#=h issue.author %></li>

View File

@ -3,12 +3,13 @@
<%= link_to(h("#{@issue.project.name}"),@project_url) %>中有了一个与您相关的最新活动,请您关注!
标题:<%= link_to(issue.subject, issue_url) %>
来源:<%= link_to(h("#{issue.project.name}"),@project_url) %>|&nbsp;项目缺陷<
来源:<%= issue.project.name %>|&nbsp;项目缺陷<
内容:
<%= textilizable(issue, :description, :only_path => false) %>
<%= issue.description %>
<% unless @issue.attachments.nil? %>
附件:
<% unless @issue.attachments.nil? %>
<% @issue.attachments.each do |attach| %>
<%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %><%= l(:label_added) %>
<% end %>

View File

@ -1,11 +1,2 @@
<%= link_to(h("#{@issue.author}"+"(#{@issue.author_id.firstname+@issue.author_id.lastname})"), @issue_author_url) %>在<%= link_to(h("#{@issue.project.name}"),@project_url) %>
<%#= l(:text_issue_added, :id => "##{@issue.project_index}", :author => @issue.author) %> !-->
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>
<% @issue.attachments.each do |attach| %>
<%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %> <%= l(:label_added) %>
<% end %>
----------------------------------------
<%= link_to( "我要回复", @issue_url) %>
<%#= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>

View File

@ -2,10 +2,12 @@
<ul>
<% details_to_strings(@journal.details, false, :only_path => false, :token => @token.value).each do |string| %>
<li><%= string %></li>
<% if (!string.include? l(:label_attachment)) && (!string.include? "attachments") %>
<li><%= string %></li>
<% end %>
<% end %>
</ul>
<%= textilizable(@journal, :notes, :only_path => false) %>
<span style="float: left"><strong><%= l(:field_content)%></strong></span><span style="float: left; width: 540px"><%= @journal.notes %></span>
<hr />
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>

View File

@ -1,11 +1,13 @@
<%= l(:text_issue_updated, :id => "##{@issue.project_index}", :author => @journal.user) %>
<% details_to_strings(@journal.details, true, :token => @token.value).each do |string| -%>
<%= string %>
<% if (!string.include? l(:label_attachment)) && (!string.include? "attachments") %>
<li><%= string %></li>
<% end %>
<% end -%>
<% if @journal.notes? -%>
<%= @journal.notes %>
<%= l(:field_content)%><%= @journal.notes %>
<% end -%>
----------------------------------------