Skip to content

Commit

Permalink
Adds Admin page for managing students in db
Browse files Browse the repository at this point in the history
  • Loading branch information
William committed Nov 15, 2015
1 parent 58fc2b3 commit ddfd9eb
Show file tree
Hide file tree
Showing 108 changed files with 22,861 additions and 1 deletion.
134 changes: 134 additions & 0 deletions public/class-roster/admin.html
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
Binary file added public/class-roster/img/default.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions public/class-roster/index.html
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>
24 changes: 24 additions & 0 deletions public/class-roster/students.json
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" }
]
17 changes: 17 additions & 0 deletions public/class-roster/styles.css
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;
}
4 changes: 3 additions & 1 deletion public/survey/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
}
.ratings-container {
display: block;
width: 215px;
width: 350px;
margin: 0 auto;
border: 1px solid #CCCCCC;
}

Expand All @@ -34,6 +35,7 @@
.thumbs-container {
display: inline-block;
padding: 3px 5px;
margin: 0 10px;
background-color: #CCCCCC;
border-radius: 5px;
}
Expand Down
Binary file added scrape-github-profile-pics/.DS_Store
Binary file not shown.
Binary file added scrape-github-profile-pics/avatars/0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scrape-github-profile-pics/avatars/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scrape-github-profile-pics/avatars/10.jpg
Binary file added scrape-github-profile-pics/avatars/11.jpg
Binary file added scrape-github-profile-pics/avatars/12.jpg
Binary file added scrape-github-profile-pics/avatars/13.jpg
Binary file added scrape-github-profile-pics/avatars/14.jpg
Binary file added scrape-github-profile-pics/avatars/15.jpg
Binary file added scrape-github-profile-pics/avatars/16.jpg
Binary file added scrape-github-profile-pics/avatars/17.jpg
Binary file added scrape-github-profile-pics/avatars/18.jpg
Binary file added scrape-github-profile-pics/avatars/19.jpg
Binary file added scrape-github-profile-pics/avatars/2.jpg
Binary file added scrape-github-profile-pics/avatars/20.jpg
Binary file added scrape-github-profile-pics/avatars/21.jpg
Binary file added scrape-github-profile-pics/avatars/3.jpg
Binary file added scrape-github-profile-pics/avatars/4.jpg
Binary file added scrape-github-profile-pics/avatars/5.jpg
Binary file added scrape-github-profile-pics/avatars/6.jpg
Binary file added scrape-github-profile-pics/avatars/7.jpg
Binary file added scrape-github-profile-pics/avatars/8.jpg
Binary file added scrape-github-profile-pics/avatars/9.jpg
22 changes: 22 additions & 0 deletions scrape-github-profile-pics/git-usernames.txt
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
Loading

0 comments on commit ddfd9eb

Please sign in to comment.