forked from EarthWindandJS/help-desk
-
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.
Adds Admin page for managing students in db
- Loading branch information
William
committed
Nov 15, 2015
1 parent
58fc2b3
commit ddfd9eb
Showing
108 changed files
with
22,861 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Admin - Add Students</title> | ||
</head> | ||
<body> | ||
|
||
<div id="container"> | ||
<div id="react-mountpoint"> | ||
</div> | ||
</div> | ||
|
||
<link rel="stylesheet" href="./styles.css" /> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" /> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react-dom.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser.js"></script> | ||
<script>console.log('babel loaded');</script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.2/marked.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.7/socket.io.min.js"></script> | ||
|
||
|
||
<script type="text/babel"> | ||
(function() { | ||
// global vars | ||
var imgStyle = {width: "100px", height: "100px", margin: "2px"}; | ||
var imagePath = './img'; | ||
var avatarPaths = []; | ||
for (var i=0; i<22; i++) { | ||
avatarPaths.push(imagePath + '/' + i + '.jpg'); | ||
} | ||
|
||
|
||
var AvatarGallery = React.createClass({ | ||
handleClick: function(e) { | ||
var imgsrc = e.target.getAttribute('src'); | ||
var state = {imgsrc: imgsrc}; | ||
this.props.updateParentState(state); | ||
}, | ||
render: function() { | ||
var imgs = avatarPaths.map(function(url, idx) { | ||
return ( | ||
<img id="imgsrc" | ||
src={ url } | ||
className="clickable img-rounded" | ||
style={ imgStyle } | ||
key={ idx } | ||
onClick={ this.handleClick } /> | ||
); | ||
}.bind(this)); | ||
return ( | ||
<div className="avatar-gallery" style={ {clear: "both"} }> | ||
<h3>Choose an avatar</h3> | ||
{ imgs } | ||
</div> | ||
); | ||
} | ||
}); | ||
|
||
var StudentPreview = React.createClass({ | ||
render: function() { | ||
var studentInfo = this.props.studentInfo; | ||
return ( | ||
<div className="col-md-4"> | ||
<img src={ studentInfo.imgsrc } className="img-rounded center-block" style={ imgStyle }/> | ||
<h4>{ studentInfo.firstname } { studentInfo.lastname }</h4> | ||
<p>{ studentInfo.email }</p> | ||
<p>http://github.com/{ studentInfo.gitHandle }</p> | ||
</div> | ||
); | ||
} | ||
}); | ||
|
||
var AddStudentForm = React.createClass({ | ||
handleChange: function(e) { | ||
console.log(e.target.id); | ||
var state = {}; | ||
state[e.target.id] = e.target.value; | ||
this.props.updateParentState(state); | ||
}, | ||
render: function() { | ||
return ( | ||
<div className="col-md-8"> | ||
<form method="post"> | ||
<label htmlFor="firstname">First name:</label> | ||
<input type="text" id="firstname" onChange={ this.handleChange } /> | ||
<label htmlFor="lastname">Last name:</label> | ||
<input type="text" id="lastname" onChange={ this.handleChange }/> | ||
<label htmlFor="email">Email:</label> | ||
<input type="text" id="email" onChange={ this.handleChange }/> | ||
<label htmlFor="git-handle">GitHub username:</label> | ||
<input type="text" id="gitHandle" onChange={ this.handleChange }/> | ||
</form> | ||
</div> | ||
); | ||
} | ||
}); | ||
|
||
var AddStudentContainer = React.createClass({ | ||
handleChange: function(state) { | ||
this.setState(state); | ||
}, | ||
getInitialState: function() { | ||
return { | ||
firstname: 'First', | ||
lastname: 'Last', | ||
email: '[email protected]', | ||
gitHandle: '', | ||
imgsrc: './img/default.gif' | ||
}; | ||
}, | ||
render: function() { | ||
return ( | ||
<div className="app"> | ||
<h1 className="text-center">Add New Student</h1> | ||
<AddStudentForm updateParentState={ this.handleChange }/> | ||
<StudentPreview studentInfo={ this.state }/> | ||
<AvatarGallery updateParentState={ this.handleChange } /> | ||
</div> | ||
); | ||
} | ||
}); | ||
|
||
ReactDOM.render( | ||
<AddStudentContainer />, | ||
document.getElementById('react-mountpoint') | ||
); | ||
})(); | ||
|
||
</script> | ||
</body> | ||
</html> |
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Mongo dbms</title> | ||
</head> | ||
<body> | ||
|
||
<div id="container"> | ||
<code>begin react</code> | ||
<div id="react-mountpoint"> | ||
</div> | ||
<code>end react</code> | ||
</div> | ||
|
||
<link rel="stylesheet" href="./styles.css" /> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" /> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react-dom.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser.js"></script> | ||
<script>console.log('babel loaded');</script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.2/marked.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.7/socket.io.min.js"></script> | ||
|
||
|
||
<script type="text/babel"> | ||
|
||
|
||
ReactDOM.render( | ||
<ClassRoster students={ students } />, | ||
document.getElementById('react-mountpoint') | ||
); | ||
|
||
|
||
</script> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[ | ||
{ "firstname": "Andrew", "lastname": "Howes", "gitHandle": "andrewhws", "location": "Los Angeles, CA.", "imgsrc": "./0.jpg" }, | ||
{ "firstname": "Aram", "lastname": "Simonian", "gitHandle": "aram91", "location": "Los Angeles, CA.", "imgsrc": "./1.jpg" }, | ||
{ "firstname": "Casandra", "lastname": "Silva", "gitHandle": "casandrawith1s", "location": "Los Angeles, CA.", "imgsrc": "./2.jpg" }, | ||
{ "firstname": "Chelsea", "lastname": "Cheung", "gitHandle": "chelseatcheung", "location": "Los Angeles, CA.", "imgsrc": "./3.jpg" }, | ||
{ "firstname": "Cory", "lastname": "Dang", "gitHandle": "coryd4ng", "location": "Los Angeles, CA.", "imgsrc": "./4.jpg" }, | ||
{ "firstname": "Seyi", "lastname": "Williams", "gitHandle": "git2go", "location": "Los Angeles, CA.", "imgsrc": "./5.jpg" }, | ||
{ "firstname": "Jeffrey", "lastname": "Yang", "gitHandle": "jeffycyang", "location": "Los Angeles, CA.", "imgsrc": "./6.jpg" }, | ||
{ "firstname": "Jonathan", "lastname": "Kvicky", "gitHandle": "jonkvix", "location": "Los Angeles, CA.", "imgsrc": "./7.jpg" }, | ||
{ "firstname": "Jonathan", "lastname": "Tamsut", "gitHandle": "jtamsut", "location": "Los Angeles, CA.", "imgsrc": "./8.jpg" }, | ||
{ "firstname": "Kevin", "lastname": "Cheng", "gitHandle": "k-cheng", "location": "Los Angeles, CA.", "imgsrc": "./9.jpg" }, | ||
{ "firstname": "Marc", "lastname": "Reicher", "gitHandle": "marcreicher", "location": "Los Angeles, CA.", "imgsrc": "./10.jpg" }, | ||
{ "firstname": "Marcus", "lastname": "Ellis", "gitHandle": "marcusmellis89", "location": "Los Angeles, CA.", "imgsrc": "./11.jpg" }, | ||
{ "firstname": "Mike", "lastname": "Martin", "gitHandle": "martinms-usc", "location": "Los Angeles, CA.", "imgsrc": "./12.jpg" }, | ||
{ "firstname": "Matt", "lastname": "Murkidjanian", "gitHandle": "mmurkidjanian", "location": "Los Angeles, CA.", "imgsrc": "./13.jpg" }, | ||
{ "firstname": "Nick", "lastname": "Krein", "gitHandle": "nkreinmusic", "location": "Los Angeles, CA.", "imgsrc": "./14.jpg" }, | ||
{ "firstname": "Stephanie", "lastname": "Raad", "gitHandle": "Stephyraad", "location": "Los Angeles, CA.", "imgsrc": "./15.jpg" }, | ||
{ "firstname": "Avi", "lastname": "Samloff", "gitHandle": "theavish", "location": "Los Angeles, CA.", "imgsrc": "./16.jpg" }, | ||
{ "firstname": "Timothy", "lastname": "Lai", "gitHandle": "tim-lai", "location": "Los Angeles, CA.", "imgsrc": "./17.jpg" }, | ||
{ "firstname": "Tina", "lastname": "Lai", "gitHandle": "tinalai", "location": "Los Angeles, CA.", "imgsrc": "./18.jpg" }, | ||
{ "firstname": "Vidiu", "lastname": "Chew", "gitHandle": "VDUCHEW", "location": "Los Angeles, CA.", "imgsrc": "./19.jpg" }, | ||
{ "firstname": "William", "lastname": "Carroll", "gitHandle": "wpcarro", "location": "Los Angeles, CA.", "imgsrc": "./20.jpg" }, | ||
{ "firstname": "Zachary", "lastname": "Cherries", "gitHandle": "zcherries", "location": "Los Angeles, CA.", "imgsrc": "./21.jpg" } | ||
] |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
form input { | ||
display: block; | ||
width: 100%; | ||
} | ||
|
||
.container { | ||
|
||
} | ||
|
||
.clickable { | ||
cursor: pointer; | ||
} | ||
|
||
.app { | ||
width: 700px; | ||
margin: 0 auto; | ||
} |
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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
andrewhws | ||
aram91 | ||
casandrawith1s | ||
chelseatcheung | ||
coryd4ng | ||
git2go | ||
jeffycyang | ||
jonkvix | ||
jtamsut | ||
k-cheng | ||
marcreicher | ||
marcusmellis89 | ||
martinms-usc | ||
mmurkidjanian | ||
nkreinmusic | ||
Stephyraad | ||
theavish | ||
tim-lai | ||
tinalai | ||
VDUCHEW | ||
wpcarro | ||
zcherries |
Oops, something went wrong.