diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-04-07 04:02:19 +0900 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-04-07 16:17:27 +0200 |
commit | 2548c155eed13c806951a6303c85dbb0c5772ca3 (patch) | |
tree | 0df8ddb462937a6cb4043b2412442a099b2513a9 /app/views/projects | |
parent | 7ccaa27f899dfbc96b23d98ee415b5daf80dd336 (diff) | |
download | gitlab-ce-2548c155eed13c806951a6303c85dbb0c5772ca3.tar.gz |
Add form for scheduled trigger
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/triggers/_form.html.haml | 23 | ||||
-rw-r--r-- | app/views/projects/triggers/_index.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/triggers/_trigger.html.haml | 6 |
3 files changed, 30 insertions, 1 deletions
diff --git a/app/views/projects/triggers/_form.html.haml b/app/views/projects/triggers/_form.html.haml index 5f708b3a2ed..169f6c43225 100644 --- a/app/views/projects/triggers/_form.html.haml +++ b/app/views/projects/triggers/_form.html.haml @@ -6,6 +6,27 @@ %label.label-light Token %p.form-control-static= @trigger.token .form-group - = f.label :key, "Description", class: "label-light" + = f.label :key, "Description (For extenral trigger and scheduled trigger)", class: "label-light" = f.text_field :description, class: "form-control", required: true, title: 'Trigger description is required.', placeholder: "Trigger description" + = f.fields_for :trigger_schedule do |schedule_fields| + .form-group + = schedule_fields.label :cron, "Cron (For scheduled trigger)", class: "label-light" + = schedule_fields.text_field :cron, class: "form-control", title: 'Trigger Schedule cron is required.', placeholder: "0 1 * * *" + .form-group + = schedule_fields.label :cron_timezone, "Cron timezone (For scheduled trigger)", class: "label-light" + = schedule_fields.text_field :cron_timezone, class: "form-control", title: 'Trigger Schedule cron_timezone is required.', placeholder: "UTC" + .form-group + = f.label :ref, "Ref (For scheduled trigger)", class: "label-light" + = f.text_field :ref, class: "form-control", title: 'Trigger Schedule Ref is required.', placeholder: "master" + - if action_name == 'edit' + = f.hidden_field :trigger_schedule_on, :value => @trigger.trigger_schedule.present? ? 1 : 0 + - else + .form-group + .checkbox + = f.label :trigger_schedule_on do + = f.check_box :trigger_schedule_on + %strong Register as scheduled trigger + .help-block + If checked, this trigger will be executed periodically according to `cron`, `cron_timezone` and `ref` + = link_to icon('question-circle'), help_page_path('user/project/pipelines/settings', anchor: 'visibility-of-pipelines') = f.submit btn_text, class: "btn btn-save" diff --git a/app/views/projects/triggers/_index.html.haml b/app/views/projects/triggers/_index.html.haml index cc74e50a5e3..84e945ee0df 100644 --- a/app/views/projects/triggers/_index.html.haml +++ b/app/views/projects/triggers/_index.html.haml @@ -22,6 +22,8 @@ %th %strong Last used %th + %strong Next run at + %th = render partial: 'projects/triggers/trigger', collection: @triggers, as: :trigger - else %p.settings-message.text-center.append-bottom-default diff --git a/app/views/projects/triggers/_trigger.html.haml b/app/views/projects/triggers/_trigger.html.haml index 9b5f63ae81a..87d7c741bd6 100644 --- a/app/views/projects/triggers/_trigger.html.haml +++ b/app/views/projects/triggers/_trigger.html.haml @@ -29,6 +29,12 @@ - else Never + %td + - if trigger.trigger_schedule.present? + = trigger.trigger_schedule.real_next_run + - else + N/A (External trigger) + %td.text-right.trigger-actions - take_ownership_confirmation = "By taking ownership you will bind this trigger to your user account. With this the trigger will have access to all your projects as if it was you. Are you sure?" - revoke_trigger_confirmation = "By revoking a trigger you will break any processes making use of it. Are you sure?" |