#1: Accept only emails in author field

This commit is contained in:
Anton Argirov 2015-05-26 10:43:31 +06:00
parent 092ea3282d
commit f3425f4dcb
4 changed files with 4 additions and 3 deletions

View File

@ -15,6 +15,7 @@ class CustomWorkflow < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name, :case_sensitive => false
validates_format_of :author, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, :allow_blank => true
validate :validate_syntax
default_scope { order(:position => :asc) }

View File

@ -24,7 +24,7 @@
<tr class="<%= cycle("odd", "even") %>">
<td class="name"><%= link_to(workflow.name, edit_custom_workflow_path(workflow)) %></td>
<td class="description"><%= textilizable(workflow.description) %></td>
<td class="author"><%= workflow.author %></td>
<td class="author"><%= mail_to workflow.author if workflow.author.present? %></td>
<td>
<% if workflow.is_for_all? %>
<%= l(:field_enabled_for_all_projects) %>

View File

@ -16,7 +16,7 @@ en:
field_before_save: "Workflow script executable before saving the issue"
field_is_enabled: "Enabled"
field_enabled_for_all_projects: "Enabled for all projects"
field_custom_workflow_author: "Custom workflow's author"
field_custom_workflow_author: "Author's e-mail"
field_custom_workflow_file: "Select the XML file previously exported process"
field_custom_workflow:
script: "Workflow script"

View File

@ -16,7 +16,7 @@ ru:
field_before_save: "Сценарий выполняемый перед сохранением задачи"
field_is_enabled: "Разрешено"
field_enabled_for_all_projects: "Разрешен для всех проектов"
field_custom_workflow_author: "Автор рабочего процесса"
field_custom_workflow_author: "E-Mail адрес автора"
field_custom_workflow_file: "Выберите XML файл ранее экспортированного процесса"
field_custom_workflow:
script: "Сценарий"