forked from shaba/openuds
removed user template
This commit is contained in:
parent
4bfcac0307
commit
579b86c527
File diff suppressed because one or more lines are too long
7
server/templates/user/.gitignore
vendored
7
server/templates/user/.gitignore
vendored
@ -1,7 +0,0 @@
|
||||
/bower_components
|
||||
/node_modules
|
||||
/dist
|
||||
/dev
|
||||
/.*
|
||||
yarn-error.log
|
||||
|
@ -1,215 +0,0 @@
|
||||
/*global module:false*/
|
||||
|
||||
config = {
|
||||
dist: 'dist', // Dist path
|
||||
dev: 'dev', // dev path
|
||||
uds_template: 'modern',
|
||||
// Source elements path
|
||||
src: {
|
||||
base: 'src',
|
||||
html: 'src/*.html',
|
||||
templates: 'src/templates/*.html',
|
||||
images: ['src/img/**/*.png', 'src/img/**/*.ico', 'src/img/**/*.gif'],
|
||||
static: 'src/static',
|
||||
server_provided: 'src/server_provided',
|
||||
sass: 'src/css/uds.scss',
|
||||
sass_watch: 'src/css/**/*.scss',
|
||||
ts: 'src/js/',
|
||||
js_lib: [
|
||||
'node_modules/bootstrap/dist/js/bootstrap.min.js', // Bootstrap js
|
||||
'node_modules/jquery/dist/jquery.min.js', // Jquery js
|
||||
'node_modules/popper.js/dist/umd/popper.min.js', // Popper js
|
||||
'node_modules/angular/angular.min.js', // Angular
|
||||
'node_modules/angular-cookies/angular-cookies.min.js' // Angular cookies
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
module.exports = function(grunt) {
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
// Project settings
|
||||
config: config,
|
||||
|
||||
// Tasks
|
||||
clean: {
|
||||
dev: ['<%= config.dev %>'],
|
||||
dist: ['<%= config.dist %>'],
|
||||
},
|
||||
|
||||
copy: {
|
||||
dev: {
|
||||
files: [
|
||||
// Javascript from libs
|
||||
{
|
||||
expand: true,
|
||||
flatten: true,
|
||||
src: config.src.js_lib,
|
||||
dest: '<%= config.dev %>/_static_/js/lib'
|
||||
},
|
||||
// Fontawewsome
|
||||
{ expand: true, flatten: true, src: 'node_modules/@fortawesome/fontawesome-free-webfonts/webfonts/*', dest:'<%= config.dev %>/_static_/webfonts' },
|
||||
// Index & Templates, no changes for development environment
|
||||
{ expand: true, flatten: true, src: config.src.html, dest:'<%= config.dev %>' },
|
||||
{ expand: true, flatten: true, src: config.src.templates, dest:'<%= config.dev %>/_static_/templates' },
|
||||
// Images
|
||||
{ expand: true, flatten: true, src: config.src.images, dest:'<%= config.dev %>/_static_/img' },
|
||||
// Other Static elements, from libraries normally
|
||||
{ expand: true, flatten: false, cwd: config.src.static, src: '**/*', dest:'<%= config.dev %>/_static_/' },
|
||||
// Server provided files, so we can "emulate" on development
|
||||
{ expand: true, flatten: false, cwd: config.src.server_provided, src:'**/*' , dest: config.dev },
|
||||
|
||||
]
|
||||
},
|
||||
dist: {
|
||||
options: {
|
||||
// Process files to make them, except "known" binaries, to do not mess them
|
||||
processContentExclude: ['**/*.{png,gif,jpg,ico,otf,eot,ttf,woff,woff2}'],
|
||||
process: function(content, srcPath) {
|
||||
if( /.?src\/[^\/]*.html/g.test(srcPath) ) {
|
||||
grunt.log.write(' converting for template... ');
|
||||
return '{% load l10n i18n static%}{% get_current_language as LANGUAGE_CODE %}' +
|
||||
content.replace(/_static_\//g, '{% get_static_prefix %}') // Static content
|
||||
.replace(/html lang="[a-z]*"/g, 'html lang="{{LANGUAGE_CODE}}"') //
|
||||
.replace(/<trans>(.*?)<\/trans>/g, function(match, $1) {
|
||||
return "{% trans \"" + $1.replace(/"/g, """) + "\" %}";
|
||||
})
|
||||
.replace(/(<form id="loginform"[^>]*>)/, "$1{% csrf_token %}");
|
||||
} else {
|
||||
return content;
|
||||
}
|
||||
}
|
||||
},
|
||||
files: [
|
||||
{
|
||||
expand: true,
|
||||
flatten: true,
|
||||
src: config.src.js_lib,
|
||||
dest: '<%= config.dist %>/static/js/lib'
|
||||
},
|
||||
// html files
|
||||
{
|
||||
expand: true,
|
||||
flatten: true,
|
||||
src: config.src.html,
|
||||
dest:'<%= config.dist %>/templates/uds/<%= config.uds_template %>',
|
||||
},
|
||||
// Fontawewsome
|
||||
{ expand: true, flatten: true, src: 'node_modules/@fortawesome/fontawesome-free-webfonts/webfonts/*', dest:'<%= config.dist %>/static/webfonts' },
|
||||
// Templates (angular, for now goes to static, but maybe it needs to go to other "django templates" folder)
|
||||
{ expand: true, flatten: true, src: config.src.templates, dest:'<%= config.dist %>/static/templates' },
|
||||
/// Images
|
||||
{ expand: true, flatten: true, src: config.src.images, dest:'<%= config.dist %>/static/img' },
|
||||
// Other Static elements, from libraries normally
|
||||
{ expand: true, flatten: false, cwd: config.src.static, src: '**/*', dest:'<%= config.dist %>/static/' },
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
ts: {
|
||||
options: {
|
||||
rootDir: config.src.ts,
|
||||
module: 'system',
|
||||
moduleResolution: 'node',
|
||||
target: 'es5',
|
||||
experimentalDecorators: true,
|
||||
emitDecoratorMetadata: true,
|
||||
noImplicitAny: false
|
||||
},
|
||||
dev: {
|
||||
files: [
|
||||
{ src: ['<%= config.src.ts %>/*.ts'], dest: '<%= config.dev %>/_static_/js/'},
|
||||
],
|
||||
options: {
|
||||
sourceMap: true,
|
||||
}
|
||||
},
|
||||
dist: {
|
||||
files: [
|
||||
{ src: ['<%= config.src.ts %>/*.ts'], dest: '<%= config.dist %>/static/js/'},
|
||||
],
|
||||
options: {
|
||||
sourceMap: false,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Compiles Sass to CSS and generates necessary files if requested
|
||||
sass: {
|
||||
options: {
|
||||
trace: true,
|
||||
loadPath: [
|
||||
'node_modules/'
|
||||
],
|
||||
},
|
||||
dev: {
|
||||
options: {
|
||||
update: true,
|
||||
},
|
||||
files: [{
|
||||
'<%= config.dev %>/_static_/css/uds.css': ['<%= config.src.sass %>']
|
||||
}]
|
||||
},
|
||||
dist: {
|
||||
options: {
|
||||
update: false,
|
||||
sourcemap: 'none',
|
||||
style: 'compressed'
|
||||
},
|
||||
files: [{
|
||||
'<%= config.dist %>/static/css/uds.css': ['<%= config.src.sass %>'],
|
||||
}]
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
ts: {
|
||||
files: '<%= config.src.ts %>/**/*.ts',
|
||||
tasks: ['ts:dev']
|
||||
},
|
||||
sass: {
|
||||
files: '<%= config.src.sass_watch %>',
|
||||
tasks: ['sass:dev']
|
||||
},
|
||||
html: {
|
||||
files: ['<%= config.src.html %>', '<%= config.src.templates %>', '<%= config.src.server_provided %>'],
|
||||
tasks: ['copy:dev']
|
||||
}
|
||||
},
|
||||
'http-server': {
|
||||
dev: {
|
||||
root: '<%= config.dev %>',
|
||||
port: 9000,
|
||||
host: '0.0.0.0',
|
||||
cache: 0,
|
||||
runInBackground: true
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// These plugins provide necessary tasks.
|
||||
grunt.loadNpmTasks('grunt-contrib-sass');
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-http-server');
|
||||
grunt.loadNpmTasks('grunt-ts');
|
||||
|
||||
// Tasks
|
||||
grunt.registerTask('build-dev', ['copy:dev', 'ts:dev', 'sass:dev'])
|
||||
grunt.registerTask('dev', ['build-dev', 'http-server', 'watch'])
|
||||
grunt.registerTask('dist', ['clean:dist', 'copy:dist', 'ts:dist', 'sass:dist'])
|
||||
|
||||
// Default task is dev
|
||||
grunt.registerTask('default', ['dist']);
|
||||
|
||||
// Aliases
|
||||
grunt.registerTask('serve', ['http-server']);
|
||||
|
||||
};
|
@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# https://yarnpkg.com/en/docs/install
|
||||
yarn
|
13
server/templates/user/package-lock.json
generated
13
server/templates/user/package-lock.json
generated
@ -1,13 +0,0 @@
|
||||
{
|
||||
"name": "user",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"font-awesome": {
|
||||
"version": "4.7.0",
|
||||
"resolved": "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz",
|
||||
"integrity": "sha1-j6jPBBGhoxr9B7BtKQK7n8gVoTM="
|
||||
}
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
{
|
||||
"engines": {
|
||||
"node": ">= 0.10.0",
|
||||
"yarn": ">= 1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/angular": "^1.6.43",
|
||||
"@types/angular-cookies": "^1.4.5",
|
||||
"grunt": "~0.4.5",
|
||||
"grunt-contrib-clean": "^1.1.0",
|
||||
"grunt-contrib-coffee": "^2.0.0",
|
||||
"grunt-contrib-copy": "^1.0.0",
|
||||
"grunt-contrib-sass": "^1.0.0",
|
||||
"grunt-contrib-watch": "^1.0.0",
|
||||
"grunt-http-server": "^2.0.0",
|
||||
"grunt-ts": "^6.0.0-beta.17",
|
||||
"typescript": "^2.7.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-free-webfonts": "^1.0.4",
|
||||
"angular": "^1.6.9",
|
||||
"angular-cookies": "^1.6.9",
|
||||
"angular-route": "^1.6.9",
|
||||
"bootstrap": "^4.0.0",
|
||||
"jquery": "^3.3.1",
|
||||
"popper.js": "^1.12.9"
|
||||
},
|
||||
"name": "uds-user",
|
||||
"version": "1.0.0",
|
||||
"description": "User space for UDS web frontend",
|
||||
"author": "Adolfo Gómez <dkmaster@dkmon.com>",
|
||||
"license": "MIT"
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
Rules to follow, for correct working:
|
||||
|
||||
1.- on Develompent (and on src code), use "_static_" path for static content. It will be translated correctly to "{% get_static_prefix %}" when generating DIST
|
||||
2.- The html files will be modified so they include the "template" info needed. (For example, will be added the lang code, etc...)
|
||||
3.- For translations, everything between <trans> & </trans> will be promoted to a translatable string. NO MULTILINE IS ALLOWED!!! :)
|
||||
4.- the login form shout start as this: <form id="loginform"
|
||||
This way, we will locate it and add the "csrf" token inside it.
|
||||
|
||||
|
||||
This is what is done when generating "dist"
|
||||
Steps:
|
||||
1.- /*.html goes to "templates/uds/modern" (name to be defined ;-)) (these are basically login.html & index.html)
|
||||
2.- templates/* goes to "static/templates" right now. Maybe they end on "templates/uds/..." also.
|
||||
3.- All js files goes to "static/js/" (with path)
|
||||
4.- Add to HTML files the headers for the templates ({% load i18n static %} and whatever is needed)
|
||||
5.- Replace all "_static_" with "{% get_static_prefix %}"
|
||||
6.- Replace all <trans>...</trans> with {% translate "..." %} (with " escaped to ")
|
||||
7.- Add after "<form id="loginform"...>" this: {% csrf_token %}, so the form contains the cross site protection.
|
||||
... (to be continued)
|
@ -1,9 +0,0 @@
|
||||
/* TYPOGRAPHY */
|
||||
//@import url("https://fonts.googleapis.com/css?family=Lato:400,300,300italic,400italic,700,700italic,900,900italic");
|
||||
//@import url("https://fonts.googleapis.com/css?family=Raleway:400,300,500,600,700,800,900");
|
||||
|
||||
// @import "@fortawesome/fontawesome-free-webfonts/scss/fa-regular";
|
||||
@import "@fortawesome/fontawesome-free-webfonts/scss/fa-solid";
|
||||
|
||||
@import "@fortawesome/fontawesome-free-webfonts/scss/fontawesome";
|
||||
|
@ -1,164 +0,0 @@
|
||||
// Darkly 4.0.0
|
||||
// Bootswatch
|
||||
|
||||
//
|
||||
// Color system
|
||||
//
|
||||
|
||||
$white: #fff !default;
|
||||
$gray-100: #f8f9fa !default;
|
||||
$gray-200: #ebebeb !default;
|
||||
$gray-300: #dee2e6 !default;
|
||||
$gray-400: #ced4da !default;
|
||||
$gray-500: #adb5bd !default;
|
||||
$gray-600: #999 !default;
|
||||
$gray-700: #444 !default;
|
||||
$gray-800: #303030 !default;
|
||||
$gray-900: #222 !default;
|
||||
$black: #000 !default;
|
||||
|
||||
$blue: #375a7f !default;
|
||||
$indigo: #6610f2 !default;
|
||||
$purple: #6f42c1 !default;
|
||||
$pink: #e83e8c !default;
|
||||
$red: #E74C3C !default;
|
||||
$orange: #fd7e14 !default;
|
||||
$yellow: #F39C12 !default;
|
||||
$green: #00bc8c !default;
|
||||
$teal: #20c997 !default;
|
||||
$cyan: #3498DB !default;
|
||||
|
||||
$primary: $blue !default;
|
||||
$secondary: $gray-700 !default;
|
||||
$success: $green !default;
|
||||
$info: $cyan !default;
|
||||
$warning: $yellow !default;
|
||||
$danger: $red !default;
|
||||
$light: $gray-800 !default;
|
||||
$dark: $gray-800 !default;
|
||||
|
||||
// Body
|
||||
|
||||
$body-bg: $gray-900 !default;
|
||||
$body-color: $white !default;
|
||||
|
||||
// Links
|
||||
|
||||
$link-color: $success !default;
|
||||
|
||||
// Fonts
|
||||
|
||||
$font-family-sans-serif: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default;
|
||||
|
||||
$font-size-base: 0.9375rem !default;
|
||||
|
||||
// Tables
|
||||
|
||||
$table-accent-bg: $gray-800 !default;
|
||||
|
||||
$table-border-color: $gray-700 !default;
|
||||
|
||||
$table-dark-bg: $gray-500 !default;
|
||||
$table-dark-border-color: darken($gray-500, 7.5%) !default;
|
||||
$table-dark-color: $body-bg !default;
|
||||
|
||||
// Forms
|
||||
|
||||
$input-border-color: transparent !default;
|
||||
|
||||
$input-group-addon-color: $gray-500 !default;
|
||||
$input-group-addon-bg: $gray-700 !default;
|
||||
|
||||
// Dropdowns
|
||||
|
||||
$dropdown-bg: $gray-900 !default;
|
||||
$dropdown-border-color: $gray-700 !default;
|
||||
$dropdown-divider-bg: $gray-700 !default;
|
||||
|
||||
$dropdown-link-color: $white !default;
|
||||
$dropdown-link-hover-color: $white !default;
|
||||
$dropdown-link-hover-bg: $primary !default;
|
||||
|
||||
// Navs
|
||||
|
||||
$nav-link-padding-x: 2rem !default;
|
||||
$nav-link-disabled-color: $gray-200 !default;
|
||||
|
||||
$nav-tabs-border-color: $gray-700 !default;
|
||||
$nav-tabs-link-hover-border-color: $nav-tabs-border-color !default;
|
||||
$nav-tabs-link-active-border-color: $nav-tabs-border-color !default;
|
||||
|
||||
// Navbar
|
||||
|
||||
$navbar-padding-y: 1rem !default;
|
||||
|
||||
$navbar-dark-color: $white !default;
|
||||
$navbar-dark-hover-color: $success !default;
|
||||
|
||||
$navbar-light-color: rgba($white,.5) !default;
|
||||
$navbar-light-hover-color: $white !default;
|
||||
$navbar-light-active-color: $white !default;
|
||||
$navbar-light-disabled-color: rgba($white,.3) !default;
|
||||
$navbar-light-toggler-border-color: rgba($white,.1) !default;
|
||||
|
||||
// Pagination
|
||||
|
||||
$pagination-color: $white !default;
|
||||
$pagination-bg: $success !default;
|
||||
$pagination-border-width: 0 !default;
|
||||
$pagination-border-color: transparent !default;
|
||||
|
||||
$pagination-hover-color: $white !default;
|
||||
$pagination-hover-bg: lighten($success, 10%) !default;
|
||||
$pagination-hover-border-color: transparent !default;
|
||||
|
||||
$pagination-active-bg: $pagination-hover-bg !default;
|
||||
$pagination-active-border-color: transparent !default;
|
||||
|
||||
$pagination-disabled-color: $white !default;
|
||||
$pagination-disabled-bg: darken($success, 15%) !default;
|
||||
$pagination-disabled-border-color: transparent !default;
|
||||
|
||||
// Jumbotron
|
||||
|
||||
$jumbotron-bg: $gray-800 !default;
|
||||
|
||||
// Cards
|
||||
|
||||
$card-cap-bg: $gray-700 !default;
|
||||
$card-bg: $gray-800 !default;
|
||||
|
||||
// Popovers
|
||||
|
||||
$popover-bg: $gray-800 !default;
|
||||
|
||||
$popover-header-bg: $gray-700 !default;
|
||||
|
||||
// Modals
|
||||
|
||||
$modal-content-bg: $gray-800 !default;
|
||||
$modal-content-border-color: $gray-700 !default;
|
||||
|
||||
$modal-header-border-color: $gray-700 !default;
|
||||
|
||||
// Progress bars
|
||||
|
||||
$progress-height: 10px !default;
|
||||
$progress-font-size: 10px !default;
|
||||
$progress-bg: $gray-700 !default;
|
||||
|
||||
// List group
|
||||
|
||||
$list-group-bg: $gray-800 !default;
|
||||
$list-group-border-color: $gray-700 !default;
|
||||
|
||||
$list-group-hover-bg: $gray-700 !default;
|
||||
|
||||
// Breadcrumbs
|
||||
|
||||
$breadcrumb-bg: $gray-700 !default;
|
||||
|
||||
// Close
|
||||
|
||||
$close-color: $white !default;
|
||||
$close-text-shadow: none !default;
|
@ -1,35 +0,0 @@
|
||||
html {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.form-signin {
|
||||
width: 100%;
|
||||
max-width: 330px;
|
||||
padding: 15px;
|
||||
margin: 0 auto;
|
||||
.checkbox {
|
||||
font-weight: 400;
|
||||
}
|
||||
.form-control {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
height: auto;
|
||||
padding: 10px;
|
||||
font-size: 16px;
|
||||
&:focus {
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
input {
|
||||
&[type="email"] {
|
||||
margin-bottom: -1px;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
&[type="password"] {
|
||||
margin-bottom: 10px;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
|
||||
/*
|
||||
Theme Name: Bootstrap 4 Sass
|
||||
Description: Bootstrap 4 with Sass
|
||||
*/
|
||||
|
||||
// variables
|
||||
@import "variables";
|
||||
|
||||
//bootstrap
|
||||
@import "bootstrap/scss/bootstrap";
|
||||
|
||||
// typography
|
||||
@import "typography";
|
||||
|
||||
// user interface related
|
||||
@import "ui";
|
||||
|
||||
// Pages specific
|
||||
@import "sections/login"
|
Binary file not shown.
Before Width: | Height: | Size: 9.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.6 KiB |
@ -1,48 +0,0 @@
|
||||
/// <reference path="uds/API.ts" />
|
||||
/// <reference path="uds/params.ts" />
|
||||
|
||||
namespace uds {
|
||||
var udsClientApp = angular.module('udsClientApp', []);
|
||||
|
||||
class LoginController {
|
||||
selected: Authenticator;
|
||||
authenticators: Authenticator[];
|
||||
api : API;
|
||||
|
||||
// Order is important!!, must mucht those on constructor
|
||||
// This tells angular the requred services, etc... to be passed to constructor
|
||||
static $inject = ["$http", "$q"];
|
||||
|
||||
constructor(
|
||||
private $http: ng.IHttpService,
|
||||
private $q: ng.IQService
|
||||
) {
|
||||
this.selected = null;
|
||||
this.authenticators = [];
|
||||
this.api = new API($http, $q);
|
||||
|
||||
this.api.getAuthenticators().then((data) => {
|
||||
this.authenticators = data;
|
||||
if (data.length > 0)
|
||||
this.selected = data[0];
|
||||
else {
|
||||
data.length = null;
|
||||
}
|
||||
}).catch((errorMsg) => {
|
||||
window.alert('Can\'t get authenticators list error: ' + errorMsg);
|
||||
});
|
||||
}
|
||||
|
||||
authChanged(auth:Authenticator) : void {
|
||||
debug(auth);
|
||||
if (auth.isCustom)
|
||||
|
||||
this.selected = auth;
|
||||
}
|
||||
|
||||
doLogin() : void {
|
||||
debug('Login in');
|
||||
}
|
||||
}
|
||||
udsClientApp.controller("LoginController", LoginController)
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
/// <reference path="uds/API.ts" />
|
||||
/// <reference path="uds/params.ts" />
|
@ -1,38 +0,0 @@
|
||||
/// <reference path="params.ts" />
|
||||
|
||||
namespace uds {
|
||||
|
||||
// Authenticator
|
||||
export interface Authenticator {
|
||||
auth: string;
|
||||
authId: string;
|
||||
priority: number;
|
||||
isCustom: boolean;
|
||||
}
|
||||
|
||||
export class API {
|
||||
private authData : string;
|
||||
|
||||
constructor(
|
||||
private $http:ng.IHttpService,
|
||||
private $q: ng.IQService
|
||||
) {
|
||||
}
|
||||
|
||||
// Get info about available authenticators
|
||||
getAuthenticators() : angular.IPromise<Authenticator[]> {
|
||||
let deferred : angular.IDeferred<Authenticator[]> = this.$q.defer();
|
||||
this.$http.get('rest/auth/auths?all=true')
|
||||
.then((response:angular.IHttpResponse<Authenticator[]>) => {
|
||||
let data = response.data.sort((a,b) => a.priority - b.priority);
|
||||
console.log(data);
|
||||
deferred.resolve(data);
|
||||
}, (errorMsg) => {
|
||||
deferred.reject(errorMsg);
|
||||
} );
|
||||
|
||||
return deferred.promise;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
namespace uds {
|
||||
export let devel = true;
|
||||
export let serverURL = "http://172.27.0.1:8000/";
|
||||
export function debug(message) {
|
||||
console.log(message);
|
||||
}
|
||||
}
|
@ -1,177 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en" data-ng-app="udsClientApp">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>My HTML File</title>
|
||||
<link href="_static_/css/uds.css" rel="stylesheet" />
|
||||
|
||||
<!-- lang related -->
|
||||
<script src="/jsi18n"></script>
|
||||
<script src="/_static_/js/lib/jquery.min.js"></script>
|
||||
<script src="/_static_/js/lib/popper.min.js"></script>
|
||||
<script src="/_static_/js/lib/bootstrap.min.js"></script>
|
||||
|
||||
<script src="/_static_/js/lib/angular.min.js"></script>
|
||||
|
||||
<!-- uds libraries -->
|
||||
<script src="/_static_/js/uds/params.js"></script>
|
||||
<script src="/_static_/js/uds/API.js"></script>
|
||||
|
||||
<script src="/_static_/js/login.js"></script>
|
||||
<!-- AUTHS -->
|
||||
<!-- All of this will be translated on production, se we can replace it with server generated variables on production -->
|
||||
<script type="text/javascript">
|
||||
var authenticators = [
|
||||
{
|
||||
"priority": -2,
|
||||
"authId": "9803FC06-D8B3-5F11-9A6E-EEC905C017FD",
|
||||
"auth": "Interna",
|
||||
"authSmallName": "int",
|
||||
"type": "InternalDBAuth",
|
||||
"isCustom": false
|
||||
},
|
||||
{
|
||||
"priority": 1,
|
||||
"authId": "fbf0727a-e754-5f17-a0fd-bd8c1850b355",
|
||||
"auth": "AD",
|
||||
"authSmallName": "ad",
|
||||
"type": "ActiveDirectoryAuthenticator",
|
||||
"isCustom": false
|
||||
},
|
||||
{
|
||||
"priority": 1,
|
||||
"authId": "9EB0689D-DF66-54FF-8E7A-3C11E3F42A1A",
|
||||
"auth": "different",
|
||||
"authSmallName": "differ",
|
||||
"type": "InternalDBAuth",
|
||||
"isCustom": false
|
||||
},
|
||||
{
|
||||
"priority": 1,
|
||||
"authId": "53a53965-8a90-5e3b-96c4-91937d0042f0",
|
||||
"auth": "Ldap AD por RegEx",
|
||||
"authSmallName": "read",
|
||||
"type": "RegexLdapAuthenticator",
|
||||
"isCustom": false
|
||||
},
|
||||
{
|
||||
"priority": 1,
|
||||
"authId": "729b2db5-115f-5aa6-8c0a-32f3fbacf1d4",
|
||||
"auth": "Ldap AUTH",
|
||||
"authSmallName": "sldap",
|
||||
"type": "SimpleLdapAuthenticator",
|
||||
"isCustom": false
|
||||
},
|
||||
{
|
||||
"priority": 1,
|
||||
"authId": "4A574A66-65DD-5B6B-8D6F-5A53B95A0A58",
|
||||
"auth": "LDAP UCA",
|
||||
"authSmallName": "luca",
|
||||
"type": "RegexLdapAuthenticator",
|
||||
"isCustom": false
|
||||
},
|
||||
{
|
||||
"priority": 1,
|
||||
"authId": "9f111569-d608-5426-b9f7-a9b4b928fd2d",
|
||||
"auth": "Red invalida",
|
||||
"authSmallName": "inval",
|
||||
"type": "IPAuth",
|
||||
"isCustom": true
|
||||
},
|
||||
{
|
||||
"priority": 1,
|
||||
"authId": "8bbd4337-5eb1-5de5-88b5-203cdcc85ec2",
|
||||
"auth": "SAML Louvain",
|
||||
"authSmallName": "louvain",
|
||||
"type": "SAML20Authenticator",
|
||||
"isCustom": true
|
||||
},
|
||||
{
|
||||
"priority": 1,
|
||||
"authId": "cd996fec-fd5a-59eb-9eb4-ec28af3cc8f7",
|
||||
"auth": "SAMLOCAL",
|
||||
"authSmallName": "saml",
|
||||
"type": "SAML20Authenticator",
|
||||
"isCustom": true
|
||||
},
|
||||
{
|
||||
"priority": 1,
|
||||
"authId": "3EAC3F30-0148-5041-986D-CE25737FEF81",
|
||||
"auth": "test",
|
||||
"authSmallName": "test",
|
||||
"type": "InternalDBAuth",
|
||||
"isCustom": false
|
||||
},
|
||||
{
|
||||
"priority": 2,
|
||||
"authId": "3613aa7e-e32a-5d05-bcfe-4e2c3e735ee3",
|
||||
"auth": "Casa",
|
||||
"authSmallName": "casa",
|
||||
"type": "IPAuth",
|
||||
"isCustom": true
|
||||
}
|
||||
];
|
||||
</script>
|
||||
<!-- END_AUTHS -->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<div class="row" id="login" data-ng-controller="LoginController as login">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<h1 class="text-center login-title"><trans>Welcome to UDS Enterprise</trans></h1>
|
||||
<div class="account-wall">
|
||||
<img class="profile-img" src="/_static_/img/login-img.png" alt="">
|
||||
<form id="loginform" class="form-signin" name="loginform" method="post">
|
||||
|
||||
<input id="id_standard" name="standard" value="1" type="hidden">
|
||||
|
||||
<input id="id_nonStandard" name="nonStandard" type="hidden">
|
||||
|
||||
<input id="id_logouturl" name="logouturl" type="hidden">
|
||||
|
||||
<div class="form-group">
|
||||
<input id="id_user" name="user" class="form-control" placeholder="Nombre de usuario" autofocus="" required="" type="text">
|
||||
<input id="id_password" name="password" class="form-control" placeholder="Contraseña" required="" type="password">
|
||||
</div>
|
||||
|
||||
<div class="form-group" data-ng-show="login.authenticators.length > 1">
|
||||
<label>Authenticator</label>
|
||||
<div class="dropdown clearfix">
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button"
|
||||
id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
|
||||
style="min-width:auto; width:100%;"
|
||||
>
|
||||
{{ login.selected.auth }}
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton" style="min-width:auto;width:100%;">
|
||||
<h6 class="dropdown-header"><trans>Authenticators</trans>></h6>
|
||||
<a data-ng-repeat="auth in login.authenticators" class="dropdown-item" href="#" data-ng-click="login.authChanged(auth)">{{ auth.auth }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button id="do_login" class="btn btn-lg btn-primary btn-block" data-ng-click="login.doLogin()"><i class="fas fa-sign-in-alt"></i> <trans>Sign in</trans></button>
|
||||
|
||||
<div id="nonStandard" style="display: none">
|
||||
<div id="nonStandardLogin" class="form">
|
||||
non standard logins
|
||||
</div>
|
||||
<div id="divBackToLogin">
|
||||
<a href="#" id="backToLogin" title="Volver a iniciar sesión">Volver a iniciar sesión</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="customHtml">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,388 +0,0 @@
|
||||
|
||||
|
||||
(function(globals) {
|
||||
|
||||
var django = globals.django || (globals.django = {});
|
||||
|
||||
|
||||
django.pluralidx = function(n) {
|
||||
var v=(n != 1);
|
||||
if (typeof(v) == 'boolean') {
|
||||
return v ? 1 : 0;
|
||||
} else {
|
||||
return v;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/* gettext library */
|
||||
|
||||
django.catalog = django.catalog || {};
|
||||
|
||||
var newcatalog = {
|
||||
"(filtered from _MAX_ total records)": "(registros filtrados de un total de _MAX_)",
|
||||
"(no days)": "(sin d\u00edas)",
|
||||
"Accept": "Aceptar",
|
||||
"Access calendar removal error": "Error en el borrado del calendario de acceso",
|
||||
"Active": "Activo",
|
||||
"Add": "A\u00f1adir",
|
||||
"Add access calendar": "A\u00f1adir calendario de acceso",
|
||||
"Add group": "Agregar grupo",
|
||||
"Add scheduled action": "A\u00f1adir acci\u00f3n programada",
|
||||
"Add transport": "A\u00f1adir transporte",
|
||||
"April": "Abril",
|
||||
"Are you sure do you want to delete ": "\u00bfEst\u00e1s seguro de que lo quieres eliminar?",
|
||||
"August": "Agosto",
|
||||
"Authenticator creation error": "Error al crear autenticador",
|
||||
"Authenticator deletion error": "Error al eliminar autenticador",
|
||||
"Authenticator saving error": "Error al guardar autenticador",
|
||||
"Beginning": "Inicio",
|
||||
"Cache": "Cach\u00e9",
|
||||
"Cache has been flushed": "La cach\u00e9 se ha vaciado",
|
||||
"Calendar creation error": "Error de creaci\u00f3n de calendario",
|
||||
"Calendar deletion error": "Error de eliminaci\u00f3n de calendario",
|
||||
"Calendar saving error": "Error guardando calendario",
|
||||
"Cancel": "Cancelar",
|
||||
"Cancel publication?": "\u00bfCancelar la publicaci\u00f3n?",
|
||||
"Click on a row to select it": "Haga clic en una fila para seleccionarla",
|
||||
"Close": "Cerrar",
|
||||
"Configuration saved": "Configuraci\u00f3n guardada",
|
||||
"Confirm revocation of following permissions: <br/>": "Confirmar la revocaci\u00f3n de los permisos siguientes: <br/>",
|
||||
"Connection failed": "Conexi\u00f3n fallida",
|
||||
"Contacting service...": "Contactando con servicio...",
|
||||
"Creation successfully done": "Creaci\u00f3n realizada con \u00e9xito",
|
||||
"Daily": "Diario",
|
||||
"Date": "Fecha",
|
||||
"Days": "D\u00edas",
|
||||
"December": "Diciembre",
|
||||
"Default fallback access": "Acceso predeterminado",
|
||||
"Delete": "Borrar",
|
||||
"Delete Image": "Borrar imagen",
|
||||
"Delete OSManager": "Eliminar OS Manager",
|
||||
"Delete Services Pool Group": "Borrar grupo para Services Pool",
|
||||
"Delete authenticator": "Eliminar autenticador",
|
||||
"Delete calendar": "Eliminar calendario",
|
||||
"Delete group": "Borrar grupo",
|
||||
"Delete network": "Eliminar red",
|
||||
"Delete rule": "Eliminar regla",
|
||||
"Delete service": "Eliminar servicio",
|
||||
"Delete services provider": "Eliminar proveedor de servicios",
|
||||
"Delete transport": "Eliminar transporte",
|
||||
"Delete user": "Eliminar usuario",
|
||||
"Delete user service": "Eliminar servicio de usuario",
|
||||
"Deletion error": "Error de eliminaci\u00f3n",
|
||||
"Deletion results": "Resultados de la eliminaci\u00f3n",
|
||||
"Edit": "Editar",
|
||||
"Edit OSManager": "Editar OS Manager",
|
||||
"Edit Services Pool Group": "Editar grupo para Services Pool",
|
||||
"Edit access calendar": "Editar calendario de acceso",
|
||||
"Edit authenticator": "Editar autenticador",
|
||||
"Edit calendar": "Editar calendario",
|
||||
"Edit group": "Editar grupo",
|
||||
"Edit image": "Editar imagen",
|
||||
"Edit network": "Editar red",
|
||||
"Edit rule": "Editar regla",
|
||||
"Edit service": "Editar servicio",
|
||||
"Edit services provider": "Editar proveedor de servicios",
|
||||
"Edit transport": "Editar transporte",
|
||||
"Edit user": "Editar usuario",
|
||||
"Edition successfully done": "Edici\u00f3n realizada con \u00e9xito",
|
||||
"Empty": "Vac\u00edo",
|
||||
"Ending": "Final",
|
||||
"Enter Maintenance Mode?": "\u00bfEntrar en modo mantenimiento?",
|
||||
"Enter maintenance Mode": "Entrar en modo mantenimiento",
|
||||
"Error accessing data": "Error de acceso a datos",
|
||||
"Error accessing service: ": "Error al acceder al servicio: ",
|
||||
"Error creating report": "Error al crear el informe",
|
||||
"Error creating rule": "Error creando regla",
|
||||
"Error deleting": "Error borrando",
|
||||
"Error obtaining report description": "Error al obtener la descripci\u00f3n del informe",
|
||||
"Error saving rule": "Error al guardar la regla",
|
||||
"Execute action": "Ejecutar acci\u00f3n",
|
||||
"Exit Maintenance Mode": "Salir del modo mantenimiento",
|
||||
"Exit Maintenance Mode?": "Salir del modo mantenimiento",
|
||||
"Failed creating publication": "No se pudo crear la publicaci\u00f3n",
|
||||
"February": "Febrero",
|
||||
"Filter": "Filtro",
|
||||
"Force Cancel": "Forzar cancelaci\u00f3n",
|
||||
"Friday": "Viernes",
|
||||
"Generate report": "Generar informe",
|
||||
"Group": "Grupo",
|
||||
"Group deletion error": "Error al borrar grupo",
|
||||
"Group information": "Informaci\u00f3n del grupo",
|
||||
"Group saved": "Grupo guardado",
|
||||
"Group saving error": "Error al guardar grupo",
|
||||
"Groups found": "Grupos encontrados",
|
||||
"Hours": "Horas",
|
||||
"If selected, will initiate the publication inmediatly after creation": "Si se selecciona, se iniciar\u00e1 la publicaci\u00f3n inmediatamente despu\u00e9s de la creaci\u00f3n",
|
||||
"Image deletion error": "Error al borrar la imagen",
|
||||
"Image is too big (max. upload size is 256Kb)": "La imagen es demasiado grande (el tama\u00f1o m\u00e1ximo es de 256Kb)",
|
||||
"In Maintenance": "En mantenimiento",
|
||||
"Information": "Informaci\u00f3n",
|
||||
"January": "Enero",
|
||||
"July": "Julio",
|
||||
"June": "Junio",
|
||||
"Just a moment...": "Un momento...",
|
||||
"Launch Now": "Lanzar ahora",
|
||||
"Launch action execution right now?": "\u00bfIniciar la ejecuci\u00f3n de la acci\u00f3n ahora?",
|
||||
"Logs": "Logs",
|
||||
"Main": "Principal",
|
||||
"Maintenance": "Mantenimiento",
|
||||
"Maintenance Mode": "Modo de mantenimiento",
|
||||
"March": "Marzo",
|
||||
"May": "Mayo",
|
||||
"Message": "Mensaje",
|
||||
"Minutes": "Minutos",
|
||||
"Monday": "Lunes",
|
||||
"Monthly": "Mensual",
|
||||
"Network creation error": "Error al crear red",
|
||||
"Network deletion error": "Error al eliminar red",
|
||||
"Network saving error": "Error al guardar red",
|
||||
"Never": "Nunca",
|
||||
"New": "Nuevo",
|
||||
"New OSManager": "Nuevo OS Manager",
|
||||
"New Services Pool Group": "Nuevo grupo para Services Pool",
|
||||
"New authenticator": "Nuevo autenticador",
|
||||
"New calendar": "Nuevo calendario",
|
||||
"New group": "Nuevo grupo",
|
||||
"New image": "Nueva imagen",
|
||||
"New meta group": "Nuevo meta grupo",
|
||||
"New network": "Nueva red",
|
||||
"New rule": "Nueva regla",
|
||||
"New service": "Nuevo servicio",
|
||||
"New service pool": "Nuevo Pool de Servicios",
|
||||
"New services provider": "Nuevo proveedor de servicios",
|
||||
"New transport": "Nuevo transporte",
|
||||
"New user": "Nuevo usuario",
|
||||
"No": "No",
|
||||
"No changes has been made": "No se han hecho cambios",
|
||||
"No records": "No hay registros",
|
||||
"November": "Noviembre",
|
||||
"OSManager creation error": "Error al crear OS Manager",
|
||||
"OSManager deletion error": "Error al eliminarl OS Manager",
|
||||
"OSManager saving error": "Error al guardar OS Manager",
|
||||
"October": "Octubre",
|
||||
"Overview": "Visi\u00f3n de conjunto",
|
||||
"Permissions": "Permisos",
|
||||
"Permissions for": "Permisos para",
|
||||
"Please enter a valid URL.": "Por favor, introduzca una URL v\u00e1lida.",
|
||||
"Please enter a valid credit card number.": "Por favor, introduzca un n\u00famero de tarjeta de cr\u00e9dito v\u00e1lida.",
|
||||
"Please enter a valid date (ISO).": "Por favor, introduzca una fecha v\u00e1lida (ISO).",
|
||||
"Please enter a valid date.": "Por favor, introduzca una fecha v\u00e1lida.",
|
||||
"Please enter a valid email address.": "Por favor, introduzca una direcci\u00f3n de correo electr\u00f3nico v\u00e1lida.",
|
||||
"Please enter a valid number.": "Por favor, introduzca un n\u00famero v\u00e1lido.",
|
||||
"Please enter a value between {0} and {1} characters long.": "Por favor, introduzca un valor de entre {0} y {1} caracteres.",
|
||||
"Please enter a value between {0} and {1}.": "Por favor, introduzca un valor entre {0} y {1}.",
|
||||
"Please enter a value greater than or equal to {0}.": "Por favor, introduzca un valor mayor o igual a {0}.",
|
||||
"Please enter a value less than or equal to {0}.": "Por favor, introduzca un valor menor o igual a {0}.",
|
||||
"Please enter at least {0} characters.": "Por favor, introduzca al menos {0} caracteres.",
|
||||
"Please enter no more than {0} characters.": "Por favor, no introduzca m\u00e1s de {0} caracteres.",
|
||||
"Please enter only digits.": "Por favor, introduzca s\u00f3lo cifras.",
|
||||
"Please enter the same value again.": "Por favor, introduzca el mismo valor otra vez.",
|
||||
"Please fix this field.": "Por favor corrija este campo.",
|
||||
"Please wait, processing": "Por favor espere, procesando",
|
||||
"Publish": "Publicar",
|
||||
"Publish on creation": "Publicar en la creaci\u00f3n",
|
||||
"Records _START_ to _END_ of _TOTAL_": "Registros de _START_ a _END_ de _TOTAL_",
|
||||
"Refresh operation failed": "Error en la operaci\u00f3n de actualizaci\u00f3n",
|
||||
"Remove ": "Quitar ",
|
||||
"Remove Assigned service": "Quitar servicio asignado",
|
||||
"Remove Cache element": "Retirar elemento de la cach\u00e9",
|
||||
"Remove access calendar": "Eliminar calendario de acceso",
|
||||
"Remove transport": "Quitar transporte",
|
||||
"Restrained": "Contenido",
|
||||
"Revoke": "Revocar",
|
||||
"Rule deletion error": "Error al eliminar la regla",
|
||||
"Saturday": "S\u00e1bado",
|
||||
"Save": "Guardar",
|
||||
"Search error": "Error en la b\u00fasqueda",
|
||||
"Search groups": "Buscar grupos",
|
||||
"Search users": "Buscar usuarios",
|
||||
"Selected %d rows": "%d filas seleccionadas",
|
||||
"Selected one row": "Seleccionar una fila",
|
||||
"September": "Septiembre",
|
||||
"Service creation error": "Error al crear servicio",
|
||||
"Service deletion error": "Error al eliminar servicio",
|
||||
"Service information": "Informaci\u00f3n sobre el servicio",
|
||||
"Service saving error": "Error al guardar servicio",
|
||||
"Services Pool Group creation error": "Error de creaci\u00f3n de grupo de servicios piscina",
|
||||
"Services Pool Group removal error": "Error de eliminaci\u00f3n de grupo para Services Pool",
|
||||
"Services Pool Group saving error": "Error al guardar grupo para Services Pool",
|
||||
"Services Provider deletion error": "Error al eliminar el proveedor de servicios",
|
||||
"Services Provider saving error": "Error al guardar proveedor de servicios",
|
||||
"Services provider creation error": "Error en la creaci\u00f3n del proveedor de servicios",
|
||||
"Staff member": "Miembro del personal",
|
||||
"Successfully deleted": "Eliminado correctamente",
|
||||
"Sun": "Dom",
|
||||
"Sunday": "Domingo",
|
||||
"Test": "Prueba",
|
||||
"Test failed:": "El test ha fallado:",
|
||||
"Test passed successfully": "Test superado con \u00e9xito",
|
||||
"This field is required.": "Este campo es obligatorio",
|
||||
"This rule will be valid every ": "Esta regla ser\u00e1 v\u00e1lida cada ",
|
||||
"Thursday": "Jueves",
|
||||
"Transport creation error": "Error al crear transporte",
|
||||
"Transport deletion error": "Error al eliminar transporte",
|
||||
"Transport removal error": "Error al quitar transporte",
|
||||
"Transport saving error": "Error al guardar transporte",
|
||||
"Tuesday": "Martes",
|
||||
"Upload": "Subir",
|
||||
"User": "Usuario",
|
||||
"User deletion error": "Error al borrar usuario",
|
||||
"User information": "Informaci\u00f3n de usuario",
|
||||
"User saved": "Usuario guardado",
|
||||
"User saving error": "Error al guardar usuario",
|
||||
"User service deletion error": "Error en la eliminaci\u00f3n del servicio de usuario",
|
||||
"Users found": "Usuarios encontrados",
|
||||
"Wednesday": "Mi\u00e9rcoles",
|
||||
"Weekdays": "D\u00edas de la semana",
|
||||
"Weekly": "Semanal",
|
||||
"Weeks": "Semanas",
|
||||
"Xls": "Xls",
|
||||
"Yearly": "Anual",
|
||||
"Yes": "S\u00ed",
|
||||
"You must provide a transport": "Debe proporcionar un transporte",
|
||||
"You must provide authenticator and": "Usted debe proporcionar autenticador y",
|
||||
"You must provide authenticator and group": "Debe proporcionar autenticador y grupo",
|
||||
"You must select an image": "Debe seleccionar una imagen",
|
||||
"_MENU_ records per page": "_MENU_ Registros por p\u00e1gina",
|
||||
"and will remain valid for": "y seguir\u00e1 siendo v\u00e1lida durante",
|
||||
"creation error": "error de creaci\u00f3n",
|
||||
"day": "d\u00eda",
|
||||
"days": "d\u00edas",
|
||||
"deletion error": "error al eliminar",
|
||||
"error": "error",
|
||||
"from": "Desde el",
|
||||
"items:": "elementos:",
|
||||
"level": "nivel",
|
||||
"message": "Mensaje",
|
||||
"month": "mes",
|
||||
"months": "meses",
|
||||
"no": "no",
|
||||
"of any week": "de cualquier semana",
|
||||
"of type": "de tipo",
|
||||
"onwards": "en adelante",
|
||||
"saving error": "error al guardar",
|
||||
"source": "fuente",
|
||||
"starting at": "comenzando a las",
|
||||
"until ": "hasta ",
|
||||
"week": "semana",
|
||||
"weeks": "semanas",
|
||||
"with no duration": "sin duraci\u00f3n",
|
||||
"year": "a\u00f1o",
|
||||
"years": "a\u00f1os",
|
||||
"yes": "s\u00ed"
|
||||
};
|
||||
for (var key in newcatalog) {
|
||||
django.catalog[key] = newcatalog[key];
|
||||
}
|
||||
|
||||
|
||||
if (!django.jsi18n_initialized) {
|
||||
django.gettext = function(msgid) {
|
||||
var value = django.catalog[msgid];
|
||||
if (typeof(value) == 'undefined') {
|
||||
return msgid;
|
||||
} else {
|
||||
return (typeof(value) == 'string') ? value : value[0];
|
||||
}
|
||||
};
|
||||
|
||||
django.ngettext = function(singular, plural, count) {
|
||||
var value = django.catalog[singular];
|
||||
if (typeof(value) == 'undefined') {
|
||||
return (count == 1) ? singular : plural;
|
||||
} else {
|
||||
return value[django.pluralidx(count)];
|
||||
}
|
||||
};
|
||||
|
||||
django.gettext_noop = function(msgid) { return msgid; };
|
||||
|
||||
django.pgettext = function(context, msgid) {
|
||||
var value = django.gettext(context + '\x04' + msgid);
|
||||
if (value.indexOf('\x04') != -1) {
|
||||
value = msgid;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
django.npgettext = function(context, singular, plural, count) {
|
||||
var value = django.ngettext(context + '\x04' + singular, context + '\x04' + plural, count);
|
||||
if (value.indexOf('\x04') != -1) {
|
||||
value = django.ngettext(singular, plural, count);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
django.interpolate = function(fmt, obj, named) {
|
||||
if (named) {
|
||||
return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])});
|
||||
} else {
|
||||
return fmt.replace(/%s/g, function(match){return String(obj.shift())});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/* formatting library */
|
||||
|
||||
django.formats = {
|
||||
"DATETIME_FORMAT": "j \\d\\e F \\d\\e Y \\a \\l\\a\\s H:i",
|
||||
"DATETIME_INPUT_FORMATS": [
|
||||
"%d/%m/%Y %H:%M:%S",
|
||||
"%d/%m/%Y %H:%M:%S.%f",
|
||||
"%d/%m/%Y %H:%M",
|
||||
"%d/%m/%y %H:%M:%S",
|
||||
"%d/%m/%y %H:%M:%S.%f",
|
||||
"%d/%m/%y %H:%M",
|
||||
"%Y-%m-%d %H:%M:%S",
|
||||
"%Y-%m-%d %H:%M:%S.%f",
|
||||
"%Y-%m-%d %H:%M",
|
||||
"%Y-%m-%d"
|
||||
],
|
||||
"DATE_FORMAT": "j \\d\\e F \\d\\e Y",
|
||||
"DATE_INPUT_FORMATS": [
|
||||
"%d/%m/%Y",
|
||||
"%d/%m/%y",
|
||||
"%Y-%m-%d"
|
||||
],
|
||||
"DECIMAL_SEPARATOR": ",",
|
||||
"FIRST_DAY_OF_WEEK": "1",
|
||||
"MONTH_DAY_FORMAT": "j \\d\\e F",
|
||||
"NUMBER_GROUPING": "3",
|
||||
"SHORT_DATETIME_FORMAT": "d/m/Y H:i",
|
||||
"SHORT_DATE_FORMAT": "d/m/Y",
|
||||
"THOUSAND_SEPARATOR": ".",
|
||||
"TIME_FORMAT": "H:i",
|
||||
"TIME_INPUT_FORMATS": [
|
||||
"%H:%M:%S",
|
||||
"%H:%M:%S.%f",
|
||||
"%H:%M"
|
||||
],
|
||||
"YEAR_MONTH_FORMAT": "F \\d\\e Y"
|
||||
};
|
||||
|
||||
django.get_format = function(format_type) {
|
||||
var value = django.formats[format_type];
|
||||
if (typeof(value) == 'undefined') {
|
||||
return format_type;
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
/* add to global namespace */
|
||||
globals.pluralidx = django.pluralidx;
|
||||
globals.gettext = django.gettext;
|
||||
globals.ngettext = django.ngettext;
|
||||
globals.gettext_noop = django.gettext_noop;
|
||||
globals.pgettext = django.pgettext;
|
||||
globals.npgettext = django.npgettext;
|
||||
globals.interpolate = django.interpolate;
|
||||
globals.get_format = django.get_format;
|
||||
|
||||
django.jsi18n_initialized = true;
|
||||
}
|
||||
|
||||
}(this));
|
||||
|
@ -1 +0,0 @@
|
||||
{"scrambler": "MkBpvLzfAg1ToRacAuNmtAXWRw5oMC6g", "version": "3.x.x-DEVEL", "result": "ok", "token": "c4o6w4ilq92ohpasty76drtodipc5ifv"}
|
@ -1 +0,0 @@
|
||||
{"result": "error", "error": "Invalid Credentials (invalid authenticator)"}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user