Add form for adding zone #2806

This commit is contained in:
Martin Lensment 2015-08-03 12:05:31 +03:00
parent 1fe8bd3f46
commit 44b2d383b1
10 changed files with 163 additions and 67 deletions

View file

@ -0,0 +1,74 @@
= form_for [:admin, @zonefile_setting], html: { class: 'form-horizontal' } do |f|
.row
.col-md-8
#domain-statuses
= render 'shared/full_errors', object: f.object
.form-group
.col-md-4.control-label
= f.label :origin
.col-md-8
- if @zonefile_setting.persisted?
= f.text_field :origin, class: 'form-control', disabled: true
- else
= f.text_field :origin, class: 'form-control'
.form-group
.col-md-4.control-label
= f.label :ttl
.col-md-8
= f.text_field :ttl, class: 'form-control'
.form-group
.col-md-4.control-label
= f.label :refresh
.col-md-8
= f.text_field :refresh, class: 'form-control'
.form-group
.col-md-4.control-label
= f.label :retry
.col-md-8
= f.text_field :retry, class: 'form-control'
.form-group
.col-md-4.control-label
= f.label :expire
.col-md-8
= f.text_field :expire, class: 'form-control'
.form-group
.col-md-4.control-label
= f.label :minimum_ttl
.col-md-8
= f.text_field :minimum_ttl, class: 'form-control'
.form-group
.col-md-4.control-label
= f.label :email
.col-md-8
= f.text_field :email, class: 'form-control'
.form-group
.col-md-4.control-label
= f.label :ns_records
.col-md-8
= f.text_area :ns_records, class: 'form-control', rows: 8
.form-group
.col-md-4.control-label
= f.label :a_records
.col-md-8
= f.text_area :a_records, class: 'form-control', rows: 8
.form-group
.col-md-4.control-label
= f.label :a4_records, t(:a4_records)
.col-md-8
= f.text_area :a4_records, class: 'form-control', rows: 8
%hr
.row
.col-md-8.text-right
%button.btn.btn-primary= t(:save)

View file

@ -1,53 +1,5 @@
= render 'shared/title', name: t(:zonefile_settings)
- content_for :actions do
= link_to(t(:back), admin_zonefile_settings_path, class: 'btn btn-default')
= render 'shared/title', name: t(:edit_zone)
= form_for [:admin, @zonefile_setting], html: { class: 'form-horizontal' } do |f|
.row
.col-md-8
#domain-statuses
= render 'shared/full_errors', object: f.object
.form-group
.col-md-4.control-label
= f.label :origin
.col-md-8
= f.text_field :origin, class: 'form-control', disabled: true
.form-group
.col-md-4.control-label
= f.label :ttl
.col-md-8
= f.text_field :ttl, class: 'form-control'
.form-group
.col-md-4.control-label
= f.label :refresh
.col-md-8
= f.text_field :refresh, class: 'form-control'
.form-group
.col-md-4.control-label
= f.label :retry
.col-md-8
= f.text_field :retry, class: 'form-control'
.form-group
.col-md-4.control-label
= f.label :expire
.col-md-8
= f.text_field :expire, class: 'form-control'
.form-group
.col-md-4.control-label
= f.label :minimum_ttl
.col-md-8
= f.text_field :minimum_ttl, class: 'form-control'
.form-group
.col-md-4.control-label
= f.label :email
.col-md-8
= f.text_field :email, class: 'form-control', email: true
%hr
.row
.col-md-8.text-right
%button.btn.btn-primary= t(:save)
= render 'form'

View file

@ -1,3 +1,5 @@
- content_for :actions do
= link_to(t(:new), new_admin_zonefile_setting_path, class: 'btn btn-primary')
= render 'shared/title', name: t(:zonefile_settings)
.row
@ -15,6 +17,6 @@
%tr
%td= link_to(x, edit_admin_zonefile_setting_path(x))
%td
= link_to(t(:generate_zonefile),
admin_zonefiles_path(origin: x.origin),
= link_to(t(:generate_zonefile),
admin_zonefiles_path(origin: x.origin),
method: 'post', class: 'btn btn-xs btn-primary')

View file

@ -0,0 +1,5 @@
- content_for :actions do
= link_to(t(:back), admin_zonefile_settings_path, class: 'btn btn-default')
= render 'shared/title', name: t(:new_zone)
= render 'form'