admin page original
This commit is contained in:
parent
a329b4b08e
commit
775a9aa502
@ -1,239 +0,0 @@
|
||||
#copyArea {
|
||||
position: absolute;
|
||||
top: -50px;
|
||||
}
|
||||
|
||||
#adminBanner {
|
||||
width: 100%;
|
||||
height: 32%;
|
||||
position: relative;
|
||||
background-size: 100vw;
|
||||
}
|
||||
|
||||
#adminTabs {
|
||||
font-size: 120%;
|
||||
width: 100%;
|
||||
margin: 0 0 0 12%;
|
||||
padding: 0.1% 0 0 0;
|
||||
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
|
||||
overflow: hidden;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
#adminTabs li {
|
||||
width: 5%;
|
||||
margin: 0 0.5% 0 0.5%;
|
||||
padding: 0.7% 0.7% 0.5% 0.7%;
|
||||
|
||||
box-shadow: 1px 1px 5px 1px #333;
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 2px;
|
||||
|
||||
display: block;
|
||||
float: left;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: background-color 0.3s ease, box-shadow 0.3s ease;
|
||||
-moz-transition: background-color 0.3s ease, box-shadow 0.3s ease;
|
||||
-ms-transition: background-color 0.3s ease, box-shadow 0.3s ease;
|
||||
transition: background-color 0.3s ease, box-shadow 0.3s ease;
|
||||
}
|
||||
|
||||
#adminTabs li:hover {
|
||||
box-shadow: 1px 1px 5px 1px #333, inset 0 0 0 99999px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
#aContainer {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#adminSide {
|
||||
width: 12%;
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.sectionTop {
|
||||
font-size: 130%;
|
||||
margin: 0;
|
||||
padding: 6% 6% 6% 9%;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
box-shadow: -5px -1px 7px 3px #555;
|
||||
}
|
||||
|
||||
.sectionTop p {
|
||||
margin-left: 10%;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.aFilter, .aFunction {
|
||||
font-size: 100%;
|
||||
margin: 0;
|
||||
padding: 7% 10% 7% 5%;
|
||||
|
||||
text-align: right;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: box-shadow 0.3s ease;
|
||||
-moz-transition: box-shadow 0.3s ease;
|
||||
-ms-transition: box-shadow 035s ease;
|
||||
transition: box-shadow 0.3s ease;
|
||||
}
|
||||
|
||||
.aFilter:hover, .aFunction:hover {
|
||||
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.08);
|
||||
}
|
||||
|
||||
.aFunction {
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
.aFunction i {
|
||||
width: 40%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
-webkit-filter: none;
|
||||
filter: none;
|
||||
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.aFunction p {
|
||||
width: 50%;
|
||||
margin: 0;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#adminContent {
|
||||
width: 88%;
|
||||
height: 68%;
|
||||
float: right;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.classItem {
|
||||
width: 30%;
|
||||
margin: 2% 0 2% 2%;
|
||||
padding: 3%;
|
||||
|
||||
box-shadow: 2px 2px 5px 3px #666;
|
||||
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.classItem h2 {
|
||||
-webkit-filter: none;
|
||||
filter: none;
|
||||
}
|
||||
|
||||
.basicInfo, .userInfo {
|
||||
width: 90%;
|
||||
padding: 2% 0 5% 10%;
|
||||
display: table;
|
||||
}
|
||||
|
||||
.keyContainer {
|
||||
width: 100%;
|
||||
margin: 5% 0 0 0;
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
.keyContainer .fa-plus, .keyContainer .fa-times {
|
||||
-webkit-filter: none;
|
||||
filter: none;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: color 0.5s ease;
|
||||
-moz-transition: color 0.5s ease;
|
||||
-ms-transition: color 0.5s ease;
|
||||
transition: color 0.5s ease;
|
||||
}
|
||||
|
||||
.keyContainer .fa-plus:hover {
|
||||
color: #519C39;
|
||||
}
|
||||
|
||||
.keyContainer .fa-times {
|
||||
margin-left: 5%;
|
||||
}
|
||||
|
||||
.keyContainer .fa-times:hover {
|
||||
color: #CC4444;
|
||||
}
|
||||
|
||||
.key {
|
||||
font-weight: 400;
|
||||
font-size: 120%;
|
||||
width: 30%;
|
||||
padding-top: 2%;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.modify {
|
||||
width: 50%;
|
||||
padding: 0;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.fa-files-o, .fa-pencil-square-o {
|
||||
width: 10%;
|
||||
display: table-cell;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: color 0.5s ease;
|
||||
-moz-transition: color 0.5s ease;
|
||||
-ms-transition: color 0.5s ease;
|
||||
transition: color 0.5s ease;
|
||||
}
|
||||
|
||||
.fa-files-o:hover {
|
||||
color: #E6E619;
|
||||
}
|
||||
|
||||
.fa-pencil-square-o:hover {
|
||||
color: #E6B319;
|
||||
}
|
||||
|
||||
.aUserContainer {
|
||||
margin-left: -50%;
|
||||
}
|
||||
|
||||
#editValue {
|
||||
width: 10%;
|
||||
margin: auto;
|
||||
margin-top: 22%;
|
||||
padding: 1.2%;
|
||||
background-color: #FEFEFE;
|
||||
}
|
||||
|
||||
#editValue p {
|
||||
margin: 0;
|
||||
padding: 3%;
|
||||
}
|
||||
|
||||
#editValue div {
|
||||
width: 100%;
|
||||
margin: auto;
|
||||
margin-top: 8%;
|
||||
display: table;
|
||||
}
|
||||
|
||||
#editValue i {
|
||||
font-size: 5vh;
|
||||
width: 40%;
|
||||
margin: auto;
|
||||
display: table-cell;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#valueArea {
|
||||
width: 92.5%;
|
||||
}
|
||||
@ -1,163 +0,0 @@
|
||||
<template name="admin">
|
||||
|
||||
<div id="mainpage{{userProfile}}" onclick="window.location='/'"><h2>Main Page</h2></div>
|
||||
<div id="{{userProfile}}adminBanner" style="{{banner}}{{textColor}}">
|
||||
<ul id="adminTabs">
|
||||
<li id="aClasses" style="background-color:{{adminTabColor 'aClasses'}};margin-left:0">Classes</li>
|
||||
<li id="aUsers" style="background-color:{{adminTabColor 'aUsers'}}">Users</li>
|
||||
<li id="aWork" style="background-color:{{adminTabColor 'aWork'}}">Work</li>
|
||||
<li id="aSchools" style="background-color:{{adminTabColor 'aSchools'}}">Schools</li>
|
||||
<li id="aReports" style="background-color:{{adminTabColor 'aReports'}}">Reports</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="aContainer">
|
||||
<div id="adminSide" style="background-color:{{divColor 'sidebar'}}">
|
||||
<div id="adminFilters">
|
||||
<div class="sectionTop">
|
||||
<i class="fa fa-server" aria-hidden="true"></i>
|
||||
<p>Filters</p>
|
||||
</div>
|
||||
{{#each filters}}
|
||||
<p class="aFilter">{{filter}}</p>
|
||||
{{/each}}
|
||||
</div>
|
||||
<div id="adminFunctions">
|
||||
<div class="sectionTop">
|
||||
<i class="fa fa-sliders" aria-hidden="true"></i>
|
||||
<p>Functions</p>
|
||||
</div>
|
||||
<div class="aFunction">
|
||||
<p>Add Item</p>
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="aFunction">
|
||||
<p>Search</p>
|
||||
<i class="fa fa-search" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="adminContent" style="background-color:{{divColor 'header'}}">
|
||||
{{#if adminTab 'aClasses'}}
|
||||
{{#each collection 'classes'}}
|
||||
<div class="classItem" style="background-color:{{divColor 'classes'}}">
|
||||
<h2>Basic Info</h2>
|
||||
<div class="basicInfo">
|
||||
<div class="keyContainer">
|
||||
<span class="key">Name: </span>
|
||||
<span class="modify name">{{name}}</span>
|
||||
<i class="fa fa-files-o" aria-hidden="true"></i>
|
||||
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="keyContainer">
|
||||
<span class="key">Hour: </span>
|
||||
<span class="modify hour">{{hour}}</span>
|
||||
<i class="fa fa-files-o" aria-hidden="true"></i>
|
||||
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="keyContainer">
|
||||
<span class="key">Teacher: </span>
|
||||
<span class="modify teacher">{{teacher}}</span>
|
||||
<i class="fa fa-files-o" aria-hidden="true"></i>
|
||||
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="keyContainer">
|
||||
<span class="key">School: </span>
|
||||
<span class="modify school">{{school}}</span>
|
||||
<i class="fa fa-files-o" aria-hidden="true"></i>
|
||||
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="keyContainer">
|
||||
<span class="key">Category: </span>
|
||||
<span class="modify category">{{category}}</span>
|
||||
<i class="fa fa-files-o" aria-hidden="true"></i>
|
||||
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="keyContainer">
|
||||
<span class="key">Privacy: </span>
|
||||
<span class="modify privacy">{{privacy}}</span>
|
||||
<i class="fa fa-files-o" aria-hidden="true"></i>
|
||||
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="keyContainer">
|
||||
<span class="key">Code: </span>
|
||||
<span class="modify code">{{code}}</span>
|
||||
<i class="fa fa-files-o" aria-hidden="true"></i>
|
||||
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
<h2>User Info</h2>
|
||||
<div class="userInfo">
|
||||
<div class="keyContainer">
|
||||
<span class="key">Creator: </span>
|
||||
<span class="modify admin">{{admin}}</span>
|
||||
<i class="fa fa-files-o" aria-hidden="true"></i>
|
||||
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="keyContainer">
|
||||
<span class="key">Subscribers: </span>
|
||||
<i class="fa fa-plus" aria-hidden="true"></i><br>
|
||||
<div class="aUserContainer">
|
||||
{{#each subscribers}}
|
||||
{{> adminUserBox}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="keyContainer">
|
||||
<span class="key">Moderators: </span>
|
||||
<i class="fa fa-plus" aria-hidden="true"></i><br>
|
||||
<div class="aUserContainer">
|
||||
{{#each moderators}}
|
||||
{{> adminUserBox}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="keyContainer">
|
||||
<span class="key">Banned: </span>
|
||||
<i class="fa fa-plus" aria-hidden="true"></i><br>
|
||||
<div class="aUserContainer">
|
||||
{{#each banned}}
|
||||
{{> adminUserBox}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{#if adminTab 'aUsers'}}
|
||||
{{#each collection 'users'}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{#if adminTab 'aWork'}}
|
||||
{{#each collection 'work'}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{#if adminTab 'aSchools'}}
|
||||
{{#each collection 'schools'}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{#if adminTab 'aReports'}}
|
||||
{{#each collection 'requests'}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="overlay">
|
||||
<div id="editValue" style="background-color:{{divColor 'header'}} ">
|
||||
<p>New Value</p>
|
||||
<input id="valueArea">
|
||||
<div>
|
||||
<i class="fa fa-check-circle-o" aria-hidden="true"></i>
|
||||
<i class="fa fa-times-circle-o" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input id="copyArea">
|
||||
</template>
|
||||
|
||||
<template name="adminUserBox">
|
||||
<span>{{email}}</span>
|
||||
{{#if none}}
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
{{/if}}
|
||||
</template>
|
||||
@ -1,91 +0,0 @@
|
||||
/* jshint esversion: 6 */
|
||||
Session.set("adminTab","aClasses");
|
||||
|
||||
Template.admin.helpers({
|
||||
banner() {
|
||||
return "background-image:url(" + Session.get("user").banner + ")";
|
||||
},
|
||||
filters() {
|
||||
return [{filter:"Lol"}];
|
||||
},
|
||||
adminTab(val) {
|
||||
return Session.equals("adminTab",val);
|
||||
},
|
||||
adminTabColor(val) {
|
||||
var value = {true:"header",false:"adminButtons"};
|
||||
return themeColors[Session.get("user").preferences.theme][value[Session.equals("adminTab",val)]];
|
||||
},
|
||||
collection(val) {
|
||||
switch(val) {
|
||||
case "classes":
|
||||
var userClasses = classes.find().fetch();
|
||||
for(var i = 0; i < userClasses.length; i++) {
|
||||
userClasses[i].privacy = userClasses[i].privacy.toString();
|
||||
|
||||
if(userClasses[i].code === "") {
|
||||
userClasses[i].code = "None";
|
||||
}
|
||||
userClasses[i].category = userClasses[i].category;
|
||||
userClasses[i].admin = getEmail(userClasses[i].admin);
|
||||
var types = ["subscribers","moderators","banned"];
|
||||
for(var j = 0; j < types.length; j++) {
|
||||
|
||||
if(userClasses[i][types[j]].length === 0) {
|
||||
userClasses[i][types[j]][k] = {"email":"None","none":false};
|
||||
continue;
|
||||
}
|
||||
|
||||
for(var k = 0; k < userClasses[i][types[j]].length; k++) {
|
||||
userClasses[i][types[j]][k] = {
|
||||
"email": getEmail(userClasses[i][types[j]][k]),
|
||||
"none":true
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
return userClasses;
|
||||
case "users":
|
||||
break;
|
||||
case "work":
|
||||
break;
|
||||
case "schools":
|
||||
break;
|
||||
case "requests":
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Template.admin.events({
|
||||
'click #adminTabs li' (event) {
|
||||
Session.set("adminTab",event.target.id);
|
||||
},
|
||||
'click .fa-files-o' (event) {
|
||||
document.getElementById("copyArea").value = event.target.parentNode.childNodes[3].childNodes[0].nodeValue;
|
||||
document.getElementById("copyArea").select();
|
||||
document.execCommand("copy");
|
||||
},
|
||||
'click .fa-pencil-square-o' (event) {
|
||||
var value = event.target.parentNode.childNodes[3].className.replace("modify ","");
|
||||
openDivFade(document.getElementsByClassName("overlay")[0]);
|
||||
}
|
||||
});
|
||||
|
||||
function openDivFade(div) {
|
||||
div.style.display = "block";
|
||||
div.style.opacity = "0";
|
||||
setTimeout(function() {
|
||||
div.style.opacity = "1";
|
||||
}, 100);
|
||||
}
|
||||
|
||||
function closeDivFade(div) {
|
||||
div.style.opacity = "0";
|
||||
setTimeout(function() {
|
||||
div.style.display = "none";
|
||||
}, 100);
|
||||
}
|
||||
|
||||
function getEmail(id) {
|
||||
return Meteor.users.findOne({_id:id}).services.google.email;
|
||||
}
|
||||
@ -58,25 +58,6 @@ Router.route('/user/:email', {
|
||||
}
|
||||
});
|
||||
|
||||
// Router.route('/admin', {
|
||||
// waitOn: function() {
|
||||
// return [
|
||||
// Meteor.subscribe('classes', this.params._id),
|
||||
// Meteor.subscribe('schools', this.params._id),
|
||||
// Meteor.subscribe('work', this.params._id),
|
||||
// Meteor.subscribe('requests', this.params._id),
|
||||
// Meteor.subscribe('users', this.params._id)
|
||||
// ];
|
||||
// },
|
||||
// action: function() {
|
||||
// if (!Roles.userIsInRole(Meteor.userId(), ['admin', 'superadmin'])) {
|
||||
// this.render("NotFound");
|
||||
// } else {
|
||||
// this.render("admin");
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
Router.configure({
|
||||
notFoundTemplate: "NotFound"
|
||||
});
|
||||
|
||||
@ -6,6 +6,9 @@ import {
|
||||
Mongo
|
||||
} from 'meteor/mongo';
|
||||
|
||||
Houston.add_collection(Meteor.users);
|
||||
Houston.add_collection(Houston._admins);
|
||||
|
||||
// Defines who the admins are - not added
|
||||
var superadmins = [
|
||||
"ybq987@gmail.com",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user