diff --git a/Gemfile b/Gemfile index ef8bd59c9..cf017f8af 100644 --- a/Gemfile +++ b/Gemfile @@ -65,8 +65,7 @@ gem 'deep_cloneable', '~> 2.1.1' gem 'digidoc_client', '~> 0.2.1' # epp + repp client -gem 'depp', github: 'domify/depp', ref: 'bac84dba62baa1b6465523f52df9eb3140f4d1ee' -# gem 'depp', path: '../depp' +gem 'depp', path: 'vendor/gems/depp' gem 'epp', '~> 1.4.2', github: 'gitlabeu/epp' # for importing legacy db diff --git a/Gemfile.lock b/Gemfile.lock index 296ba4823..6e73077e9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,26 +8,6 @@ GIT activesupport (>= 3.0, < 6.0) request_store (~> 1.1.0) -GIT - remote: git://github.com/domify/depp.git - revision: bac84dba62baa1b6465523f52df9eb3140f4d1ee - ref: bac84dba62baa1b6465523f52df9eb3140f4d1ee - specs: - depp (0.0.2) - coderay (>= 1.1.0) - coffee-rails (>= 4.1.0) - countries (>= 0.9.3) - epp-xml (>= 0.10.4) - figaro (>= 1.1.0) - haml-rails (>= 0.9.0) - jquery-rails (>= 4.0.3) - kaminari (~> 0.16.3) - nokogiri (>= 1.6.6.2) - rails (>= 4.2.1) - sass-rails (>= 5.0.0) - uglifier (>= 2.6.1) - uuidtools (>= 2.1.4) - GIT remote: git://github.com/gitlabeu/epp.git revision: 505c3f2739eb1da918e54111aecfb138a822739d @@ -47,6 +27,24 @@ GIT nokogiri (~> 1.6.0) ruby_parser (~> 3.5) +PATH + remote: vendor/gems/depp + specs: + depp (0.0.2) + coderay (>= 1.1.0) + coffee-rails (>= 4.1.0) + countries (>= 0.9.3) + epp-xml (>= 0.10.4) + figaro (>= 1.1.0) + haml-rails (>= 0.9.0) + jquery-rails (>= 4.0.3) + kaminari (~> 0.16.3) + nokogiri (>= 1.6.6.2) + rails (>= 4.2.1) + sass-rails (>= 5.0.0) + uglifier (>= 2.6.1) + uuidtools (>= 2.1.4) + GEM remote: https://rubygems.org/ specs: @@ -147,7 +145,7 @@ GEM coffee-rails (4.1.0) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.0) - coffee-script (2.3.0) + coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.9.1) @@ -182,7 +180,7 @@ GEM builder (~> 3.2) equalizer (0.0.11) erubis (2.7.0) - execjs (2.4.0) + execjs (2.5.0) fabrication (2.12.2) faker (1.3.0) i18n (~> 0.5) @@ -223,7 +221,7 @@ GEM guard-rubocop (1.1.0) guard (~> 2.0) rubocop (~> 0.20) - gyoku (1.3.0) + gyoku (1.3.1) builder (>= 2.1.2) haml (4.0.6) tilt @@ -301,7 +299,7 @@ GEM cliver (~> 0.3.1) multi_json (~> 1.0) websocket-driver (>= 0.2.0) - polyamorous (1.1.0) + polyamorous (1.2.0) activerecord (>= 3.0) powerpack (0.0.9) pry (0.10.1) @@ -405,7 +403,7 @@ GEM virtus (~> 1.0) safe_yaml (1.0.4) sass (3.4.13) - sass-rails (5.0.2) + sass-rails (5.0.1) railties (>= 4.0.0, < 5.0) sass (~> 3.1) sprockets (>= 2.8, < 4.0) @@ -437,7 +435,7 @@ GEM temple (~> 0.6.9) tilt (>= 1.3.3, < 2.1) slop (3.6.0) - spring (1.3.3) + spring (1.3.4) spring-commands-rspec (1.0.4) spring (>= 0.9.1) sprockets (2.12.3) @@ -454,7 +452,7 @@ GEM systemu (2.6.5) temple (0.6.10) terminal-table (1.4.5) - therubyracer (0.12.1) + therubyracer (0.12.2) libv8 (~> 3.16.14.0) ref thor (0.19.1) diff --git a/depp b/depp new file mode 120000 index 000000000..591ef99cd --- /dev/null +++ b/depp @@ -0,0 +1 @@ +vendor/gems/depp \ No newline at end of file diff --git a/vendor/gems/depp/Gemfile b/vendor/gems/depp/Gemfile new file mode 100644 index 000000000..e718cb8a9 --- /dev/null +++ b/vendor/gems/depp/Gemfile @@ -0,0 +1,17 @@ +source 'https://rubygems.org' + +# Declare your gem's dependencies in depp.gemspec. +# Bundler will treat runtime dependencies like base dependencies, and +# development dependencies will be added by default to the :development group. +gemspec + +gem 'epp', '~> 1.4.2', github: 'gitlabeu/epp' + +# Declare any dependencies that are still in development here instead of in +# your gemspec. These might include edge Rails or gems from your path or +# Git. Remember to move these dependencies to your gemspec before releasing +# your gem to rubygems.org. + +# To use a debugger +# gem 'byebug', group: [:development, :test] + diff --git a/vendor/gems/depp/Gemfile.lock b/vendor/gems/depp/Gemfile.lock new file mode 100644 index 000000000..8bd574ea6 --- /dev/null +++ b/vendor/gems/depp/Gemfile.lock @@ -0,0 +1,182 @@ +GIT + remote: git://github.com/gitlabeu/epp.git + revision: 505c3f2739eb1da918e54111aecfb138a822739d + specs: + epp (1.4.2) + hpricot + libxml-ruby + +PATH + remote: . + specs: + depp (0.0.2) + coderay (>= 1.1.0) + coffee-rails (>= 4.1.0) + countries (>= 0.9.3) + epp-xml (>= 0.10.4) + figaro (>= 1.1.0) + haml-rails (>= 0.9.0) + jquery-rails (>= 4.0.3) + nokogiri (>= 1.6.6.2) + rails (>= 4.2.1) + sass-rails (>= 5.0.0) + uglifier (>= 2.6.1) + uuidtools (>= 2.1.4) + +GEM + remote: https://rubygems.org/ + specs: + actionmailer (4.2.1) + actionpack (= 4.2.1) + actionview (= 4.2.1) + activejob (= 4.2.1) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.1) + actionview (= 4.2.1) + activesupport (= 4.2.1) + rack (~> 1.6) + rack-test (~> 0.6.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.1) + actionview (4.2.1) + activesupport (= 4.2.1) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.1) + activejob (4.2.1) + activesupport (= 4.2.1) + globalid (>= 0.3.0) + activemodel (4.2.1) + activesupport (= 4.2.1) + builder (~> 3.1) + activerecord (4.2.1) + activemodel (= 4.2.1) + activesupport (= 4.2.1) + arel (~> 6.0) + activesupport (4.2.1) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + arel (6.0.0) + builder (3.2.2) + coderay (1.1.0) + coffee-rails (4.1.0) + coffee-script (>= 2.2.0) + railties (>= 4.0.0, < 5.0) + coffee-script (2.3.0) + coffee-script-source + execjs + coffee-script-source (1.9.1) + countries (0.11.3) + currencies (~> 0.4.2) + i18n_data (~> 0.6.0) + currencies (0.4.2) + epp-xml (0.10.4) + activesupport (~> 4.1) + builder (~> 3.2) + erubis (2.7.0) + execjs (2.4.0) + figaro (1.1.0) + thor (~> 0.14) + globalid (0.3.3) + activesupport (>= 4.1.0) + haml (4.0.6) + tilt + haml-rails (0.9.0) + actionpack (>= 4.0.1) + activesupport (>= 4.0.1) + haml (>= 4.0.6, < 5.0) + html2haml (>= 1.0.1) + railties (>= 4.0.1) + hike (1.2.3) + hpricot (0.8.6) + html2haml (2.0.0) + erubis (~> 2.7.0) + haml (~> 4.0.0) + nokogiri (~> 1.6.0) + ruby_parser (~> 3.5) + i18n (0.7.0) + i18n_data (0.6.3) + jquery-rails (4.0.3) + rails-dom-testing (~> 1.0) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + json (1.8.2) + libxml-ruby (2.8.0) + loofah (2.0.1) + nokogiri (>= 1.5.9) + mail (2.6.3) + mime-types (>= 1.16, < 3) + mime-types (2.4.3) + mini_portile (0.6.2) + minitest (5.5.1) + multi_json (1.11.0) + nokogiri (1.6.6.2) + mini_portile (~> 0.6.0) + rack (1.6.0) + rack-test (0.6.3) + rack (>= 1.0) + rails (4.2.1) + actionmailer (= 4.2.1) + actionpack (= 4.2.1) + actionview (= 4.2.1) + activejob (= 4.2.1) + activemodel (= 4.2.1) + activerecord (= 4.2.1) + activesupport (= 4.2.1) + bundler (>= 1.3.0, < 2.0) + railties (= 4.2.1) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.6) + activesupport (>= 4.2.0.beta, < 5.0) + nokogiri (~> 1.6.0) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.0.2) + loofah (~> 2.0) + railties (4.2.1) + actionpack (= 4.2.1) + activesupport (= 4.2.1) + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (10.4.2) + ruby_parser (3.6.5) + sexp_processor (~> 4.1) + sass (3.4.13) + sass-rails (5.0.1) + railties (>= 4.0.0, < 5.0) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (~> 1.1) + sexp_processor (4.5.0) + sprockets (2.12.3) + hike (~> 1.2) + multi_json (~> 1.0) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + sprockets-rails (2.2.4) + actionpack (>= 3.0) + activesupport (>= 3.0) + sprockets (>= 2.8, < 4.0) + thor (0.19.1) + thread_safe (0.3.5) + tilt (1.4.1) + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (2.7.1) + execjs (>= 0.3.0) + json (>= 1.8.0) + uuidtools (2.1.5) + +PLATFORMS + ruby + +DEPENDENCIES + depp! + epp (~> 1.4.2)! diff --git a/vendor/gems/depp/MIT-LICENSE b/vendor/gems/depp/MIT-LICENSE new file mode 100644 index 000000000..d8af697eb --- /dev/null +++ b/vendor/gems/depp/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright 2015 Priit Tark + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/gems/depp/README.md b/vendor/gems/depp/README.md new file mode 100644 index 000000000..a52f532cb --- /dev/null +++ b/vendor/gems/depp/README.md @@ -0,0 +1,23 @@ +Depp +==== + +EPP/REPP Rails engine + +Installation +------------ + +Add Depp and epp to your Gemfile: + + gem 'depp', github: 'domify/depp' + gem 'epp', '~> 1.4.2', github: 'gitlabeu/epp' + +Mount Depp to your application routes, example: + + mount Depp::Engine, at: '/depp' + +Depp requires login_url helper, example in routes: + + get '/login', to: 'sessions#login', as: 'login' + +Depp requires current_user helper in controller + diff --git a/vendor/gems/depp/Rakefile b/vendor/gems/depp/Rakefile new file mode 100644 index 000000000..f35deb1c8 --- /dev/null +++ b/vendor/gems/depp/Rakefile @@ -0,0 +1,37 @@ +begin + require 'bundler/setup' +rescue LoadError + puts 'You must `gem install bundler` and `bundle install` to run rake tasks' +end + +require 'rdoc/task' + +RDoc::Task.new(:rdoc) do |rdoc| + rdoc.rdoc_dir = 'rdoc' + rdoc.title = 'Depp' + rdoc.options << '--line-numbers' + rdoc.rdoc_files.include('README.rdoc') + rdoc.rdoc_files.include('lib/**/*.rb') +end + +APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) +load 'rails/tasks/engine.rake' + + +load 'rails/tasks/statistics.rake' + + + +Bundler::GemHelper.install_tasks + +require 'rake/testtask' + +Rake::TestTask.new(:test) do |t| + t.libs << 'lib' + t.libs << 'test' + t.pattern = 'test/**/*_test.rb' + t.verbose = false +end + + +task default: :test diff --git a/vendor/gems/depp/TODO b/vendor/gems/depp/TODO new file mode 100644 index 000000000..8e16354c5 --- /dev/null +++ b/vendor/gems/depp/TODO @@ -0,0 +1 @@ +* add config/application.yml default with rake task diff --git a/vendor/gems/depp/app/assets/images/depp/.keep b/vendor/gems/depp/app/assets/images/depp/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/gems/depp/app/assets/images/depp/bg-alpha.png b/vendor/gems/depp/app/assets/images/depp/bg-alpha.png new file mode 100644 index 000000000..c3f1bf12d Binary files /dev/null and b/vendor/gems/depp/app/assets/images/depp/bg-alpha.png differ diff --git a/vendor/gems/depp/app/assets/images/depp/bg-development.png b/vendor/gems/depp/app/assets/images/depp/bg-development.png new file mode 100644 index 000000000..1dd9fb7b5 Binary files /dev/null and b/vendor/gems/depp/app/assets/images/depp/bg-development.png differ diff --git a/vendor/gems/depp/app/assets/images/depp/bg-staging.png b/vendor/gems/depp/app/assets/images/depp/bg-staging.png new file mode 100644 index 000000000..fcb408e19 Binary files /dev/null and b/vendor/gems/depp/app/assets/images/depp/bg-staging.png differ diff --git a/vendor/gems/depp/app/assets/images/depp/favicon.ico b/vendor/gems/depp/app/assets/images/depp/favicon.ico new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/gems/depp/app/assets/javascripts/depp/application.coffee b/vendor/gems/depp/app/assets/javascripts/depp/application.coffee new file mode 100644 index 000000000..1c8eddbdd --- /dev/null +++ b/vendor/gems/depp/app/assets/javascripts/depp/application.coffee @@ -0,0 +1,31 @@ +#= require jquery +#= require jquery_ujs +#= require turbolinks +#= require bootstrap-sprockets +#= require jquery.nested_attributes + +$(document).on 'ready page:load', -> + $('.js-contact-form').on 'restoreDefault', (e) -> + form = $(e.target) + form.find('.js-ident-tip').hide() + switch $('.js-ident-country-code option:selected').val() + when 'EE' + $('.js-ident-type').find('option[value=birthday]').prop('disabled', true) + else + $('.js-ident-type').find('option[value=birthday]').prop('disabled', false) + + $('.js-ident-country-code').change (e) -> + form = $('.js-contact-form') + form.trigger 'restoreDefault' + + $('.js-ident-type').change (e) -> + form = $('.js-contact-form') + form.trigger 'restoreDefault' + + switch e.target.value + # when 'bic' + # when 'priv' + when 'birthday' + form.find('.js-ident-tip').show() + + $('.js-contact-form').trigger('restoreDefault') diff --git a/vendor/gems/depp/app/assets/stylesheets/depp/application.scss b/vendor/gems/depp/app/assets/stylesheets/depp/application.scss new file mode 100644 index 000000000..5ac46af24 --- /dev/null +++ b/vendor/gems/depp/app/assets/stylesheets/depp/application.scss @@ -0,0 +1,3 @@ +//= require './custom-boostrap' +//= require './general' +//= require './overwrites' diff --git a/vendor/gems/depp/app/assets/stylesheets/depp/custom-boostrap.scss b/vendor/gems/depp/app/assets/stylesheets/depp/custom-boostrap.scss new file mode 100644 index 000000000..d2c776d1f --- /dev/null +++ b/vendor/gems/depp/app/assets/stylesheets/depp/custom-boostrap.scss @@ -0,0 +1,5 @@ +$font-family-sans-serif: 'EtelkaLightProRegular', Arial, Helvetica, sans-serif; +$font-family-serif: 'EtelkaLightProBold', Georgia, "Times New Roman", Times, serif; + +@import "bootstrap-sprockets"; +@import "bootstrap"; diff --git a/vendor/gems/depp/app/assets/stylesheets/depp/general.sass b/vendor/gems/depp/app/assets/stylesheets/depp/general.sass new file mode 100644 index 000000000..59768c4f9 --- /dev/null +++ b/vendor/gems/depp/app/assets/stylesheets/depp/general.sass @@ -0,0 +1,226 @@ +html + font-size: 100% + overflow-y: scroll + -webkit-text-size-adjust: 100% + -ms-text-size-adjust: 100% + +body + background: url(image_path('bg.jpg')) + +h1 + font-size: 26px + margin-bottom: 16px + +a + color: #008fd7 + text-decoration: none + +a:hover, +a:active + color: #008fd7 + outline: 0 + +h1, h2, h3, h4, h1 a, h2 a, h3 a, h4 a + color: #272f34 + text-decoration: none + font-weight: normal + font-family: 'EtelkaLightProBold' + +h1 + font-size: 22px + text-transform: uppercase + +body, +button, +input, +select, +textarea + font-family: 'EtelkaLightProRegular', Arial, Helvetica, sans-serif + color: #5d6064 + font-size: 13px + +abbr[title] + border-bottom: 1px dotted + +b, +strong + font-weight: normal + font-family: 'EtelkaLightProBold' + +blockquote + margin: 1em 40px + +dfn + font-style: italic + +mark + background: #ff0 + color: #000 + +pre, +code, +kbd, +samp + font-family: monospace, serif + _font-family: 'courier new', monospace + font-size: 1em + +pre + white-space: pre + white-space: pre-wrap + word-wrap: break-word + +q + quotes: none + +q:before, +q:after + content: '' + content: none + +small + font-size: 75% + +sub, +sup + font-size: 75% + line-height: 0 + position: relative + vertical-align: baseline + +sup + top: -0.5em + +sub + bottom: -0.25em + +.title-row + margin-bottom: 22px + +.app-nav + padding-top: 7px + +.general-tab + padding-top: 30px + padding-right: 20px + border-top: 0px + +.container + border-radius: 3px + width: 860px +body > .container + background: #F8F8F8 + margin-bottom: 50px + min-height: 600px + padding: 30px 30px 56px 30px + +.container.version + background: transparent + margin-top: -116px + min-height: 0px + text-align: right + font-size: 12px + color: gray + +.container.subnav + background: transparent + min-height: 0 + padding: 0 46px 0 0 + margin-bottom: 0 + ul.nav + li a + background: #E7E7E7 + height: 33px + line-height: 12px + color: gray + &:hover + color: #333 + li.active a + background: #F8F8F8 + font-weight: bold + color: #333 + + +.subactions + h4 + margin-bottom: 20px + margin-top: 10px + min-height: 600px + +.sidebar + min-height: 400px + +.content + margin-right: 240px + margin-left: 0 + +h4 + margin: 0 + +.top-actions + margin-top: 12px + margin-bottom: 16px + float: right + +.navbar-brand + line-height: 12px + padding-top: 20px + padding-bottom: 5px + +.navbar-brand small + display: block + font-size: 10px + +.footer + color: #777 + padding-top: 70px + padding-bottom: 10px + font-size: 10px + +.domify + td + vertical-align: middle !important + +body.login + padding-top: 40px + padding-bottom: 40px + + .form-signin + .form-signin-heading, + .form-signin + .checkbox + margin-bottom: 10px + + .form-signin + max-width: 330px + padding: 15px + margin: 0 auto + + input[type="text"] + margin-bottom: 8px + + input[type="password"] + margin-bottom: 10px + + .btn-lg + margin-top: 28px + + .checkbox + font-weight: normal + + .form-control + position: relative + height: auto + -webkit-box-sizing: border-box + -moz-box-sizing: border-box + box-sizing: border-box + padding: 10px + font-size: 16px + + .form-control:focus + z-index: 2 + +// fix label position for medium screen +@media (min-width: 768px) and (max-width: 991px) + .form-horizontal .control-label + text-align: left diff --git a/vendor/gems/depp/app/assets/stylesheets/depp/overwrites.sass b/vendor/gems/depp/app/assets/stylesheets/depp/overwrites.sass new file mode 100644 index 000000000..ec4308d11 --- /dev/null +++ b/vendor/gems/depp/app/assets/stylesheets/depp/overwrites.sass @@ -0,0 +1 @@ +// Overwrite this file at your application app/assets/stylesheets/depp/overwrite.sass diff --git a/vendor/gems/depp/app/controllers/depp/application_controller.rb b/vendor/gems/depp/app/controllers/depp/application_controller.rb new file mode 100644 index 000000000..9a30231fc --- /dev/null +++ b/vendor/gems/depp/app/controllers/depp/application_controller.rb @@ -0,0 +1,54 @@ +module Depp + # class ApplicationController < ::ApplicationController + class ApplicationController < ActionController::Base + include CurrentUserHelper + include ApplicationHelper + + # Prevent CSRF attacks by raising an exception. + # For APIs, you may want to use :null_session instead. + protect_from_forgery with: :exception + + helper_method :depp_current_user + + rescue_from(Errno::ECONNRESET, Errno::ECONNREFUSED) do |exception| + redirect_to login_url, alert: t(:no_connection_to_registry) + end + + before_action :authenticate_user + def authenticate_user + if ENV['session_timeout'] + redirect_to main_app.login_url and return unless depp_current_user && session[:last_seen] + + if (session[:last_seen].to_i + ENV['session_timeout'].to_i) < Time.now.to_i + session_timeout + else + session[:last_seen] = Time.now.to_i + end + else + redirect_to main_app.login_url and return unless depp_current_user + end + end + + def session_timeout + reset_session + flash[:alert] = t('your_session_has_timed_out') + redirect_to main_app.login_url and return + end + + def depp_current_user + return nil unless current_user + @depp_current_user ||= Depp::User.new( + tag: current_user.username, + password: current_user.password + ) + end + + def response_ok? + @data.css('result').each do |x| + success_codes = %(1000, 1300, 1301) + return false unless success_codes.include?(x['code']) + end + true + end + end +end diff --git a/vendor/gems/depp/app/controllers/depp/contacts_controller.rb b/vendor/gems/depp/app/controllers/depp/contacts_controller.rb new file mode 100644 index 000000000..b4444fde3 --- /dev/null +++ b/vendor/gems/depp/app/controllers/depp/contacts_controller.rb @@ -0,0 +1,84 @@ +module Depp + class ContactsController < ApplicationController + before_action :init_epp_contact + + def index + limit, offset = pagination_details + + res = depp_current_user.repp_request('contacts', { details: true, limit: limit, offset: offset }) + flash.now[:epp_results] = [{ 'code' => res.code, 'msg' => res.message }] + @response = res.parsed_body.with_indifferent_access if res.code == '200' + @contacts = @response ? @response[:contacts] : [] + + @paginatable_array = Kaminari.paginate_array( + [], total_count: @response[:total_number_of_records] + ).page(params[:page]).per(limit) + end + + def new + @contact = Depp::Contact.new + end + + def show + @contact = Depp::Contact.find_by_id(params[:id]) + end + + def edit + @contact = Depp::Contact.find_by_id(params[:id]) + end + + def create + @contact = Depp::Contact.new(params[:contact]) + + if @contact.save + redirect_to contact_url(@contact.id) + else + render 'new' + end + end + + def update + @contact = Depp::Contact.new(params[:contact]) + + if @contact.update_attributes(params[:contact]) + redirect_to contact_url(@contact.id) + else + render 'edit' + end + end + + def delete + @contact = Depp::Contact.find_by_id(params[:id]) + end + + def destroy + @contact = Depp::Contact.new(params[:contact]) + + if @contact.delete + redirect_to contacts_url, notice: t(:destroyed) + else + render 'delete' + end + end + + def check + @ids = params[:contacts] + # if @ids + # @contacts = [] + # @ids.split(',').each do |id| + # @contacts << id.strip + # end + # end + return unless @ids + + @data = @contact.check(@ids) + @contacts = Depp::Contact.construct_check_hash_from_data(@data) + end + + private + + def init_epp_contact + Depp::Contact.user = depp_current_user + end + end +end diff --git a/vendor/gems/depp/app/controllers/depp/domains_controller.rb b/vendor/gems/depp/app/controllers/depp/domains_controller.rb new file mode 100644 index 000000000..6116fc9ce --- /dev/null +++ b/vendor/gems/depp/app/controllers/depp/domains_controller.rb @@ -0,0 +1,107 @@ +module Depp + class DomainsController < ApplicationController + before_action :init_domain, except: :new + + def index + limit, offset = pagination_details + + res = depp_current_user.repp_request('domains', { details: true, limit: limit, offset: offset }) + flash.now[:epp_results] = [{ 'code' => res.code, 'msg' => res.message }] + @response = res.parsed_body.with_indifferent_access if res.code == '200' + @contacts = @response ? @response[:contacts] : [] + + @paginatable_array = Kaminari.paginate_array( + [], total_count: @response[:total_number_of_records] + ).page(params[:page]).per(limit) + end + + def info + @data = @domain.info(params[:domain_name]) if params[:domain_name] + if response_ok? + render 'info' + else + flash[:alert] = t('domain_not_found') + redirect_to domains_path and return + end + end + + def check + if params[:domain_name] + @data = @domain.check(params[:domain_name]) + render 'check_index' and return unless response_ok? + else + render 'check_index' + end + end + + def new + @domain_params = Depp::Domain.default_params + end + + def create + @domain_params = params[:domain] + @data = @domain.create(@domain_params) + + if response_ok? + redirect_to info_domains_path(domain_name: @domain_params[:name]) + else + render 'new' + end + end + + def edit + @data = @domain.info(params[:domain_name]) + @domain_params = Depp::Domain.construct_params_from_server_data(@data) + end + + def update + @domain_params = params[:domain] + @data = @domain.update(@domain_params) + + if response_ok? + redirect_to info_domains_path(domain_name: @domain_params[:name]) + else + params[:domain_name] = @domain_params[:name] + render 'new' + end + end + + def delete; end + + def destroy + @data = @domain.delete(params[:domain]) + @results = @data.css('result') + if response_ok? + params[:domain_name] = nil + render 'info_index' + else + params[:domain_name] = params[:domain][:name] + render 'delete' + end + end + + def renew + if params[:domain_name] && params[:cur_exp_date] + @data = @domain.renew(params) + render 'renew_index' and return unless response_ok? + else + render 'renew_index' + end + end + + def transfer + if params[:domain_name] + @data = @domain.transfer(params) + render 'transfer_index' and return unless response_ok? + else + render 'transfer_index' + end + end + + private + + def init_domain + @domain = Depp::Domain.new(current_user: depp_current_user) + end + end +end diff --git a/vendor/gems/depp/app/controllers/depp/keyrelays_controller.rb b/vendor/gems/depp/app/controllers/depp/keyrelays_controller.rb new file mode 100644 index 000000000..0596e1444 --- /dev/null +++ b/vendor/gems/depp/app/controllers/depp/keyrelays_controller.rb @@ -0,0 +1,17 @@ +module Depp + class KeyrelaysController < ApplicationController + def show; end + + def create + keyrelay = Depp::Keyrelay.new(current_user: depp_current_user) + @data = keyrelay.keyrelay(params) + + if response_ok? + flash[:epp_results] = [{ 'code' => '1000', 'msg' => 'Command completed successfully' }] + redirect_to keyrelay_path + else + render 'show' + end + end + end +end diff --git a/vendor/gems/depp/app/controllers/depp/polls_controller.rb b/vendor/gems/depp/app/controllers/depp/polls_controller.rb new file mode 100644 index 000000000..16d8918e5 --- /dev/null +++ b/vendor/gems/depp/app/controllers/depp/polls_controller.rb @@ -0,0 +1,50 @@ +module Depp + class PollsController < ApplicationController + before_action :init_epp_xml + + def show + @data = depp_current_user.request(@ex.poll) + end + + def destroy + @data = depp_current_user.request(@ex.poll(poll: { + value: '', attrs: { op: 'ack', msgID: params[:id] } + })) + + @results = @data.css('result') + + @data = depp_current_user.request(@ex.poll) + render 'show' + end + + def confirm_keyrelay + domain_params = params[:domain] + @data = @domain.confirm_keyrelay(domain_params) + + if response_ok? + redirect_to info_domains_path(domain_name: domain_params[:name]) + else + @results = @data.css('result') + @data = depp_current_user.request(@ex.poll) + render 'show' + end + end + + def confirm_transfer + domain_params = params[:domain] + @data = @domain.confirm_transfer(domain_params) + + @results = @data.css('result') + @data = depp_current_user.request(@ex.poll) + + render 'show' + end + + private + + def init_epp_xml + @ex = EppXml::Session.new(cl_trid_prefix: depp_current_user.tag) + @domain = Depp::Domain.new(current_user: depp_current_user) + end + end +end diff --git a/vendor/gems/depp/app/controllers/depp/xml_consoles_controller.rb b/vendor/gems/depp/app/controllers/depp/xml_consoles_controller.rb new file mode 100644 index 000000000..ae417695e --- /dev/null +++ b/vendor/gems/depp/app/controllers/depp/xml_consoles_controller.rb @@ -0,0 +1,23 @@ +module Depp + class XmlConsolesController < ApplicationController + def show; end + + def create + begin + @result = depp_current_user.server.request(params[:payload]) + rescue + @result = 'CONNECTION ERROR - Is the EPP server running?' + end + render :show + end + + def load_xml + # binding.pry + cl_trid = "#{depp_current_user.tag}-#{Time.now.to_i}" + xml_dir_path = Depp::Engine.root + 'app/views/depp/xml_consoles/epp_requests' + xml = File.read("#{xml_dir_path}/#{params[:obj]}/#{params[:epp_action]}.xml") + xml.gsub!('ABC-12345', "#{cl_trid}") + render text: xml + end + end +end diff --git a/vendor/gems/depp/app/helpers/depp/application_helper.rb b/vendor/gems/depp/app/helpers/depp/application_helper.rb new file mode 100644 index 000000000..7c325f63f --- /dev/null +++ b/vendor/gems/depp/app/helpers/depp/application_helper.rb @@ -0,0 +1,29 @@ +module Depp + module ApplicationHelper + def unstable_env + return nil if Rails.env.production? + Rails.env + end + + def env_style + return '' if unstable_env.nil? + "background-image: url(#{image_path("depp/bg-#{unstable_env}.png")});" + end + + def ident_for(contact) + case contact.ident_type + when 'birthday' + "#{contact.ident} [#{contact.ident_type}]" + else + "#{contact.ident} [#{contact.ident_country_code} #{contact.ident_type}]" + end + end + + def pagination_details + params[:page] ||= 1 + limit = ENV['depp_records_on_page'] || DEPP_RECORDS_ON_PAGE + offset = ((params[:page].to_i - 1) * limit.to_i) + [limit, offset] + end + end +end diff --git a/vendor/gems/depp/app/models/depp/concerns/.keep b/vendor/gems/depp/app/models/depp/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/gems/depp/app/models/depp/contact.rb b/vendor/gems/depp/app/models/depp/contact.rb new file mode 100644 index 000000000..ebfac40f1 --- /dev/null +++ b/vendor/gems/depp/app/models/depp/contact.rb @@ -0,0 +1,293 @@ +module Depp + class Contact + include ActiveModel::Model + + attr_accessor :id, :name, :email, :phone, :org_name, + :ident, :ident_type, :ident_country_code, + :street, :city, :zip, :state, :country_code, + :password, :legal_document, :statuses, :code + + DISABLED = 'Disabled' + DISCLOSURE_TYPES = [DISABLED, '1', '0'] + TYPES = %w( bic priv birthday ) + SELECTION_TYPES = [ + [ 'Business code', 'bic' ], + [ 'Personal identification code', 'priv' ], + [ 'Birthday', 'birthday' ] + ] + + class << self + def new_from_params(params) + new( + id: params[:code], + code: params[:code], + email: params[:email], + phone: params[:phone], + ident: params[:ident], + ident_type: params[:ident_type], + ident_country_code: params[:ident_country_code], + + # postalInfo + name: params[:name], + org_name: params[:org_name], + + # address + street: params[:street], + city: params[:city], + zip: params[:zip], + state: params[:state], + country_code: params[:country_code], + ) + end + + def find_by_id(id) + data = info_xml(id) + + res = data.css('epp response resData infData') + new( + id: res.css('id').text, + code: res.css('id').text, + email: res.css('email').text, + phone: res.css('voice').text, + ident: res.css('ident').text, + ident_type: res.css('ident').first.try(:attributes).try(:[], 'type').try(:value), + ident_country_code: res.css('ident').first.try(:attributes).try(:[], 'cc').try(:value), + + # postalInfo + name: res.css('postalInfo name').text, + org_name: res.css('postalInfo org').text, + + # address + street: res.css('postalInfo addr street').text, + city: res.css('postalInfo addr city').text, + zip: res.css('postalInfo addr pc').text, + state: res.css('postalInfo addr sp').text, + country_code: res.css('postalInfo addr cc').text, + + # authInfo + password: res.css('authInfo pw').text, + + # statuses + statuses: data.css('status').map { |s| [s['s'], s.text] } + ) + end + + def user=(user) + @user = user + @epp_xml = EppXml::Contact.new(cl_trid_prefix: user.tag) + end + + def epp_xml + @epp_xml + end + + def user + @user + end + + def info_xml(id, password = nil) + xml = epp_xml.info( + id: { value: id }, + authInfo: { pw: { value: password } } + ) + user.request(xml) + end + + def construct_check_hash_from_data(data) + res = data.css('epp response resData chkData cd') + @contacts = [] + res.each do |_r| + id = res.css('id').try(:text) + reason = res.css('reason').present? ? res.css('reason').text : I18n.t(:available) + @contacts << { id: id, reason: reason } + end + @contacts + end + + def contact_id_from_xml(data) + id = data.css('epp response resData creData id').text + id.blank? ? nil : id + end + + def construct_create_disclosure_xml(cph, flag) + xml = { disclose: {} } + cph.each do |k, v| + xml[:disclose][k] = {} + xml[:disclose][k][:value] = v + end + xml[:disclose][:attrs] = {} + xml[:disclose][:attrs][:flag] = flag + xml.with_indifferent_access + end + + def extract_disclosure_hash(cpd) # cpd = contact_params[:disclose] + return {} unless cpd + cpd = cpd.delete_if { |k, v| v if v != '1' && k == 'flag' } + cpd + end + + def extract_info_disclosure(data) + hash = {} + data.css('disclose').each do |d| + flag = d.attributes['flag'].value + next unless flag + hash[flag] = {} + d.children.each do |c| + hash[flag][c.name] = flag if %w( name email fax voice addr org_name ).include?(c.name) + end + end + hash + end + end + + def initialize(attributes={}) + super + self.country_code = 'EE' if country_code.blank? + self.ident_type = 'bic' if ident_type.blank? + self.ident_country_code = 'EE' if ident_country_code.blank? + end + + def save + create_xml = Depp::Contact.epp_xml.create( + { + id: { value: code }, + email: { value: email }, + voice: { value: phone }, + postalInfo: { + name: { value: name }, + org: { value: org_name }, + addr: { + street: { value: street }, + city: { value: city }, + pc: { value: zip }, + sp: { value: state }, + cc: { value: country_code } + } + } + }, + extension_xml + ) + data = Depp::Contact.user.request(create_xml) + self.id = data.css('id').text + handle_errors(data) + end + + def update_attributes(params) + self.ident_country_code = params[:ident_country_code] + self.ident_type = params[:ident_type] + self.ident = params[:ident] + + self.name = params[:name] + self.email = params[:email] + self.phone = params[:phone] + + self.org_name = params[:org_name] + self.street = params[:street] + self.city = params[:city] + self.zip = params[:zip] + self.state = params[:state] + self.country_code = params[:country_code] + + update_xml = Depp::Contact.epp_xml.update( + { + id: { value: id }, + chg: { + voice: { value: phone }, + email: { value: email }, + postalInfo: { + name: { value: name }, + org: { value: org_name }, + addr: { + street: { value: street }, + city: { value: city }, + pc: { value: zip }, + sp: { value: state }, + cc: { value: country_code } + } + } + }, + authInfo: { + pw: { value: password } + } + }, + extension_xml + ) + data = Depp::Contact.user.request(update_xml) + handle_errors(data) + end + + def delete + delete_xml = Contact.epp_xml.delete( + { + id: { value: id }, + authInfo: { pw: { value: password } } + }, + extension_xml + ) + data = Depp::Contact.user.request(delete_xml) + handle_errors(data) + end + + def extension_xml + ident_xml.merge(legal_document_xml) + end + + def ident_xml + { + _anonymus: [ + ident: { value: ident, attrs: { type: ident_type, cc: ident_country_code } } + ] + } + end + + def legal_document_xml + return {} if legal_document.blank? + + type = legal_document.original_filename.split('.').last.downcase + { + _anonymus: [ + legalDocument: { value: Base64.encode64(legal_document.read), attrs: { type: type } } + ] + } + end + + def check(id) + xml = epp_xml.check(id: { value: id }) + current_user.request(xml) + end + + def country_name + Country.new(country_code) + end + + def bic? + ident_type == 'bic' + end + + def priv? + ident_type == 'priv' + end + + def persisted? + id.present? + end + + def handle_errors(data) + data.css('result').each do |x| + success_codes = %(1000, 1300, 1301) + + unless success_codes.include?(x['code']) + message = "#{x.css('msg').text} #{x.css('value').text}" + + attr = message.split('[').last.strip.sub(']','') if message.include?('[') + + attr = :base if attr.nil? + attr = 'phone' if attr == 'voice' + + errors.add(attr, message) + end + end + errors.blank? + end + end +end diff --git a/vendor/gems/depp/app/models/depp/dnskey.rb b/vendor/gems/depp/app/models/depp/dnskey.rb new file mode 100644 index 000000000..895dca74b --- /dev/null +++ b/vendor/gems/depp/app/models/depp/dnskey.rb @@ -0,0 +1,25 @@ +module Depp + class Dnskey + FLAGS = [ + ['0 - not for DNSSEC validation', 0], + ['256 - ZSK', 256], + ['257 - KSK', 257] + ] + + ALGORITHMS = [ + ['3 - DSA/SHA-1', 3], + ['5 - RSA/SHA-1', 5], + ['6 - DSA-NSEC3-SHA1', 6], + ['7 - RSASHA1-NSEC3-SHA1', 7], + ['8 - RSA/SHA-256', 8], + ['252 - Reserved for Indirect Keys', 252], + ['253 - Private algorithm', 253], + ['254 - Private algorithm OID', 254], + ['255 - Reserved', 255] + ] + + PROTOCOLS = [3] + + DS_DIGEST_TYPES = [1, 2] + end +end diff --git a/vendor/gems/depp/app/models/depp/domain.rb b/vendor/gems/depp/app/models/depp/domain.rb new file mode 100644 index 000000000..7034ebaee --- /dev/null +++ b/vendor/gems/depp/app/models/depp/domain.rb @@ -0,0 +1,300 @@ +module Depp + class Domain + include ActiveModel::Conversion + extend ActiveModel::Naming + + attr_accessor :name, :current_user, :epp_xml + + DOMAIN_STATUSES = %w( + clientDeleteProhibited + clientHold + clientRenewProhibited + clientTransferProhibited + clientUpdateProhibited + ) + + def initialize(args = {}) + self.current_user = args[:current_user] + self.epp_xml = EppXml::Domain.new(cl_trid_prefix: current_user.tag) + end + + def info(domain_name) + xml = epp_xml.info(name: { value: domain_name }) + current_user.request(xml) + end + + def check(domain_name) + xml = epp_xml.check( + _anonymus: [ + name: { value: domain_name } + ] + ) + current_user.request(xml) + end + + def create(domain_params) + xml = epp_xml.create({ + name: { value: domain_params[:name] }, + registrant: { value: domain_params[:registrant] }, + period: { value: domain_params[:period], attrs: { unit: domain_params[:period_unit] } }, + ns: Domain.create_nameservers_hash(domain_params), + _anonymus: Domain.create_contacts_hash(domain_params) + }, { + _anonymus: Domain.create_dnskeys_hash(domain_params) + }, Domain.construct_custom_params_hash(domain_params)) + + current_user.request(xml) + end + + def update(domain_params) + data = current_user.request(epp_xml.info(name: { value: domain_params[:name] })) + old_domain_params = Depp::Domain.construct_params_from_server_data(data) + + xml = epp_xml.update( + Depp::Domain.construct_edit_hash(domain_params, old_domain_params), + Depp::Domain.construct_ext_edit_hash(domain_params, old_domain_params), + Depp::Domain.construct_custom_params_hash(domain_params) + ) + + current_user.request(xml) + end + + def delete(domain_params) + xml = epp_xml.delete({ + name: { value: domain_params[:name] } + }, Depp::Domain.construct_custom_params_hash(domain_params)) + + current_user.request(xml) + end + + def renew(params) + current_user.request(epp_xml.renew( + name: { value: params[:domain_name] }, + curExpDate: { value: params[:cur_exp_date] }, + period: { value: params[:period], attrs: { unit: params[:period_unit] } } + )) + end + + def transfer(params) + op = params[:query] ? 'query' : nil + op = params[:approve] ? 'approve' : op + op = params[:reject] ? 'reject' : op + + current_user.request(epp_xml.transfer({ + name: { value: params[:domain_name] }, + authInfo: { pw: { value: params[:password] } } + }, op, Domain.construct_custom_params_hash(params))) + end + + def confirm_keyrelay(domain_params) + xml = epp_xml.update({ + name: { value: domain_params[:name] } + }, { + add: Domain.create_dnskeys_hash(domain_params) + }) + + current_user.request(xml) + end + + def confirm_transfer(domain_params) + data = current_user.request(epp_xml.info(name: { value: domain_params[:name] })) + pw = data.css('pw').text + + xml = epp_xml.transfer({ + name: { value: domain_params[:name] }, + authInfo: { pw: { value: pw } } + }, 'approve') + + current_user.request(xml) + end + + class << self + def default_params + ret = {} + + ret[:contacts_attributes] ||= {} + ENV['default_admin_contacts_count'].to_i.times do |i| + ret[:contacts_attributes][i] = { code: '', type: 'admin' } + end + + ret[:nameservers_attributes] ||= {} + ENV['default_nameservers_count'].to_i.times do |i| + ret[:nameservers_attributes][i] = {} + end + + ret[:dnskeys_attributes] ||= { 0 => {} } + ret[:statuses_attributes] ||= { 0 => {} } + ret.with_indifferent_access + end + + def construct_params_from_server_data(data) # rubocop:disable Metrics/MethodLength + ret = default_params + ret[:name] = data.css('name').text + ret[:registrant] = data.css('registrant').text + + data.css('contact').each_with_index do |x, i| + ret[:contacts_attributes][i] = { code: x.text, type: x['type'] } + end + + data.css('hostAttr').each_with_index do |x, i| + ret[:nameservers_attributes][i] = { + hostname: x.css('hostName').text, + ipv4: x.css('hostAddr[ip="v4"]').text, + ipv6: x.css('hostAddr[ip="v6"]').text + } + end + + data.css('dsData').each_with_index do |x, i| + ds = { + ds_key_tag: x.css('keyTag').first.try(:text), + ds_alg: x.css('alg').first.try(:text), + ds_digest_type: x.css('digestType').first.try(:text), + ds_digest: x.css('digest').first.try(:text) + } + + kd = x.css('keyData').first + ds.merge!({ + flags: kd.css('flags').first.try(:text), + protocol: kd.css('protocol').first.try(:text), + alg: kd.css('alg').first.try(:text), + public_key: kd.css('pubKey').first.try(:text) + }) if kd + + ret[:dnskeys_attributes][i] = ds + end + + data.css('status').each_with_index do |x, i| + next unless DOMAIN_STATUSES.include?(x['s']) + ret[:statuses_attributes][i] = { + code: x['s'], + description: x.text + } + end + + ret + end + + def construct_custom_params_hash(domain_params) + custom_params = {} + if domain_params[:legal_document].present? + type = domain_params[:legal_document].original_filename.split('.').last.downcase + custom_params = { + _anonymus: [ + legalDocument: { value: Base64.encode64(domain_params[:legal_document].read), attrs: { type: type } } + ] + } + end + + custom_params + end + + def construct_edit_hash(domain_params, old_domain_params) + contacts = create_contacts_hash(domain_params) - create_contacts_hash(old_domain_params) + statuses = create_statuses_hash(domain_params) - create_statuses_hash(old_domain_params) + add_anon = contacts + statuses + + contacts = create_contacts_hash(old_domain_params) - create_contacts_hash(domain_params) + statuses = create_statuses_hash(old_domain_params) - create_statuses_hash(domain_params) + rem_anon = contacts + statuses + + if domain_params[:registrant] != old_domain_params[:registrant] + chg = [{ registrant: { value: domain_params[:registrant] } }] + end + + { + name: { value: domain_params[:name] }, + chg: chg, + add: [ + { ns: create_nameservers_hash(domain_params) - create_nameservers_hash(old_domain_params) }, + { _anonymus: add_anon } + ], + rem: [ + { ns: create_nameservers_hash(old_domain_params) - create_nameservers_hash(domain_params) }, + { _anonymus: rem_anon } + ] + } + end + + def construct_ext_edit_hash(domain_params, old_domain_params) + { + add: create_dnskeys_hash(domain_params) - create_dnskeys_hash(old_domain_params), + rem: create_dnskeys_hash(old_domain_params) - create_dnskeys_hash(domain_params) + } + end + + def create_nameservers_hash(domain_params) + ret = [] + domain_params[:nameservers_attributes].each do |_k, v| + next if v['hostname'].blank? + + host_attr = [] + host_attr << { hostName: { value: v['hostname'] } } + host_attr << { hostAddr: { value: v['ipv4'], attrs: { ip: 'v4' } } } if v['ipv4'].present? + host_attr << { hostAddr: { value: v['ipv6'], attrs: { ip: 'v6' } } } if v['ipv6'].present? + + ret << { hostAttr: host_attr } + end + + ret + end + + def create_contacts_hash(domain_params) + ret = [] + domain_params[:contacts_attributes].each do |_k, v| + next if v['code'].blank? + ret << { + contact: { value: v['code'], attrs: { type: v['type'] } } + } + end + + ret + end + + def create_dnskeys_hash(domain_params) + ret = [] + domain_params[:dnskeys_attributes].each do |_k, v| + if v['ds_key_tag'].blank? + kd = create_key_data_hash(v) + ret << { + keyData: kd + } if kd + else + ret << { + dsData: [ + keyTag: { value: v['ds_key_tag'] }, + alg: { value: v['ds_alg'] }, + digestType: { value: v['ds_digest_type'] }, + digest: { value: v['ds_digest'] }, + keyData: create_key_data_hash(v) + ] + } + end + end + + ret + end + + def create_key_data_hash(key_data_params) + return nil if key_data_params['public_key'].blank? + { + flags: { value: key_data_params['flags'] }, + protocol: { value: key_data_params['protocol'] }, + alg: { value: key_data_params['alg'] }, + pubKey: { value: key_data_params['public_key'] } + } + end + + def create_statuses_hash(domain_params) + ret = [] + domain_params[:statuses_attributes].each do |_k, v| + next if v['code'].blank? + ret << { + status: { value: v['description'], attrs: { s: v['code'] } } + } + end + + ret + end + end + end +end diff --git a/vendor/gems/depp/app/models/depp/keyrelay.rb b/vendor/gems/depp/app/models/depp/keyrelay.rb new file mode 100644 index 000000000..0d08d4add --- /dev/null +++ b/vendor/gems/depp/app/models/depp/keyrelay.rb @@ -0,0 +1,41 @@ +module Depp + class Keyrelay + attr_accessor :current_user, :epp_xml + + def initialize(args = {}) + self.current_user = args[:current_user] + self.epp_xml = EppXml::Keyrelay.new(cl_trid_prefix: current_user.tag) + end + + def keyrelay(params) # rubocop:disable Metrics/MethodLength + custom_params = {} + if params[:legal_document].present? + type = params[:legal_document].original_filename.split('.').last.downcase + custom_params = { + _anonymus: [ + legalDocument: { value: Base64.encode64(params[:legal_document].read), attrs: { type: type } } + ] + } + end + + xml = epp_xml.keyrelay({ + name: { value: params['domain_name'] }, + keyData: { + flags: { value: params['key_data_flags'] }, + protocol: { value: params['key_data_protocol'] }, + alg: { value: params['key_data_alg'] }, + pubKey: { value: params['key_data_public_key'] } + }, + authInfo: { + pw: { value: params['password'] } + }, + expiry: { + relative: { value: params['expiry_relative'] }, + absolute: { value: params['expiry_absolute'] } + } + }, custom_params) + + current_user.request(xml) + end + end +end diff --git a/vendor/gems/depp/app/models/depp/user.rb b/vendor/gems/depp/app/models/depp/user.rb new file mode 100644 index 000000000..935a3e499 --- /dev/null +++ b/vendor/gems/depp/app/models/depp/user.rb @@ -0,0 +1,92 @@ +module Depp + class User + include ActiveModel::Validations + include ActiveModel::Conversion + extend ActiveModel::Naming + + attr_accessor :tag, :password, :pki + + validates :tag, :password, presence: true + + validate :validate_existance_in_server + + def initialize(args = {}) + args.each { |k, v| send(k.to_s + '=', v) } + end + + def server + client_cert = File.read(ENV['cert_path']) + client_key = File.read(ENV['key_path']) + port = Rails.env.test? ? 701 : ENV['epp_port'] + + @server_cache ||= Epp::Server.new({ + server: ENV['epp_hostname'], + tag: tag, + password: password, + port: port, + cert: OpenSSL::X509::Certificate.new(client_cert), + key: OpenSSL::PKey::RSA.new(client_key) + }) + end + + def request(xml) + Nokogiri::XML(server.request(xml)).remove_namespaces! + end + + def repp_request(path, params = {}) + client_cert = File.read(ENV['cert_path']) + client_key = File.read(ENV['key_path']) + + uri = URI.parse("#{ENV['repp_url']}#{path}") + uri.query = URI.encode_www_form(params) + + req = Net::HTTP::Get.new(uri) + req.basic_auth tag, password + + res = Net::HTTP.start(uri.hostname, uri.port, + use_ssl: (uri.scheme == 'https'), + verify_mode: OpenSSL::SSL::VERIFY_NONE, + cert: OpenSSL::X509::Certificate.new(client_cert), + key: OpenSSL::PKey::RSA.new(client_key) + ) do |http| + http.request(req) + end + + ret = OpenStruct.new(code: res.code) + ret.parsed_body = JSON.parse(res.body) if res.body.present? + + if ret.parsed_body && ret.parsed_body['error'] + ret.message = ret.parsed_body['error'] + else + ret.message = res.message + end + + ret + end + + private + + def validate_existance_in_server + return if errors.any? + res = server.open_connection + unless Nokogiri::XML(res).css('greeting') + errors.add(:base, :failed_to_open_connection_to_epp_server) + server.close_connection # just in case + return + end + + ex = EppXml::Session.new(cl_trid_prefix: tag) + xml = ex.login(clID: { value: tag }, pw: { value: password }) + res = server.send_request(xml) + + if Nokogiri::XML(res).css('result').first['code'] != '1000' + errors.add(:base, :authorization_error) + end + + server.close_connection + + rescue OpenSSL::SSL::SSLError + errors.add(:base, :invalid_cert) + end + end +end diff --git a/vendor/gems/depp/app/views/depp/contacts/_form.haml b/vendor/gems/depp/app/views/depp/contacts/_form.haml new file mode 100644 index 000000000..d3c920b02 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/_form.haml @@ -0,0 +1,24 @@ += form_for(@contact, html: {class: 'form-horizontal js-contact-form'}) do |f| + = render 'depp/shared/error_messages', f: f + = f.hidden_field :id + = f.hidden_field :password + .row + .col-md-12 + = render 'depp/contacts/form_partials/general', f: f + .row + .col-md-12 + = render 'depp/contacts/form_partials/address', f: f + - if !@contact.persisted? + .row + .col-md-12 + = render 'depp/contacts/form_partials/code', f: f + .row + .col-md-12 + = render 'depp/contacts/form_partials/legal_document', f: f + + .row + .col-md-12.text-right + - if @contact.persisted? + = button_tag(t(:save), class: 'btn btn-primary') + - else + = button_tag(t(:create), class: 'btn btn-primary') diff --git a/vendor/gems/depp/app/views/depp/contacts/check.haml b/vendor/gems/depp/app/views/depp/contacts/check.haml new file mode 100644 index 000000000..35517ad39 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/check.haml @@ -0,0 +1,33 @@ += render 'depp/shared/title', name: t(:contact_info) + +%hr +.row + .col-md-12 + = form_tag check_contacts_path, class: 'form-horizontal', method: :get do + .col-md-11 + .form-group + = text_field_tag :contacts, params[:contacts], class: 'form-control', autocomplete: 'off' + + .col-md-1.text-right.text-center-xs + .form-group + .col-md-offset-2.col-md-10 + %button.btn.btn-primary +   + %span.glyphicon.glyphicon-search +   + +- if @contacts + %hr + .row + .col-md-12 + .table-responsive + %table.table.table-hover.table-bordered.table-condensed + %thead + %tr + %th= t('id') + %th= t('value') + %tbody + - @contacts.each do |contact| + %tr + %td= contact[:id] + %td= contact[:reason] diff --git a/vendor/gems/depp/app/views/depp/contacts/delete.haml b/vendor/gems/depp/app/views/depp/contacts/delete.haml new file mode 100644 index 000000000..1918461fa --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/delete.haml @@ -0,0 +1,18 @@ +- if @contact.persisted? + = render 'depp/shared/title', name: "#{t(:delete)}: #{@contact.name}" + + = form_for(@contact, class: 'form-horizontal', multipart: true, method: :delete) do |f| + = render 'depp/shared/error_messages', f: f + = f.hidden_field :id + = f.hidden_field :password + + .row + .col-md-12 + = render 'depp/contacts/form_partials/legal_document', f: f + + %hr + .row + .col-md-12.text-right + = button_tag t(:delete), class: 'btn btn-danger' +- else + %h2= "#{t(:delete)}: #{t(:not_found)}" diff --git a/vendor/gems/depp/app/views/depp/contacts/edit.haml b/vendor/gems/depp/app/views/depp/contacts/edit.haml new file mode 100644 index 000000000..067b6423b --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/edit.haml @@ -0,0 +1,3 @@ += render 'depp/shared/title', name: "#{t(:edit)}: #{@contact.name}" + += render 'form' diff --git a/vendor/gems/depp/app/views/depp/contacts/form_partials/_address.haml b/vendor/gems/depp/app/views/depp/contacts/form_partials/_address.haml new file mode 100644 index 000000000..352de0cc7 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/form_partials/_address.haml @@ -0,0 +1,33 @@ +.panel.panel-default + .panel-heading.clearfix + .pull-left= t(:address) + .panel-body + .form-group + .col-md-2.control-label + = f.label :street, t(:street) + '*' + .col-md-10 + = f.text_field :street, class: 'form-control' + + .form-group + .col-md-2.control-label + = f.label :city, t(:city) + '*' + .col-md-10 + = f.text_field :city, class: 'form-control' + + .form-group + .col-md-2.control-label + = f.label :zip, t(:zip) + '*' + .col-md-10 + = f.text_field :zip, class: 'form-control' + + .form-group + .col-md-2.control-label + = f.label :state, t(:state) + .col-md-10 + = f.text_field :state, class: 'form-control' + + .form-group + .col-md-2.control-label + = f.label :country_code, t(:country) + '*' + .col-md-10 + = f.select(:country_code, SortedCountry.all_options(f.object.country_code)) diff --git a/vendor/gems/depp/app/views/depp/contacts/form_partials/_code.haml b/vendor/gems/depp/app/views/depp/contacts/form_partials/_code.haml new file mode 100644 index 000000000..a9d6e131f --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/form_partials/_code.haml @@ -0,0 +1,9 @@ +.panel.panel-default + .panel-heading.clearfix + .pull-left= t(:code) + .panel-body + .form-group + .col-md-2.control-label + = f.label :code + .col-md-10 + = f.text_field :code, class: 'form-control' diff --git a/vendor/gems/depp/app/views/depp/contacts/form_partials/_disclose.haml b/vendor/gems/depp/app/views/depp/contacts/form_partials/_disclose.haml new file mode 100644 index 000000000..e7c7ee959 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/form_partials/_disclose.haml @@ -0,0 +1,41 @@ +.panel.panel-default + .panel-heading.clearfix + .pull-left= t('contact_disclosure') + + .panel-body + .form-group + = label_tag :contact_disclose_flag, t('flag_type'), class: 'col-md-2 control-label' + .col-md-10 + =# check_box_tag('contact[disclose][sv_policy]', @contact_params[:disclose][:sv_policy], class: 'form-control') + = select_tag('contact[disclose][flag]', options_for_select(Depp::Contact::DISCLOSURE_TYPES) ) + + .panel-body + .form-group + = label_tag :contact_disclose_name, t('name'), class: 'col-md-2 control-label' + .col-md-10 + = check_box_tag('contact[disclose][name]') + + .form-group + = label_tag :contact_disclose_email, t('email'), class: 'col-md-2 control-label' + .col-md-10 + = check_box_tag('contact[disclose][email]') + + .form-group + = label_tag :contact_disclose_org_name, t('org_name'), class: 'col-md-2 control-label' + .col-md-10 + = check_box_tag('contact[disclose][org_name]') + + .form-group + = label_tag :contact_disclose_address, t('address'), class: 'col-md-2 control-label' + .col-md-10 + = check_box_tag('contact[disclose][address]') + + .form-group + = label_tag :contact_disclose_voice, t('voice'), class: 'col-md-2 control-label' + .col-md-10 + = check_box_tag('contact[disclose][voice]') + + .form-group + = label_tag :contact_disclose_fax, t('fax'), class: 'col-md-2 control-label' + .col-md-10 + = check_box_tag('contact[disclose][fax]') diff --git a/vendor/gems/depp/app/views/depp/contacts/form_partials/_general.haml b/vendor/gems/depp/app/views/depp/contacts/form_partials/_general.haml new file mode 100644 index 000000000..70abe4171 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/form_partials/_general.haml @@ -0,0 +1,50 @@ +.panel.panel-default + .panel-heading.clearfix + .pull-left= t(:ident) + .panel-body + .form-group + .col-md-2.control-label + = f.label :ident_country_code, t(:country) + '*' + .col-md-10 + = f.select(:ident_country_code, SortedCountry.all_options(f.object.ident_country_code), {}, + class: 'js-ident-country-code') + + .form-group + .col-md-2.control-label + = f.label :ident_type, t(:type) + '*' + .col-md-10 + = f.select(:ident_type, Depp::Contact::SELECTION_TYPES, { selected: f.object.ident_type }, + class: 'js-ident-type') + + .form-group + .col-md-2.control-label + = f.label :ident, t(:ident) + '*' + .col-md-10 + = f.text_field :ident, class: 'form-control' + - tip_visibility = f.object.ident_type == 'birthday' ? '' : 'display: none' + .js-ident-tip{ style: tip_visibility } + = t(:birthday_format) + +.panel.panel-default + .panel-heading.clearfix + .pull-left= t(:general) + .panel-body + .form-group + .col-md-2.control-label + = f.label :name, t(:name) + '*' + .col-md-10 + = f.text_field :name, class: 'form-control' + + .form-group + .col-md-2.control-label + = f.label :email, t(:email) + '*' + .col-md-10 + = f.text_field :email, class: 'form-control' + + .form-group + .col-md-2.control-label + = f.label :phone, t(:phone) + '*' + .col-md-10 + = f.text_field(:phone, class: 'form-control', placeholder: '+372.12323344') + + diff --git a/vendor/gems/depp/app/views/depp/contacts/form_partials/_legal_document.haml b/vendor/gems/depp/app/views/depp/contacts/form_partials/_legal_document.haml new file mode 100644 index 000000000..6c423eb19 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/form_partials/_legal_document.haml @@ -0,0 +1,12 @@ +.form-group + .col-md-10 + +.panel.panel-default + .panel-heading.clearfix + .pull-left= t(:legal_document) + .panel-body + .form-group + .col-md-3.control-label + = f.label :legal_document, t(:legal_document) + .col-md-7 + = f.file_field :legal_document, :value => '' diff --git a/vendor/gems/depp/app/views/depp/contacts/index.haml b/vendor/gems/depp/app/views/depp/contacts/index.haml new file mode 100644 index 000000000..bc0410b58 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/index.haml @@ -0,0 +1,25 @@ +- content_for :actions do + = link_to(t(:new), new_contact_path, class: 'btn btn-primary') += render 'depp/shared/title', name: t(:contacts) + +- if @response + .panel.panel-default + .table-responsive + %table.table.table-hover.table-bordered.table-condensed.domify + %thead + %tr + %th{class: 'col-xs-3'}= t(:name) + %th{class: 'col-xs-3'}= t(:code) + %th{class: 'col-xs-3'}= t(:ident) + %th{class: 'col-xs-3'}= t(:actions) + %tbody + - @contacts.each do |c| + %tr + %td= link_to(c[:name], contact_path(id: c[:code])) + %td= c[:code] + %td= c[:ident] + %td + = link_to(t(:edit), edit_contact_path(c[:code]), class: 'btn btn-primary btn-xs') + = link_to(t(:delete), delete_contact_path(c[:code]), class: 'btn btn-default btn-xs') + += paginate @paginatable_array diff --git a/vendor/gems/depp/app/views/depp/contacts/info_index.haml b/vendor/gems/depp/app/views/depp/contacts/info_index.haml new file mode 100644 index 000000000..a4f02ce1c --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/info_index.haml @@ -0,0 +1,19 @@ += render 'depp/shared/title', name: t(:contacts_info) + +.row + .col-md-12 + = form_tag contact_path, class: 'form-horizontal', method: :get do + .form-group + = label_tag :contact_id, t('contact_id'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag :contact_id, params[:contact_id], class: 'form-control', autocomplete: 'off' + .form-group + = label_tag :password, t('password'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag :password, params[:password], class: 'form-control', autocomplete: 'off' + .form-group + .col-md-offset-2.col-md-10 + %button.btn.btn-primary +   + %span.glyphicon.glyphicon-search +   diff --git a/vendor/gems/depp/app/views/depp/contacts/new.haml b/vendor/gems/depp/app/views/depp/contacts/new.haml new file mode 100644 index 000000000..e4232f184 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/new.haml @@ -0,0 +1,3 @@ += render 'depp/shared/title', name: t(:new_contact) + += render 'form' diff --git a/vendor/gems/depp/app/views/depp/contacts/partials/_address.haml b/vendor/gems/depp/app/views/depp/contacts/partials/_address.haml new file mode 100644 index 000000000..ce26b5667 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/partials/_address.haml @@ -0,0 +1,23 @@ +.panel.panel-default + .panel-heading + %h3.panel-title= t(:address) + .panel-body + %dl.dl-horizontal + - if @contact.org_name.present? + %dt= t(:org_name) + %dd= @contact.org_name + + %dt= t(:street) + %dd= @contact.street + + %dt= t(:city) + %dd= @contact.city + + %dt= t(:zip) + %dd= @contact.zip + + %dt= t(:state) + %dd= @contact.state + + %dt= t(:country) + %dd= @contact.country_name diff --git a/vendor/gems/depp/app/views/depp/contacts/partials/_disclose.haml b/vendor/gems/depp/app/views/depp/contacts/partials/_disclose.haml new file mode 100644 index 000000000..734ca056d --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/partials/_disclose.haml @@ -0,0 +1,10 @@ +- @contact[:disclose].each do |flag, data| + - next if data.empty? + .panel.panel-default + .panel-heading + %h3.panel-title= t("disclosure-#{flag}") + .panel-body + %dl.dl-horizontal + - data.each do |k,v| + %dt= t(k) + diff --git a/vendor/gems/depp/app/views/depp/contacts/partials/_general.haml b/vendor/gems/depp/app/views/depp/contacts/partials/_general.haml new file mode 100644 index 000000000..2524f34e9 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/partials/_general.haml @@ -0,0 +1,23 @@ +.panel.panel-default + .panel-heading + %h3.panel-title= t(:general) + .panel-body + %dl.dl-horizontal + %dt= t(:ident) + %dd= ident_for(@contact) + + %br + + %dt= t(:email) + %dd= @contact.email + + %dt= t(:phone) + %dd= @contact.phone + + %br + + %dt= t(:contact_code) + %dd= @contact.id + + %dt= t(:password) + %dd= @contact.password diff --git a/vendor/gems/depp/app/views/depp/contacts/partials/_statuses.haml b/vendor/gems/depp/app/views/depp/contacts/partials/_statuses.haml new file mode 100644 index 000000000..5d41db972 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/partials/_statuses.haml @@ -0,0 +1,16 @@ +.panel.panel-default + .panel-heading + %h3.panel-title= t(:statuses) + .table-responsive + %table.table.table-hover.table-bordered.table-condensed + %thead + %tr + %th{class: 'col-xs-6'}= t(:status) + %th{class: 'col-xs-6'}= t(:description) + %tbody + - statuses.each do |s| + %tr + %td= s.first + %td= s.second + + diff --git a/vendor/gems/depp/app/views/depp/contacts/show.haml b/vendor/gems/depp/app/views/depp/contacts/show.haml new file mode 100644 index 000000000..bb070126e --- /dev/null +++ b/vendor/gems/depp/app/views/depp/contacts/show.haml @@ -0,0 +1,16 @@ +- if @contact.id.present? + - content_for :actions do + = link_to(t(:edit), edit_contact_path(@contact.id), class: 'btn btn-primary') + = link_to(t(:delete), delete_contact_path(@contact.id), class: 'btn btn-default') + = render 'depp/shared/title', name: truncate(@contact.name) + + .row + .col-md-6= render 'depp/contacts/partials/general' + .col-md-6= render 'depp/contacts/partials/address' + .row + .col-md-12= render 'depp/contacts/partials/statuses', statuses: @contact.statuses + +- else + .row + .col-sm-6 + %h1= t(:not_found) diff --git a/vendor/gems/depp/app/views/depp/domains/_check_form.haml b/vendor/gems/depp/app/views/depp/domains/_check_form.haml new file mode 100644 index 000000000..ca4295e1c --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/_check_form.haml @@ -0,0 +1,10 @@ += form_tag check_domains_path, class: 'form-horizontal', method: :get do + .col-md-11 + .form-group + = text_field_tag :domain_name, params[:domain_name], class: 'form-control', placeholder: t('domain_name'), autocomplete: 'off' + .col-md-1.text-right.text-center-xs + .form-group + %button.btn.btn-primary +   + %span.glyphicon.glyphicon-search +   diff --git a/vendor/gems/depp/app/views/depp/domains/_form.haml b/vendor/gems/depp/app/views/depp/domains/_form.haml new file mode 100644 index 000000000..37da7efce --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/_form.haml @@ -0,0 +1,41 @@ +- path = (params[:domain_name]) ? update_domains_path : domains_path += form_tag(path, class: 'form-horizontal', multipart: true) do + .row + .col-md-12 + / Nav tabs + %ul.nav.nav-tabs{:role => "tablist", id: 'tabs'} + %li.active + %a{"data-toggle" => "tab", :href => "#general-tab", :role => "tab"}= t('general') + - if params['domain_name'] + %li + %a{"data-toggle" => "tab", :href => "#statuses-tab", :role => "tab"}= t('statuses') + / Tab panes + .tab-content + #general-tab.tab-pane.active + = render 'depp/domains/form_partials/general' + = render 'depp/domains/form_partials/contacts' + %hr + = render 'depp/domains/form_partials/nameservers' + %hr + = render 'depp/domains/form_partials/dnskeys' + - if params['domain_name'] + #statuses-tab.tab-pane + = render 'depp/domains/form_partials/statuses' + + .panel.panel-default + .panel-heading.clearfix + .pull-left= t(:legal_document) + .panel-body + .form-group + = label_tag 'domain[legal_document]', t('legal_document'),class: 'col-md-3 control-label' + .col-md-9 + = file_field_tag 'domain[legal_document]' + + .row + .col-md-12.text-right + = button_tag(t('shared.save'), class: 'btn btn-primary') + +:javascript + $(function () { + $('#tabs a:first').tab('show') + }) diff --git a/vendor/gems/depp/app/views/depp/domains/check.haml b/vendor/gems/depp/app/views/depp/domains/check.haml new file mode 100644 index 000000000..6a3136b27 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/check.haml @@ -0,0 +1,25 @@ += render 'depp/shared/title', name: t(:check_domain) + +.row + .col-md-12 + = render 'check_form' + +%hr + +.row + .col-md-12 + .panel.panel-default + .panel-heading + %h3.panel-title= t('result') + .panel-body + %dl.dl-horizontal + %dt= t('name') + %dd= @data.css('name').text + + - name = @data.css('name').first + %dt= t('available') + %dd= name['avail'] + + - if @data.css('reason').text.present? + %dt= t('reason') + %dd= @data.css('reason').text diff --git a/vendor/gems/depp/app/views/depp/domains/check_index.haml b/vendor/gems/depp/app/views/depp/domains/check_index.haml new file mode 100644 index 000000000..e01a408b9 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/check_index.haml @@ -0,0 +1,5 @@ += render 'depp/shared/title', name: t(:check_domain) + +.row + .col-md-12 + = render 'check_form' diff --git a/vendor/gems/depp/app/views/depp/domains/delete.haml b/vendor/gems/depp/app/views/depp/domains/delete.haml new file mode 100644 index 000000000..3bf650930 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/delete.haml @@ -0,0 +1,17 @@ += render 'depp/shared/title', name: "#{t(:delete)}: #{params[:domain_name]}" + += form_tag(destroy_domains_path, class: 'form-horizontal', multipart: true, method: :delete) do + .panel.panel-default + .panel-heading.clearfix + = t(:legal_document) + .panel-body + .form-group + .col-md-4.control-label + = label_tag 'domain[legal_document]', t('legal_document') + .col-md-6 + = file_field_tag 'domain[legal_document]' + = hidden_field_tag 'domain[name]', params[:domain_name] + %hr + .row + .col-md-12.text-right + = button_tag t('delete'), class: 'btn btn-danger' diff --git a/vendor/gems/depp/app/views/depp/domains/edit.haml b/vendor/gems/depp/app/views/depp/domains/edit.haml new file mode 100644 index 000000000..a258438bf --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/edit.haml @@ -0,0 +1,4 @@ += render 'depp/shared/title', name: "#{t(:edit)}: #{params[:domain_name]}" + +%hr += render 'form' diff --git a/vendor/gems/depp/app/views/depp/domains/form_partials/_contacts.haml b/vendor/gems/depp/app/views/depp/domains/form_partials/_contacts.haml new file mode 100644 index 000000000..8fce6c4f5 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/form_partials/_contacts.haml @@ -0,0 +1,24 @@ +#domain-contacts + - @domain_params['contacts_attributes'].each do |k, v| + .panel.panel-default + .panel-heading.clearfix + .pull-left= t('contact') + .pull-right + = link_to(t('add_another'), '#', class: 'btn btn-primary btn-xs add-domain-contact') + = link_to(t('delete'), '#', class: 'btn btn-danger btn-xs destroy') + .panel-body + .form-group + = label_tag "domain_contacts_attributes_#{k}_type", t('contact_type'), class: 'col-md-2 control-label' + .col-md-10 + = select_tag "domain[contacts_attributes][#{k}][type]", options_for_select(['admin', 'tech'], v['type']), {class: 'form-control'} + + .form-group + = label_tag "domain_contacts_attributes_#{k}_code", t('contact_code'), class: 'col-md-2 control-label' + .col-md-10.has-feedback + = text_field_tag("domain[contacts_attributes][#{k}][code]", v['code'], class: 'form-control', placeholder: t('contact_code'), autocomplete: 'off') +:coffee + $("#domain-contacts").nestedAttributes + bindAddTo: $(".add-domain-contact") + afterAdd: (item) -> + item.find('select').each (k, v) -> + $(v).val($(v).find('option:first-child').val()) diff --git a/vendor/gems/depp/app/views/depp/domains/form_partials/_dnskeys.haml b/vendor/gems/depp/app/views/depp/domains/form_partials/_dnskeys.haml new file mode 100644 index 000000000..06f7152dd --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/form_partials/_dnskeys.haml @@ -0,0 +1,57 @@ +#dnskeys + - @domain_params['dnskeys_attributes'].each do |k, v| + .panel.panel-default + .panel-heading.clearfix + .pull-left= t('dnskey') + .pull-right + = link_to(t('add_another'), '#', class: 'btn btn-primary btn-xs add-dnskey') + = link_to(t('delete'), '#', class: 'btn btn-danger btn-xs destroy') + .panel-body + - if ENV['show_ds_data_fields'] == 'true' + .form-group + = label_tag "domain_dnskeys_attributes_#{k}_ds_key_tag", t('ds_key_tag'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag "domain[dnskeys_attributes][#{k}][ds_key_tag]", v['ds_key_tag'], {class: 'form-control'} + + .form-group + = label_tag "domain_dnskeys_attributes_#{k}_ds_alg", t('ds_algorithm'), class: 'col-md-2 control-label' + .col-md-10 + = select_tag "domain[dnskeys_attributes][#{k}][ds_alg]", options_for_select(Depp::Dnskey::ALGORITHMS, v['ds_alg']), {class: 'form-control'} + + .form-group + = label_tag "domain_dnskeys_attributes_#{k}_ds_digest_type", t('ds_digest_type'), class: 'col-md-2 control-label' + .col-md-10 + = select_tag "domain[dnskeys_attributes][#{k}][ds_digest_type]", options_for_select(Depp::Dnskey::DS_DIGEST_TYPES, v['ds_digest_type']), {class: 'form-control'} + + .form-group + = label_tag "domain_dnskeys_attributes_#{k}_ds_digest", t('ds_digest'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag "domain[dnskeys_attributes][#{k}][ds_digest]", v['ds_digest'], {class: 'form-control'} + + .form-group + = label_tag "domain_dnskeys_attributes_#{k}_flags", t('flags'), class: 'col-md-2 control-label' + .col-md-10 + = select_tag "domain[dnskeys_attributes][#{k}][flags]", options_for_select(Depp::Dnskey::FLAGS, v['flags']), {class: 'form-control'} + + .form-group + = label_tag "domain_dnskeys_attributes_#{k}_protocol", t('protocol'), class: 'col-md-2 control-label' + .col-md-10 + = select_tag "domain[dnskeys_attributes][#{k}][protocol]", options_for_select(Depp::Dnskey::PROTOCOLS, v['protocol']), {class: 'form-control'} + + .form-group + = label_tag "domain_dnskeys_attributes_#{k}_alg", t('alg'), class: 'col-md-2 control-label' + .col-md-10 + = select_tag "domain[dnskeys_attributes][#{k}][alg]", options_for_select(Depp::Dnskey::ALGORITHMS, v['alg']), {class: 'form-control'} + + .form-group + = label_tag "domain_dnskeys_attributes_#{k}_public_key", t('public_key'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag "domain[dnskeys_attributes][#{k}][public_key]", v['public_key'], class: 'form-control' +:coffee + $("#dnskeys").nestedAttributes + bindAddTo: $(".add-dnskey") + afterAdd: (item) -> + item.find('select').each (k, v) -> + $(v).val($(v).find('option:first-child').val()) + + diff --git a/vendor/gems/depp/app/views/depp/domains/form_partials/_general.haml b/vendor/gems/depp/app/views/depp/domains/form_partials/_general.haml new file mode 100644 index 000000000..8de6ba96a --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/form_partials/_general.haml @@ -0,0 +1,19 @@ +.general-tab.panel.panel-default + .form-group + = label_tag :domain_name, t('name'), class: 'col-md-2 control-label' + .col-md-10 + - readonly = params[:domain_name] ? true : false + = text_field_tag('domain[name]', @domain_params[:name], class: 'form-control', readonly: readonly) + + - unless params[:domain_name] + .form-group + = label_tag :domain_period, t('period'), class: 'col-md-2 control-label' + .col-md-5 + = text_field_tag('domain[period]', @domain_params[:period], class: 'form-control') + .col-md-5 + = select_tag 'domain[period_unit]', options_for_select(['y', 'm', 'd'], @domain_params[:period_unit]), { class: 'form-control' } + + .form-group + = label_tag :domain_registrant, t('registrant'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag('domain[registrant]', @domain_params[:registrant], class: 'form-control', placeholder: t('contact_code'), autocomplete: 'off') diff --git a/vendor/gems/depp/app/views/depp/domains/form_partials/_nameservers.haml b/vendor/gems/depp/app/views/depp/domains/form_partials/_nameservers.haml new file mode 100644 index 000000000..b37d73594 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/form_partials/_nameservers.haml @@ -0,0 +1,24 @@ +#nameservers + - @domain_params['nameservers_attributes'].each do |k, v| + .panel.panel-default + .panel-heading.clearfix + .pull-left= t('nameserver') + .pull-right + = link_to(t('add_another'), '#', class: 'btn btn-primary btn-xs add-nameserver') + = link_to(t('delete'), '#', class: 'btn btn-danger btn-xs destroy') + .panel-body + .form-group + = label_tag "domain_nameservers_attributes_#{k}_hostname", t('hostname'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag "domain[nameservers_attributes][#{k}][hostname]", v['hostname'], class: 'form-control' + .form-group + = label_tag "domain_nameservers_attributes_#{k}_ipv4", t('ipv4'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag "domain[nameservers_attributes][#{k}][ipv4]", v['ipv4'], class: 'form-control' + .form-group + = label_tag "domain_nameservers_attributes_#{k}_ipv6", t('ipv6'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag "domain[nameservers_attributes][#{k}][ipv6]", v['ipv6'], class: 'form-control' +:coffee + $("#nameservers").nestedAttributes + bindAddTo: $(".add-nameserver") diff --git a/vendor/gems/depp/app/views/depp/domains/form_partials/_statuses.haml b/vendor/gems/depp/app/views/depp/domains/form_partials/_statuses.haml new file mode 100644 index 000000000..af7fe8e2d --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/form_partials/_statuses.haml @@ -0,0 +1,24 @@ +#domain-statuses + - @domain_params['statuses_attributes'].each do |k, v| + %br + .panel.panel-default + .panel-heading.clearfix + .pull-left= t('status') + .pull-right + = link_to(t('add_another'), '#', class: 'btn btn-primary btn-xs add-domain-status') + = link_to(t('delete'), '#', class: 'btn btn-danger btn-xs destroy') + .panel-body + .form-group + = label_tag "domain_statuses_attributes_#{k}_code", t('code'),class: 'col-md-2 control-label' + .col-md-10 + = select_tag "domain[statuses_attributes][#{k}][code]", options_for_select(Depp::Domain::DOMAIN_STATUSES, v['code']), {class: 'form-control', prompt: ''} + .form-group + = label_tag "domain_statuses_attributes_#{k}_description", t('description'),class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag "domain[statuses_attributes][#{k}][description]", v['description'], class: 'form-control', autocomplete: 'off' +:coffee + $("#domain-statuses").nestedAttributes + bindAddTo: $(".add-domain-status") + afterAdd: (item) -> + item.find('select').each (k, v) -> + $(v).val($(v).find('option:first-child').val()) diff --git a/vendor/gems/depp/app/views/depp/domains/index.haml b/vendor/gems/depp/app/views/depp/domains/index.haml new file mode 100644 index 000000000..de4d2bb54 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/index.haml @@ -0,0 +1,47 @@ +- content_for :actions do + = link_to(t(:new), new_domain_path, class: 'btn btn-primary') + = link_to(t(:transfer), transfer_domains_path, class: 'btn btn-default') + = link_to(t(:keyrelay), keyrelay_path, class: 'btn btn-default') += render 'depp/shared/title', name: t(:domains) + +.row + .col-md-12{style: 'margin-bottom: -15px;'} + = form_tag info_domains_path, class: 'form-horizontal', method: :get do + .col-md-11 + .form-group + = text_field_tag :domain_name, params[:domain_name], class: 'form-control', placeholder: t('domain_name'), autocomplete: 'off', autofocus: true + .col-md-1.text-right.text-center-xs + .form-group + %button.btn.btn-primary +   + %span.glyphicon.glyphicon-search +   + +%hr + +- if @response + .panel.panel-default + .table-responsive + %table.table.table-hover.table-bordered.table-condensed.domify + %thead + %tr + %th{class: 'col-xs-3'}= t(:name) + %th{class: 'col-xs-6'}= t(:valid) + %th{class: 'col-xs-3'}= t(:actions) + %tbody + - @response['domains'].each do |x| + %tr + %td= link_to(x['name'], info_domains_path(domain_name: x['name'])) + %td + = Time.parse(x['valid_from']).try(:to_date) + \- + = Time.parse(x['valid_to']).try(:to_date) + %td + = link_to(t(:edit), edit_domains_path(domain_name: x['name']), + class: 'btn btn-primary btn-xs') + = link_to(t(:renew), renew_domains_path(domain_name: x['name']), + class: 'btn btn-default btn-xs') + = link_to(t(:delete), delete_domains_path(domain_name: x['name']), + class: 'btn btn-default btn-xs') + += paginate @paginatable_array diff --git a/vendor/gems/depp/app/views/depp/domains/info.haml b/vendor/gems/depp/app/views/depp/domains/info.haml new file mode 100644 index 000000000..8aee91523 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/info.haml @@ -0,0 +1,26 @@ +- content_for :actions do + = link_to(t(:edit), edit_domains_path(domain_name: params[:domain_name]), + class: 'btn btn-primary') + = link_to(t(:renew), renew_domains_path(domain_name: params[:domain_name]), + class: 'btn btn-default') + = link_to(t(:delete), delete_domains_path(domain_name: params[:domain_name]), + class: 'btn btn-default') += render 'depp/shared/title', name: truncate(@data.css('name').text) + +.row + .col-sm-12 + - if @data.css('result').first['code'] == '1000' + .row + .col-md-12= render 'depp/domains/partials/general' + .row + .col-md-12= render 'depp/domains/partials/contacts' + .row + .col-md-12= render 'depp/domains/partials/statuses' + .row + .col-md-12= render 'depp/domains/partials/nameservers' + .row + .col-md-12= render 'depp/domains/partials/dnskeys' + - else + .row + .col-sm-6 + %h1= t(:not_found) diff --git a/vendor/gems/depp/app/views/depp/domains/new.haml b/vendor/gems/depp/app/views/depp/domains/new.haml new file mode 100644 index 000000000..72ab1493e --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/new.haml @@ -0,0 +1,3 @@ += render 'depp/shared/title', name: t(:new_domain) + += render 'form' diff --git a/vendor/gems/depp/app/views/depp/domains/partials/_contacts.haml b/vendor/gems/depp/app/views/depp/domains/partials/_contacts.haml new file mode 100644 index 000000000..ddb6d41e4 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/partials/_contacts.haml @@ -0,0 +1,15 @@ +#tech_contacts.panel.panel-default + .panel-heading.clearfix + %h3.panel-title= t(:contacts) + .table-responsive + %table.table.table-hover.table-bordered.table-condensed + %thead + %tr + %th{class: 'col-xs-4'}= t('type') + %th{class: 'col-xs-8'}= t('code') + %tbody + - @data.css('contact').each do |x| + %tr + %td= x['type'] + %td= x.text + diff --git a/vendor/gems/depp/app/views/depp/domains/partials/_dnskeys.haml b/vendor/gems/depp/app/views/depp/domains/partials/_dnskeys.haml new file mode 100644 index 000000000..9bbca3e95 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/partials/_dnskeys.haml @@ -0,0 +1,33 @@ +.panel.panel-default + .panel-heading + %h3.panel-title= t('dnskeys') + .panel-body{style: 'word-wrap: break-word;'} + - @data.css('dsData').each do |x| + %dl.dl-horizontal + - if x.css('keyTag').text.present? + %dt= t('ds_key_tag') + %dd= x.css('keyTag').text + + - if x.css('alg').first.text.present? + %dt= t('ds_algorithm') + %dd= x.css('alg').first.text + + - if x.css('digestType').text.present? + %dt= t('ds_digest_type') + %dd= x.css('digestType').text + + - if x.css('digest').text.present? + %dt= t('ds_digest') + %dd= x.css('digest').text + + %dt= t('flag') + %dd= x.css('flags').text + + %dt= t('protocol') + %dd= x.css('protocol').text + + %dt= t('algorithm') + %dd= x.css('keyData > alg').text + + %dt= t('public_key') + %dd= x.css('pubKey').text diff --git a/vendor/gems/depp/app/views/depp/domains/partials/_general.haml b/vendor/gems/depp/app/views/depp/domains/partials/_general.haml new file mode 100644 index 000000000..85cb78fd8 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/partials/_general.haml @@ -0,0 +1,22 @@ +.panel.panel-default + .panel-heading + %h3.panel-title= t(:general) + .panel-body + %dl.dl-horizontal + %dt= t(:password) + %dd= @data.css('pw').text + + %dt= t(:registrant) + %dd= @data.css('registrant').text + + %dt= t(:registered) + %dd= @data.css('crDate').text + + %dt= t(:valid_to) + %dd= @data.css('exDate').text + + %dt= t(:created) + %dd= @data.css('crDate').text + + %dt= t(:updated) + %dd= @data.css('upDate').text diff --git a/vendor/gems/depp/app/views/depp/domains/partials/_nameservers.haml b/vendor/gems/depp/app/views/depp/domains/partials/_nameservers.haml new file mode 100644 index 000000000..851801229 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/partials/_nameservers.haml @@ -0,0 +1,17 @@ +#nameservers.panel.panel-default + .panel-heading.clearfix + %h3.panel-title= t(:nameservers) + .table-responsive + %table.table.table-hover.table-bordered.table-condensed + %thead + %tr + %th{class: 'col-xs-4'}= t('hostname') + %th{class: 'col-xs-4'}= t('ipv4') + %th{class: 'col-xs-4'}= t('ipv6') + %tbody + - @data.css('hostAttr').each do |x| + %tr + %td= x.css('hostName').text + %td= x.css('hostAddr[ip="v4"]').text + %td= x.css('hostAddr[ip="v6"]').text + diff --git a/vendor/gems/depp/app/views/depp/domains/partials/_statuses.haml b/vendor/gems/depp/app/views/depp/domains/partials/_statuses.haml new file mode 100644 index 000000000..5cd71caec --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/partials/_statuses.haml @@ -0,0 +1,14 @@ +#domain_statuses.panel.panel-default + .panel-heading.clearfix + %h3.panel-title= t(:statuses) + .table-responsive + %table.table.table-hover.table-bordered.table-condensed + %thead + %tr + %th{class: 'col-xs-6'}= t('status') + %th{class: 'col-xs-6'}= t('description') + %tbody + - @data.css('status').each do |x| + %tr + %td= x['s'] + %td= x.text diff --git a/vendor/gems/depp/app/views/depp/domains/renew.haml b/vendor/gems/depp/app/views/depp/domains/renew.haml new file mode 100644 index 000000000..981b95327 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/renew.haml @@ -0,0 +1,14 @@ += render 'depp/shared/title', name: t(:renew_domain) + +.row + .col-md-12 + .panel.panel-default + .panel-heading + %h3.panel-title= t('result') + .panel-body + %dl.dl-horizontal + %dt= t('domain_name') + %dd= @data.css('name').text + + %dt= t('valid_to') + %dd= @data.css('exDate').text diff --git a/vendor/gems/depp/app/views/depp/domains/renew_index.haml b/vendor/gems/depp/app/views/depp/domains/renew_index.haml new file mode 100644 index 000000000..18d7f7011 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/renew_index.haml @@ -0,0 +1,22 @@ += render 'depp/shared/title', name: t(:renew_domain) + +.row + .col-md-12 + = form_tag renew_domains_path, class: 'form-horizontal', method: :get do + .form-group + = label_tag :domain_name, t('name'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag :domain_name, params[:domain_name], class: 'form-control', placeholder: t('domain_name'), autocomplete: 'off' + .form-group + = label_tag :cur_exp_date, t('cur_exp_date'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag :cur_exp_date, params[:cur_exp_date], class: 'form-control', placeholder: 'yyyy-mm-dd', autocomplete: 'off' + .form-group + = label_tag :domain_period, t('period'), class: 'col-md-2 control-label' + .col-md-5 + = text_field_tag(:period, params[:period], class: 'form-control') + .col-md-5 + = select_tag :period_unit, options_for_select(['y', 'm', 'd'], params[:period_unit]), { class: 'form-control' } + .form-group + .col-md-offset-2.col-md-10 + %button.btn.btn-primary= t('renew') diff --git a/vendor/gems/depp/app/views/depp/domains/transfer.haml b/vendor/gems/depp/app/views/depp/domains/transfer.haml new file mode 100644 index 000000000..46801d7c4 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/transfer.haml @@ -0,0 +1,16 @@ += render 'depp/shared/title', name: t(:transfer_domain) + +.row + .col-md-12 + .panel.panel-default + .panel-heading + %h3.panel-title= t('result') + .panel-body + %dl.dl-horizontal + %dt= t('domain_name') + %dd= @data.css('name').text + + - @data.css('trnData').children.each do |x| + - next if x.blank? + %dt= t(x.name) + %dd= x.text diff --git a/vendor/gems/depp/app/views/depp/domains/transfer_index.haml b/vendor/gems/depp/app/views/depp/domains/transfer_index.haml new file mode 100644 index 000000000..0a9c72d2c --- /dev/null +++ b/vendor/gems/depp/app/views/depp/domains/transfer_index.haml @@ -0,0 +1,22 @@ += render 'depp/shared/title', name: t(:transfer_domain) + +.row + .col-md-12 + = form_tag transfer_domains_path, class: 'form-horizontal', method: :post, multipart: true do + .form-group + = label_tag :domain_name, t('name'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag :domain_name, params[:domain_name], class: 'form-control', placeholder: t('domain_name'), autocomplete: 'off', autofocus: true + .form-group + = label_tag :password, t('password'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag :password, params[:password], class: 'form-control', autocomplete: 'off' + .form-group + = label_tag 'legal_document', t('legal_document'),class: 'col-md-2 control-label' + .col-md-10 + = file_field_tag 'legal_document' + .form-group + .col-md-offset-2.col-md-10 + %button.btn.btn-primary{ name: 'query' }= t('query') + %button.btn.btn-primary{ name: 'approve' }= t('approve') + %button.btn.btn-primary{ name: 'reject' }= t('reject') diff --git a/vendor/gems/depp/app/views/depp/keyrelays/show.haml b/vendor/gems/depp/app/views/depp/keyrelays/show.haml new file mode 100644 index 000000000..4020ded41 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/keyrelays/show.haml @@ -0,0 +1,55 @@ +.row + .col-sm-12 + %h2.text-center-xs= t('keyrelay') +%hr +.row + .col-md-12 + = form_tag keyrelay_path, class: 'form-horizontal', method: :post, multipart: true do + .form-group + = label_tag :domain_name, t('domain_name'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag :domain_name, params[:domain_name], class: 'form-control', autocomplete: 'off' + + .form-group + = label_tag :password, t('password'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag :password, params[:password], class: 'form-control', autocomplete: 'off' + + .form-group + = label_tag :expiry_relative, t('expiry_relative'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag :expiry_relative, params[:expiry_relative], class: 'form-control', autocomplete: 'off' + + .form-group + = label_tag :expiry_absolute, t('expiry_absolute'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag :expiry_absolute, params[:expiry_absolute], class: 'form-control', autocomplete: 'off' + + .form-group + = label_tag :key_data_flags, t('flag'), class: 'col-md-2 control-label' + .col-md-10 + = select_tag :key_data_flags, options_for_select(Depp::Dnskey::FLAGS, params['key_data_flags']), {class: 'form-control'} + + .form-group + = label_tag :key_data_protocol, t('protocol'), class: 'col-md-2 control-label' + .col-md-10 + = select_tag :key_data_protocol, options_for_select(Depp::Dnskey::PROTOCOLS, params['key_data_protocol']), {class: 'form-control'} + + .form-group + = label_tag :key_data_alg, t('algorithm'), class: 'col-md-2 control-label' + .col-md-10 + = select_tag :key_data_alg, options_for_select(Depp::Dnskey::ALGORITHMS, params['key_data_alg']), {class: 'form-control'} + + .form-group + = label_tag :key_data_public_key, t('public_key'), class: 'col-md-2 control-label' + .col-md-10 + = text_field_tag :key_data_public_key, params['key_data_public_key'], class: 'form-control' + + .form-group + = label_tag :legal_document, t('legal_document'),class: 'col-md-2 control-label' + .col-md-10 + = file_field_tag :legal_document + + .form-group + .col-md-offset-2.col-md-10 + %button.btn.btn-primary= t('upload_key') diff --git a/vendor/gems/depp/app/views/depp/polls/show.haml b/vendor/gems/depp/app/views/depp/polls/show.haml new file mode 100644 index 000000000..38e685c42 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/polls/show.haml @@ -0,0 +1,89 @@ +- if @data.css('msgQ').any? + - msg_q = @data.css('msgQ').first + .row + .col-sm-12 + %h2= t('messages', count: msg_q['count']) + %hr + .row + .col-md-12 + .panel.panel-default + .panel-heading.clearfix + .pull-left= t('message_no', id: msg_q['id']) + .pull-right + - if @data.css('panData').any? # this is a keyrelay request + = link_to(t('confirm'), 'javascript: void(0);', class: 'btn btn-primary btn-xs js-keyrelay-confirm') + - if @data.css('trnData trStatus').any? # this is a transfer request + - unless ['serverApproved', 'clientApproved'].include?(@data.css('trStatus').first.text) + = link_to(t('confirm'), 'javascript: void(0);', class: 'btn btn-primary btn-xs js-transfer-confirm') + = link_to(t('dequeue'), poll_path(id: msg_q['id']), method: :delete, class: 'btn btn-primary btn-xs') + .panel-body + %dl.dl-horizontal + %dt= t('message') + %dd= msg_q.css('msg').text + + %dt= t('queue_date') + %dd= @data.css('qDate').text + + %dl.dl-horizontal + / keyrelay + - if @data.css('panData').any? + %dt= t('domain_name') + %dd= @data.css('name').text + + %dt= t('password') + %dd= @data.css('pw').text + + - if @data.css('relative').text.present? + %dt= t('expiry_relative') + %dd= @data.css('relative').text + + - if @data.css('absolute').text.present? + %dt= t('expiry_absolute') + %dd= @data.css('absolute').text + + %dt paDate + %dd= @data.css('paDate').text + + %dt= t('flag') + %dd= @data.css('flags').text + + %dt= t('protocol') + %dd= @data.css('protocol').text + + %dt= t('algorithm') + %dd= @data.css('alg').text + + %dt= t('public_key') + %dd= @data.css('pubKey').text + + = form_tag confirm_keyrelay_poll_path, class: 'js-keyrelay-form' do + = hidden_field_tag 'domain[name]', @data.css('name').text + = hidden_field_tag 'domain[dnskeys_attributes][0][flags]', @data.css('flags').text + = hidden_field_tag 'domain[dnskeys_attributes][0][protocol]', @data.css('protocol').text + = hidden_field_tag 'domain[dnskeys_attributes][0][alg]', @data.css('alg').text + = hidden_field_tag 'domain[dnskeys_attributes][0][public_key]', @data.css('pubKey').text + + - else + - if @data.css('trnData trStatus').any? # this is a transfer request + = form_tag confirm_transfer_poll_path, class: 'js-transfer-form' do + = hidden_field_tag 'domain[name]', @data.css('name').text + + - @data.css('trnData').children.each do |x| + - next if x.blank? + %dt= t(x.name) + %dd= x.text +- else + .row + .col-sm-12 + %h2= t('messages', count: 0) + %hr + .row + .col-md-12 + %p.bg-info{style: 'padding: 15px;'}= t('you_have_no_new_messages') + +:coffee + $(".js-keyrelay-confirm").on "click", -> + $(".js-keyrelay-form").submit() + + $(".js-transfer-confirm").on "click", -> + $(".js-transfer-form").submit() diff --git a/vendor/gems/depp/app/views/depp/shared/_epp_results.haml b/vendor/gems/depp/app/views/depp/shared/_epp_results.haml new file mode 100644 index 000000000..5645c5063 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/shared/_epp_results.haml @@ -0,0 +1,29 @@ +- if @data && @data.css('result') + - @results ||= @data.css('result') + +- if @results || flash[:epp_results] + - success_codes = %(1000, 1300, 1301, 200) + + - if @results + - @results.each do |x| + - next if success_codes.include?(x['code']) + .row + .col-md-12 + %p{class: "alert alert-danger"} + = x.css('msg').text.split('[').first + - if x.css('value').text.present? + = " - #{x.css('value').text}" + %span.pull-right + = "[code: #{x['code']}]" + + - if flash[:epp_results] + - flash[:epp_results].each do |x| + - next if success_codes.include?(x['code']) + .row + .col-md-12 + %p{class: "alert alert-danger"} + = x['msg'].split('[').first + - if x['value'].present? + = " - #{x['value']}" + %span.pull-right + = "[code: #{x['code']}]" diff --git a/vendor/gems/depp/app/views/depp/shared/_error_messages.haml b/vendor/gems/depp/app/views/depp/shared/_error_messages.haml new file mode 100644 index 000000000..fd9b5bfbc --- /dev/null +++ b/vendor/gems/depp/app/views/depp/shared/_error_messages.haml @@ -0,0 +1,5 @@ +- if f.object.errors.present? + .alert.alert-warning + %ul + - f.object.errors.messages.each do |message| + %li= message.second.first.split('[').first diff --git a/vendor/gems/depp/app/views/depp/shared/_errors.haml b/vendor/gems/depp/app/views/depp/shared/_errors.haml new file mode 100644 index 000000000..50eb6de12 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/shared/_errors.haml @@ -0,0 +1,5 @@ +- if object.errors.any? + %p.text-danger + - object.errors.each do |attr, err| + = err + %br diff --git a/vendor/gems/depp/app/views/depp/shared/_flash.haml b/vendor/gems/depp/app/views/depp/shared/_flash.haml new file mode 100644 index 000000000..d4c817fe7 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/shared/_flash.haml @@ -0,0 +1,4 @@ +- if flash[:notice].present? || flash[:alert].present? + #flash + - type = (flash[:notice]) ? 'bg-success' : 'bg-danger' + .alert{class: type}= flash[:notice] || flash[:alert] diff --git a/vendor/gems/depp/app/views/depp/shared/_flash_messages.haml b/vendor/gems/depp/app/views/depp/shared/_flash_messages.haml new file mode 100644 index 000000000..b1d850a0c --- /dev/null +++ b/vendor/gems/depp/app/views/depp/shared/_flash_messages.haml @@ -0,0 +1,4 @@ +- display = (flash.empty?) ? 'none' : 'block' +#flash{style: "display: #{display};"} + - type = (flash[:notice]) ? 'bg-success' : 'bg-danger' + .alert{class: type}= flash[:notice] || flash[:alert] diff --git a/vendor/gems/depp/app/views/depp/shared/_nav.haml b/vendor/gems/depp/app/views/depp/shared/_nav.haml new file mode 100644 index 000000000..ff17197f4 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/shared/_nav.haml @@ -0,0 +1,13 @@ +- content_for :tabs do + .container.subnav + %ul.nav.nav-tabs.navbar-right + %li{role: :presentation, class: active == :domains ? 'active' : ''} + = link_to t(:all), domains_path + %li{role: :presentation, class: active == :new ? 'active' : ''} + = link_to t(:new), new_domain_path + %li{role: :presentation, class: active == :check ? 'active' : ''} + = link_to t(:check), check_domains_path + %li{role: :presentation, class: active == :transfer ? 'active' : ''} + = link_to t(:transfer), transfer_domains_path + %li{role: :presentation, class: active == :keyrelay ? 'active' : ''} + = link_to t(:keyrelay), keyrelay_path diff --git a/vendor/gems/depp/app/views/depp/shared/_title.haml b/vendor/gems/depp/app/views/depp/shared/_title.haml new file mode 100644 index 000000000..a720d1c20 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/shared/_title.haml @@ -0,0 +1,9 @@ +- content_for :window_title do + %title= name + +.row.title-row + .col-sm-6 + %h1= name + .col-sm-6 + .top-actions + = yield :actions diff --git a/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/check.xml b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/check.xml new file mode 100644 index 000000000..2748c7275 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/check.xml @@ -0,0 +1,12 @@ + + + + + + sh8013 + + + ABC-12345 + + diff --git a/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/check_multiple.xml b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/check_multiple.xml new file mode 100644 index 000000000..a77dcd852 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/check_multiple.xml @@ -0,0 +1,14 @@ + + + + + + sh8013 + sh13 + vsdfvq + + + ABC-12345 + + diff --git a/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/create.xml b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/create.xml new file mode 100644 index 000000000..c44990196 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/create.xml @@ -0,0 +1,34 @@ + + + + + + + Sillius Soddus + + 123 Example Dr. + Suite 100 + + Megaton + F3 + 201-33 + EE + + + +372.1234567 + example@test.example + + + + + + 123 + + + JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp== + + + + ABC-12345 + + diff --git a/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/delete.xml b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/delete.xml new file mode 100644 index 000000000..7b98c32df --- /dev/null +++ b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/delete.xml @@ -0,0 +1,22 @@ + + + + + + sh8013 + + wrong-one + + + + + + + JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp== + + + + ABC-12345 + + diff --git a/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/info.xml b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/info.xml new file mode 100644 index 000000000..e40e42fd7 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/info.xml @@ -0,0 +1,14 @@ + + + + + + sh8013 + + Aas34fq + + + + ABC-12345 + + diff --git a/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/update_chg.xml b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/update_chg.xml new file mode 100644 index 000000000..01e13e701 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/contact/update_chg.xml @@ -0,0 +1,36 @@ + + + + + + sh8013 + + + John Doe + + 123 Example Dr. + Suite 100 + Dulles + VA + 20166-6503 + EE + + + +123.7035555555 + jdoe@example.com + + + 2fooBAR + + + + + + + JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp== + + + + ABC-12345 + + diff --git a/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/check.xml b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/check.xml new file mode 100644 index 000000000..b55a4b129 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/check.xml @@ -0,0 +1,12 @@ + + + + + + example.ee + + + ABC-12345 + + diff --git a/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/create.xml b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/create.xml new file mode 100644 index 000000000..97be9f695 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/create.xml @@ -0,0 +1,44 @@ + + + + + + example.ee + 1 + + + ns1.example.net + + + ns2.example.net + 192.0.2.2 + 1080:0:0:0:8:800:200C:417A + + + jd1234 + sh8013 + sh8013 + sh801333 + + + + + + 257 + 3 + 8 + AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8 + + + + + + + JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp== + + + + ABC-12345 + + diff --git a/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/delete.xml b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/delete.xml new file mode 100644 index 000000000..47692e340 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/delete.xml @@ -0,0 +1,19 @@ + + + + + + example.ee + + + + + + JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp== + + + + ABC-12345 + + diff --git a/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/info.xml b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/info.xml new file mode 100644 index 000000000..9f654753f --- /dev/null +++ b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/info.xml @@ -0,0 +1,15 @@ + + + + + + example.ee + + 2fooBAR + + + + ABC-12345 + + diff --git a/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/renew.xml b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/renew.xml new file mode 100644 index 000000000..2ba7ea4a8 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/renew.xml @@ -0,0 +1,14 @@ + + + + + + example.ee + 2014-08-07 + 1 + + + ABC-12345 + + diff --git a/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/transfer.xml b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/transfer.xml new file mode 100644 index 000000000..1c9e0a254 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/transfer.xml @@ -0,0 +1,22 @@ + + + + + + example.ee + + 2BARfoo + + + + + + + JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp== + + + + ABC-12345 + + diff --git a/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/update.xml b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/update.xml new file mode 100644 index 000000000..f0d4b1f81 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/domain/update.xml @@ -0,0 +1,48 @@ + + + + + + example.ee + + mak21 + + + + ns1.example.com + ns2.example.com + + mak21 + Payment overdue. + + + + + ns1.example.com + + mak21 + + + + + + + + + 700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f + + + + + + + + JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp== + + + + ABC-12345 + + diff --git a/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/keyrelay/keyrelay.xml b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/keyrelay/keyrelay.xml new file mode 100644 index 000000000..84ece643a --- /dev/null +++ b/vendor/gems/depp/app/views/depp/xml_consoles/epp_requests/keyrelay/keyrelay.xml @@ -0,0 +1,24 @@ + + + + + example6.ee + + 256 + 3 + 8 + cmlraXN0aGViZXN0 + + + 7521f360ae480e67c3096e4c046beb84 + + + P1D + + + + JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp== + + 1422542244 + + diff --git a/vendor/gems/depp/app/views/depp/xml_consoles/show.haml b/vendor/gems/depp/app/views/depp/xml_consoles/show.haml new file mode 100644 index 000000000..c08d8c972 --- /dev/null +++ b/vendor/gems/depp/app/views/depp/xml_consoles/show.haml @@ -0,0 +1,66 @@ +.row + .col-md-8 + = form_tag(xml_console_path) do + .form-group + = text_area_tag(:payload, params[:payload], class: 'form-control', rows: 15, style: 'font-family:monospace; font-size: 11px;') + + = button_tag t('send_epp_request'), class: 'btn btn-default' + .col-md-4 + %h4 Domain + %a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'domain', epp_action: 'create'}} + Create + , + %a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'domain', epp_action: 'update'}} + Update + , + %a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'domain', epp_action: 'info'}} + Info + , + %a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'domain', epp_action: 'renew'}} + Renew + , + %a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'domain', epp_action: 'check'}} + Check + , + %a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'domain', epp_action: 'transfer'}} + Transfer + , + %a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'domain', epp_action: 'delete'}} + Delete + + %h4 Keyrelay + %a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'keyrelay', epp_action: 'keyrelay'}} + Keyrelay + + %h4 Contact + %a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'contact', epp_action: 'create'}} + Create + , + %a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'contact', epp_action: 'check'}} + Check + , + %a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'contact', epp_action: 'check_multiple'}} + Check(multiple) + , + %a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'contact', epp_action: 'delete'}} + Delete + , + %a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'contact', epp_action: 'info'}} + Info + , + %a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'contact', epp_action: 'update_chg'}} + Update(chg) + +- if @result + %hr + .row + .col-md-12 + = preserve do + = CodeRay.scan(@result.to_s.force_encoding("UTF-8"), :xml).div().html_safe + +:javascript + $('.js-load-xml').click(function() { + $.get('xml_console/load_xml', {obj: $(this).data('obj'), epp_action: $(this).data('epp-action')}, function(data) { + $('textarea[name="payload"]').html(data); + }); + }); diff --git a/vendor/gems/depp/app/views/layouts/depp/application.haml b/vendor/gems/depp/app/views/layouts/depp/application.haml new file mode 100644 index 000000000..bf149da3d --- /dev/null +++ b/vendor/gems/depp/app/views/layouts/depp/application.haml @@ -0,0 +1,42 @@ +%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: "EPP-Client", name: "description"}/ + %meta{content: "Gitlab LTD", name: "author"}/ + = csrf_meta_tags + = stylesheet_link_tag 'depp/application', media: 'all', 'data-turbolinks-track' => true + = javascript_include_tag 'depp/application', 'data-turbolinks-track' => true + = favicon_link_tag 'favicon.ico' + = yield :window_title + %body{:style => env_style} + / Static navbar + .navbar.navbar-default.navbar-static-top{role: "navigation"} + .container + .navbar-header + %button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", type: "button"} + %span.sr-only Toggle navigation + %span.icon-bar + %span.icon-bar + %span.icon-bar + = link_to 'EPP Client', root_path, class: 'navbar-brand' + .navbar-collapse.collapse + %ul.nav.navbar-nav + - active_class = %w(domains check renew tranfer keyrelays).include?(params[:controller]) ? 'active' :nil + %li{class: active_class}= link_to t(:domains), domains_path + + - active_class = ['contacts'].include?(params[:controller]) ? 'active' :nil + %li{class: active_class}= link_to t(:contacts), contacts_path + + - active_class = ['xml_consoles'].include?(params[:controller]) ? 'active' :nil + %li{class: active_class}= link_to t(:xml_console), xml_console_path + + %ul.nav.navbar-nav.navbar-right + %li= link_to t(:log_out, user: depp_current_user.tag), '/logout' + / /.nav-collapse + + .container + = render 'depp/shared/flash' + = render 'depp/shared/epp_results' + = yield diff --git a/vendor/gems/depp/bin/rails b/vendor/gems/depp/bin/rails new file mode 100755 index 000000000..7d1fe1124 --- /dev/null +++ b/vendor/gems/depp/bin/rails @@ -0,0 +1,12 @@ +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. + +ENGINE_ROOT = File.expand_path('../..', __FILE__) +ENGINE_PATH = File.expand_path('../../lib/depp/engine', __FILE__) + +# Set up gems listed in the Gemfile. +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) + +require 'rails/all' +require 'rails/engine/commands' diff --git a/vendor/gems/depp/config/locales/en.yml b/vendor/gems/depp/config/locales/en.yml new file mode 100644 index 000000000..ea9ffa3da --- /dev/null +++ b/vendor/gems/depp/config/locales/en.yml @@ -0,0 +1,126 @@ +en: + activemodel: + errors: + models: + 'depp/user': + attributes: + base: + failed_to_open_connection_to_epp_server: 'Failed to open connection to EPP server!' + authorization_error: 'Authorization error' + invalid_cert: 'Invalid certificate' + tag: + blank: "Username can't be blank" + password: + blank: "Password can't be blank" + + username: 'Username' + password: 'Password' + log_in: 'Log in' + log_out: 'Log out (%{user})' + domain_name: 'Domain name' + domains: 'Domains' + register: 'Register' + check: 'Check' + contacts: 'Contacts' + domain_info: 'Domain info' + domain_details: 'Domain details' + xml_console: 'XML Console' + info: 'Info' + register: 'Register' + send_epp_request: 'Send EPP Request' + registrant: 'Registrant' + created_at: 'Created at' + valid_to: 'Valid to' + updated_at: 'Updated at' + tech_contacts: 'Tech contacts' + name: 'Name' + type: 'Type' + code: 'Code' + nameservers: 'Nameservers' + hostname: 'Hostname' + ipv4: 'IPv4' + ipv6: 'IPv6' + dnskeys: 'DNS Keys' + flag: 'Flag' + protocol: 'Protocol' + algorithm: 'Algorithm' + public_key: 'Public key' + ds_key_tag: 'DS key tag' + ds_algorithm: 'DS algorithm' + ds_digest_type: 'DS digest type' + ds_digest: 'DS digest' + statuses: 'Statuses' + status: 'Status' + description: 'Description' + check_domain: 'Check domain' + result: 'Result' + available: 'Available' + reason: 'Reason' + contact_code: 'Code' + add_another: 'Add another' + delete: 'Delete' + contact_type: 'Contact type' + edit_domain: 'Edit domain' + new_domain: 'New domain' + edit: 'Edit' + delete: 'Delete' + are_you_sure: 'Are you sure?' + renew: 'Renew' + renew_domain: 'Renew domain' + cur_exp_date: 'curExpDate' + transfer: 'Transfer' + query: 'Query' + transfer_domain: 'Transfer domain' + reject: 'Reject' + approve: 'Approve' + contact_info: 'Contact info' + contact_id: 'Contact ID' + address: 'Address' + street: 'Street' + city: 'City' + messages: 'Messages (%{count})' + message: 'Message' + message_no: 'Message #%{id}' + queue_date: 'Queue date' + messages_in_queue: 'Messages in queue' + you_have_no_new_messages: 'You have no new messages' + message_id: 'Message ID' + trStatus: 'Status' + reID: 'Transfer from' + reDate: 'Transfer requested at' + acID: 'Transfer to' + acDate: 'Accept date' + exDate: 'Valid to' + dequeue: 'Dequeue' + are_you_sure_you_want_to_delete_domain: 'Are you sure you want to delete domain %{domain}?' + keyrelay: 'Keyrelay' + expiry_relative: 'Expiry relative' + expiry_absolute: 'Expiry absolute' + upload_key: 'Upload key' + legal_document: 'Legal document' + delete_domain: 'Delete domain' + index: 'Index' + ident: 'Ident' + email: 'E-mail' + value: 'Value' + phone: 'Phone' + org_name: Org name + ident_type: Ident code + country: Country + period: Period + birthday_format: 'Insert birthday in format: YYYY-MM-DD' + your_session_has_timed_out: 'Your session has timed out. Please log in again.' + certificate_loaded: 'Certificate (already loaded)' + private_key_loaded: 'Private key (already loaded)' + credentials: 'Credentials' + pki: 'PKI' + zip: Postcode + contact_details: Contact Details + general: General + id_card: 'ID Card' + m_id: 'M-ID' + destroyed: It was successfully deleted. + not_found: Not found + no_connection_to_registry: Connection issue to the registry server! Please try again later. + domain_not_found: 'Domain was not found' + new_contact: 'New contact' diff --git a/vendor/gems/depp/config/locales/et.yml b/vendor/gems/depp/config/locales/et.yml new file mode 100644 index 000000000..37e1e9dea --- /dev/null +++ b/vendor/gems/depp/config/locales/et.yml @@ -0,0 +1,4 @@ +et: + username: 'Kasutajanimi' + password: 'Parool' + log_in: 'Logi sisse' diff --git a/vendor/gems/depp/config/routes.rb b/vendor/gems/depp/config/routes.rb new file mode 100644 index 000000000..f47cde33b --- /dev/null +++ b/vendor/gems/depp/config/routes.rb @@ -0,0 +1,41 @@ +Depp::Engine.routes.draw do + resources :domains do + collection do + post 'update', as: 'update' + post 'destroy', as: 'destroy' + get 'renew' + match 'transfer', via: [:post, :get] + get 'edit' + get 'info' + get 'check' + get 'delete' + end + end + + resources :contacts do + member do + get 'delete' + end + + collection do + get 'check' + end + end + + resource :poll do + collection do + post 'confirm_keyrelay' + post 'confirm_transfer' + end + end + + resource :keyrelay + + resource :xml_console do + collection do + get 'load_xml' + end + end + + root 'polls#show' +end diff --git a/vendor/gems/depp/depp.gemspec b/vendor/gems/depp/depp.gemspec new file mode 100644 index 000000000..bbb0aaa06 --- /dev/null +++ b/vendor/gems/depp/depp.gemspec @@ -0,0 +1,49 @@ +$:.push File.expand_path("../lib", __FILE__) + +# Maintain your gem's version: +require "depp/version" + +# Describe your gem and declare its dependencies: +Gem::Specification.new do |s| + s.name = "depp" + s.version = Depp::VERSION + s.authors = ["Priit Tark", "Martin Lensment"] + s.email = ["priit@gitlab.eu", "martin@gitlab.eu"] + s.homepage = "https://github.com/domify/depp" + s.summary = "EPP/REPP client build as Rails engine." + s.description = "EPP/REPP client build as Rails engine." + s.license = "MIT" + + s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"] + s.test_files = Dir["test/**/*"] + + s.add_dependency "rails", ">= 4.2.1" + + # load env + s.add_dependency "figaro", ">= 1.1.0" + + # html + s.add_dependency "haml-rails", ">= 0.9.0" + + # style + s.add_dependency "sass-rails", ">= 5.0.0" + + # js + s.add_dependency "uglifier", ">= 2.6.1" # minifies js + s.add_dependency "coffee-rails", ">= 4.1.0" # coffeescript support + s.add_dependency "jquery-rails", ">= 4.0.3" # jquery + + # epp api + # s.add_dependency "epp", "~> 1.4.2", github: 'gitlabeu/epp' + s.add_dependency "epp-xml", '>= 0.10.4' + s.add_dependency "nokogiri", '>= 1.6.6.2' + + # registry related + s.add_dependency "countries", '>= 0.9.3' + s.add_dependency "coderay", '>= 1.1.0' + s.add_dependency "uuidtools", '>= 2.1.4' + + s.add_dependency "kaminari", '~> 0.16.3' + + # s.add_development_dependency "sqlite3" +end diff --git a/vendor/gems/depp/lib/depp.rb b/vendor/gems/depp/lib/depp.rb new file mode 100644 index 000000000..2134fb7cc --- /dev/null +++ b/vendor/gems/depp/lib/depp.rb @@ -0,0 +1,5 @@ +require "depp/engine" + +module Depp + DEPP_RECORDS_ON_PAGE = 20 +end diff --git a/vendor/gems/depp/lib/depp/engine.rb b/vendor/gems/depp/lib/depp/engine.rb new file mode 100644 index 000000000..d68b3c93f --- /dev/null +++ b/vendor/gems/depp/lib/depp/engine.rb @@ -0,0 +1,10 @@ +require 'epp-xml' +require 'countries' +require 'depp/sorted_country' +require 'coderay' + +module Depp + class Engine < ::Rails::Engine + isolate_namespace Depp + end +end diff --git a/vendor/gems/depp/lib/depp/sorted_country.rb b/vendor/gems/depp/lib/depp/sorted_country.rb new file mode 100644 index 000000000..5b452b236 --- /dev/null +++ b/vendor/gems/depp/lib/depp/sorted_country.rb @@ -0,0 +1,42 @@ +require 'countries' +require 'action_view' + +class SortedCountry + class << self + include ActionView::Helpers + + def all_options(selected = nil) + quick_options = options_for_select(quick_list + [['---','']], selected) + + # no double select + selected = quick_list.map{ |c| c.second }.include?(selected) ? '' : selected + + all_options = options_for_select(all_sorted_truncated, selected) + quick_options + all_options + end + + private + + def quick_list + @quick_list ||= + [ + ['Estonia', 'EE'], + ['Finland', 'FI'], + ['Latvia', 'LV'], + ['Lithuania', 'LT'], + ['Russian Federation', 'RU'], + ['Sweden', 'SE'], + ['United States', 'US'] + ] + end + + def all_sorted + @all_sorted ||= Country.all.sort_by { |name, _code| name.first } + end + + def all_sorted_truncated + @all_sorted_truncated ||= + all_sorted.map { |name, code| [truncate(name, length: 26), code] } + end + end +end diff --git a/vendor/gems/depp/lib/depp/version.rb b/vendor/gems/depp/lib/depp/version.rb new file mode 100644 index 000000000..e2b711832 --- /dev/null +++ b/vendor/gems/depp/lib/depp/version.rb @@ -0,0 +1,3 @@ +module Depp + VERSION = "0.0.2" +end diff --git a/vendor/gems/depp/lib/tasks/depp_tasks.rake b/vendor/gems/depp/lib/tasks/depp_tasks.rake new file mode 100644 index 000000000..9659f1e61 --- /dev/null +++ b/vendor/gems/depp/lib/tasks/depp_tasks.rake @@ -0,0 +1,4 @@ +# desc "Explaining what the task does" +# task :depp do +# # Task goes here +# end diff --git a/vendor/gems/depp/test/depp_test.rb b/vendor/gems/depp/test/depp_test.rb new file mode 100644 index 000000000..9d298f550 --- /dev/null +++ b/vendor/gems/depp/test/depp_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class DeppTest < ActiveSupport::TestCase + test "truth" do + assert_kind_of Module, Depp + end +end diff --git a/vendor/gems/depp/test/dummy/README.rdoc b/vendor/gems/depp/test/dummy/README.rdoc new file mode 100644 index 000000000..dd4e97e22 --- /dev/null +++ b/vendor/gems/depp/test/dummy/README.rdoc @@ -0,0 +1,28 @@ +== README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... + + +Please feel free to use a different markup language if you do not plan to run +rake doc:app. diff --git a/vendor/gems/depp/test/dummy/Rakefile b/vendor/gems/depp/test/dummy/Rakefile new file mode 100644 index 000000000..ba6b733dd --- /dev/null +++ b/vendor/gems/depp/test/dummy/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path('../config/application', __FILE__) + +Rails.application.load_tasks diff --git a/vendor/gems/depp/test/dummy/app/assets/images/.keep b/vendor/gems/depp/test/dummy/app/assets/images/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/gems/depp/test/dummy/app/assets/javascripts/application.js b/vendor/gems/depp/test/dummy/app/assets/javascripts/application.js new file mode 100644 index 000000000..8913b40f6 --- /dev/null +++ b/vendor/gems/depp/test/dummy/app/assets/javascripts/application.js @@ -0,0 +1,13 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require_tree . diff --git a/vendor/gems/depp/test/dummy/app/assets/stylesheets/application.css b/vendor/gems/depp/test/dummy/app/assets/stylesheets/application.css new file mode 100644 index 000000000..f9cd5b348 --- /dev/null +++ b/vendor/gems/depp/test/dummy/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any styles + * defined in the other CSS/SCSS files in this directory. It is generally better to create a new + * file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/vendor/gems/depp/test/dummy/app/controllers/application_controller.rb b/vendor/gems/depp/test/dummy/app/controllers/application_controller.rb new file mode 100644 index 000000000..d83690e1b --- /dev/null +++ b/vendor/gems/depp/test/dummy/app/controllers/application_controller.rb @@ -0,0 +1,5 @@ +class ApplicationController < ActionController::Base + # Prevent CSRF attacks by raising an exception. + # For APIs, you may want to use :null_session instead. + protect_from_forgery with: :exception +end diff --git a/vendor/gems/depp/test/dummy/app/controllers/concerns/.keep b/vendor/gems/depp/test/dummy/app/controllers/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/gems/depp/test/dummy/app/helpers/application_helper.rb b/vendor/gems/depp/test/dummy/app/helpers/application_helper.rb new file mode 100644 index 000000000..de6be7945 --- /dev/null +++ b/vendor/gems/depp/test/dummy/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/vendor/gems/depp/test/dummy/app/mailers/.keep b/vendor/gems/depp/test/dummy/app/mailers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/gems/depp/test/dummy/app/models/.keep b/vendor/gems/depp/test/dummy/app/models/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/gems/depp/test/dummy/app/models/concerns/.keep b/vendor/gems/depp/test/dummy/app/models/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/gems/depp/test/dummy/app/views/layouts/application.html.erb b/vendor/gems/depp/test/dummy/app/views/layouts/application.html.erb new file mode 100644 index 000000000..593a778ba --- /dev/null +++ b/vendor/gems/depp/test/dummy/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + Dummy + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> + <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> + <%= csrf_meta_tags %> + + + +<%= yield %> + + + diff --git a/vendor/gems/depp/test/dummy/bin/bundle b/vendor/gems/depp/test/dummy/bin/bundle new file mode 100755 index 000000000..66e9889e8 --- /dev/null +++ b/vendor/gems/depp/test/dummy/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/vendor/gems/depp/test/dummy/bin/rails b/vendor/gems/depp/test/dummy/bin/rails new file mode 100755 index 000000000..5191e6927 --- /dev/null +++ b/vendor/gems/depp/test/dummy/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/vendor/gems/depp/test/dummy/bin/rake b/vendor/gems/depp/test/dummy/bin/rake new file mode 100755 index 000000000..17240489f --- /dev/null +++ b/vendor/gems/depp/test/dummy/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/vendor/gems/depp/test/dummy/bin/setup b/vendor/gems/depp/test/dummy/bin/setup new file mode 100755 index 000000000..acdb2c138 --- /dev/null +++ b/vendor/gems/depp/test/dummy/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file: + + puts "== Installing dependencies ==" + system "gem install bundler --conservative" + system "bundle check || bundle install" + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end diff --git a/vendor/gems/depp/test/dummy/config.ru b/vendor/gems/depp/test/dummy/config.ru new file mode 100644 index 000000000..bd83b2541 --- /dev/null +++ b/vendor/gems/depp/test/dummy/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Rails.application diff --git a/vendor/gems/depp/test/dummy/config/application.rb b/vendor/gems/depp/test/dummy/config/application.rb new file mode 100644 index 000000000..880c067dd --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/application.rb @@ -0,0 +1,26 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +Bundler.require(*Rails.groups) +require "depp" + +module Dummy + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Do not swallow errors in after_commit/after_rollback callbacks. + config.active_record.raise_in_transactional_callbacks = true + end +end + diff --git a/vendor/gems/depp/test/dummy/config/boot.rb b/vendor/gems/depp/test/dummy/config/boot.rb new file mode 100644 index 000000000..6266cfc50 --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/boot.rb @@ -0,0 +1,5 @@ +# Set up gems listed in the Gemfile. +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) + +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) +$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) diff --git a/vendor/gems/depp/test/dummy/config/database.yml b/vendor/gems/depp/test/dummy/config/database.yml new file mode 100644 index 000000000..1c1a37ca8 --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +# +default: &default + adapter: sqlite3 + pool: 5 + timeout: 5000 + +development: + <<: *default + database: db/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: db/test.sqlite3 + +production: + <<: *default + database: db/production.sqlite3 diff --git a/vendor/gems/depp/test/dummy/config/environment.rb b/vendor/gems/depp/test/dummy/config/environment.rb new file mode 100644 index 000000000..ee8d90dc6 --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require File.expand_path('../application', __FILE__) + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/vendor/gems/depp/test/dummy/config/environments/development.rb b/vendor/gems/depp/test/dummy/config/environments/development.rb new file mode 100644 index 000000000..b55e2144b --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/environments/development.rb @@ -0,0 +1,41 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/vendor/gems/depp/test/dummy/config/environments/production.rb b/vendor/gems/depp/test/dummy/config/environments/production.rb new file mode 100644 index 000000000..5c1b32e48 --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/environments/production.rb @@ -0,0 +1,79 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like + # NGINX, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Asset digests allow you to set far-future HTTP expiration dates on all assets, + # yet still be able to expire them through the digest params. + config.assets.digest = true + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + # config.log_tags = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups. + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/vendor/gems/depp/test/dummy/config/environments/test.rb b/vendor/gems/depp/test/dummy/config/environments/test.rb new file mode 100644 index 000000000..1c19f08b2 --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/environments/test.rb @@ -0,0 +1,42 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure static file server for tests with Cache-Control for performance. + config.serve_static_files = true + config.static_cache_control = 'public, max-age=3600' + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Randomize the order test cases are executed. + config.active_support.test_order = :random + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/vendor/gems/depp/test/dummy/config/initializers/assets.rb b/vendor/gems/depp/test/dummy/config/initializers/assets.rb new file mode 100644 index 000000000..01ef3e663 --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +# Rails.application.config.assets.precompile += %w( search.js ) diff --git a/vendor/gems/depp/test/dummy/config/initializers/backtrace_silencers.rb b/vendor/gems/depp/test/dummy/config/initializers/backtrace_silencers.rb new file mode 100644 index 000000000..59385cdf3 --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/vendor/gems/depp/test/dummy/config/initializers/cookies_serializer.rb b/vendor/gems/depp/test/dummy/config/initializers/cookies_serializer.rb new file mode 100644 index 000000000..7f70458de --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/vendor/gems/depp/test/dummy/config/initializers/filter_parameter_logging.rb b/vendor/gems/depp/test/dummy/config/initializers/filter_parameter_logging.rb new file mode 100644 index 000000000..4a994e1e7 --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/vendor/gems/depp/test/dummy/config/initializers/inflections.rb b/vendor/gems/depp/test/dummy/config/initializers/inflections.rb new file mode 100644 index 000000000..ac033bf9d --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/vendor/gems/depp/test/dummy/config/initializers/mime_types.rb b/vendor/gems/depp/test/dummy/config/initializers/mime_types.rb new file mode 100644 index 000000000..dc1899682 --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/vendor/gems/depp/test/dummy/config/initializers/session_store.rb b/vendor/gems/depp/test/dummy/config/initializers/session_store.rb new file mode 100644 index 000000000..e766b67b1 --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_dummy_session' diff --git a/vendor/gems/depp/test/dummy/config/initializers/wrap_parameters.rb b/vendor/gems/depp/test/dummy/config/initializers/wrap_parameters.rb new file mode 100644 index 000000000..33725e95f --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] if respond_to?(:wrap_parameters) +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/vendor/gems/depp/test/dummy/config/locales/en.yml b/vendor/gems/depp/test/dummy/config/locales/en.yml new file mode 100644 index 000000000..065395716 --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/locales/en.yml @@ -0,0 +1,23 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/vendor/gems/depp/test/dummy/config/routes.rb b/vendor/gems/depp/test/dummy/config/routes.rb new file mode 100644 index 000000000..620c2d782 --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/routes.rb @@ -0,0 +1,4 @@ +Rails.application.routes.draw do + + mount Depp::Engine => "/depp" +end diff --git a/vendor/gems/depp/test/dummy/config/secrets.yml b/vendor/gems/depp/test/dummy/config/secrets.yml new file mode 100644 index 000000000..cb0c1bdfe --- /dev/null +++ b/vendor/gems/depp/test/dummy/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: c011b0c80f810476a5141330eebf338821a3eddfbb71297021bc77c828eda3f6c7bc25a5b2efcdd1f9bc902f6704444189135123efe967289c2f77347a4895e1 + +test: + secret_key_base: 815fb11f0cd80bedd5505e0e85717645c1e715fcc24029d8c0c763bd41a372d7b80f1a2252cc99a37870c2bcb2b363fd4e25d715ecb9ec50256147f5eb1e25ba + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/vendor/gems/depp/test/dummy/lib/assets/.keep b/vendor/gems/depp/test/dummy/lib/assets/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/gems/depp/test/dummy/log/.keep b/vendor/gems/depp/test/dummy/log/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/gems/depp/test/dummy/public/404.html b/vendor/gems/depp/test/dummy/public/404.html new file mode 100644 index 000000000..b612547fc --- /dev/null +++ b/vendor/gems/depp/test/dummy/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
+
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/vendor/gems/depp/test/dummy/public/422.html b/vendor/gems/depp/test/dummy/public/422.html new file mode 100644 index 000000000..a21f82b3b --- /dev/null +++ b/vendor/gems/depp/test/dummy/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
+
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/vendor/gems/depp/test/dummy/public/500.html b/vendor/gems/depp/test/dummy/public/500.html new file mode 100644 index 000000000..061abc587 --- /dev/null +++ b/vendor/gems/depp/test/dummy/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
+
+

