Добавлено перенаправление на страницу регистрации, при просмотре контактов без регистрации Поправлены мелкие ошибки в редактировании профиля пользователяremotes/origin/HEAD
parent
77f9d55d1c
commit
3d65806fed
23 changed files with 604 additions and 175 deletions
@ -0,0 +1,135 @@ |
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {}; |
||||
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) { |
||||
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) |
||||
/******/ return installedModules[moduleId].exports; |
||||
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = { |
||||
/******/ exports: {}, |
||||
/******/ id: moduleId, |
||||
/******/ loaded: false |
||||
/******/ }; |
||||
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
||||
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.loaded = true; |
||||
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports; |
||||
/******/ } |
||||
|
||||
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules; |
||||
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules; |
||||
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = ""; |
||||
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(0); |
||||
/******/ }) |
||||
/************************************************************************/ |
||||
/******/ ({ |
||||
|
||||
/***/ 0: |
||||
/***/ function(module, exports, __webpack_require__) { |
||||
|
||||
'use strict'; |
||||
|
||||
var _custom_select = __webpack_require__(15); |
||||
|
||||
var _custom_check = __webpack_require__(1); |
||||
|
||||
$(function () { |
||||
(0, _custom_select.customSelectInit)(); |
||||
(0, _custom_check.customCheckInit)(); |
||||
}); |
||||
|
||||
/***/ }, |
||||
|
||||
/***/ 1: |
||||
/***/ function(module, exports) { |
||||
|
||||
"use strict"; |
||||
|
||||
Object.defineProperty(exports, "__esModule", { |
||||
value: true |
||||
}); |
||||
function customCheckInit() { |
||||
function tuneCheckBoxes($boxes) { |
||||
var currentState = $boxes.find("input").prop("checked") ? 'checked' : 'not-checked'; |
||||
$boxes.find("div").hide(); |
||||
$boxes.find("div." + currentState).show(); |
||||
} |
||||
|
||||
var $boxes = $('.custom-check'); |
||||
tuneCheckBoxes($boxes); |
||||
$boxes.on("click", function (e) { |
||||
var inside_checkBox = $(e.target).parent().find("input"); |
||||
inside_checkBox.prop("checked", !inside_checkBox.prop("checked")); |
||||
tuneCheckBoxes($boxes); |
||||
e.preventDefault(); |
||||
return false; |
||||
}); |
||||
} |
||||
|
||||
exports.customCheckInit = customCheckInit; |
||||
|
||||
/***/ }, |
||||
|
||||
/***/ 15: |
||||
/***/ function(module, exports) { |
||||
|
||||
'use strict'; |
||||
|
||||
Object.defineProperty(exports, "__esModule", { |
||||
value: true |
||||
}); |
||||
function customSelectInit() { |
||||
// CUSTOM-SELECT
|
||||
var $select_container = $('.custom-select'); |
||||
var $sc_headers = $select_container.find('.simple-select'); |
||||
var $sc_options = $select_container.find('.select-box-options'); |
||||
|
||||
$sc_options.hide(); |
||||
|
||||
$sc_headers.on("click", function (e) { |
||||
$(e.target).siblings('.select-box-options').show(); |
||||
}); |
||||
|
||||
var $options = $sc_options.find('li'); |
||||
$options.on("click", function (e) { |
||||
var target = $(e.target); |
||||
var header = target.closest('.select-box-options').siblings('.simple-select'); |
||||
var data = target.closest('.select-box-options').siblings('input[type=hidden]'); |
||||
header.val(target.html()); |
||||
data.val(target.data("id")); |
||||
// $sc_data.val($(e.target).data("id"));
|
||||
$sc_options.hide(); |
||||
e.preventDefault(); |
||||
}); |
||||
$(document).click(function (event) { |
||||
//FIXME: запомнить на ком был клик, и не закрывать именно его
|
||||
if ($(event.target).closest($select_container).length) { |
||||
return; |
||||
} |
||||
$sc_options.hide(); |
||||
}); |
||||
} |
||||
|
||||
exports.customSelectInit = customSelectInit; |
||||
|
||||
/***/ } |
||||
|
||||
/******/ }); |
||||
@ -0,0 +1,124 @@ |
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {}; |
||||
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) { |
||||
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) |
||||
/******/ return installedModules[moduleId].exports; |
||||
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = { |
||||
/******/ exports: {}, |
||||
/******/ id: moduleId, |
||||
/******/ loaded: false |
||||
/******/ }; |
||||
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
||||
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.loaded = true; |
||||
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports; |
||||
/******/ } |
||||
|
||||
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules; |
||||
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules; |
||||
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = ""; |
||||
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(0); |
||||
/******/ }) |
||||
/************************************************************************/ |
||||
/******/ ({ |
||||
|
||||
/***/ 0: |
||||
/***/ function(module, exports, __webpack_require__) { |
||||
|
||||
'use strict'; |
||||
|
||||
var _popups = __webpack_require__(9); |
||||
|
||||
function checkHash() { |
||||
// on load of the page: switch to the currently selected tab
|
||||
var hash = window.location.hash; |
||||
console.log("hash = ", hash); |
||||
if (hash == '#need-login-for-view') { |
||||
(0, _popups.addMessage)('Для просмотра личных данных необходимо зарегистрироваться', 'info'); |
||||
} |
||||
} |
||||
|
||||
$(function () { |
||||
(0, _popups.showPopupsInit)(); |
||||
checkHash(); |
||||
}); |
||||
|
||||
/***/ }, |
||||
|
||||
/***/ 9: |
||||
/***/ function(module, exports) { |
||||
|
||||
'use strict'; |
||||
|
||||
Object.defineProperty(exports, "__esModule", { |
||||
value: true |
||||
}); |
||||
//Message TYPES: see in 'popups.sass'
|
||||
|
||||
function showMessage(container, template, message, type) { |
||||
var $popup = $(template); |
||||
$popup.hide(); |
||||
$popup.find('.message').html(message); |
||||
$popup.addClass(type); |
||||
container.append($popup); |
||||
$popup.fadeIn(1000, function () { |
||||
setTimeout(function (el) { |
||||
$(el).fadeOut(1000); |
||||
}, 2000, this); |
||||
}); |
||||
} |
||||
|
||||
function addMessage(message, type) { |
||||
var $popups_storage = $('#popups-storage'); |
||||
var li = '<li class="' + type + '">' + message + '</li>'; |
||||
$popups_storage.append(li); |
||||
} |
||||
|
||||
function showPopupsInit() { |
||||
var $popups_storage = $('#popups-storage'); |
||||
var $popups_container = $('#popups-container'); |
||||
var $popup = $popups_container.find(".popup"); |
||||
var popup_html = $popup[0].outerHTML; |
||||
$popup.remove(); |
||||
if (!$popups_storage.length) return; |
||||
$.each($popups_storage.find("li"), function (key, value) { |
||||
var message = $(value).html(); |
||||
var type = $(value).attr('class'); |
||||
showMessage($popups_container, popup_html, message, type); |
||||
$(value).remove(); |
||||
}); |
||||
$popups_storage.bind("DOMNodeInserted", function () { |
||||
var $li = $(this).find('li'); |
||||
var message = $li.html(); |
||||
var type = $li.attr('class'); |
||||
$li.remove(); |
||||
showMessage($popups_container, popup_html, message, type); |
||||
}); |
||||
} |
||||
|
||||
exports.showPopupsInit = showPopupsInit; |
||||
exports.addMessage = addMessage; |
||||
|
||||
/***/ } |
||||
|
||||
/******/ }); |
||||
@ -0,0 +1,7 @@ |
||||
import {customSelectInit} from './seeds/custom_select' |
||||
import {customCheckInit} from './seeds/custom_check' |
||||
|
||||
$(function () { |
||||
customSelectInit(); |
||||
customCheckInit(); |
||||
}); |
||||
@ -0,0 +1,15 @@ |
||||
import {showPopupsInit, addMessage} from './seeds/popups' |
||||
|
||||
function checkHash() { |
||||
// on load of the page: switch to the currently selected tab
|
||||
let hash = window.location.hash; |
||||
console.log("hash = ", hash); |
||||
if (hash == '#need-login-for-view'){ |
||||
addMessage('Для просмотра личных данных необходимо зарегистрироваться', 'info'); |
||||
} |
||||
} |
||||
|
||||
$(function(){ |
||||
showPopupsInit(); |
||||
checkHash(); |
||||
}); |
||||
@ -0,0 +1,33 @@ |
||||
function customSelectInit() { |
||||
// CUSTOM-SELECT
|
||||
let $select_container = $('.custom-select'); |
||||
let $sc_headers = $select_container.find('.simple-select'); |
||||
let $sc_options = $select_container.find('.select-box-options'); |
||||
|
||||
$sc_options.hide(); |
||||
|
||||
$sc_headers.on("click", function (e) { |
||||
$(e.target).siblings('.select-box-options').show(); |
||||
}); |
||||
|
||||
let $options = $sc_options.find('li'); |
||||
$options.on("click", function (e) { |
||||
const target = $(e.target); |
||||
let header = target.closest('.select-box-options').siblings('.simple-select'); |
||||
let data = target.closest('.select-box-options').siblings('input[type=hidden]'); |
||||
header.val(target.html()); |
||||
data.val(target.data("id")); |
||||
// $sc_data.val($(e.target).data("id"));
|
||||
$sc_options.hide(); |
||||
e.preventDefault() |
||||
}); |
||||
$(document).click(function (event) { |
||||
//FIXME: запомнить на ком был клик, и не закрывать именно его
|
||||
if ($(event.target).closest($select_container).length) { |
||||
return; |
||||
} |
||||
$sc_options.hide(); |
||||
}); |
||||
} |
||||
|
||||
export {customSelectInit} |
||||
@ -1,9 +1,11 @@ |
||||
import {avatarUploadInit} from './seeds/avatar_upload' |
||||
import {tabsHashInit, restoreTab} from './seeds/bootstrap_tabs' |
||||
import {checkBoxBindingInit} from './seeds/user_check_statuses' |
||||
import {customSelectInit} from './seeds/custom_select' |
||||
|
||||
$(function () { |
||||
avatarUploadInit(); |
||||
tabsHashInit(); |
||||
checkBoxBindingInit(); |
||||
customSelectInit(); |
||||
}); |
||||
@ -1,14 +1,36 @@ |
||||
{% extends 'partials/base.html' %} |
||||
{% extends 'partials/_base.html' %} |
||||
{% load sass_tags %} |
||||
{% load static %} |
||||
{% block personal_css %} |
||||
<link rel='stylesheet' href='{% sass_src "sass/old_main.sass" %}'> |
||||
<link rel='stylesheet' href='{% sass_src "lib/proekton-components/sass/components.sass" %}'> |
||||
<link rel='stylesheet' href='{% sass_src "sass/components/custom-components.sass" %}'> |
||||
{% endblock %} |
||||
{% block content %} |
||||
{% include 'partials/header.html' %} |
||||
<div class="container mainScore"> |
||||
<div class="container main-scope"> |
||||
<div class="row"> |
||||
<div class="col-lg-12"> |
||||
<p class="titleScore">Регистрация </p> |
||||
<div class="row title-scope" style="border-bottom: none"> |
||||
<div class="col-lg-12"> |
||||
<p> |
||||
Регистрация |
||||
</p> |
||||
|
||||
</div> |
||||
{% include 'partials/inc-registration_form.html' %} |
||||
|
||||
{% include 'partials/footer.html' %} |
||||
</div> |
||||
{% include 'partials/inc-registration_form.html' %} |
||||
</div> |
||||
</div> |
||||
<ul id="popups-storage" hidden> |
||||
{# <li class="error">Форма заполнена неполностью</li>#} |
||||
{# <li class="info">Message-1</li>#} |
||||
{# <li class="warning">Message-1</li>#} |
||||
</ul> |
||||
{% include 'partials/inc-message-popup.html' %} |
||||
</div> |
||||
{% endblock %} |
||||
{% block personal_js %} |
||||
<script src='{% static "js/build/custom_components.js" %}'></script> |
||||
<script src='{% static "js/build/registration.js" %}'></script> |
||||
{% endblock %} |
||||
Loading…
Reference in new issue