Add legal documents view

This commit is contained in:
Martin Lensment 2014-12-30 12:14:55 +02:00
parent 038e03a16f
commit 3adab3f0ae
6 changed files with 31 additions and 0 deletions

View 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

View file

@ -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

View 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

View file

@ -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'