diff --git a/static/css/bootstrap-wizard.css b/static/css/bootstrap-wizard.css deleted file mode 100644 index c90510ea..00000000 --- a/static/css/bootstrap-wizard.css +++ /dev/null @@ -1,186 +0,0 @@ -/* WIZARD GENERAL */ -.wizard { - display:none; -} - -.wizard-dialog {} -.wizard-content {} - -.wizard-body { - padding: 0; - margin: 0; -} - -/* WIZARD HEADER */ -.wizard-header { - padding: 9px 15px; - border-bottom: 0; -} - -.wizard-header h3 { - margin: 0; - line-height: 35px; - display: inline; - font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; - font-family: inherit; - font-weight: bold; - text-rendering: optimizelegibility; - color: rgb(51, 51, 51); -} - -.wizard-subtitle { - font-weight:bold; - color:#AFAFAF; - padding-left:20px; -} - - -/* WIZARD NAVIGATION */ -.wizard-steps { - width: 28%; - background-color: #f5f5f5; - border-bottom-left-radius: 6px; - position: relative; -} - -.wizard-nav-container { - padding-bottom: 30px; -} - -.wizard-nav-list { - margin-bottom: 0; -} - -.wizard-nav-link .glyphicon-chevron-right { - float:right; - margin-top:12px; - margin-right:-6px; - opacity:.25; -} - -li.wizard-nav-item.active .glyphicon-chevron-right { - opacity:1; -} - -li.wizard-nav-item { - line-height:40px; -} - -.wizard-nav-list > li > a { - background-color:#f5f5f5; - padding:3px 15px 3px 20px; - cursor:default; - color:#B4B4B4; -} - -.wizard-nav-list > li > a:hover { - background-color: transparent; -} - -.wizard-nav-list > li.already-visited > a.wizard-nav-link { - color:#08C; - cursor:pointer; -} - -.wizard-nav-list > li.active > a.wizard-nav-link { - color:white; -} - -.wizard-nav-item .already-visited .active { - background-color:#08C; -} - -.wizard-nav-list li.active > a { - background-color:#08C; -} - - -/* WIZARD CONTENT */ -.wizard-body form { - padding: 0; - margin: 0; -} - -/* WIZARD PROGRESS BAR */ -.wizard-progress-container { - margin-top: 20px; - padding: 15px; - width: 100%; - position: absolute; - bottom: 0; -} - -.wizard-progress-container .progress-bar { - width: 0; -} - -.wizard-card-container { - margin-left: 28%; -} - -/* WIZARD CARDS */ -.wizard-error, -.wizard-failure, -.wizard-success, -.wizard-loading, -.wizard-card { - border-top: 1px solid #EEE; - display:none; - padding:35px; - padding-top:20px; - overflow-y:auto; - - /* - position:relative; - height:300px; - margin-right: 5px; - */ -} - -.wizard-card-overlay { - overflow-y: initial; -} - -.wizard-card > h3 { - margin-top:0; - margin-bottom:20px; - font-size:21px; - line-height:40px; - font-weight:normal; -} - -/* WIZARD FOOTER */ -.wizard-footer { - padding:0; -} - -.wizard-buttons-container { - padding:20px; -} - -.wizard-cancel { - margin-left: 12px; -} - -/* Inner Card */ -.wizard-input-section { - margin-bottom:20px; -} - -.wizard-dialog .popover.error-popover { - background-color:#F2DEDE; - color:#B94A48; - border-color:#953B39; -} - -.wizard-dialog .popover.error-popover .arrow::after { - border-right-color:#F2DEDE; -} - -.wizard-dialog .popover.error-popover .popover-title { - display:none; -} - -.wizard-dialog .popover.error-popover .arrow { - border-right-color:#953B39; -} diff --git a/static/css/bootstrap2-wizard.css b/static/css/bootstrap2-wizard.css deleted file mode 100644 index 21ecb9b3..00000000 --- a/static/css/bootstrap2-wizard.css +++ /dev/null @@ -1,160 +0,0 @@ -.wizard { - display:none; -} -.wizard-modal form { - margin:0; - padding:0; -} -.wizard-modal.modal { - width:750px; - margin-left:-375px; - top:50%; -} -.wizard-modal-footer { - padding:0; -} -.wizard-modal-header.modal-header h3 { - line-height:35px; - display:inline -} -.wizard-modal-header.modal-header { - border-bottom:0; -} - -.wizard-subtitle { - font-weight:bold; - color:#AFAFAF; - padding-left:20px; -} - -.wizard-error, -.wizard-failure, -.wizard-success, -.wizard-loading, -.wizard-card { - position:relative; - padding:35px; - padding-top:20px; - overflow-y:auto; - height:300px; - display:none; - border-top: 1px solid #EEE; - margin-right: 5px; -} - -.wizard-nav-link .icon-chevron-right { - float:right; - margin-top:12px; - margin-right:-6px; - opacity:.25; -} - -li.wizard-nav-item.active .icon-chevron-right { - opacity:1; -} - -li.wizard-nav-item { - line-height:40px; -} - -.wizard-no-modal .nav-list > li > a, -.wizard-modal.modal .nav-list > li > a { - background-color:#f5f5f5; - padding:3px 15px 3px 20px; - cursor:default; - color:#B4B4B4; -} - -.wizard-no-modal .nav-list li.active > a, -.wizard-modal.modal .nav-list li.active > a { - background-color:#08C; -} -.wizard-no-modal .nav-list > li.already-visited > a.wizard-nav-link, -.wizard-modal.modal .nav-list > li.already-visited > a.wizard-nav-link { - color:#08C; - cursor:pointer; -} - -.wizard-no-modal .nav-list > li.active > a.wizard-nav-link, -.wizard-modal.modal .nav-list > li.active > a.wizard-nav-link { - color:white; -} - -.already-visited > a.wizard-nav-link:hover { - background-color:#E4E4E4; -} - -.wizard-card > h3 { - margin-top:0; - margin-bottom:20px; - font-size:21px; - line-height:40px; - font-weight:normal; -} - -.wizard-progress { - padding:15px; - bottom:0; -} -.wizard-progress-container { - padding:20px; -} - -.wizard-steps { - width:28%; - height:425px; - background-color:#f5f5f5; -} - -.wizard-nav-container { - height:360px; -} - -.nav > li > a.wizard-step-error { - background-color:#F2DEDE; - color:#B94A48; - font-weight:bold; -} - -.wizard-step-error .icon-chevron-right { - opacity:0; -} - -.wizard-input-section { - margin-bottom:20px; -} - -.wizard-buttons-container { - padding:20px; -} - -.wizard-cancel { - display:none; - margin-left:20px; -} - -.wizard-close { - display: none; -} - -.wizard-no-modal .popover.error-popover, -.wizard-modal .popover.error-popover { - background-color:#F2DEDE; - color:#B94A48; - border-color:#953B39; -} - -.wizard-no-modal .popover.error-popover .arrow::after, -.wizard-modal .popover.error-popover .arrow::after { - border-right-color:#F2DEDE; -} - -.wizard-no-modal .popover.error-popover .popover-title, -.wizard-modal .popover.error-popover .popover-title { - display:none; -} - -.wizard-no-modal .popover.error-popover .arrow, -.wizard-modal .popover.error-popover .arrow { - border-right-color:#953B39; -} diff --git a/static/css/dashboard.css b/static/css/dashboard.css index 68284dea..667165d1 100644 --- a/static/css/dashboard.css +++ b/static/css/dashboard.css @@ -30,20 +30,17 @@ padding-left:0; padding-right:0; } -#profile-menu-large ul, -ul.wizard-nav-list { +#profile-menu-large ul { border-right:none; } -#profile-menu-large li, -ul.wizard-nav-list li { +#profile-menu-large li { position:relative; color:#000; padding-left:0; border-bottom: 1px solid #629c92; } -#profile-menu-large li:last-child, -ul.wizard-nav-list li:last-child { +#profile-menu-large li:last-child { border:none; } #profile-menu-large li#profile-filled-li:after, @@ -76,17 +73,11 @@ ul.wizard-nav-list li:last-child { #profile-menu-large li.active, #profile-menu-large li:hover, -ul.wizard-nav-list li.active, -ul.wizard-nav-list li.already-visited:hover, .nav>li>a:hover, .nav>li>a:focus { position:relative; background-color:#fff; } -ul.wizard-nav-list > li.active a.wizard-nav-link, -ul.wizard-nav-list li.already-visited a.wizard-nav-link { - color: #111 !important; -} #profile-menu-large li.active a, #profile-menu-large li:hover a { /*padding-left:30px;*/ @@ -101,9 +92,7 @@ ul.wizard-nav-list li.already-visited a.wizard-nav-link { margin-bottom:0; } #profile-menu-large li.active:after, -#profile-menu-large li:hover:after, -ul.wizard-nav-list li.active:after, -ul.wizard-nav-list li.already-visited:hover:after { +#profile-menu-large li:hover:after { content:''; display:block; position:absolute; @@ -115,9 +104,6 @@ ul.wizard-nav-list li.already-visited:hover:after { border-bottom: 22px solid transparent; border-left: 20px solid #fff; } -ul.wizard-nav-list li a span.glyphicon { - display: none; -} .nav-tabs>li.active>a, .nav-tabs>li.active>a:hover, @@ -405,48 +391,8 @@ form#resetpasswordstep2view-form div.checkbox { /* End of reset password view styles -------------------------------------------------- */ -/* Wizard --------------------------------------------------- */ - -.wizard-modal p { - margin: 0 0 10px; - padding: 0; -} - -#wizard-ns-detail-servers, .wizard-additional-servers { - font-size:12px; - margin-top:10px; - margin-left:15px; -} -#wizard-ns-detail-servers > li, .wizard-additional-servers li { - line-height:20px; - list-style-type:none; -} -#wizard-ns-detail-servers > li > img { - padding-right:5px; -} - -.wizard-modal .chzn-container .chzn-results { - max-height:150px; - } -.wizard-addl-subsection { - margin-bottom:40px; -} -.wizard-progress-container > .progress { - width:135px; -} - -.wizard-modal .help-inline .error { - color: #b94a48; -} - /* Forms */ -div.modal.wizard > div.wizard-dialog { - width: 650px; - margin-top: 60px !important; -} - #chpass-form-buttons { text-align: center; width: 100%; @@ -726,147 +672,6 @@ div#profile-menu-small { } -/* Wizard --------------------------------------------------- */ - -.wizard-modal p { - margin: 0 0 10px; - padding: 0; -} - -div.wizard-steps, -ul.wizard-nav-list > li > a { - background-color: transparent !important; -} - -#wizard-ns-detail-servers, .wizard-additional-servers { - font-size:12px; - margin-top:10px; - margin-left:15px; -} -#wizard-ns-detail-servers > li, .wizard-additional-servers li { - line-height:20px; - list-style-type:none; -} -#wizard-ns-detail-servers > li > img { - padding-right:5px; -} - -.wizard-modal .chzn-container .chzn-results { - max-height:150px; - } -.wizard-addl-subsection { - margin-bottom:40px; -} -.wizard-progress-container > .progress { - width:135px; -} - -.wizard-modal .help-inline .error { - color: #b94a48; -} - -.wizard-card > h3 { - color: #333; -} - -.wizard-header h3.modal-title.wizard-title { - color: #fff; -} - -button.wizard-next { - margin-left: 0 !important; -} - -div.wizard-steps { - height: 295px !important; - width: 36%; -} - a#go-to-mobiles-tab { cursor: pointer; } - -/* end wizard */ - - -@media only screen and (min-width: 598px) { - -.wizard-body .wizard-steps { - height:298px !important; -} - -} - -@media only screen and (max-width: 597px) { - -div.wizard div.wizard-steps { - display: none; -} - -div.wizard div.wizard-dialog { - width: 94% !important; - margin-top: 15px !important; -} - -div.wizard div.wizard-card-container, -div.wizard div.wizard-buttons-container > div.btn-group-single { - margin-left: 0px !important; -} - -div.wizard div.wizard-content, -div.wizard div.wizard-body, -div.wizard div.wizard-cards, -div.wizard div.wizard-card-container { - height: auto !important; -} - -} - -@media only screen and (max-width: 650px) { - -div.wizard-card { - padding: 20px 35px 0px !important; -} - -div.wizard div.wizard-steps { - display: none; -} - -div.wizard div.wizard-dialog { - width: 94% !important; - margin-top: 15px !important; -} - -div.wizard div.wizard-card-container { - margin-left: 0px; -} - -div.wizard div.wizard-content, -div.wizard div.wizard-body, -div.wizard div.wizard-cards, -div.wizard div.wizard-card-container { - height: auto !important; -} - -div.wizard div.wizard-buttons-container > div.btn-group-single { - float: none !important; -} -} - -@media only screen and (min-width: 651px) and (max-width: 767px) { - -div.wizard-buttons-container .btn { - margin-left:auto; - margin-right:auto; - width:auto; - max-width:100%; - padding-left: 30px; - padding-right: 30px; - font-size:13px - } - -} - -/* End of wizard --------------------------------------------------- */ diff --git a/static/css/screen.css b/static/css/screen.css index 7ecebc37..131a05d7 100644 --- a/static/css/screen.css +++ b/static/css/screen.css @@ -1,7 +1,6 @@ body, .well, .container-fluid .jumbotron, -div.wizard-content, div.modal-dialog .modal-content { background-color:#bbded9; background-image:url(../img/texture.png); @@ -287,10 +286,6 @@ form.form-horizontal label { font-weight: 400; } -form.form-horizontal .btn-primary.wizard-next { - margin-left: 0; -} - .table-thin { width: 50%; } diff --git a/static/js/dashboard-basewizard.js b/static/js/dashboard-basewizard.js deleted file mode 100644 index 8629e336..00000000 --- a/static/js/dashboard-basewizard.js +++ /dev/null @@ -1,31 +0,0 @@ -(function ($) { - var dataholder = $('span.dataholder#basewizard-data'), - step = parseInt(dataholder.data('step')), - datakey = dataholder.data('datakey'), - model = dataholder.data('model'), - path = dataholder.data('path'), - msg_done = dataholder.data('msg_done'), - msg_sending = dataholder.data('msg_sending'), - msg_next = dataholder.data('msg_next'), - msg_back = dataholder.data('msg_back'), - msg_dismiss = dataholder.data('msg_dismiss'), - eduidwizard; - - $.fn.wizard.logging = true; - - eduidwizard = EduidWizard("#"+model+"-wizard", step, { - showCancel: true, - isModal: true, - submitUrl: path, - contentHeight: 400, - contentWidth: 650, - buttons: { - submitText: msg_done, - submittingText: msg_sending, - nextText: msg_next, - backText: msg_back, - cancelText: msg_dismiss, - }, - }); - -}(jQuery)); diff --git a/static/js/dashboard-eduid-wizards.js b/static/js/dashboard-eduid-wizards.js deleted file mode 100644 index b413fe9f..00000000 --- a/static/js/dashboard-eduid-wizards.js +++ /dev/null @@ -1,176 +0,0 @@ -/*jslint vars: false, nomen: true, browser: true */ -/*global $, console, alert, active_card, Wizard */ - - -$.fn.serializeObject = function () { - 'use strict'; - var o = {}, - a = this.serializeArray(); - $.each(a, function () { - if (o[this.name] !== undefined) { - if (!o[this.name].push) { - o[this.name] = [o[this.name]]; - } - o[this.name].push(this.value || ''); - } else { - o[this.name] = this.value || ''; - } - }); - return o; -}; - -var currentwizard = {}; - -var EduidWizard = function (container_path, active_card, options) { - 'use strict'; - - var wizard = $(container_path).wizard(options), - presentcard, - newcard, - show_alert = function (message, level) { - var currentCard = wizard.getActiveCard(); - - if (level === undefined) { - level = 'danger'; - } - if (currentCard.el.find('div.alert.alert-' + level).length > 0) { - currentCard.el.find('div.alert.alert-' + level).html(message); - } else { - currentCard.el.find('> h3'). - before("
" + message + "
"); - } - setTimeout(function () { - currentCard.el.find('div.alert').hide('slow').html(""); - }, 5000); - }; - - currentwizard = wizard; - - Wizard.prototype._onNextClick = function () { - var jsondata, - currentCard = this.getActiveCard(), - step = currentCard.index; - - this.log("handling 'next' button click (custom method)"); - - - if (currentCard.index === (this._cards.length - 1)) { - // This is the last card - this.reset().close(); - location.reload(); - - } else if (currentCard.validate()) { - jsondata = wizard.el.find('input, select').serializeObject(); - $.extend(jsondata, { - step: currentCard.index, - action: 'next_step' - }); - wizard.el.find('.btn.wizard-next').attr('disabled', 'disabled'). - addClass('loading').trigger('button-wait'); - - if (wizard.el.find('.btn.wizard-next .spinner').length == 0) { - setTimeout(function () { - wizard.el.find('.btn.wizard-next').prepend(''); - }, 200); - } - - $.ajax({ - url: this.args.submitUrl, - data: jsondata, - type: 'POST', - success: function (data, textStatus, jqXHR) { - var el, input; - if (data.status === 'success') { - // go to next card - currentCard = wizard.incrementCard(); - } else if (data.status === 'failure') { - currentCard.el.find('.form-group').toggleClass("has-error", false); - currentCard.el.find('select, input, textarea').popover("destroy"); - for (input in data.data) { - el = currentCard.el.find('[name=' + input + ']'); - wizard.errorPopover(el, data.data[input], true); - el.parent(".form-group").toggleClass("has-error", true); - } - } - wizard.el.find('.btn.wizard-next'). - removeAttr('disabled'). - removeClass('loading'). - trigger('button-enabled'); - }, - error: function (event, jqXHR, ajaxSettings, thrownError) { - console.debug('Hey!, there are some errors here ' + - thrownError); - wizard.el.find('.btn.wizard-next'). - removeAttr('disabled'). - trigger('button-enabled'); - } - }); - } - }; - - wizard.cancelButton.click(function (e) { - $.ajax({ - url: wizard.args.submitUrl, - data: { - action: 'dismissed' - }, - type: 'POST', - success: function (data, textStatus, jqXHR){ - wizard.reset().close(); - if (window.dismissNinsWizardChooser){ - window.dismissNinsWizardChooser(); - } - }, - error: function (event, jqXHR, ajaxSettings, thrownError) { - console.debug('Hey!, there are some errors here ' + - thrownError); - wizard.close(); - } - }); - }); - - - wizard.el.find('.btn.wizard-next').addClass('has-spinner'); - - wizard.el.find('a[data-role=action]').click(function (e) { - var action = $(e.target).attr('data-action'), - jsondata = wizard.el.find('input, select').serializeObject(), - currentCard = wizard.getActiveCard(); - - $.extend(jsondata, { - step: currentCard.index, - action: action - }); - $.ajax({ - url: options.submitUrl, - data: jsondata, - type: 'POST', - success: function (data, textStatus, jqXHR){ - if (data.status === 'success') { - // show a success message - show_alert(data.text, 'success'); - } - else if (data.status === 'error') { - // show a error message - show_alert(data.text); - } - }, - error: function (event, jqXHR, ajaxSettings, thrownError) { - show_alert('Unexpected error, please retry later'); - console.debug('Hey!, there are some errors here ' + - thrownError); - } - }); - e.preventDefault(); - }); - - if (active_card > 1) { - presentcard = wizard._cards[0]; - presentcard.deselect(); - presentcard.markVisited(); - newcard = wizard.setCard(active_card-1); - //newcard.select(); - } - - return wizard; -}; diff --git a/static/js/dashboard-forms-helper-functions.js b/static/js/dashboard-forms-helper-functions.js index 593f0a58..b43756e0 100644 --- a/static/js/dashboard-forms-helper-functions.js +++ b/static/js/dashboard-forms-helper-functions.js @@ -180,56 +180,6 @@ addDisableMmPopover(); }, - basewizard: function () { - var dataholder = $('span.dataholder#basewizard-data'), - step = parseInt(dataholder.data('step')), - datakey = dataholder.data('datakey'), - model = dataholder.data('model'), - path = dataholder.data('path'), - msg_done = dataholder.data('msg_done'), - msg_sending = dataholder.data('msg_sending'), - msg_next = dataholder.data('msg_next'), - msg_back = dataholder.data('msg_back'), - msg_dismiss = dataholder.data('msg_dismiss'), - eduidwizard; - - $.fn.wizard.logging = true; - - eduidwizard = EduidWizard("#"+model+"-wizard", step, { - showCancel: true, - isModal: true, - submitUrl: path, - contentHeight: 400, - contentWidth: 650, - buttons: { - submitText: msg_done, - submittingText: msg_sending, - nextText: msg_next, - backText: msg_back, - cancelText: msg_dismiss, - }, - } - ); - }, - - wizard_norEduPersonNIN: function () { - var msg_invalidnin = $('span.dataholder#ninwizard-data').data('msg_invalidnin'); - - window.validateNIN = function (el) { - var val = el.val(), - re = /^(18|19|20)\d{2}(0[1-9]|1[0-2])\d{2}[-\s]?\d{4}$/, - ret = { - status: true - }; - if (!re.test(val)) { - ret.status = false; - ret.msg = msg_invalidnin; - } - // if format is valid, then try to send to server - return ret; - }; - }, - initialize_pending_actions: function () { $('ul.pending-actions a').click(function (e) { var action_path = e.target.href.split('#')[1]; diff --git a/static/js/dashboard-profile.js b/static/js/dashboard-profile.js index 338e7a70..28e4f216 100644 --- a/static/js/dashboard-profile.js +++ b/static/js/dashboard-profile.js @@ -1,18 +1,9 @@ (function ($) { var dataholder = $('span.dataholder#profile-data'), workmode = dataholder.data('workmode'), - open_wizard = dataholder.data('openwizard'), - datakey = dataholder.data('datakey'), - wizard_nins_url = dataholder.data('wizard_nins_url'), userstatus_url = dataholder.data('userstatus_url'), polling_timeout = parseInt(dataholder.data('polling_timeout')); - if (open_wizard === 'True') { - open_wizard = true; - } else { - open_wizard = false; - } - var loa_popovers = function () { $('.circles-widget-labels a').popover({ placement: 'bottom', @@ -33,26 +24,6 @@ $("button[data-toggle=tooltip]").tooltip(); loa_popovers(); - if ((workmode === 'personal') && open_wizard) { - if (datakey === '') { - var params = {}; - } else { - var params = { - norEduPersonNIN: datakey - }, - initial_card = 1; - } - $.get( wizard_nins_url, params, function (data, textStatus, jqXHR) { - var wizardholder = $('div.openwizard'); - wizardholder.html(data); - wizardholder.find('span.scriptholder').each(function (i, e) { - var script = $(e).data('script'); - console.log('Executing wizard form script: ' + script); - window.forms_helper_functions[script](); - }); - currentwizard.show(); - }); - } // show progress var profile_filled = $('span.dataholder#profile-data').data('profile_filled'), pb = $('div.profile-filled-progress-bar'); diff --git a/static/js/dashboard-wizard-norEduPersonNIN.js b/static/js/dashboard-wizard-norEduPersonNIN.js deleted file mode 100644 index aaa6b964..00000000 --- a/static/js/dashboard-wizard-norEduPersonNIN.js +++ /dev/null @@ -1,17 +0,0 @@ -(function ($) { - var msg_invalidnin = $('span.dataholder#ninwizard-data').data('msg_invalidnin'); - - window.validateNIN = function (el) { - var val = el.val(), - re = /^(18|19|20)\d{2}(0[1-9]|1[0-2])\d{2}[-\s]?\d{4}$/, - ret = { - status: true - }; - if (!re.test(val)) { - ret.status = false; - ret.msg = msg_invalidnin; - } - // if format is valid, then try to send to server - return ret; - }; -}(jQuery));