mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
Refactor zones
- Rename "zonefile_setting" to "zone" - Remove version #475
This commit is contained in:
parent
f1d7e53734
commit
bff7437277
51 changed files with 425 additions and 389 deletions
|
@ -31,7 +31,7 @@
|
|||
%li.divider
|
||||
%li.dropdown-header= t(:system)
|
||||
%li= link_to t(:settings), admin_settings_path
|
||||
%li= link_to t(:zonefile), admin_zonefile_settings_path
|
||||
%li= link_to t('.zones'), admin_zones_path
|
||||
%li= link_to t('.blocked_domains'), admin_blocked_domains_path
|
||||
%li= link_to t('.reserved_domains'), admin_reserved_domains_path
|
||||
%li= link_to t(:mail_templates), admin_mail_templates_path
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
= form_for [:admin, @zonefile_setting], html: { class: 'form-horizontal' } do |f|
|
||||
= form_for [:admin, zone], html: { class: 'form-horizontal' } do |f|
|
||||
.row
|
||||
.col-md-8
|
||||
#domain-statuses
|
||||
|
@ -9,7 +8,7 @@
|
|||
.col-md-4.control-label
|
||||
= f.label :origin
|
||||
.col-md-8
|
||||
- if @zonefile_setting.persisted?
|
||||
- if zone.persisted?
|
||||
= f.text_field :origin, class: 'form-control', disabled: true
|
||||
- else
|
||||
= f.text_field :origin, class: 'form-control'
|
||||
|
@ -77,4 +76,4 @@
|
|||
%hr
|
||||
.row
|
||||
.col-md-8.text-right
|
||||
%button.btn.btn-primary= t(:save)
|
||||
%button.btn.btn-success= t(".#{zone.new_record? ? 'create' : 'update'}_btn")
|
9
app/views/admin/dns/zones/_zone.html.erb
Normal file
9
app/views/admin/dns/zones/_zone.html.erb
Normal file
|
@ -0,0 +1,9 @@
|
|||
<tr>
|
||||
<td><%= zone.origin %></td>
|
||||
<td>
|
||||
<%= link_to t('.edit_btn'), edit_admin_zone_path(zone), class: 'btn btn-xs btn-primary' %>
|
||||
<%= link_to t('.generate_zone_file_btn'),
|
||||
admin_zonefiles_path(origin: zone.origin),
|
||||
method: 'post', class: 'btn btn-xs btn-primary' %>
|
||||
</td>
|
||||
</tr>
|
20
app/views/admin/dns/zones/edit.html.erb
Normal file
20
app/views/admin/dns/zones/edit.html.erb
Normal file
|
@ -0,0 +1,20 @@
|
|||
<ol class="breadcrumb">
|
||||
<li><%= link_to t('admin.dns.zones.index.title'), admin_zones_path %></li>
|
||||
</ol>
|
||||
|
||||
<div class="page-header">
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<h1><%= t '.title' %></h1>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 text-right">
|
||||
<%= link_to(t('.delete_btn'), admin_zone_path(@zone),
|
||||
method: :delete,
|
||||
data: { confirm: t('.delete_btn_confirm') },
|
||||
class: 'btn btn-danger') %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render 'form', zone: @zone %>
|
28
app/views/admin/dns/zones/index.html.erb
Normal file
28
app/views/admin/dns/zones/index.html.erb
Normal file
|
@ -0,0 +1,28 @@
|
|||
<div class="page-header">
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<h1><%= t '.title' %></h1>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 text-right">
|
||||
<%= link_to t('.new_btn'), new_admin_zone_path, class: 'btn btn-primary' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if @zones.present? %>
|
||||
<table class="table table-hover table-bordered table-wrapped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= DNS::Zone.human_attribute_name :origin %></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<%= render @zones %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<div class="alert alert-info"><%= t '.not_found' %></div>
|
||||
<% end %>
|
9
app/views/admin/dns/zones/new.html.erb
Normal file
9
app/views/admin/dns/zones/new.html.erb
Normal file
|
@ -0,0 +1,9 @@
|
|||
<ol class="breadcrumb">
|
||||
<li><%= link_to t('admin.dns.zones.index.title'), admin_zones_path %></li>
|
||||
</ol>
|
||||
|
||||
<div class="page-header">
|
||||
<h1><%= t '.title' %></h1>
|
||||
</div>
|
||||
|
||||
<%= render 'form', zone: @zone %>
|
|
@ -1,7 +0,0 @@
|
|||
- content_for :actions do
|
||||
= link_to(t(:back), admin_zonefile_settings_path, class: 'btn btn-default')
|
||||
= link_to(t(:delete), admin_zonefile_setting_path(@zonefile_setting),
|
||||
method: :delete, data: { confirm: t(:are_you_sure) }, class: 'btn btn-danger')
|
||||
= render 'shared/title', name: t(:edit_zone)
|
||||
|
||||
= render 'form'
|
|
@ -1,22 +0,0 @@
|
|||
- 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
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-10'}
|
||||
= t(:origin)
|
||||
%th{class: 'col-xs-2'}
|
||||
= t(:action)
|
||||
%tbody
|
||||
- @zonefile_settings.each do |x|
|
||||
%tr
|
||||
%td= link_to(x, edit_admin_zonefile_setting_path(x))
|
||||
%td
|
||||
= link_to(t(:generate_zonefile),
|
||||
admin_zonefiles_path(origin: x.origin),
|
||||
method: 'post', class: 'btn btn-xs btn-primary')
|
|
@ -1,5 +0,0 @@
|
|||
- 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'
|
Loading…
Add table
Add a link
Reference in a new issue