diff --git a/app/models/custom_workflow.rb b/app/models/custom_workflow.rb index 0dfa5c7..e0d6c82 100644 --- a/app/models/custom_workflow.rb +++ b/app/models/custom_workflow.rb @@ -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) } diff --git a/app/views/custom_workflows/index.html.erb b/app/views/custom_workflows/index.html.erb index 6e97dce..d37f928 100644 --- a/app/views/custom_workflows/index.html.erb +++ b/app/views/custom_workflows/index.html.erb @@ -24,7 +24,7 @@ "> <%= link_to(workflow.name, edit_custom_workflow_path(workflow)) %> <%= textilizable(workflow.description) %> - <%= workflow.author %> + <%= mail_to workflow.author if workflow.author.present? %> <% if workflow.is_for_all? %> <%= l(:field_enabled_for_all_projects) %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 5e5138c..dbb4025 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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" diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 9e636d8..0374270 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -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: "Сценарий"