mirror of
https://github.com/redmine/redmine.git
synced 2026-03-04 03:21:24 +01:00
added password for mailing list and setting option for lists domain
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@268 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -57,7 +57,12 @@ class MailingListsController < ApplicationController
|
||||
end
|
||||
|
||||
def destroy
|
||||
@mailing_list.update_attribute :status, MailingList::STATUS_TO_BE_DELETED
|
||||
case @mailing_list.status
|
||||
when MailingList::STATUS_REQUESTED
|
||||
@mailing_list.destroy
|
||||
when MailingList::STATUS_CREATED
|
||||
@mailing_list.update_attribute :status, MailingList::STATUS_TO_BE_DELETED
|
||||
end
|
||||
redirect_to :controller => 'projects', :action => 'settings', :tab => 'mailing-lists', :id => @project
|
||||
end
|
||||
|
||||
|
||||
@@ -21,9 +21,10 @@ class MailingList < ActiveRecord::Base
|
||||
belongs_to :project
|
||||
belongs_to :admin, :class_name => 'User', :foreign_key => 'admin_id'
|
||||
has_many :messages, :class_name => 'MailingMessage', :dependent => :delete_all
|
||||
|
||||
|
||||
validates_presence_of :name, :description, :password
|
||||
validates_confirmation_of :password
|
||||
validates_format_of :name, :with => /^[a-z0-9\-]+$/i
|
||||
|
||||
STATUSES = {
|
||||
(STATUS_REQUESTED = 1) => :mailing_list_status_requested,
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
|
||||
<div class="box">
|
||||
<!--[form:mailing_list]-->
|
||||
<p><%= f.text_field :name, :size => 25, :required => true %></p>
|
||||
<p><%= f.text_field :name, :size => 25, :required => true %> <strong>@<%= Setting.mailing_lists_domain %></strong></p>
|
||||
<p><%= f.text_field :description, :size => 60, :required => true %></p>
|
||||
<p><%= f.check_box :is_public %></p>
|
||||
<p><%= f.select :admin_id, @project.users.collect {|p| [p.name, p.id]}, :required => true %></p>
|
||||
<p><%= f.password_field :password, :size => 25, :required => true %></p>
|
||||
<p><%= f.password_field :password_confirmation, :size => 25, :required => true %></p>
|
||||
|
||||
@@ -62,17 +62,16 @@
|
||||
|
||||
<div id="tab-content-mailing-lists" class="tab-content" style="display:none;">
|
||||
<table class="list">
|
||||
<thead><th><%= l(:field_name) %></th><th><%= l(:field_description) %></th><th><%= l(:field_admin) %></th><th><%= l(:field_is_public) %></th><th><%= l(:field_status) %></th><th></th><th></th></thead>
|
||||
<thead><th><%= l(:field_name) %></th><th><%= l(:field_description) %></th><th><%= l(:field_admin) %></th><th><%= l(:field_status) %></th><th></th><th></th></thead>
|
||||
<tbody>
|
||||
<% for mailing_list in @project.mailing_lists %>
|
||||
<tr class="<%= cycle 'odd', 'even' %>">
|
||||
<td><%=h mailing_list.name %></td>
|
||||
<td><%=h mailing_list.description %></td>
|
||||
<td align="center"><%= mailing_list.admin.name if mailing_list.admin %></td>
|
||||
<td align="center"><%= image_tag('true.png') if mailing_list.is_public? %></td>
|
||||
<td align="center"><%= l(mailing_list.status_name) if mailing_list.status_name %></td>
|
||||
<td align="center" style="width:10%"><%= link_to_if_authorized l(:button_edit), {:controller => 'mailing_lists', :action => 'edit', :id => mailing_list}, :class => 'icon icon-edit' %></td>
|
||||
<td align="center" style="width:10%"><%= link_to_if_authorized l(:button_delete), {:controller => 'mailing_lists', :action => 'destroy', :id => mailing_list}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %></td>
|
||||
<td align="center" style="width:10%"><%= link_to_if_authorized(l(:button_edit), {:controller => 'mailing_lists', :action => 'edit', :id => mailing_list}, :class => 'icon icon-edit') %></td>
|
||||
<td align="center" style="width:10%"><%= link_to_if_authorized(l(:button_delete), {:controller => 'mailing_lists', :action => 'destroy', :id => mailing_list}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del') unless mailing_list.status==MailingList::STATUS_TO_BE_DELETED %></td>
|
||||
</tr>
|
||||
<% end; reset_cycle %>
|
||||
</tbody>
|
||||
|
||||
@@ -33,7 +33,10 @@
|
||||
<%= text_field_tag 'settings[mail_from]', Setting.mail_from, :size => 60 %></p>
|
||||
|
||||
<p><label><%= l(:setting_host_name) %></label>
|
||||
<%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %></p>
|
||||
<%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 30 %></p>
|
||||
|
||||
<p><label><%= l(:setting_mailing_lists_domain) %></label>
|
||||
<%= text_field_tag 'settings[mailing_lists_domain]', Setting.mailing_lists_domain, :size => 30 %></p>
|
||||
|
||||
<p><label><%= l(:setting_text_formatting) %></label>
|
||||
<%= select_tag 'settings[text_formatting]', options_for_select( [[l(:label_none), 0], ["textile", "textile"]], Setting.text_formatting) %></p>
|
||||
|
||||
Reference in New Issue
Block a user