Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2a41c00b
authored
Nov 16, 2016
by
root
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
issue #603 implemented: customized corporative image of Pictogram
parent
cd3921d9
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
55 additions
and
9 deletions
sails/roles/database/files/pictodb-schema.sql
sails/src/api/controllers/OfficeController.js
sails/src/api/models/Office.js
sails/src/assets/scripts/app.js
sails/src/assets/scripts/modules/login/controllers/login.js
sails/src/assets/scripts/modules/login/views/login.html
sails/src/assets/scripts/modules/supervisor/views/header.html
sails/src/assets/scripts/modules/supervisor/views/students.html
sails/src/assets/scripts/modules/translate/views/footer_translate.html
sails/src/config/policies.js
sails/src/config/routes.js
sails/roles/database/files/pictodb-schema.sql
View file @
2a41c00b
...
@@ -138,6 +138,7 @@ COMMENT="Methods predefined in the platform or stored by users for cloning";
...
@@ -138,6 +138,7 @@ COMMENT="Methods predefined in the platform or stored by users for cloning";
CREATE
TABLE
IF
NOT
EXISTS
`office`
(
CREATE
TABLE
IF
NOT
EXISTS
`office`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`name`
varchar
(
80
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`name`
varchar
(
80
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`logo_url`
varchar
(
240
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`address`
varchar
(
180
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`address`
varchar
(
180
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`country`
varchar
(
2
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`country`
varchar
(
2
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`lang`
varchar
(
5
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`lang`
varchar
(
5
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
...
...
sails/src/api/controllers/OfficeController.js
View file @
2a41c00b
...
@@ -50,6 +50,25 @@ module.exports = {
...
@@ -50,6 +50,25 @@ module.exports = {
},
},
/**
/**
* Get basic informacion (logo_url and name) about an office identified by a code
*/
getBasic
:
function
(
req
,
res
)
{
// We simply remove first 3 characters
var
id
=
req
.
params
.
code
.
substr
(
3
,
req
.
params
.
code
.
length
-
1
);
Office
.
findOne
({
id
:
id
}).
populate
(
'admin'
).
then
(
function
(
office
)
{
if
(
office
)
{
res
.
ok
({
logo_url
:
office
.
logo_url
,
name
:
office
.
name
});
}
else
{
res
.
notFound
();
}
})
.
catch
(
function
()
{
res
.
badRequest
();
});
},
/**
* Return all offices
* Return all offices
* @param {request} req {}
* @param {request} req {}
* @param {response} res
* @param {response} res
...
...
sails/src/api/models/Office.js
View file @
2a41c00b
...
@@ -31,6 +31,11 @@ module.exports = {
...
@@ -31,6 +31,11 @@ module.exports = {
type
:
"string"
,
type
:
"string"
,
size
:
80
size
:
80
},
},
logo_url
:
{
required
:
true
,
type
:
"string"
,
size
:
240
},
contactPerson
:
{
contactPerson
:
{
columnName
:
"contact_person"
,
columnName
:
"contact_person"
,
required
:
true
,
required
:
true
,
...
@@ -85,4 +90,4 @@ module.exports = {
...
@@ -85,4 +90,4 @@ module.exports = {
via
:
'office'
via
:
'office'
}
}
}
}
};
};
\ No newline at end of file
sails/src/assets/scripts/app.js
View file @
2a41c00b
...
@@ -56,6 +56,11 @@ dashboardApp.config(function ($stateProvider, $urlRouterProvider) {
...
@@ -56,6 +56,11 @@ dashboardApp.config(function ($stateProvider, $urlRouterProvider) {
templateUrl
:
'modules/login/views/login.html'
,
templateUrl
:
'modules/login/views/login.html'
,
controller
:
'LoginCtrl'
controller
:
'LoginCtrl'
})
})
.
state
(
'login_office'
,
{
url
:
'/login/:office'
,
templateUrl
:
'modules/login/views/login.html'
,
controller
:
'LoginCtrl'
})
.
state
(
'login_validate'
,
{
.
state
(
'login_validate'
,
{
url
:
'/login/:code/:email'
,
url
:
'/login/:code/:email'
,
templateUrl
:
'modules/login/views/login.html'
,
templateUrl
:
'modules/login/views/login.html'
,
...
...
sails/src/assets/scripts/modules/login/controllers/login.js
View file @
2a41c00b
...
@@ -16,12 +16,18 @@ function LoginCtrl(
...
@@ -16,12 +16,18 @@ function LoginCtrl(
config
,
config
,
$stateParams
,
$stateParams
,
ngToast
)
{
ngToast
)
{
$scope
.
credentials
=
{
$scope
.
credentials
=
{
email
:
''
,
email
:
''
,
password
:
''
,
password
:
''
,
lang
:
'es-es'
lang
:
'es-es'
};
};
$scope
.
office
=
{
logo_url
:
'img/logo_pictogram.png'
,
name
:
'Pictogram'
};
// Validation of account
// Validation of account
// if the code has been sent in the url "...app/login/code/email"
// if the code has been sent in the url "...app/login/code/email"
if
(
$stateParams
.
code
&&
$stateParams
.
email
)
{
if
(
$stateParams
.
code
&&
$stateParams
.
email
)
{
...
@@ -39,6 +45,15 @@ function LoginCtrl(
...
@@ -39,6 +45,15 @@ function LoginCtrl(
});
});
}
}
// Corporate login, office code has been passed
if
(
$stateParams
.
office
)
{
$http
.
get
(
config
.
backend
+
'/office/'
+
$stateParams
.
office
)
.
success
(
function
(
data
)
{
$scope
.
office
=
data
;
});
}
$scope
.
login
=
function
()
{
$scope
.
login
=
function
()
{
$scope
.
submitted
=
true
;
$scope
.
submitted
=
true
;
$http
$http
...
...
sails/src/assets/scripts/modules/login/views/login.html
View file @
2a41c00b
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
</p>
</p>
-->
-->
<p
class=
"text-center"
>
<p
class=
"text-center"
>
<img
src=
"
https://www.dropbox.com/s/6v4hwp9rflvak4s/Logomakr_0PxJqJ.png?raw=1"
alt=
"Centro Autismo Jaén"
title=
"Centro Autismo Jaén
"
>
<img
src=
"
{{office.logo_url}}"
alt=
"{{office.name}}"
title=
"{{office.name}}
"
>
</p>
</p>
<!-- Formulario -->
<!-- Formulario -->
<!-- LoginCtrl controls here, see app.js -->
<!-- LoginCtrl controls here, see app.js -->
...
...
sails/src/assets/scripts/modules/supervisor/views/header.html
View file @
2a41c00b
...
@@ -8,9 +8,9 @@
...
@@ -8,9 +8,9 @@
href=
"/app/#/students"
>
href=
"/app/#/students"
>
<img
<img
class=
"topbar__logo__image"
class=
"topbar__logo__image"
src=
"
img/logo_pictogram.png
"
src=
"
{{user.office.logo_url}}
"
alt=
"
Pictogram
"
alt=
"
{{user.office.name}}
"
title=
"
Pictogram
"
/>
title=
"
{{user.office.name}}
"
/>
</a>
</a>
</div>
</div>
<div
class=
"topbar__supervisor nav navbar-nav navbar-right"
>
<div
class=
"topbar__supervisor nav navbar-nav navbar-right"
>
...
...
sails/src/assets/scripts/modules/supervisor/views/students.html
View file @
2a41c00b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<!-- Default panel contents -->
<!-- Default panel contents -->
<div
class=
"panel-heading"
><h3
class=
"panel-title"
translate
>
students
</h3>
<div
class=
"panel-heading"
><h3
class=
"panel-title"
translate
>
students
</h3>
<span
ng-if=
"user.isAdmin"
>
({{user.office.currentStudents}}/{{user.office.maxStudents}} -
<span
translate=
"licenses_left"
translate-values=
"{number: num_licenses_left}"
></span>
)
</span>
<span
ng-if=
"user.isAdmin"
>
({{user.office.currentStudents}}/{{user.office.maxStudents}} -
<span
translate=
"licenses_left"
translate-values=
"{number: num_licenses_left}"
></span>
)
</span>
<
/divuser
.office.currentStudents}}/ivuser.office.maxStudents}}
<
div
class="panel-body"
>
<div
class=
"panel-body"
>
<!-- Add Student Form -->
<!-- Add Student Form -->
<div
ng-include=
"'modules/supervisor/views/students_add.html'"
ng-init=
"hidestudentadd = true"
ng-hide=
"hidestudentadd"
></div>
<div
ng-include=
"'modules/supervisor/views/students_add.html'"
ng-init=
"hidestudentadd = true"
ng-hide=
"hidestudentadd"
></div>
...
...
sails/src/assets/scripts/modules/translate/views/footer_translate.html
View file @
2a41c00b
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
<button
type=
"button"
class=
"btn btn-link"
ng-click=
"changeLanguage('en-gb')"
>
English
</button>
<button
type=
"button"
class=
"btn btn-link"
ng-click=
"changeLanguage('en-gb')"
>
English
</button>
</div>
</div>
<div>
<div>
<p
class=
"text-center"
>
<p
class=
"text-center"
style=
"margin-top:10px"
>
<small>
Powered by
<a
href=
"http://www.yottacode.com"
><img
src=
"img/logo_pictogram.png"
width=
"
6
0px"
alt=
"Pictogram"
title=
"Pictogram"
/></a></small>
<small>
Powered by
<a
href=
"http://www.yottacode.com"
><img
src=
"img/logo_pictogram.png"
width=
"
4
0px"
alt=
"Pictogram"
title=
"Pictogram"
/></a></small>
</p>
</p>
</div>
</div>
</div>
</div>
sails/src/config/policies.js
View file @
2a41c00b
...
@@ -62,6 +62,7 @@ module.exports.policies = {
...
@@ -62,6 +62,7 @@ module.exports.policies = {
OfficeController
:
{
OfficeController
:
{
getAll
:
[
'tokenAuth'
,
'isAdmin'
],
getAll
:
[
'tokenAuth'
,
'isAdmin'
],
get
:
[
'tokenAuth'
],
get
:
[
'tokenAuth'
],
getBasic
:
true
,
supervisors
:
[
'tokenAuth'
,
'isAdmin'
]
supervisors
:
[
'tokenAuth'
,
'isAdmin'
]
},
},
...
...
sails/src/config/routes.js
View file @
2a41c00b
...
@@ -52,6 +52,7 @@ module.exports.routes = {
...
@@ -52,6 +52,7 @@ module.exports.routes = {
'DELETE /method/template/:id'
:
'MetaMethodController.destroy'
,
'DELETE /method/template/:id'
:
'MetaMethodController.destroy'
,
'GET /office/get_all'
:
'OfficeController.getAll'
,
'GET /office/get_all'
:
'OfficeController.getAll'
,
'GET /office/:code'
:
'OfficeController.getBasic'
,
'GET /office/get/:id'
:
'OfficeController.get'
,
'GET /office/get/:id'
:
'OfficeController.get'
,
'GET /office/get/:id/supervisors'
:
'OfficeController.supervisors'
,
'GET /office/get/:id/supervisors'
:
'OfficeController.supervisors'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment