mentors

mentors Commit Details


Date:2014-06-27 00:33:04 (10 years 6 months ago)
Author:Right Or Wrong
Branch:develop
Commit:e3ed3bda55370328af081b8bd808452b8dcbbfcd
Parents: ab86cfc30c5751ce47a86228c9c475f15254796d
Message:finished some routing stuff and passing parameters around

Changes:

File differences

app/controllers/UserController.php
3232
3333
3434
35
36
3735
3836
3937
4038
41
42
39
40
4341
4442
45
43
4644
4745
4846
4947
5048
5149
52
53
50
51
5452
55
53
5654
57
55
5856
5957
60
61
62
63
64
65
58
6659
67
6860
69
70
61
62
7163
72
73
74
75
76
77
78
79
80
64
8165
66
8267
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
10568
10669
107
108
109
110
111
112
113
114
115
116
117
11870
'email' => Input::get('email'),
'password' => Hash::make(\Input::get('password'))));
if($user->save())
{
$user_id = $user->id;
return Redirect::to('users/group')->with('success', 'You have successfully registered')
->with('id', $user_id);
return Redirect::route('group', array('user_id' => $user_id));
}else
{
return \Redirect::to('users/create')->with('errors', 'Something terrible happened');
return \Redirect::to('create')->with('errors', 'Something terrible happened');
}
}
}
/**
* Display the mentor or mentee choice view
* @return Response
* Display the two buttons for choosing between mentor and mentee
* @return View response
*/
public function chooseGroup()
public function chooseGroup($user_id)
{
return View::make('users.group');
return View::make('users.group')->with('user_id', $user_id);
}
/**
* Handles POST to complete user profile
* @param int $id user id
* @return Response
*/
public function completeProfile($id)
public function completeRegistration()
{
$user = User::find($id);
return View::make('users.complete', array('user' => $user));
}
$user_id = \Request::segment(3);
$group_id = \Request::segment(4);
/**
* Handles POST request to update user profile
* @param $id of the user being updated
* @return Response
*/
public function saveProfile($id)
{
$user = User::find($id);
}
$user = User::find($user_id);
return View::make('users.profile')->with('user', $user)->with('group_id', $group_id);
/**
* Display the view of a single user
* @param $id user id to be displayed
* @return Response
*/
public function viewProfile($id)
{
$user = User::find($id);
return View::make('users.profile', array('user' => $user));
}
/**
* Display view to edit a given user
* @param $id of the user being updated
* @return Response
*/
public function edit($id)
{
$user = User::find($id);
return View::make('users.edit', array('user' => $user));
}
/**
* Handle POST request to delete a user
* @param $id of the user to destroy
* @return Response
*/
public function destroy($id)
{
$user = User::destroy($id);
}
}
app/routes.php
2424
2525
2626
27
28
29
30
31
32
33
34
35
27
28
3629
3730
3831
......
4134
4235
4336
44
45
46
47
48
49
50
51
*/
Route::get('users/create', array('as' => 'create', 'uses' => 'UserController@create'));
Route::post('users/store', array('uses' => 'UserController@store'));
Route::put('users/{id}/update', array('before' => 'auth', 'as' => 'update', 'uses' => 'UserController@update'));
Route::get('users/{id}/edit', array('before' => 'auth','uses' => 'UserController@edit'));
Route::delete('users/{id}/delete', array('before' => 'auth','uses' => 'UserController@destroy'));
Route::get('users/group', array('uses' => 'UserController@chooseGroup'));
Route::get('users/{id}', array('uses' => 'UserController@viewProfile'));
Route::post('users/{id}', array('uses' => 'UserController@updateProfile'));
Route::get('users/group/{user_id}', array('as' => 'group', 'uses' => 'UserController@chooseGroup'));
Route::get('users/group/{user_id}/{group_id}', array('as' => 'complete', 'uses' => 'UserController@completeRegistration'));
/**
* User Password Reminder Controller routes
Route::post('password/remind', array('uses' => 'RemindersController@postRemind'));
Route::get('password/reset/{token}', array('uses' => 'RemindersController@getReset'));
Route::post('password/reset/{token}', array('uses' => 'RemindersController@postReset'));
// App::missing(function($exception)
// {
// return View::make('home');
// });
app/views/users/group.blade.php
4949
5050
5151
52
53
54
5255
5356
5457
5558
5659
57
60
5861
5962
6063
6164
6265
6366
64
67
6568
6669
6770
</div>
<hr />
<!-- Need to point these two buttons to their respective destinations -->
<div class="container">
<div class="row">
<div class="col-lg-6">
<div class="page-header"><h1>mentor - <small>someone who teaches or gives help and advice to a less experienced and often younger person.(a friend of Odysseus entrusted with the education of Odysseus' son Telemachus)</small></h1></div>
<p id="button-row">
{{ HTML::linkRoute('users/create', 'Become a Mentor', array('class' => 'btn btn-large btn-primary proxima-bold')) }}
{{ HTML::linkRoute('complete', 'Become a Mentor', array('user_id' => $user_id, 'group' => 1), array('class' => 'btn btn-large btn-primary proxima-bold')) }}
</p>
</div>
<div class="col-lg-6">
<div class="page-header"><h1>mentee - <small>a less experienced person (protege) who is offered special guidance and support by a respected and trusted person with more experience (a mentor)</small></h1></div>
<p id="button-row">
{{ HTML::link('users/create', 'Become a Mentee', array('class' => 'btn btn-large btn-primary proxima-bold')) }}
{{ HTML::linkRoute('complete', 'Become a Mentee',array('user_id' => $user_id, 'group' => 2), array('class' => 'btn btn-large btn-primary proxima-bold')) }}
</p>
</div>
</div>
app/views/users/profile.blade.php
22
33
44
5
5
66
77
88
......
3030
3131
3232
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
3386
3487
3588
3689
3790
38
91
3992
4093
4194
4295
43
96
4497
4598
4699
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Laravel PHP Framework</title>
<title>Mentconnect Inc</title>
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
{{HTML::style('css/mentconnect.css')}}
</head>
</div>
</header>
<div id="signup-content">
{{ Form::open(array('url' => 'users/store', 'class' => 'form-horizontal')) }}
<div class="container padded">
<div class="container">
<legend><h2>Complete Your Registration</h2></legend>
</div>
<div class="row">
<div class="col-lg-3 col-lg-offset-1">
<h3>Be part of the change!</h3>
<p>Learn from experts who care to share. When you are ready, be free to give back by sharing your skills with others.</p>
</div>
<div class="col-lg-8">
<div class="form-group">
<label for="first">First Name</label>
{{Form::text('first', $user->first, array('class' => 'form-control form-control-bordered', 'tabindex' => '1'))}} <span class="pull-right">{{$errors->first('first')}}</span>
</div>
<div class="form-group">
<label for="last">Last Name</label>
{{ Form::text('last', $user->last, array('class' => 'form-control form-control-bordered', 'tabindex' => '2')) }} <span class="pull-right"> {{$errors->first('last')}}</span>
</div>
<div class="form-group">
<label for="email">Email</label>
{{ Form::email('email', $user->email, array('class' => 'form-control form-control-bordered',
'tabindex' => '3')) }}<span class="pull-right"> {{$errors->first('email') }}</span>
</div>
<div class="row" id="signup-bottom-row">
<div class="col-lg-3">
{{Form::submit('Complete My Profile!', array('class' => 'btn btn-success btn-large submit-button'))}}
<br /><br />
</div>
<div class="col-lg-5">
By clicking "Sign Me Up" you agree to our
{{HTML::link('tos', 'Terms of Service') }} and {{HTML::link('privacy', 'Privacy Policy.')}}
</div>
</div>
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="container padded"></div>
<div class="container"></div>
<div id="sub-footer">
<div class="container">
<div class="row">
<div class="col-lg-4">
<p id="copyright-section">
Copyright &copy; 2014. All Rights Reserved.
Copyright &copy; 2014. Mentconnect Inc. All Rights Reserved.
</p>
</div>
<div class="col-lg-4">
{{HTML::image('images/mentconnect.png', "logo", array('width' => '140px', 'height' => '50px'))}}
</div>
<div class="col-lg-4">

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.10456s using 13 queries.