Skip to content

Commit

Permalink
Merge pull request #41 from AreaFiftyLAN/feature-web_tab
Browse files Browse the repository at this point in the history
Add web tab to admin page
  • Loading branch information
timhuisman1 authored Dec 18, 2018
2 parents 93b4ae7 + b62cfbe commit c88c04d
Show file tree
Hide file tree
Showing 18 changed files with 2,264 additions and 8 deletions.
1 change: 1 addition & 0 deletions gulp/polymer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"src/lancie-admin-endpoint/lancie-admin-pages/lancie-admin-seats.html",
"src/lancie-admin-endpoint/lancie-admin-pages/lancie-admin-mail/lancie-admin-mail.html",
"src/lancie-admin-endpoint/lancie-admin-pages/lancie-admin-homepage-text.html",
"src/lancie-admin-web/lancie-admin-web.html",
"src/lancie-admin-rfid/lancie-admin-rfid-assign.html",
"src/lancie-admin-rfid/lancie-admin-rfid-alcohol.html",
"src/lancie-admin-rfid/lancie-admin-rfid-consumption.html",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
"fs-extra": "^4.0.1",
"glob": "^7.1.1",
"gulp": "gulpjs/gulp#4.0",
"gulp-babel-minify": "^0.2.0",
"gulp-html-minifier": "^0.1.8",
"gulp-if": "^2.0.1",
"gulp-imagemin": "^3.3.0",
"gulp-jshint": "^2.0.2",
"gulp-replace": "^0.6.1",
"gulp-style-modules": "^0.1.0",
Expand All @@ -16,10 +18,8 @@
"merge-stream": "^1.0.0",
"plylog": "^0.5.0",
"polymer-build": "^2.0.0",
"polyserve": "^0.20.0",
"superagent": "^3.2.1",
"gulp-babel-minify": "^0.2.0",
"gulp-imagemin": "^3.3.0"
"polyserve": "^0.27.13",
"superagent": "^3.2.1"
},
"scripts": {
"build": "node ./node_modules/gulp/bin/gulp.js",
Expand Down
3 changes: 3 additions & 0 deletions src/lancie-admin-app.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<link rel="import" href="../bower_components/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="../bower_components/lancie-login-card/lancie-login-card.html">
<link rel="import" href="../bower_components/lancie-ajax/lancie-ajax.html">
<link rel="import" href="../bower_components/lancie-form/lancie-form.html">
<link rel="import" href="../bower_components/paper-toast/paper-toast.html">

<dom-module id="lancie-admin-app">
Expand All @@ -30,6 +31,7 @@
<paper-toast id="globalToast"></paper-toast>

<lancie-ajax id="ajax"></lancie-ajax>
<lancie-form id="form"></lancie-form>
<iron-ajax
id="getCurrentUser"
url="/api/v1/users/current"
Expand Down Expand Up @@ -94,6 +96,7 @@
if (detail.user.authorities.indexOf('ROLE_ADMIN') > -1) {
this.user = detail;
this.$.ajax.injectToken(detail.token);
this.$.form.injectToken(detail.token);
window.localStorage.setItem('a5lauth', detail.token);

this.loggedIn = true;
Expand Down
1 change: 1 addition & 0 deletions src/lancie-admin-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<lancie-admin-seats data-route="seats" data-path="lancie-admin-endpoint/lancie-admin-pages/lancie-admin-seats.html"></lancie-admin-seats>
<lancie-admin-homepage-text data-route="text" data-path="lancie-admin-endpoint/lancie-admin-pages/lancie-admin-homepage-text.html"></lancie-admin-homepage-text>
<lancie-admin-mail data-route="mail" data-path="lancie-admin-endpoint/lancie-admin-pages/lancie-admin-mail/lancie-admin-mail.html"></lancie-admin-mail>
<lancie-admin-web data-route="web" data-path="lancie-admin-web/lancie-admin-web.html"></lancie-admin-web>
<lancie-admin-rfid-assign data-route="rfidassign" data-path="lancie-admin-rfid/lancie-admin-rfid-assign.html"></lancie-admin-rfid-assign>
<lancie-admin-rfid-alcohol data-route="alcoholcheck" data-path="lancie-admin-rfid/lancie-admin-rfid-alcohol.html"></lancie-admin-rfid-alcohol>
<lancie-admin-rfid-consumption data-route="consumptions" data-path="lancie-admin-rfid/lancie-admin-rfid-consumption.html"></lancie-admin-rfid-consumption>
Expand Down
1 change: 1 addition & 0 deletions src/lancie-admin-icons.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
<g id="menu"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></g>
<g id="mail"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></g>
<g id="timeline"><path d="M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2z"/></g>
<g id="web"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"/></g>
</defs></svg>
</iron-iconset-svg>
8 changes: 6 additions & 2 deletions src/lancie-admin-layout/lancie-admin-layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
width: 100%;
}

.rfid, .logout{
.rfid, .logout, .web {
border-top: 1px solid #e8e8e8;
}

Expand Down Expand Up @@ -125,6 +125,10 @@
<iron-icon icon="lancie-admin:mail" slot="item-icon"></iron-icon>
<a href="/mail">Mail</a>
</paper-icon-item>
<paper-icon-item class="web" data-route="web">
<iron-icon icon="lancie-admin:web" slot="item-icon"></iron-icon>
<a href="/web">Web</a>
</paper-icon-item>
<paper-icon-item class="rfid" data-route="rfidassign">
<iron-icon icon="lancie-admin:nfc" slot="item-icon"></iron-icon>
<a href="/rfidassign">Assign RFID</a>
Expand Down Expand Up @@ -153,7 +157,7 @@
<app-header-layout id="headerLayout" fullbleed>
<app-header fixed effects="waterfall" slot="header">
<app-toolbar class="layout horizontal">
<paper-icon-button class="menu-button" icon="lancie-admin:menu" hidden$="[[wideLayout]]" drawer-toggle></paper-icon-button>
<paper-icon-button class="menu-button" icon="lancie-admin:menu" hidden$="[[wideLayout]]" drawer-toggle></paper-icon-button>
<div main-title>[[_getTitle(route)]]</div>
</app-toolbar>
</app-header>
Expand Down
4 changes: 2 additions & 2 deletions src/lancie-admin-table/lancie-admin-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
var keys = Object.keys(data[0]);
var columns = keys.map(function(key) {
// If a mapping exists, resolve it
if (!!this.columnMappings[key]) {
if (this.columnMappings && !!this.columnMappings[key]) {
return this.columnMappings[key].map(function(item) {
return {
name: key + '.' + item,
Expand All @@ -195,7 +195,7 @@
attached here.
*/
columns = columns.map(function(col) {
if (!!this.columnRenderers[col.name]) {
if (this.columnRenderers && !!this.columnRenderers[col.name]) {
col.renderer = this.columnRenderers[col.name];
}
return col;
Expand Down
14 changes: 14 additions & 0 deletions src/lancie-admin-web/lancie-admin-committee-icons.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<link rel="import" href="../../bower_components/iron-icon/iron-icon.html">
<link rel="import" href="../../bower_components/iron-iconset-svg/iron-iconset-svg.html">

<iron-iconset-svg size="24" name="commission">
<svg><defs>
<g id="attach-money"><path d="M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z"></path></g>
<g id="announcement"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 9h-2V5h2v6zm0 4h-2v-2h2v2z"></path></g>
<g id="chrome-reader-mode"><path d="M13 12h7v1.5h-7zm0-2.5h7V11h-7zm0 5h7V16h-7zM21 4H3c-1.1 0-2 .9-2 2v13c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 15h-9V6h9v13z"></path></g>
<g id="gavel"><path d="M1 21h12v2H1zM5.245 8.07l2.83-2.827 14.14 14.142-2.828 2.828zM12.317 1l5.657 5.656-2.83 2.83-5.654-5.66zM3.825 9.485l5.657 5.657-2.828 2.828-5.657-5.657z"></path></g>
<g id="settings"><path d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"></path></g>
<g id="local-shipping"><path d="M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5l-3-4zM6 18.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm13.5-9l1.96 2.5H17V9.5h2.5zm-1.5 9c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"></path></g>
<g id="notifications"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"></path></g>
</defs></svg>
</iron-iconset-svg>
85 changes: 85 additions & 0 deletions src/lancie-admin-web/lancie-admin-committee-member.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="../../bower_components/iron-icon/iron-icon.html">

<link rel="import" href="lancie-admin-committee-icons.html">

<dom-module id="lancie-admin-committee-member">
<template>
<style>
:host {
display: block;
}

iron-icon {
margin-right: 10px;
}

.delete-button {
cursor: pointer;
}

.align-right {
text-align: right;
}
</style>

<custom-style>
<style is="custom-style">
.flex-horizontal-with-ratios {
@apply (--layout-horizontal);
}
.flexchild {
@apply (--layout-flex);
}
.flex2child {
@apply (--layout-flex-4);
}
.flex3child {
@apply (--layout-flex-9);
}
</style>
</custom-style>

<paper-item class="container flex-horizontal-with-ratios">
<div class="flex2child">[[member.name]]</div>
<div class="flex3child">
<iron-icon icon="commission:[[member.icon]]"></iron-icon>[[member.function]]
</div>
<div class="flexchild">[[member.position]]</div>
<div class="flexchild align-right">
<iron-icon icon="icons:delete" on-tap="deleteMemberDialog" class="delete-button"></iron-icon>
</div>
</paper-item>

</template>
<script>
(function() {
'use strict';

class LancieAdminCommitteeMember extends Polymer.Element {
static get is() {
return 'lancie-admin-committee-member';
}

static get properties() {
return {
member: Object
}
}

deleteMemberDialog() {
this.dispatchEvent(new CustomEvent('delete-member-dialog', {
detail: {
position: this.member.position
},
bubbles: true,
composed: true
}));
}
}

customElements.define(LancieAdminCommitteeMember.is, LancieAdminCommitteeMember);
})();
</script>
</dom-module>
Loading

0 comments on commit c88c04d

Please sign in to comment.