This repository has been archived by the owner on Aug 12, 2018. It is now read-only.
forked from 401ChemistryGenealogy/ChemistryGenealogy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
1,095 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,10 @@ | |
{ | ||
password: 'admin', email: '[email protected]', password_digest: 'pword', | ||
first_name: 'todd', last_name: 'lowary', approved: true | ||
}, | ||
{ | ||
password: 'user', email: '[email protected]', password_digest: 'pword', | ||
first_name: 'josh', last_name: 'cameron', approved: true | ||
} | ||
]) | ||
|
||
|
@@ -38,7 +42,7 @@ | |
{name: 'james baddiley', position: nil, institution_id: nil, approved: true}, | ||
{name: 'jun liu', position: nil, institution_id: nil, approved: true}, | ||
{name: 'clinton ballou', position: nil, institution_id: nil, approved: true}, | ||
{name: 'harold jennings', position: nil, institution_id: nil, approved: true} | ||
{name: 'harold jennings', position: nil, institution_id: nil, approved: true} #id=10 | ||
]) | ||
|
||
Degree.create!([ | ||
|
@@ -63,3 +67,49 @@ | |
{person_id: 4, mentor_id: 10, start: 1971, end: 1973, institution_id: 7, approved: true}, | ||
{person_id: 4, mentor_id: 6, start: 1973, end: 1975, institution_id: 1, approved: true} | ||
]) | ||
|
||
# delete this next data when in production | ||
# this is to test notifications while in development enviroment | ||
Person.create!([ | ||
{name: 'Steven Myers', position: 'professor', institution_id: 1, approved: false}, | ||
{name: 'steve supervised', position: 'prof', institution_id: 1, approved: true}, | ||
{name: "steve's mentor", position: 'professor', institution_id: 1, approved: true}, | ||
{name: "steve's mentored", position: 'professor', institution_id: 1, approved: true}, | ||
{name: "x mentor", position: "professor", institution_id: 1, approved: true}, #id=15 | ||
{name: "mentored by x", position: "professor", institution_id: 1, approved: true}, | ||
{name: "y supervisor", position: "professor", institution_id:3, approved: true}, | ||
{name: "supervised by y", position: "professor", institution_id: 2, approved: true} | ||
]) | ||
|
||
Degree.create!([ | ||
{year: 2024, institution_id: 1, degree_type: 'phd', approved: false}, | ||
{year: 2030, institution_id: 1, degree_type: 'phd', approved: false}, | ||
{year: 2050, institution_id: 4, degree_type: 'masters', approved: false} | ||
]) | ||
|
||
Supervision.create!([ | ||
{approved: false, degree_id: 5, person_id: 11, supervisor_id: 1}, | ||
{approved: false, degree_id: 6, person_id: 12, supervisor_id: 11}, | ||
{approved: false, degree_id: 7, person_id: 18, supervisor_id: 17} | ||
]) | ||
|
||
Mentorship.create!([ | ||
{person_id: 11, mentor_id: 13, start: 2026, end: 2027, institution_id: 1, approved: false}, | ||
{person_id: 14, mentor_id: 11, start: 2031, end: 2032, institution_id: 1, approved: false}, | ||
{person_id: 16, mentor_id: 15, start:1999, end:2001, institution_id: 2, approved: false} | ||
]) | ||
|
||
User.create!([ | ||
{ | ||
password: 'xxx', email: '[email protected]', password_digest: 'pword', | ||
first_name: 'james', last_name: 'brown', approved: false | ||
}, | ||
{ | ||
password: 'xxx', email: '[email protected]', password_digest: 'pword', | ||
first_name: 'tupac', last_name: 'shakur', approved: true | ||
} | ||
]) | ||
|
||
Admin.create!([ | ||
{user_id: 5, approved: false} | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,210 +1,16 @@ | ||
/** | ||
* Controller for the Submission page. | ||
* | ||
* Status: CONTROLLER | ||
* Associated files: submit.html | ||
* | ||
* The submission page is going to be the core of where the users will be able to supply information to begin a new | ||
* page for a given particular user. This page is going to be essentially a massive collection of information that | ||
* we will be inserting into the system. | ||
* | ||
* Things that we're collecting include basic information like: | ||
* -first name | ||
* -last name | ||
* -degree type | ||
* -postdoc postings | ||
* -etc | ||
* | ||
*/ | ||
|
||
|
||
angular.module('chemGeno') | ||
|
||
//Stating that this is a controller for this project. | ||
.controller('adminPanelController', ['$scope', 'adminPanelService', '$mdDialog', '$mdMedia', '$location', | ||
function($scope, adminPanelService, $mdDialog, $mdMedia, $location) { | ||
|
||
$scope.mockChangesObject = { | ||
//List of all of the changes made in the application. | ||
changesList: [ | ||
{ | ||
person: 'personname 1', | ||
title: 'title 1', | ||
institution: 'instituttion 1', | ||
postdoc :[{ | ||
pdStartYear: 2078, pdSupervisor: "the cheese goddess", pdInstitution: "NeverEverLand", pdEndYear: "0007" | ||
}], | ||
|
||
degree:[{ | ||
year: "2973", supervisor: "Cheese King", institution: "University of NeverEverLand", type: "Doctorate" | ||
|
||
}] | ||
}, | ||
{ | ||
person: 'onion knight', | ||
title: 'onion knight (of course)', | ||
institution: 'onion knight... academy...?', | ||
postdoc: 'c2', | ||
degree: 'd2', | ||
degree_Supervision: 'e2' | ||
} | ||
], | ||
|
||
//List for all newly registered accounts. | ||
newUsersList: [ | ||
{ | ||
username: "Username1", | ||
password: "Password1", | ||
email: "email1" | ||
}, | ||
{ | ||
username: "Username2", | ||
password: "Password2", | ||
email: "email2" | ||
}, | ||
{ | ||
username: "Username3", | ||
password: "Password3", | ||
email: "email3" | ||
} | ||
] | ||
|
||
|
||
}; | ||
|
||
|
||
/** | ||
* Mock object for what I am sending to the backend from the admin panel page. (INFORMATION.) | ||
*/ | ||
|
||
$scope.mockReturnObject = { | ||
uniqueID: "10281921", //String? Int? Whatever you guys send me! Returning it for identification. | ||
status: "accepted" //User hit accept button, commit changes. | ||
}; | ||
|
||
$scope.mockReturnObject2 = { | ||
uniqueID: "991", //String? Int? Whatever you guys send me! Returning it for identification. | ||
status: "rejected" //User hit the reject button, discard changes. | ||
}; | ||
|
||
/** | ||
* Mock object for what I am sending to the backend from the admin panel page. (USERS.) | ||
*/ | ||
|
||
$scope.mockReturnObject3 = { | ||
uniqueID: "usr91", //unique identifier | ||
status: "accepted" //accepted the new user | ||
}; | ||
|
||
$scope.mockReturnObject4 = { | ||
uniqueID: "usr71827818291", //unique identifier | ||
status: "rejected" //rejected the new user | ||
}; | ||
|
||
|
||
|
||
$scope.goBackToMain = function(){ | ||
$location.path('search'); // path not hash | ||
|
||
}; | ||
|
||
//For information modification requests. | ||
$scope.viewInformationModRequests = false; | ||
|
||
$scope.showInformationModRequests = function(){ | ||
$scope.viewInformationModRequests = true; | ||
}; | ||
|
||
$scope.hideInformationModRequests = function(){ | ||
$scope.viewInformationModRequests = false; | ||
}; | ||
|
||
$scope.rejectInformationModRequest = function(item){ | ||
console.log("Reject Request made on item" + item); | ||
}; | ||
|
||
$scope.acceptInformationModRequest = function(item){ | ||
console.log("Accept Request made on item" + item); | ||
|
||
}; | ||
|
||
|
||
//For new user requests. | ||
$scope.viewNewUserRequests = false; | ||
|
||
$scope.showNewUserRequests = function(){ | ||
$scope.viewNewUserRequests = true; | ||
}; | ||
|
||
$scope.hideNewUserRequests = function(){ | ||
$scope.viewNewUserRequests = false; | ||
}; | ||
|
||
$scope.rejectNewUserRequest = function(user){ | ||
console.log("Reject Request made on user" + user.username); | ||
}; | ||
|
||
$scope.acceptNewUserRequest = function(user){ | ||
console.log("Accept Request made on user" + user.username); | ||
|
||
}; | ||
|
||
|
||
|
||
//Attempt at getting a dialogue working to show detailed information... | ||
$scope.status = ' '; | ||
$scope.customFullscreen = $mdMedia('xs') || $mdMedia('sm'); | ||
$scope.showAdvanced = function(ev, item) { | ||
|
||
|
||
var useFullScreen = ($mdMedia('sm') || $mdMedia('xs')) && $scope.customFullscreen; | ||
$mdDialog.show({ | ||
controller: DialogController, | ||
templateUrl: '/app/views/adminPanelDetailed.html', | ||
parent: angular.element(document.body), | ||
targetEvent: ev, | ||
clickOutsideToClose:true, | ||
fullscreen: useFullScreen | ||
}) | ||
.then(function(answer) { | ||
$scope.status = 'You said the information was "' + answer + '".'; | ||
}, function() { | ||
$scope.status = 'You cancelled the dialog.'; | ||
}); | ||
$scope.$watch(function() { | ||
return $mdMedia('xs') || $mdMedia('sm'); | ||
}, function(wantsFullScreen) { | ||
$scope.customFullscreen = (wantsFullScreen === true); | ||
}); | ||
}; | ||
|
||
|
||
|
||
|
||
|
||
function DialogController($scope, $mdDialog) { | ||
$scope.leItem = $scope.itemDetailsItem; | ||
$scope.hide = function() { | ||
$mdDialog.hide(); | ||
}; | ||
$scope.cancel = function() { | ||
$mdDialog.cancel(); | ||
}; | ||
$scope.answer = function(answer) { | ||
$mdDialog.hide(answer); | ||
}; | ||
|
||
} | ||
|
||
|
||
/** | ||
* Functions that are associated with the detailed administrator page... | ||
*/ | ||
|
||
//Mock object for right now at this point in time. | ||
|
||
|
||
|
||
|
||
|
||
}]); | ||
.controller('adminPanelController', ['$scope', 'adminPanelService', | ||
function($scope, adminPanelService) { | ||
$scope.loadData = function() { | ||
var promise = adminPanelService.loadNotifications(); | ||
promise.then(function(resp){ | ||
$scope.data = resp.data; | ||
console.log($scope.data) | ||
}, function(error){ | ||
alert('error loading notifications'); | ||
}) | ||
}; | ||
$scope.loadData(); | ||
|
||
|
||
}]); |
Oops, something went wrong.