mentors

mentors Commit Details


Date:2014-07-05 22:56:59 (10 years 5 months ago)
Author:Right Or Wrong
Branch:develop
Commit:3aeac66099ac2083a52ce1daf1ba8d392a288b26
Parents: ff0836b050f070ef0a047e83b1acbd3ad5e5ca14
Message:added some functionality to the controller

Changes:

File differences

app/controllers/ProjectsController.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
class ProjectsController extends \BaseController {
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return View::make('projects.home');
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
return View::make('projects.add');
}
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
$data = \Input::all();
$project = new Project;
$savedProject = $project->save();
}
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
$project = Project::find($id);
return View::make('projects.project')->with('project', $project);
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$project = Project::find($id);
return View::make('projects.edit')->with('project', $project);
}
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
$project = Project::find($id);
$data = \Input::all();
$project->title = \Input::get('title');
$project->save();
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Project::delete($id);
}
}
app/models/Project.php
1
2
3
4
5
6
7
8
9
<?php
/**
* This class manages projects for use by the mentors and mentees
*/
class Project extends Eloquent
{
protected $table = 'projects';
}
app/routes.php
3737
3838
3939
40
41
42
43
44
45
4046
4147
4248
Route::get('users', array('as' => 'users', 'uses' => 'UserController@index'));
Route::get('mentors', array('as' => 'mentors', 'uses' => 'UserController@mentors'));
Route::get('mentees', array('as' => 'mentees', 'uses' => 'UserController@mentees'));
});
Route::group(array('before' => 'auth'), function()
{
Route::resource('projects', 'ProjectsController');
});
/**
app/views/projects/home.blade.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mentconnect - Login</title>
{{HTML::style('css/mentconnect.css')}}
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css">
</head>
<body>
<header id="cta" class="background-showcase">
<div id="nv" class="navbar">
<div class="container">
<a class="navbar-brand" href="/">
<div class="asset logo-white-header">
{{ HTML::image("images/mentconnect.png", "editor", array("width" => "130px", "height" => "44px")) }}
</div>
</a>
<ul class=" nav navbar-nav pull-right">
<li class>
{{HTML::link('partners', 'Partners') }}
</li>
<li class>
{{HTML::link('blog', 'Blog') }}
</li>
<li class="button">
{{HTML::link('login', 'Sign In') }}
</li>
</ul>
</div>
</div>
</header>
<div class="container">
<div id="login-cta-content">
</div>
</div>
<div class="container padded">
<div class="col-lg-4"></div>
<div class="col-lg-4">
{{ Form::open(array('url' => 'login', 'class' => 'form-horizontal'))}}
<fieldset>
<legend><h2>Please Sign In</h2></legend>
@if(Session::has('message'))
<p class="alert-success">{{ Session::get('message') }}</p>
@endif
<div class="control-group">
{{ Form::label('email', 'Email', array('class' => 'control-label')) }}
<div class="controls">
{{ Form::text('email', \Input::old('email'), array('class' => 'form-control borderd input-large', 'span' => 'span6', 'placeholder' => 'awesome@awesome.com'))}} <p class="alert-error pull-right">{{ $errors->first('email') }}</p>
</div>
</div>
<div class="control-group">
{{ Form::label('password', 'Password', array('class' => 'control-label'))}}
<div class="controls">
{{ Form::password('password', array('class' => 'form-control bordered input-large', 'placeholder' => 'Password', 'span' => 'span6'))}} <p class="alert-error pull-right">{{ $errors->first('password') }}</p>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox-inline">
{{ Form::checkbox('remember', 'yes') }} Remember me
</label>
</div>
</div>
<br />
<div class="form-group">
<button class="btn btn-primary btn-large pull-left" type="submit"><span class="login-button-icon"></span>Sign in</button> &nbsp; &nbsp; &nbsp;
{{HTML::link('password/remind', 'Forgot your password?')}}
</div>
<hr/>
<div class="form-group bottom-group">
Don't have a Mentconnect account? {{HTML::link('users/create', 'Register now')}}
</div>
</fieldset>
{{Form::close()}}
</div>
<div class="col-lg-4"></div>
</div>
<div class="container padded"></div>
<br /><br /><br />
<div id="sub-footer">
<div class="container">
<div class="row">
<div class="col-lg-4">
<p id="copyright-section">
Copyright &copy; 2014. Mentconnect Inc. All Rights Reserved.
</p>
</div>
<div class="col-lg-4">
</div>
<div class="col-lg-4">
<p id="love">
Built With Laravel + Bootstrap Frameworks by Elisha Chirchir.
</p>
</div>
</div>
</div>
</div>
</body>
</html>

Archive Download the corresponding diff file

Branches

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