From 364adffdab2f266bb1802b228fb0911e7e467064 Mon Sep 17 00:00:00 2001 From: shlok007 Date: Thu, 3 Aug 2017 00:07:38 +0530 Subject: [PATCH] added show page for custom domain --- .../admin/conferences_controller.rb | 2 + .../admin/conferences/custom_domain.html.haml | 76 +++++++++++++++++++ app/views/layouts/_admin_sidebar.html.haml | 5 ++ config/routes.rb | 3 + 4 files changed, 86 insertions(+) create mode 100644 app/views/admin/conferences/custom_domain.html.haml diff --git a/app/controllers/admin/conferences_controller.rb b/app/controllers/admin/conferences_controller.rb index 6716a253..3c900a45 100644 --- a/app/controllers/admin/conferences_controller.rb +++ b/app/controllers/admin/conferences_controller.rb @@ -4,6 +4,8 @@ module Admin load_resource :program, through: :conference, singleton: true, except: :index load_resource :user, only: [:remove_user] + def cusrom_domain; end + def index # Redirect to new form if there is no conference if Conference.count == 0 diff --git a/app/views/admin/conferences/custom_domain.html.haml b/app/views/admin/conferences/custom_domain.html.haml new file mode 100644 index 00000000..7eb9d85a --- /dev/null +++ b/app/views/admin/conferences/custom_domain.html.haml @@ -0,0 +1,76 @@ +.row + .col-md-12 + %h1 + Custom domain + %p.text-muted + Point your own domain to #{@conference.title} +%hr +.row + .col-md-12 + %table.table + %thead + %th Domain Name + %th Correctly points to #{@conference.short_title} + %th Actions + %tbody + %tr + %td + = @conference.custom_domain + %td + = "" + %td + .btn-group + = link_to 'Edit', edit_admin_conference_path(@conference), + method: :get, class: 'btn btn-primary' + = link_to 'Delete', admin_conference_path(@conference), + method: :delete, class: 'btn btn-danger' +.row + .col-md-9.text-right + = link_to '#status-help', class: 'btn btn-default', "data-toggle"=>"collapse" do + Help? +.row + .col-md-12 + .collapse#status-help + %h2 + Instructions to add your own domain + %hr + %p + When you created the conference, the conference splash page is available in the following domain: + %strong + osem.io/conferences/#{@conference.short_title} + %p + However, we also provide support for hosting conferences on your own domain. + + Terms to get familiar with: + %p + %strong + Domain registrar: + Domain registrar is just another term used for providers who work on reserving domain names. + %p + %strong + CNAME: + A Canonical Name record is a resource used which defines that your domain name is an alias for another domain name. + %p + To add your own domain you can follow these + %i + three + steps: + %ol + %li + Pick a domain you want to host your conference on from a domain registrar or register it with a domain registrar. + %li + Add your own domain name to OSEM ( link to conference/custom_domain#create ) and select the conference it should belong to. + %li + The last step is adding a CNAME record in your registrar’s DNS Settings. Different registrars have different ways of adding a CNAME record. The following guides would help you setup a CNAME record depending upon the registrar of your domain. If it doesn’t, you probably should get in touch with your domain registrar and ask him how to register a CNAME record in their platform. + %ul + %li + = link_to 'GoDaddy', 'https://in.godaddy.com/help/add-a-cname-record-19236' + %li + = link_to 'Namecheap', 'https://www.namecheap.com/support/knowledgebase/article.aspx/9646/2237/how-can-i-set-up-a-cname-record-for-my-domain' + %li + = link_to 'BlueHost', 'https://my.bluehost.com/cgi/help/cname#creating_a_cname' + %li + = link_to '12-reg.co.uk', 'https://www.123-reg.co.uk/support/answers/Domains/Domain-Configuration/how-do-i-set-up-a-cname-record-on-my-domain-name-1198/' + + + diff --git a/app/views/layouts/_admin_sidebar.html.haml b/app/views/layouts/_admin_sidebar.html.haml index 1c7bac9a..a4f857fb 100644 --- a/app/views/layouts/_admin_sidebar.html.haml +++ b/app/views/layouts/_admin_sidebar.html.haml @@ -27,6 +27,11 @@ = link_to(admin_conference_path(@conference.short_title)) do %span.fa.fa-tachometer Dashboard + - if can? :edit, @conference + %li + = link_to(custom_domain_admin_conference_path(@conference.short_title)) do + %span.fa.fa-link + Custom domain - if can? :show, @conference %li{class: "#{active_nav_li(edit_admin_conference_path(@conference.short_title))}"} - if can? :edit, @conference diff --git a/config/routes.rb b/config/routes.rb index 381e55ee..380d9d43 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -32,6 +32,9 @@ Osem::Application.routes.draw do end resources :comments, only: [:index] resources :conferences do + member do + get :custom_domain + end resource :contact, except: [:index, :new, :create, :show, :destroy] resources :schedules, only: [:index, :create, :show, :update, :destroy] resources :event_schedules, only: [:create, :update, :destroy]