/ TODO
/ Replace ApplicationName
.home
.banners
.row
.col-md-10.col-md-offset-2
%h2 ApplicationName Connector
%p
-if @organization
Link your company #{@organization.name} (#{@organization.uid}) to ApplicationName to get your business in synch. Check the status of your connection on this screen.
-else
Link your account to ApplicationName to get your business in synch. Check the status of your connection on this screen.
.container
- if current_user
- unless is_admin
.row
.col-md-12.alert.alert-warning
Only administrators can modify the application settings
.row.link-step{class: "#{@organization.oauth_uid ? 'done' : 'todo'}"}
.col-md-1.text-center.link-step-number
%span.badge.link-step-badge
1
.col-md-6.link-step-description
%h
- if @organization.oauth_uid
Your ApplicationName account #{@organization.oauth_name} (#{@organization.oauth_uid}) is currently linked
- else
Your ApplicationName account is not linked
.col-md-2.col-md-offset-3.text-center.link-step-action
- if @organization.oauth_uid
= link_to "Disconnect", signout_omniauth_path(organization_id: @organization.id), class: "btn btn-warning btn-lg #{is_admin ? '' : 'disabled'}"
- else
= link_to "Link to ApplicationName", "/auth/ApplicationName/request?org_uid=#{@organization.uid}", class: "btn btn-warning btn-lg" if is_admin
.spacer1
.row.link-step{class: "#{(@organization.sync_enabled && @organization.synchronized_entities.values.any?) ? 'done' : 'todo'}"}
= form_tag home_update_path(id: @organization.id), method: :put do
.col-md-1.text-center.link-step-number
%span.badge.link-step-badge
2
.col-md-9.link-step-description
%h
You can customize which entities are synchronized by the connector:
.spacer1
.row
.col-md-11.col-md-offset-1
- @organization.synchronized_entities.each do |k, v|
.row.sync-entity
.col-md-1.link-step-action
%input{type: "checkbox", id: "#{k}", name: "#{k}", checked: v}
.col-md-6{style: 'padding-top: 5px;'}
%label{:for => "#{k}"} #{k.to_s.humanize.pluralize}
-if is_admin
.col-md-5.text-right
- if v && @organization.oauth_uid && @organization.sync_enabled
= link_to "Force a synchronization for #{k.to_s.humanize.pluralize} only", home_synchronize_path(opts: {only_entities: [k.to_s]}), method: :post, class: "btn btn-warning btn-sm"
.spacer1
.row
.col-md-2.col-md-offset-10.text-center.link-step-action
=submit_tag "#{@organization.sync_enabled ? 'Update' : 'Start synchronizing!'}", class: "btn btn-lg btn-warning #{@organization.oauth_uid ? '' : 'disabled'} text-sm"
-if @organization.oauth_uid && @organization.sync_enabled
.spacer2
.row
.col-md-4.col-md-offset-4.text-center
= link_to 'Go to ApplicationName', home_redirect_to_external_path, class: 'btn btn-lg btn-primary'
- else
.row
.col-md-4.col-md-offset-4.center
= link_to "Link your Maestrano account", Maestrano::Connector::Rails::Engine.routes.url_helpers.default_maestrano_auth_saml_index_path(tenant: :default), class: 'btn btn-warning'