mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
Add legal documents view
This commit is contained in:
parent
038e03a16f
commit
3adab3f0ae
6 changed files with 31 additions and 0 deletions
9
app/controllers/admin/legal_documents_controller.rb
Normal file
9
app/controllers/admin/legal_documents_controller.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
class Admin::LegalDocumentsController < AdminController
|
||||
load_and_authorize_resource
|
||||
|
||||
def show
|
||||
@ld = LegalDocument.find(params[:id])
|
||||
file = Base64.decode64(@ld.body)
|
||||
send_data file, filename: "#{@ld.created_at}.#{@ld.document_type}"
|
||||
end
|
||||
end
|
|
@ -23,6 +23,7 @@ class Ability
|
|||
can :manage, User
|
||||
can :manage, EppUser
|
||||
can :manage, Keyrelay
|
||||
can :manage, LegalDocument
|
||||
can :index, :delayed_job
|
||||
can :create, :zonefile
|
||||
can :access, :settings_menu
|
||||
|
|
14
app/views/admin/domains/partials/_legal_documents.haml
Normal file
14
app/views/admin/domains/partials/_legal_documents.haml
Normal file
|
@ -0,0 +1,14 @@
|
|||
.panel.panel-default
|
||||
.panel-heading.clearfix
|
||||
= t('legal_documents')
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-8'}= t('created_at')
|
||||
%th{class: 'col-xs-4'}= t('type')
|
||||
%tbody
|
||||
- @domain.legal_documents.each do |x|
|
||||
%tr
|
||||
%td= link_to(x.created_at, [:admin, x])
|
||||
%td= x.document_type
|
|
@ -25,3 +25,5 @@
|
|||
.col-md-12= render 'admin/domains/partials/dnskeys'
|
||||
.row
|
||||
.col-md-12= render 'admin/domains/partials/keyrelays'
|
||||
.row
|
||||
.col-md-12= render 'admin/domains/partials/legal_documents'
|
||||
|
|
|
@ -469,3 +469,6 @@ en:
|
|||
keyrelay_details: 'Keyrelay details'
|
||||
unknown_expiry_absolute_pattern: 'Expiry absolute must be compatible to ISO 8601'
|
||||
domain_name: 'Domain name'
|
||||
created_at: 'Created at'
|
||||
type: 'Type'
|
||||
legal_documents: 'Legal documents'
|
||||
|
|
|
@ -13,6 +13,8 @@ Rails.application.routes.draw do
|
|||
|
||||
resources :zonefile_settings
|
||||
|
||||
resources :legal_documents
|
||||
|
||||
resources :keyrelays
|
||||
resources :domains
|
||||
resources :settings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue