mentors

mentors Commit Details


Date:2014-07-06 23:30:24 (10 years 5 months ago)
Author:Right Or Wrong
Branch:develop
Commit:94756fbde889eb764810e99e079112a29bf83baa
Parents: f09c49d4c5fbe811f54f0e5c81d4a7a88752a24c
Message:added soft deleting for projects and tie project to user ids

Changes:

File differences

app/controllers/ProjectsController.php
1515
1616
1717
18
19
20
21
22
23
24
25
1826
1927
2028
......
3846
3947
4048
41
49
4250
4351
4452
......
5361
5462
5563
64
5665
5766
5867
......
125134
126135
127136
137
128138
129139
130140
}
public function fetchProject($url = null)
{
$session = curl_init('http://simpledeveloper.com/');
curl_setopt($session, CURLOPT_RETURNTRANSFER,true);
$json = curl_exec($session);
return $json;
}
/**
* Show the form for creating a new resource.
'title' => 'required|min:5',
'link' => 'required|url',
'language' => 'required'
);
);
$data = Input::all();
{
$project = Project::firstOrCreate(
array(
'user_id' => Auth::id(),
'title' => Input::get('title'),
'link' => Input::get('link'),
'language' => Input::get('language')
->withInput(Input::all());
}else
{
$project->user_id = Auth::id();
$project->title = Input::get('title');
$project->link = Input::get('link');
$project->language = Input::get('language');
app/database/migrations/2014_07_06_040450_alter_users_table_add_deleted_at_column.php
2525
2626
2727
28
28
29
30
31
2932
3033
3134
*/
public function down()
{
//do nothing here
Schema::table('users', function(Blueprint $table)
{
$table->dropColumn('deleted_at');
});
}
}
app/database/migrations/2014_07_07_034137_alter_projects_table_add_user_id_column.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
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterProjectsTableAddUserIdColumn extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('projects', function(Blueprint $table)
{
$table->integer('user_id')->unsigned()->after('id');
$table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade');
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('projects', function(Blueprint $table)
{
$table->dropColumn('user_id');
$table->dropForeign('user_id');
$table->dropColumn('deleted_at');
});
}
}
app/models/Project.php
11
22
3
4
35
46
57
......
79
810
911
10
12
13
14
15
16
1117
1218
<?php
use Illuminate\Database\Eloquent\SoftDeletingTrait;
/**
* This class manages projects for use by the mentors and mentees
*/
{
protected $table = 'projects';
protected $fillable = array('title', 'link', 'language');
protected $softDelete = true;
protected $dates = ['deleted_at'];
protected $fillable = array('title', 'link', 'language', 'user_id');
}
app/views/projects/add.blade.php
22
33
44
5
5
66
77
88
......
1313
1414
1515
16
16
1717
1818
1919
2020
2121
2222
23
24
25
2623
2724
2825
......
3633
3734
3835
39
36
4037
4138
4239
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mentconnect - Login</title>
<title>Mentconnect - Add New Projects</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">
<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")) }}
{{ HTML::image("images/mentconnect.png", "mentconnect", 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>
<div class="container padded">
<div class="container">
<legend><h2>Please fill in the form below to submit an open source project</h2>
<legend><h2>Please complete the form below to submit an open source project</h2>
<p><small><i><strong>NOTICE :</strong> Please, do not share privately owned projects unless you own them and fully understand that all projects shared within Mentconnect community will be freely used by members for learning at no extra fee. Also do not submit other people's project without their permission to do so. </i></small></p></legend>
</div>
app/views/projects/edit.blade.php
22
33
44
5
5
66
77
88
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mentconnect - Login</title>
<title>Editing - {{ $project->title }}</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">
app/views/projects/home.blade.php
22
33
44
5
5
66
77
88
......
2828
2929
3030
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
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
7868
79
80
81
69
70
8271
83
72
8473
8574
8675
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mentconnect - Login</title>
<title>Mentconnect - Open Source Projects</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">
</div>
</header>
<div class="container">
<div id="login-cta-content">
</div>
</div>
<div class="container">
<div class="col-lg-2"></div>
<div class="col-lg-8">
<div id="main">
<div class="container padded">
<div id="feature-screenshot">
<h2>Awesome Projects, You're Welcome!</h2>
<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">
<div class="col-lg">
<table class="table table-striped table-hover">
<thead>
<tr>
<td><strong>Project Title</strong></td>
<td><strong>Project URL</strong></td>
<td><strong>Project Language</strong></td>
<td><strong>View Project</strong></td>
</tr>
</thead>
<tbody>
@foreach($projects as $key => $value)
<tr>
<td>{{ $value->title }}</td>
<td><a href="{{ $value->link }}">{{ $value->link }}</a></td>
<td>{{ $value->language }}</td>
<td>
<a class="btn btn-small btn-primary" href="{{ URL::to('projects/' . $value->id) }}">View this Project</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<div id="main">
<div class="container padded">
<div id="feature-screenshot">
<h2>Awesome Projects, You're Welcome!</h2>
<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">
<div class="col-lg">
<table class="table table-striped table-hover">
<thead>
<tr>
<td><strong>Project Title</strong></td>
<td><strong>Project URL</strong></td>
<td><strong>Project Language</strong></td>
<td><strong>View Project</strong></td>
</tr>
</thead>
<tbody>
@foreach($projects as $key => $value)
<tr>
<td>{{ $value->title }}</td>
<td><a href="{{ $value->link }}">{{ $value->link }}</a></td>
<td>{{ $value->language }}</td>
<td>
<a class="btn btn-small btn-primary" href="{{ URL::to('projects/' . $value->id) }}">View this Project</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
<div class="col-lg-2"></div>
</div>
</div>
</div>
<div id="footer">
<div id="sub-footer">
<div class="container">
app/views/users/index.blade.php
1919
2020
2121
22
23
24
25
22
2623
2724
28
25
2926
3027
3128
</a>
<ul class=" nav navbar-nav pull-right">
<li class>
{{HTML::link('partners', 'Partners') }}
</li>
<li class>
{{HTML::link('blog', 'Blog') }}
{{HTML::link('projects', 'Projects') }}
</li>
<li class="button">
{{HTML::link('login', 'Sign In') }}
{{HTML::link('logout', 'Logout') }}
</li>
</ul>
</div>
vendor/autoload.php
44
55
66
7
7
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit88b875760db91f64e8dafae7d12d9f83::getLoader();
return ComposerAutoloaderInit28465c2db9863d424f6e7d76c6a98221::getLoader();
vendor/composer/autoload_classmap.php
77
88
99
10
1011
1112
1213
return array(
'AdminController' => $baseDir . '/app/controllers/AdminController.php',
'AlterProjectsTableAddUserIdColumn' => $baseDir . '/app/database/migrations/2014_07_07_034137_alter_projects_table_add_user_id_column.php',
'AlterUserTableAddAdminColumn' => $baseDir . '/app/database/migrations/2014_06_29_233811_alter_user_table_add_admin_column.php',
'AlterUserTableAddColumns' => $baseDir . '/app/database/migrations/2014_06_28_024032_alter_user_table_add_columns.php',
'AlterUserTableReplaceColumn' => $baseDir . '/app/database/migrations/2014_06_29_015251_alter_user_table_replace_column.php',
vendor/composer/autoload_real.php
22
33
44
5
5
66
77
88
......
1919
2020
2121
22
22
2323
24
24
2525
2626
2727
......
4646
4747
4848
49
49
5050
5151
5252
5353
5454
5555
56
56
5757
5858
5959
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit88b875760db91f64e8dafae7d12d9f83
class ComposerAutoloaderInit28465c2db9863d424f6e7d76c6a98221
{
private static $loader;
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit88b875760db91f64e8dafae7d12d9f83', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit28465c2db9863d424f6e7d76c6a98221', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit88b875760db91f64e8dafae7d12d9f83', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit28465c2db9863d424f6e7d76c6a98221', 'loadClassLoader'));
$includePaths = require __DIR__ . '/include_paths.php';
array_push($includePaths, get_include_path());
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
composerRequire88b875760db91f64e8dafae7d12d9f83($file);
composerRequire28465c2db9863d424f6e7d76c6a98221($file);
}
return $loader;
}
}
function composerRequire88b875760db91f64e8dafae7d12d9f83($file)
function composerRequire28465c2db9863d424f6e7d76c6a98221($file)
{
require $file;
}

Archive Download the corresponding diff file

Branches

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