mirror of
https://github.com/internetee/registry.git
synced 2025-08-11 20:19:34 +02:00
Merge branch 'change-registrar-area-controller-hierarchy' into registry-475-refactor-zones
This commit is contained in:
commit
ed8a4bed66
21 changed files with 883 additions and 825 deletions
|
@ -1,4 +1,5 @@
|
||||||
class Registrar::AccountActivitiesController < RegistrarController
|
class Registrar
|
||||||
|
class AccountActivitiesController < BaseController
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
def index # rubocop: disable Metrics/AbcSize
|
def index # rubocop: disable Metrics/AbcSize
|
||||||
|
@ -26,3 +27,4 @@ class Registrar::AccountActivitiesController < RegistrarController
|
||||||
params[:q][:created_at_lteq] = ca_cache
|
params[:q][:created_at_lteq] = ca_cache
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
40
app/controllers/registrar/base_controller.rb
Normal file
40
app/controllers/registrar/base_controller.rb
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
class Registrar
|
||||||
|
class BaseController < ApplicationController
|
||||||
|
before_action :authenticate_user!, :check_ip
|
||||||
|
|
||||||
|
include Registrar::ApplicationHelper
|
||||||
|
|
||||||
|
helper_method :depp_controller?
|
||||||
|
|
||||||
|
def depp_controller?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
|
def check_ip
|
||||||
|
return unless current_user
|
||||||
|
unless current_user.is_a? ApiUser
|
||||||
|
sign_out(current_user)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return if Rails.env.development?
|
||||||
|
registrar_ip_whitelisted = current_user.registrar.registrar_ip_white?(request.ip)
|
||||||
|
|
||||||
|
return if registrar_ip_whitelisted
|
||||||
|
flash[:alert] = t('ip_is_not_whitelisted')
|
||||||
|
sign_out(current_user)
|
||||||
|
redirect_to registrar_login_path and return
|
||||||
|
end
|
||||||
|
|
||||||
|
helper_method :head_title_sufix
|
||||||
|
|
||||||
|
def head_title_sufix
|
||||||
|
t(:registrar_head_title_sufix)
|
||||||
|
end
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def current_ability
|
||||||
|
@current_ability ||= Ability.new(current_user, request.remote_ip)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,4 +1,5 @@
|
||||||
class Registrar::ContactsController < Registrar::DeppController # EPP controller
|
class Registrar
|
||||||
|
class ContactsController < DeppController
|
||||||
before_action :init_epp_contact
|
before_action :init_epp_contact
|
||||||
helper_method :address_processing?
|
helper_method :address_processing?
|
||||||
|
|
||||||
|
@ -140,3 +141,4 @@ class Registrar::ContactsController < Registrar::DeppController # EPP controller
|
||||||
Contact.address_processing?
|
Contact.address_processing?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
class Registrar::DashboardController < RegistrarController
|
class Registrar
|
||||||
|
class DashboardController < BaseController
|
||||||
authorize_resource class: false
|
authorize_resource class: false
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
@ -9,3 +10,4 @@ class Registrar::DashboardController < RegistrarController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
class Registrar::DepositsController < RegistrarController
|
class Registrar
|
||||||
|
class DepositsController < BaseController
|
||||||
authorize_resource class: false
|
authorize_resource class: false
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
@ -24,3 +25,4 @@ class Registrar::DepositsController < RegistrarController
|
||||||
params.require(:deposit).permit(:amount, :description)
|
params.require(:deposit).permit(:amount, :description)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
class Registrar::DeppController < RegistrarController # EPP controller
|
class Registrar
|
||||||
|
class DeppController < BaseController
|
||||||
helper_method :depp_current_user
|
helper_method :depp_current_user
|
||||||
|
|
||||||
rescue_from(Errno::ECONNRESET, Errno::ECONNREFUSED) do |exception|
|
rescue_from(Errno::ECONNRESET, Errno::ECONNREFUSED) do |exception|
|
||||||
|
@ -8,6 +9,7 @@ class Registrar::DeppController < RegistrarController # EPP controller
|
||||||
end
|
end
|
||||||
|
|
||||||
before_action :authenticate_user
|
before_action :authenticate_user
|
||||||
|
|
||||||
def authenticate_user
|
def authenticate_user
|
||||||
redirect_to registrar_login_url and return unless depp_current_user
|
redirect_to registrar_login_url and return unless depp_current_user
|
||||||
end
|
end
|
||||||
|
@ -32,3 +34,4 @@ class Registrar::DeppController < RegistrarController # EPP controller
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
class Registrar::DomainsController < Registrar::DeppController # EPP controller
|
class Registrar
|
||||||
|
class DomainsController < DeppController
|
||||||
before_action :init_domain, except: :new
|
before_action :init_domain, except: :new
|
||||||
helper_method :contacts
|
helper_method :contacts
|
||||||
|
|
||||||
|
@ -55,6 +56,7 @@ class Registrar::DomainsController < Registrar::DeppController # EPP controller
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# rubocop: enable Metrics/PerceivedComplexity
|
# rubocop: enable Metrics/PerceivedComplexity
|
||||||
# rubocop: enable Metrics/CyclomaticComplexity
|
# rubocop: enable Metrics/CyclomaticComplexity
|
||||||
# rubocop: enable Metrics/AbcSize
|
# rubocop: enable Metrics/AbcSize
|
||||||
|
@ -189,3 +191,4 @@ class Registrar::DomainsController < Registrar::DeppController # EPP controller
|
||||||
params[:q][:valid_to_lteq] = ca_cache
|
params[:q][:valid_to_lteq] = ca_cache
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
class Registrar::InvoicesController < RegistrarController
|
class Registrar
|
||||||
|
class InvoicesController < BaseController
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
before_action :set_invoice, only: [:show, :forward, :download_pdf]
|
before_action :set_invoice, only: [:show, :forward, :download_pdf]
|
||||||
|
@ -14,7 +15,8 @@ class Registrar::InvoicesController < RegistrarController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def show; end
|
def show;
|
||||||
|
end
|
||||||
|
|
||||||
def forward
|
def forward
|
||||||
@invoice.billing_email = @invoice.buyer.billing_email
|
@invoice.billing_email = @invoice.buyer.billing_email
|
||||||
|
@ -69,3 +71,4 @@ class Registrar::InvoicesController < RegistrarController
|
||||||
params[:q][:due_date_lteq] = ca_cache
|
params[:q][:due_date_lteq] = ca_cache
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
class Registrar::KeyrelaysController < Registrar::DeppController # EPP controller
|
class Registrar
|
||||||
|
class KeyrelaysController < DeppController
|
||||||
def show
|
def show
|
||||||
authorize! :view, Depp::Keyrelay
|
authorize! :view, Depp::Keyrelay
|
||||||
end
|
end
|
||||||
|
@ -16,3 +17,4 @@ class Registrar::KeyrelaysController < Registrar::DeppController # EPP controlle
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
class Registrar::PaymentsController < RegistrarController
|
class Registrar
|
||||||
|
class PaymentsController < BaseController
|
||||||
protect_from_forgery except: :back
|
protect_from_forgery except: :back
|
||||||
|
|
||||||
skip_authorization_check # actually anyone can pay, no problems at all
|
skip_authorization_check # actually anyone can pay, no problems at all
|
||||||
|
@ -35,6 +36,7 @@ class Registrar::PaymentsController < RegistrarController
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def banks
|
def banks
|
||||||
ENV['payments_banks'].split(",").map(&:strip)
|
ENV['payments_banks'].split(",").map(&:strip)
|
||||||
end
|
end
|
||||||
|
@ -42,5 +44,5 @@ class Registrar::PaymentsController < RegistrarController
|
||||||
def check_bank
|
def check_bank
|
||||||
raise StandardError.new("Not Implemented bank") unless banks.include?(params[:bank])
|
raise StandardError.new("Not Implemented bank") unless banks.include?(params[:bank])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
class Registrar::PollsController < Registrar::DeppController # EPP controller
|
class Registrar
|
||||||
|
class PollsController < DeppController
|
||||||
authorize_resource class: false
|
authorize_resource class: false
|
||||||
before_action :init_epp_xml
|
before_action :init_epp_xml
|
||||||
|
|
||||||
def show
|
def show
|
||||||
if Rails.env.test? # Stub for depp server request
|
if Rails.env.test? # Stub for depp server request
|
||||||
@data = Object.new
|
@data = Object.new
|
||||||
def @data.css(key); []; end
|
|
||||||
|
def @data.css(key)
|
||||||
|
; [];
|
||||||
|
end
|
||||||
else
|
else
|
||||||
@data = depp_current_user.request(@ex.poll)
|
@data = depp_current_user.request(@ex.poll)
|
||||||
end
|
end
|
||||||
|
@ -54,3 +58,4 @@ class Registrar::PollsController < Registrar::DeppController # EPP controller
|
||||||
@domain = Depp::Domain.new(current_user: depp_current_user)
|
@domain = Depp::Domain.new(current_user: depp_current_user)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
class Registrar::SessionsController < Devise::SessionsController
|
class Registrar
|
||||||
layout 'registrar/application'
|
class SessionsController < Devise::SessionsController
|
||||||
helper_method :depp_controller?
|
helper_method :depp_controller?
|
||||||
|
|
||||||
def depp_controller?
|
def depp_controller?
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
@ -59,6 +60,7 @@ class Registrar::SessionsController < Devise::SessionsController
|
||||||
render 'login'
|
render 'login'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# rubocop:enable Metrics/MethodLength
|
# rubocop:enable Metrics/MethodLength
|
||||||
# rubocop:enable Metrics/AbcSize
|
# rubocop:enable Metrics/AbcSize
|
||||||
|
|
||||||
|
@ -76,6 +78,7 @@ class Registrar::SessionsController < Devise::SessionsController
|
||||||
|
|
||||||
redirect_to registrar_root_url
|
redirect_to registrar_root_url
|
||||||
end
|
end
|
||||||
|
|
||||||
# rubocop:enable Metrics/CyclomaticComplexity
|
# rubocop:enable Metrics/CyclomaticComplexity
|
||||||
# rubocop:enable Metrics/PerceivedComplexity
|
# rubocop:enable Metrics/PerceivedComplexity
|
||||||
|
|
||||||
|
@ -128,6 +131,7 @@ class Registrar::SessionsController < Devise::SessionsController
|
||||||
render json: { message: t(:no_such_user) }, status: :unauthorized
|
render json: { message: t(:no_such_user) }, status: :unauthorized
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# rubocop:enable Metrics/MethodLength
|
# rubocop:enable Metrics/MethodLength
|
||||||
|
|
||||||
# rubocop: disable Metrics/AbcSize
|
# rubocop: disable Metrics/AbcSize
|
||||||
|
@ -169,6 +173,7 @@ class Registrar::SessionsController < Devise::SessionsController
|
||||||
render json: { message: t(:internal_error) }, status: :bad_request
|
render json: { message: t(:internal_error) }, status: :bad_request
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# rubocop: enable Metrics/AbcSize
|
# rubocop: enable Metrics/AbcSize
|
||||||
# rubocop: enable Metrics/CyclomaticComplexity
|
# rubocop: enable Metrics/CyclomaticComplexity
|
||||||
# rubocop: enable Metrics/MethodLength
|
# rubocop: enable Metrics/MethodLength
|
||||||
|
@ -186,3 +191,4 @@ class Registrar::SessionsController < Devise::SessionsController
|
||||||
render text: t('access_denied') and return
|
render text: t('access_denied') and return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
class Registrar::XmlConsolesController < Registrar::DeppController # EPP controller
|
class Registrar
|
||||||
|
class XmlConsolesController < DeppController
|
||||||
authorize_resource class: false
|
authorize_resource class: false
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
@ -21,3 +22,4 @@ class Registrar::XmlConsolesController < Registrar::DeppController # EPP control
|
||||||
render text: xml
|
render text: xml
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
class RegistrarController < ApplicationController
|
|
||||||
before_action :authenticate_user!, :check_ip
|
|
||||||
layout 'registrar/application'
|
|
||||||
|
|
||||||
include Registrar::ApplicationHelper
|
|
||||||
|
|
||||||
helper_method :depp_controller?
|
|
||||||
def depp_controller?
|
|
||||||
false
|
|
||||||
end
|
|
||||||
|
|
||||||
def check_ip
|
|
||||||
return unless current_user
|
|
||||||
unless current_user.is_a? ApiUser
|
|
||||||
sign_out(current_user)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
return if Rails.env.development?
|
|
||||||
registrar_ip_whitelisted = current_user.registrar.registrar_ip_white?(request.ip)
|
|
||||||
|
|
||||||
return if registrar_ip_whitelisted
|
|
||||||
flash[:alert] = t('ip_is_not_whitelisted')
|
|
||||||
sign_out(current_user)
|
|
||||||
redirect_to registrar_login_path and return
|
|
||||||
end
|
|
||||||
|
|
||||||
helper_method :head_title_sufix
|
|
||||||
def head_title_sufix
|
|
||||||
t(:registrar_head_title_sufix)
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def current_ability
|
|
||||||
@current_ability ||= Ability.new(current_user, request.remote_ip)
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,75 +0,0 @@
|
||||||
!!! 5
|
|
||||||
%html{lang: I18n.locale.to_s}
|
|
||||||
%head
|
|
||||||
%meta{charset: "utf-8"}/
|
|
||||||
%meta{content: "IE=edge", "http-equiv" => "X-UA-Compatible"}/
|
|
||||||
%meta{content: "width=device-width, initial-scale=1", name: "viewport"}/
|
|
||||||
%meta{content: "Full stack top-level domain (TLD) management.", name: "description"}/
|
|
||||||
%meta{content: "Gitlab LTD", name: "author"}/
|
|
||||||
- if content_for? :head_title
|
|
||||||
= yield :head_title
|
|
||||||
- else
|
|
||||||
%title= t(:registrar_head_title)
|
|
||||||
= csrf_meta_tags
|
|
||||||
= stylesheet_link_tag 'registrar-manifest', media: 'all', 'data-turbolinks-track' => true
|
|
||||||
= javascript_include_tag 'registrar-manifest', 'data-turbolinks-track' => true
|
|
||||||
= favicon_link_tag 'favicon.ico'
|
|
||||||
%body
|
|
||||||
/ Fixed navbar
|
|
||||||
%nav.navbar.navbar-default.navbar-fixed-top
|
|
||||||
.container
|
|
||||||
.navbar-header
|
|
||||||
%button.navbar-toggle.collapsed{"aria-controls" => "navbar", "aria-expanded" => "false", "data-target" => "#navbar", "data-toggle" => "collapse", :type => "button"}
|
|
||||||
%span.sr-only Toggle navigation
|
|
||||||
%span.icon-bar
|
|
||||||
%span.icon-bar
|
|
||||||
%span.icon-bar
|
|
||||||
= link_to main_app.registrar_root_path, class: 'navbar-brand' do
|
|
||||||
= t(:registrar_head_title)
|
|
||||||
- if unstable_env.present?
|
|
||||||
.text-center
|
|
||||||
%small{style: 'color: #0074B3;'}= unstable_env
|
|
||||||
- if current_user
|
|
||||||
.navbar-collapse.collapse
|
|
||||||
%ul.nav.navbar-nav.public-nav
|
|
||||||
- if can? :view, Depp::Domain
|
|
||||||
- active_class = %w(registrar/domains registrar/check registrar/renew registrar/tranfer registrar/keyrelays).include?(params[:controller]) ? 'active' :nil
|
|
||||||
%li{class: active_class}= link_to t(:domains), registrar_domains_path
|
|
||||||
|
|
||||||
- if can? :view, Depp::Contact
|
|
||||||
- active_class = ['registrar/contacts'].include?(params[:controller]) ? 'active' :nil
|
|
||||||
%li{class: active_class}= link_to t(:contacts), registrar_contacts_path
|
|
||||||
|
|
||||||
- if can? :show, Invoice
|
|
||||||
- active_class = ['registrar/invoices'].include?(params[:controller]) ? 'active' :nil
|
|
||||||
%li{class: active_class}= link_to t(:billing), registrar_invoices_path
|
|
||||||
|
|
||||||
- if !Rails.env.production? && can?(:manage, :xml_console)
|
|
||||||
- active_class = ['registrar/xml_consoles'].include?(params[:controller]) ? 'active' :nil
|
|
||||||
%li{class: active_class}= link_to t(:xml_console), registrar_xml_console_path
|
|
||||||
|
|
||||||
%ul.nav.navbar-nav.navbar-right
|
|
||||||
%li.dropdown
|
|
||||||
%a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
|
|
||||||
= "#{current_user} (#{current_user.roles.first}) - #{current_user.registrar}"
|
|
||||||
%span.caret
|
|
||||||
%ul.dropdown-menu{role: "menu"}
|
|
||||||
- ApiUser.all_by_identity_code(current_user.identity_code).each do |x|
|
|
||||||
%li= link_to "#{x} (#{x.roles.first}) - #{x.registrar}", "/registrar/switch_user/#{x.id}"
|
|
||||||
- if user_signed_in?
|
|
||||||
%li= link_to t(:log_out_), '/registrar/logout'
|
|
||||||
|
|
||||||
.container
|
|
||||||
= render 'shared/flash'
|
|
||||||
- if depp_controller?
|
|
||||||
= render 'registrar/shared/epp_results'
|
|
||||||
= yield
|
|
||||||
|
|
||||||
%footer.footer
|
|
||||||
.container
|
|
||||||
%row
|
|
||||||
.col-md-6
|
|
||||||
= image_tag 'eis-logo-et.png'
|
|
||||||
.col-md-6.text-right
|
|
||||||
Version
|
|
||||||
= CURRENT_COMMIT_HASH
|
|
48
app/views/layouts/registrar/base.haml
Normal file
48
app/views/layouts/registrar/base.haml
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
!!! 5
|
||||||
|
%html{lang: I18n.locale.to_s}
|
||||||
|
%head
|
||||||
|
%meta{charset: "utf-8"}/
|
||||||
|
%meta{content: "IE=edge", "http-equiv" => "X-UA-Compatible"}/
|
||||||
|
%meta{content: "width=device-width, initial-scale=1", name: "viewport"}/
|
||||||
|
%meta{content: "Full stack top-level domain (TLD) management.", name: "description"}/
|
||||||
|
%meta{content: "Gitlab LTD", name: "author"}/
|
||||||
|
- if content_for? :head_title
|
||||||
|
= yield :head_title
|
||||||
|
- else
|
||||||
|
%title= t(:registrar_head_title)
|
||||||
|
= csrf_meta_tags
|
||||||
|
= stylesheet_link_tag 'registrar-manifest', media: 'all', 'data-turbolinks-track' => true
|
||||||
|
= javascript_include_tag 'registrar-manifest', 'data-turbolinks-track' => true
|
||||||
|
= favicon_link_tag 'favicon.ico'
|
||||||
|
%body
|
||||||
|
/ Fixed navbar
|
||||||
|
%nav.navbar.navbar-default.navbar-fixed-top
|
||||||
|
.container
|
||||||
|
.navbar-header
|
||||||
|
%button.navbar-toggle.collapsed{"aria-controls" => "navbar", "aria-expanded" => "false", "data-target" => "#navbar", "data-toggle" => "collapse", :type => "button"}
|
||||||
|
%span.sr-only Toggle navigation
|
||||||
|
%span.icon-bar
|
||||||
|
%span.icon-bar
|
||||||
|
%span.icon-bar
|
||||||
|
= link_to main_app.registrar_root_path, class: 'navbar-brand' do
|
||||||
|
= t(:registrar_head_title)
|
||||||
|
- if unstable_env.present?
|
||||||
|
.text-center
|
||||||
|
%small{style: 'color: #0074B3;'}= unstable_env
|
||||||
|
- if current_user
|
||||||
|
= render 'navbar'
|
||||||
|
|
||||||
|
.container
|
||||||
|
= render 'shared/flash'
|
||||||
|
- if depp_controller?
|
||||||
|
= render 'registrar/shared/epp_results'
|
||||||
|
= yield
|
||||||
|
|
||||||
|
%footer.footer
|
||||||
|
.container
|
||||||
|
%row
|
||||||
|
.col-md-6
|
||||||
|
= image_tag 'eis-logo-et.png'
|
||||||
|
.col-md-6.text-right
|
||||||
|
Version
|
||||||
|
= CURRENT_COMMIT_HASH
|
11
app/views/registrar/base/_form_errors.html.erb
Normal file
11
app/views/registrar/base/_form_errors.html.erb
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<% if target.errors.any? %>
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
<p><%= pluralize(target.errors.count, 'error') %> prohibited this <%= target.model_name.human.downcase %> from being saved:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<% target.errors.full_messages.each do |message| %>
|
||||||
|
<li><%= message %></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
28
app/views/registrar/base/_navbar.haml
Normal file
28
app/views/registrar/base/_navbar.haml
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
.navbar-collapse.collapse
|
||||||
|
%ul.nav.navbar-nav.public-nav
|
||||||
|
- if can? :view, Depp::Domain
|
||||||
|
- active_class = %w(registrar/domains registrar/check registrar/renew registrar/tranfer registrar/keyrelays).include?(params[:controller]) ? 'active' :nil
|
||||||
|
%li{class: active_class}= link_to t(:domains), registrar_domains_path
|
||||||
|
|
||||||
|
- if can? :view, Depp::Contact
|
||||||
|
- active_class = ['registrar/contacts'].include?(params[:controller]) ? 'active' :nil
|
||||||
|
%li{class: active_class}= link_to t(:contacts), registrar_contacts_path
|
||||||
|
|
||||||
|
- if can? :show, Invoice
|
||||||
|
- active_class = ['registrar/invoices'].include?(params[:controller]) ? 'active' :nil
|
||||||
|
%li{class: active_class}= link_to t(:billing), registrar_invoices_path
|
||||||
|
|
||||||
|
- if !Rails.env.production? && can?(:manage, :xml_console)
|
||||||
|
- active_class = ['registrar/xml_consoles'].include?(params[:controller]) ? 'active' :nil
|
||||||
|
%li{class: active_class}= link_to t(:xml_console), registrar_xml_console_path
|
||||||
|
|
||||||
|
%ul.nav.navbar-nav.navbar-right
|
||||||
|
%li.dropdown
|
||||||
|
%a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
|
||||||
|
= "#{current_user} (#{current_user.roles.first}) - #{current_user.registrar}"
|
||||||
|
%span.caret
|
||||||
|
%ul.dropdown-menu{role: "menu"}
|
||||||
|
- ApiUser.all_by_identity_code(current_user.identity_code).each do |x|
|
||||||
|
%li= link_to "#{x} (#{x.roles.first}) - #{x.registrar}", "/registrar/switch_user/#{x.id}"
|
||||||
|
- if user_signed_in?
|
||||||
|
%li= link_to t(:log_out_), '/registrar/logout'
|
|
@ -25,7 +25,7 @@
|
||||||
%dt= t(:payment_term)
|
%dt= t(:payment_term)
|
||||||
%dd= t(@invoice.payment_term)
|
%dd= t(@invoice.payment_term)
|
||||||
|
|
||||||
%dt= t(:"invoice no")
|
%dt= t(:invoice_number)
|
||||||
%dd= @invoice.number
|
%dd= @invoice.number
|
||||||
|
|
||||||
- if @invoice.description.present?
|
- if @invoice.description.present?
|
||||||
|
|
|
@ -175,7 +175,7 @@
|
||||||
%dt= t(:payment_term)
|
%dt= t(:payment_term)
|
||||||
%dd= t(@invoice.payment_term)
|
%dd= t(@invoice.payment_term)
|
||||||
|
|
||||||
%dt= t(:"invoice no")
|
%dt= t(:invoice_number)
|
||||||
%dd= @invoice.number
|
%dd= @invoice.number
|
||||||
|
|
||||||
- if @invoice.description.present?
|
- if @invoice.description.present?
|
||||||
|
|
|
@ -666,6 +666,7 @@ en:
|
||||||
amount: 'Amount'
|
amount: 'Amount'
|
||||||
please_pay_the_following_invoice: 'Please pay the following invoice'
|
please_pay_the_following_invoice: 'Please pay the following invoice'
|
||||||
invoice_no: 'Invoice no. %{no}'
|
invoice_no: 'Invoice no. %{no}'
|
||||||
|
invoice_number: Invoice no.
|
||||||
seller: 'Seller'
|
seller: 'Seller'
|
||||||
prepayment: 'Prepayment'
|
prepayment: 'Prepayment'
|
||||||
vat: 'VAT (%{vat_prc}%)'
|
vat: 'VAT (%{vat_prc}%)'
|
||||||
|
@ -934,3 +935,11 @@ en:
|
||||||
cant_match_version: 'Impossible match version with request'
|
cant_match_version: 'Impossible match version with request'
|
||||||
user_not_authenticated: "user not authenticated"
|
user_not_authenticated: "user not authenticated"
|
||||||
actions: Actions
|
actions: Actions
|
||||||
|
|
||||||
|
number:
|
||||||
|
currency:
|
||||||
|
format:
|
||||||
|
format: "%n %u"
|
||||||
|
delimiter: " "
|
||||||
|
precision: 2
|
||||||
|
unit: €
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue