Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Commit

Permalink
Merge pull request #12 from VandyHacks/dev-mentor
Browse files Browse the repository at this point in the history
Add mentor application
  • Loading branch information
cktang88 authored Oct 23, 2018
2 parents 3102b63 + f7b705d commit 2aaf410
Show file tree
Hide file tree
Showing 11 changed files with 254 additions and 51 deletions.
4 changes: 2 additions & 2 deletions app/client/src/services/UserService.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ angular.module('app')
return $http.get(base + 'stats');
},

admitUser: function (id) {
return $http.post(base + id + '/admit');
admitUser: function (id, acceptAsMentor) {
return $http.post(base + id + '/admit' + '?mentor=' + acceptAsMentor);
},

admitAll: function (querytext) {
Expand Down
17 changes: 12 additions & 5 deletions app/client/views/admin/stats/stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,25 +156,32 @@
</div>

<div class="ui divider"></div>

<div class="item">
<div> Volunteers </div>
</div>
<div class="item">
<div>
<strong> Volunteers (submitted): </strong> {{stats.volunteerSubmitted}}
</div>
</div>
<div class="item">
<div>
<strong> Volunteers (accepted): </strong> {{stats.volunteerAdmitted}}
<strong> Volunteers (admitted): </strong> {{stats.volunteerAdmitted}}
</div>
</div>
<div class="item">
<div>
<strong> Volunteers (confirmed): </strong> {{stats.volunteerConfirmed}}
</div>
</div>
<div class="ui divider"></div>
<div class="item">
<div>
<strong> Mentors (submitted): </strong> {{stats.mentorSubmitted}}
</div>
</div>
<div class="item">
<div>
<strong> Mentors (admitted): </strong> {{stats.mentorAdmitted}}
</div>
</div>

<div class="ui divider"></div>

Expand Down
51 changes: 39 additions & 12 deletions app/client/views/admin/users/adminUsersCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,22 @@ angular.module('app')
});
};

$scope.acceptUser = function ($event, user, index) {
$scope.acceptUser = function ($event, user, acceptAsMentor, index) {
$event.stopPropagation();

const endText = acceptAsMentor ? ' as a MENTOR. This will also admit them as a hacker.' : '!';

swal({
title: 'Whoa, wait a minute!',
text: 'You are about to accept ' + user.profile.name + '!',
text: 'You are about to accept ' + user.profile.name + endText,
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#DD6B55',
confirmButtonText: 'Yes, accept them.',
closeOnConfirm: false
}, () => {
UserService
.admitUser(user._id)
.admitUser(user._id, acceptAsMentor)
.success((user) => {
$scope.users[index] = user;
swal('Accepted', user.profile.name + ' has been admitted.', 'success');
Expand Down Expand Up @@ -169,7 +171,7 @@ angular.module('app')

function generateSections(user) {
const address = user.confirmation.address;
return [
const res = [
{
name: 'Basic Info',
fields: [
Expand Down Expand Up @@ -259,16 +261,16 @@ angular.module('app')
value: user.confirmation.lightningTalker
}
]
}, {
}
];

if (user.confirmation.needsReimbursement) {
res.push({
name: 'Travel',
fields: [
{
name: 'Needs Reimbursement',
value: user.confirmation.needsReimbursement,
type: 'boolean'
}, {
name: 'Received Reimbursement',
value: user.confirmation.needsReimbursement && user.status.reimbursementGiven
value: user.status.reimbursementGiven
}, {
name: 'Address',
value: address ? [
Expand All @@ -286,8 +288,33 @@ angular.module('app')
value: user.confirmation.notes
}
]
}
];
});
}

if (user.profile.mentor_application && user.profile.mentor_applied) {
res.push({
name: 'Mentor Application',
fields: [
{
name: 'Mentor Accepted',
value: user.profile.mentor_accepted
}, {
name: 'Mentor subjects',
value: user.profile.mentor_application.mentorSubjects.join(', ')
}, {
name: 'Teaching experience',
value: user.profile.mentor_application.essay1
}, {
name: 'Subject experience',
value: user.profile.mentor_application.essay2
}, {
name: 'Mentor shifts',
value: user.profile.mentor_application.mentorShifts.join(', ')
}
]
});
}
return res;
}

$scope.selectUser = selectUser;
Expand Down
18 changes: 15 additions & 3 deletions app/client/views/admin/users/users.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ <h3> {{section.title}} </h3>
<th>Grad</th>
<th>V/S/A/C</th>
<th>Vol.</th>
<th>Mentor</th>
<th>$</th>
<th>L.Talk</th>
<th>App</th>
Expand Down Expand Up @@ -200,6 +201,18 @@ <h3> {{section.title}} </h3>
</i>
</td>

<!-- Mentor -->
<td class="collapsing">
<button
class="accept ui circular mini basic blue icon button"
ng-if="user.profile.mentor_applied && !user.profile.mentor_accepted"
ng-disabled="!user.status.completedProfile"
ng-click="acceptUser($event, user, true, $index)">
<i class="blue plus circle icon"></i>
</button>
<i ng-if="user.profile.mentor_accepted" class="blue handshake icon"></i>
</td>

<td
class="collapsing">
<span ng-if="user.status.confirmed">
Expand Down Expand Up @@ -235,15 +248,14 @@ <h3> {{section.title}} </h3>

<td
class="right aligned collapsing">

<button
class="accept ui circular mini basic green icon button"
ng-disabled="!user.status.completedProfile || user.status.admitted"
ng-click="acceptUser($event, user, $index)">
ng-click="acceptUser($event, user, false, $index)">
<i class="add user icon"></i>
</button>

</td>

<td>{{user.email}}</td>
</tr>
</tbody>
Expand Down
58 changes: 55 additions & 3 deletions app/client/views/application/application.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,10 @@
<div class="grouped fields">
<label> Ethnicity (Choose as many as you like) </label>
<div class="field" ng-repeat="(key, value) in ethnicities">

<div class="ui checkbox">
<input type="checkbox" ng-model="ethnicities[key]" name="ethnicity" />
<label>{{key}}</label>
</div>

</div>
</div>

Expand Down Expand Up @@ -137,8 +135,12 @@
<input type="text" name="website" placeholder="https://foobar.me" ng-model="user.profile.website">
</div>

<br>
<div class="divided title" ng-if="isVandyStudent">Volunteering</div>
<br>

<div class="field" ng-if="isVandyStudent">
<label> Volunteering </label>
<label> Become a volunteer! (optional) </label>
<p>
Get a behind the scenes look at the event! Help with tasks like checkin, food, swag, and more. Vanderbilt students only.
</p>
Expand All @@ -148,6 +150,56 @@
</div>
</div>

<br>
<div class="divided title">Mentoring</div>
<br>

<div class="field">
<label> Become a mentor! (optional) </label>
<p>
Have some sweet skills and want to be available to field some technical questions from hackers? Become a mentor!
</p>
<div class="ui checkbox">
<input type="checkbox" name="mentor" ng-model="user.profile.mentor_applied">
<label for="mentor">I would like to be a mentor.</label>
</div>
</div>

<div ng-if="user.profile.mentor_applied">
<div class="field">
<label>
[REQUIRED] Briefly describe any teaching experience you have.
</label>
<textarea name="mentor_essay1" ng-model="user.profile.mentor_application.essay1">
</textarea>
</div>
<div class="grouped fields">
<label> [REQUIRED] What area(s) do you feel comfortable mentoring in? Check all that apply. </label>
<div class="field" ng-repeat="(key, value) in mentorSubjects">
<div class="ui checkbox">
<input type="checkbox" ng-model="mentorSubjects[key]" name="mentorSubjects" />
<label>{{key}}</label>
</div>
</div>
</div>
<div class="field">
<label>
[REQUIRED] Please describe your experience in the areas checked above, or in any additional areas not listed above.
</label>
<textarea name="mentor_essay2" ng-model="user.profile.mentor_application.essay2">
</textarea>
</div>
<div class="grouped fields">
<label> [REQUIRED] Which shifts are you available to mentor? </label>
<div class="field" ng-repeat="(key, value) in mentorShifts">
<div class="ui checkbox">
<input type="checkbox" ng-model="mentorShifts[key]" name="mentorShifts" />
<label>{{key}}</label>
</div>
</div>
</div>
</div>

<br>
<div class="divided title">Legal</div>
<br>
Expand Down
Loading

0 comments on commit 2aaf410

Please sign in to comment.