We're sorry, but something went wrong.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/vendor/gems/depp/test/dummy/public/favicon.ico b/vendor/gems/depp/test/dummy/public/favicon.ico new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/gems/depp/test/integration/navigation_test.rb b/vendor/gems/depp/test/integration/navigation_test.rb new file mode 100644 index 000000000..97a94c9bb --- /dev/null +++ b/vendor/gems/depp/test/integration/navigation_test.rb @@ -0,0 +1,10 @@ +require 'test_helper' + +class NavigationTest < ActionDispatch::IntegrationTest + fixtures :all + + # test "the truth" do + # assert true + # end +end + diff --git a/vendor/gems/depp/test/test_helper.rb b/vendor/gems/depp/test/test_helper.rb new file mode 100644 index 000000000..a3177bf35 --- /dev/null +++ b/vendor/gems/depp/test/test_helper.rb @@ -0,0 +1,20 @@ +# Configure Rails Environment +ENV["RAILS_ENV"] = "test" + +require File.expand_path("../../test/dummy/config/environment.rb", __FILE__) +ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)] +ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__) +require "rails/test_help" + +# Filter out Minitest backtrace while allowing backtrace from other libraries +# to be shown. +Minitest.backtrace_filter = Minitest::BacktraceFilter.new + +# Load support files +Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } + +# Load fixtures from the engine +if ActiveSupport::TestCase.respond_to?(:fixture_path=) + ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__) + ActiveSupport::TestCase.fixtures :all +end diff --git a/vendor/gems/depp/vendor/assets/javascripts/.keep b/vendor/gems/depp/vendor/assets/javascripts/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/gems/depp/vendor/assets/javascripts/jquery.nested_attributes.coffee b/vendor/gems/depp/vendor/assets/javascripts/jquery.nested_attributes.coffee new file mode 100644 index 000000000..f3d11cf97 --- /dev/null +++ b/vendor/gems/depp/vendor/assets/javascripts/jquery.nested_attributes.coffee @@ -0,0 +1,293 @@ +### +Authors: Nick Giancola (@patbenatar), Brendan Loudermilk (@bloudermilk) +Homepage: https://github.com/patbenatar/jquery-nested_attributes +### +$ = jQuery + +methods = + init: (options) -> + $el = $(@) + throw "Can't initialize more than one item at a time" if $el.length > 1 + if $el.data("nestedAttributes") + throw "Can't initialize on this element more than once" + instance = new NestedAttributes($el, options) + $el.data("nestedAttributes", instance) + return $el + add: -> + $el = $(@) + unless $el.data("nestedAttributes")? + throw "You are trying to call instance methods without initializing first" + $el.data("nestedAttributes").addItem() + return $el + +$.fn.nestedAttributes = (method) -> + if methods[method]? + return methods[method].apply @, Array.prototype.slice.call(arguments, 1) + else if typeof method == 'object' || !method + return methods.init.apply(@, arguments) + else + $.error("Method #{method} does not exist on jQuery.nestedAttributes") + +class NestedAttributes + + RELEVANT_INPUTS_SELECTOR: ":input[name][name!=\"\"]" + + settings: + collectionName: false # If not provided, we will autodetect + bindAddTo: false # Required + removeOnLoadIf: false + collectIdAttributes: true + beforeAdd: false + afterAdd: false + beforeMove: false + afterMove: false + beforeDestroy: false + afterDestroy: false + destroySelector: '.destroy' + deepClone: true + $clone: null + + ###################### + ## ## + ## Initialization ## + ## ## + ###################### + + constructor: ($el, options) -> + + # This plugin gets called on the container + @$container = $el + + # Merge default options + @options = $.extend({}, @settings, options) + + # If the user provided a jQuery object to bind the "Add" + # bind it now or forever hold your peace. + @options.bindAddTo.click(@addClick) if @options.bindAddTo + + # Cache all the items + @$items = @$container.children() + + # If the user didn't provide a collectionName, autodetect it + unless @options.collectionName + @autodetectCollectionName() + + # Initialize existing items + @$items.each (i, el) => + $item = $(el) + + # If the user wants us to attempt to collect Rail's ID attributes, do it now + # Using the default rails helpers, ID attributes will wind up right after their + # propper containers in the form. + if @options.collectIdAttributes and $item.is('input') + # Move the _id field into its proper container + $item.appendTo($item.prev()) + # Remove it from the $items collection + @$items = @$items.not($item) + else + # Try to find and bind the destroy link if the user wanted one + @bindDestroy($item) + + # Now that we've collected ID attributes + @hideIfAlreadyDestroyed $(item) for item in @$items + + # Remove any items on load if the client implements a check and the check passes + if @options.removeOnLoadIf + @$items.each (i, el) => + $el = $(el) + if $el.call(true, @options.removeOnLoadIf, i) + $el.remove() + + + ######################## + ## ## + ## Instance Methods ## + ## ## + ######################## + + autodetectCollectionName: -> + pattern = /\[(.[^\]]*)_attributes\]/ + try + match = pattern.exec(@$items.first().find("#{@RELEVANT_INPUTS_SELECTOR}:first").attr('name'))[1] + if match != null + @options.collectionName = match + else + throw "Regex error" + catch error + console.log "Error detecting collection name", error + + addClick: (event) => + + @addItem() + + # Don't let the link do anything + event.preventDefault() + + addItem: -> + # Piece together an item + newIndex = @$items.length + $newClone = @applyIndexToItem(@extractClone(), newIndex) + + # Give the user a chance to make their own changes before we insert + if (@options.beforeAdd) + + # Stop the add process if the callback returns false + return false if !@options.beforeAdd.call(undefined, $newClone, newIndex) + + # Insert the new item after the last item + @$container.append($newClone) + + # Give the user a chance to make their own changes after insertion + @options.afterAdd.call(undefined, $newClone, newIndex) if (@options.afterAdd) + + # Add this item to the items list + @refreshItems() + + extractClone: -> + + # Are we restoring from an already created clone? + if @$restorableClone + + $record = @$restorableClone + + @$restorableClone = null + + else + $record = @options.$clone || @$items.first() + + # Make a deep clone (bound events and data) + $record = $record.clone(@options.deepClone) + + @bindDestroy($record) if @options.$clone or !@options.deepClone + + # Empty out the values of text inputs and selects + $record.find(':text, textarea, select').val('') + + # Reset checkboxes and radios + $record.find(':checkbox, :radio').attr("checked", false) + + # Empty out any hidden [id] or [_destroy] fields + $record.find('input[name$="\\[id\\]"]').remove() + $record.find('input[name$="\\[_destroy\\]"]').remove() + + # Make sure it's not hidden as we return. + # It would be hidden in the case where we're duplicating an + # already removed item for its template. + return $record.show() + + applyIndexToItem: ($item, index) -> + collectionName = @options.collectionName + + $item.find(@RELEVANT_INPUTS_SELECTOR).each (i, el) => + + $el = $(el) + + idRegExp = new RegExp("_#{collectionName}_attributes_\\d+_") + idReplacement = "_#{collectionName}_attributes_#{index}_" + nameRegExp = new RegExp("\\[#{collectionName}_attributes\\]\\[\\d+\\]") + nameReplacement = "[#{collectionName}_attributes][#{index}]" + + newID = $el.attr('id').replace(idRegExp, idReplacement) if $el.attr('id') + newName = $el.attr('name').replace(nameRegExp, nameReplacement) + + $el.attr + id: newID + name: newName + + $item.find('label[for]').each (i, el) => + $el = $(el) + try + forRegExp = new RegExp("_#{collectionName}_attributes_\\d+_") + forReplacement = "_#{collectionName}_attributes_#{index}_" + newFor = $el.attr('for').replace(forRegExp, forReplacement) + $el.attr('for', newFor) + catch error + console.log "Error updating label", error + + return $item + + hideIfAlreadyDestroyed: ($item) -> + $destroyField = $item.find("[name$='[_destroy]']") + if $destroyField.length && $destroyField.val() == "true" + @destroy $item + + # Hides a item from the user and marks it for deletion in the + # DOM by setting _destroy to true if the record already exists. If it + # is a new escalation, we simple delete the item + destroyClick: (event) => + event.preventDefault() + @destroy $(event.target).parentsUntil(@$container).last() + + destroy: ($item) -> + # If you're about to delete the last one, + # cache a clone of it first so we have something to show + # the next time user hits add + @$restorableClone = @extractClone() unless @$items.length-1 + + index = @indexForItem($item) + itemIsNew = $item.find('input[name$="\\[id\\]"]').length == 0 + + if (@options.beforeDestroy) + + # Stop the destroy process if the callback returns false + return false if !@options.beforeDestroy.call(undefined, $item, index, itemIsNew) + + # Add a blank item row if none are visible after this deletion + @addItem() unless @$items.filter(':visible').length-1 + + if itemIsNew + + $item.remove() + + else + + # Hide the item + $item.hide() + + # Add the _destroy field + otherFieldName = $item.find(':input[name]:first').attr('name') + attributePosition = otherFieldName.lastIndexOf('[') + destroyFieldName = "#{otherFieldName.substring(0, attributePosition)}[_destroy]" + # First look for an existing _destroy field + $destroyField = $item.find("input[name='#{destroyFieldName}']") + # If it doesn't exist, create it + if $destroyField.length == 0 + $destroyField = $("") + $item.append($destroyField) + $destroyField.val(true).change() + + @options.afterDestroy.call($item, index, itemIsNew) if (@options.afterDestroy) + + # Remove this item from the items list + @refreshItems() + + # Rename the remaining items + @resetIndexes() + + indexForItem: ($item) -> + regExp = new RegExp("\\[#{@options.collectionName}_attributes\\]\\[\\d+\\]") + name = $item.find("#{@RELEVANT_INPUTS_SELECTOR}:first").attr('name') + return parseInt(name.match(regExp)[0].split('][')[1].slice(0, -1), 10) + + refreshItems: -> + @$items = @$container.children() + + # Sets the proper association indices and labels to all items + # Used when removing items + resetIndexes: -> + @$items.each (i, el) => + $el = $(el) + + # Make sure this is actually a new position + oldIndex = @indexForItem($el) + return true if (i == oldIndex) + + @options.beforeMove.call($el, i, oldIndex) if (@options.beforeMove) + + # Change the number to the new index + @applyIndexToItem($el, i) + + @options.afterMove.call($el, i, oldIndex) if (@options.afterMove) + + bindDestroy: ($item) -> + $item.find(@options.destroySelector).click(@destroyClick) if (@options.destroySelector) diff --git a/vendor/gems/depp/vendor/assets/stylesheets/.keep b/vendor/gems/depp/vendor/assets/stylesheets/.keep new file mode 100644 index 000000000..e69de29bb