diff --git a/hourglass/client/admin/admin.css b/hourglass/client/admin/admin.css deleted file mode 100644 index c901242..0000000 --- a/hourglass/client/admin/admin.css +++ /dev/null @@ -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%; -} diff --git a/hourglass/client/admin/admin.html b/hourglass/client/admin/admin.html deleted file mode 100644 index ab4add5..0000000 --- a/hourglass/client/admin/admin.html +++ /dev/null @@ -1,163 +0,0 @@ - - - diff --git a/hourglass/client/admin/admin.js b/hourglass/client/admin/admin.js deleted file mode 100644 index 410dfde..0000000 --- a/hourglass/client/admin/admin.js +++ /dev/null @@ -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; -} diff --git a/hourglass/lib/router.js b/hourglass/lib/router.js index 6486d30..4c6e2b2 100644 --- a/hourglass/lib/router.js +++ b/hourglass/lib/router.js @@ -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" }); diff --git a/hourglass/server/main.js b/hourglass/server/main.js index 1c3fad7..26c5b4d 100644 --- a/hourglass/server/main.js +++ b/hourglass/server/main.js @@ -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",