mentors

mentors Commit Details


Date:2014-07-06 21:51:46 (10 years 5 months ago)
Author:Right Or Wrong
Branch:develop
Commit:f09c49d4c5fbe811f54f0e5c81d4a7a88752a24c
Parents: 25fa07de112218bde6dfc3a9d8e7405964d89122
Message:completed project editing and updating by users

Changes:

File differences

app/controllers/ProjectsController.php
108108
109109
110110
111
111
112
113
114
115
112116
113
117
114118
115
119
116120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
117141
118142
119143
......
125149
126150
127151
128
152
153
154
155
156
129157
130158
131159
{
$project = Project::find($id);
$data = \Input::all();
$rules = array(
'title' => 'required|min:5',
'link' => 'required|url',
'language' => 'required'
);
$project->title = \Input::get('title');
$data = Input::all();
$project->save();
$validator = Validator::make($data, $rules);
if($validator->fails())
{
return Redirect::to('projects/' . $id . '/edit')
->withErrors($validator)
->withInput(Input::all());
}else
{
$project->title = Input::get('title');
$project->link = Input::get('link');
$project->language = Input::get('language');
if($project->save())
{
Session::flash('message', 'You have successfully updated '. $project->title);
return Redirect::to('projects');
}else{
return Redirect::back();
}
}
}
*/
public function destroy($id)
{
Project::delete($id);
$project = Project::find($id);
$project->delete();
Session::flash('message', 'Successfully deleted the project!');
return Redirect::to('projects');
}
app/controllers/UserController.php
212212
213213
214214
215
215
216216
217217
218218
public function edit($id)
{
if( Auth::check() && Auth::user()->id != $id)
if( Auth::check() && Auth::id() != $id)
{
return Redirect::to('/');
}else
app/views/projects/add.blade.php
6464
6565
6666
67
67
6868
6969
7070
</div>
<div class="row" id="signup-bottom-row">
{{Form::submit('Submit', array('class' => 'btn btn-success btn-large submit-button'))}}
{{Form::submit('Add Project', array('class' => 'btn btn-success btn-large submit-button'))}}
</div>
</div>
</div>
app/views/projects/edit.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mentconnect - Login</title>
{{HTML::style('css/mentconnect.css')}}
{{HTML::style('css/denied.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('projects', 'Projects') }}
</li>
<li class>
{{HTML::link('projects/create', 'Add Projects') }}
</li>
<li class="button">
{{HTML::link('logout', 'Logout') }}
</li>
</ul>
</div>
</div>
</header>
<div id="signup-content">
{{ Form::model($project, array('route' => array('projects.update', $project->id), 'method' => 'PUT', 'class' => 'form-horizontal')) }}
<div class="container padded">
<div class="container">
<legend><h2>Editing - {{ $project->title }} </h2></legend>
</div>
<div class="row">
<div class="col-lg-2">
</div>
<div class="col-lg-8">
<div class="form-group">
<label for="first">Project Name</label>
{{Form::text('title', $project->title, array('class' => 'form-control form-control-bordered', 'tabindex' => '1'))}} <span class="pull-right">{{$errors->first('title')}}</span>
</div>
<div class="form-group">
<label for="last">Project Url</label>
{{ Form::text('link', $project->link, array('class' => 'form-control form-control-bordered', 'tabindex' => '2')) }} <span class="pull-right"> {{$errors->first('link')}}</span>
</div>
<div class="form-group">
<label for="language">Project Language</label>
{{ Form::text('language', $project->language, array('class' => 'form-control form-control-bordered',
'tabindex' => '3')) }}<span class="pull-right"> {{$errors->first('language') }}</span>
</div>
<div class="row" id="signup-bottom-row">
{{Form::submit('Update Project', array('class' => 'btn btn-success btn-large submit-button'))}}
{{HTML::link('projects', 'Cancel Editing', array('class' => 'btn btn-success btn-large pull-right'))}}
</div>
</div>
</div>
<div class="col-lg-2">
</div>
</div>
{{ Form::close() }}
</div>
<div id="footer">
<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>
</div>
</body>
</html>
app/views/projects/home.blade.php
4343
4444
4545
46
46
47
48
49
4750
4851
4952
<p class="center-feature-sub-content">
Explore these community recommended projects and start learning today!
</p>
@if(Session::has('message'))
<p class="alert-success">{{ Session::get('message') }}</p>
@endif
<hr />
</div>
<div class="row">

Archive Download the corresponding diff file

Branches

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