Skip to content

Commit 1041c9a

Browse files
committed
Initial commit.
0 parents  commit 1041c9a

File tree

284 files changed

+29756
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+29756
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/bootstrap/compiled.php
2+
/vendor
3+
composer.phar
4+
composer.lock
5+
.DS_Store
6+
Thumbs.db

Boxfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
web1:
2+
document_root: public
3+
php_version: 5.4.14
4+
php_upload_max_filesize: "10M"
5+
php_post_max_size: "10M"
6+
php_extensions:
7+
- mbstring
8+
- mcrypt
9+
- curl
10+
- gd
11+
- pdo_mysql
12+
- redis
13+
- zip
14+
- xcache
15+
php_session_save_handler: redis
16+
php_session_save_path: "tcp://tunnel.pagodabox.com:6379"
17+
shared_writable_dirs:
18+
- app/storage/cache
19+
- app/storage/logs
20+
- app/storage/meta
21+
- app/storage/sessions
22+
- app/storage/views
23+
- public/img/screenshots
24+
- public/img/avatars
25+
- public/img/avatar
26+
- public/img/screenshots/temp
27+
after_build:
28+
- "if [ ! -f composer.phar ]; then curl -s http://getcomposer.org/installer | php; fi; php composer.phar install --prefer-source"
29+
after_deploy:
30+
- "rm -f app/storage/cache/*"
31+
- "php artisan cache:clear"
32+
- "rm -f app/storage/views/*"
33+
before_deploy:
34+
- "php artisan migrate"
35+
cache1:
36+
type: redis
37+
38+
db1:
39+
type: mysql

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2011-2014 Stidges and Maksim Surguy
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<?php
2+
3+
namespace Controllers\Admin;
4+
5+
use Controllers\BaseController;
6+
use Illuminate\Support\Facades\Input;
7+
use Tricks\Repositories\CategoryRepositoryInterface;
8+
9+
class CategoriesController extends BaseController
10+
{
11+
/**
12+
* Category repository.
13+
*
14+
* @var \Tricks\Repositories\CategoryRepositoryInterface
15+
*/
16+
protected $categories;
17+
18+
/**
19+
* Create a new CategoriesController instance.
20+
*
21+
* @param \Tricks\Repositories\CategoryRepositoryInterface $categories
22+
* @return void
23+
*/
24+
public function __construct(CategoryRepositoryInterface $categories)
25+
{
26+
parent::__construct();
27+
28+
$this->categories = $categories;
29+
}
30+
31+
/**
32+
* Show the admin categories index page.
33+
*
34+
* @return \Response
35+
*/
36+
public function getIndex()
37+
{
38+
$categories = $this->categories->findAll('order', 'asc');
39+
40+
$this->view('admin.categories.list', compact('categories'));
41+
}
42+
43+
/**
44+
* Handle the creation of a category.
45+
*
46+
* @return \Illuminate\Http\RedirectResponse
47+
*/
48+
public function postIndex()
49+
{
50+
$form = $this->categories->getForm();
51+
52+
if (! $form->isValid()) {
53+
return $this->redirectRoute('admin.categories.index')
54+
->withErrors($form->getErrors())
55+
->withInput();
56+
}
57+
58+
$category = $this->categories->create($form->getInputData());
59+
60+
return $this->redirectRoute('admin.categories.index');
61+
}
62+
63+
/**
64+
* Update the order of the categories.
65+
*
66+
* @return \Response
67+
*/
68+
public function postArrange()
69+
{
70+
$decoded = Input::get('data');
71+
72+
if ($decoded) {
73+
$this->categories->arrange($decoded);
74+
}
75+
76+
return 'ok';
77+
}
78+
79+
/**
80+
* Show the category edit form.
81+
*
82+
* @param mixed $id
83+
* @return \Response
84+
*/
85+
public function getView($id)
86+
{
87+
$category = $this->categories->findById($id);
88+
89+
$this->view('admin.categories.edit', compact('category'));
90+
}
91+
92+
/**
93+
* Handle the editting of a category.
94+
*
95+
* @param mixed $id
96+
* @return \Illuminate\Http\RedirectResponse
97+
*/
98+
public function postView($id)
99+
{
100+
$form = $this->categories->getForm();
101+
102+
if (! $form->isValid()) {
103+
return $this->redirectRoute('admin.categories.view', $id)
104+
->withErrors($form->getErrors())
105+
->withInput();
106+
}
107+
108+
$category = $this->categories->update($id, $form->getInputData());
109+
110+
return $this->redirectRoute('admin.categories.view', $id);
111+
}
112+
113+
/**
114+
* Delete a category from the database.
115+
*
116+
* @param mixed $id
117+
* @return \Illuminate\Http\RedirectResponse
118+
*/
119+
public function getDelete($id)
120+
{
121+
$this->categories->delete($id);
122+
123+
return $this->redirectRoute('admin.categories.index');
124+
}
125+
}
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<?php
2+
3+
namespace Controllers\Admin;
4+
5+
use Controllers\BaseController;
6+
use Tricks\Repositories\TagRepositoryInterface;
7+
8+
class TagsController extends BaseController
9+
{
10+
/**
11+
* Tag repository.
12+
*
13+
* @var \Tricks\Repositories\TagRepositoryInterface
14+
*/
15+
protected $tags;
16+
17+
/**
18+
* Create a new TagsController instance.
19+
*
20+
* @param \Tricks\Repositories\TagRepositoryInterface $tags
21+
* @return void
22+
*/
23+
public function __construct(TagRepositoryInterface $tags)
24+
{
25+
parent::__construct();
26+
27+
$this->tags = $tags;
28+
}
29+
30+
/**
31+
* Show the tags index page.
32+
*
33+
* @return \Response
34+
*/
35+
public function getIndex()
36+
{
37+
$tags = $this->tags->findAll();
38+
39+
$this->view('admin.tags.list', compact('tags'));
40+
}
41+
42+
/**
43+
* Delete a tag from the database.
44+
*
45+
* @param mixed $id
46+
* @return \Illuminate\Http\RedirectResponse
47+
*/
48+
public function getDelete($id)
49+
{
50+
$this->tags->delete($id);
51+
52+
return $this->redirectRoute('admin.tags.index');
53+
}
54+
55+
/**
56+
* Show the tag edit form.
57+
*
58+
* @param mixed $id
59+
* @return \Response
60+
*/
61+
public function getView($id)
62+
{
63+
$tag = $this->tags->findById($id);
64+
65+
$this->view('admin.tags.edit', compact('tag'));
66+
}
67+
68+
/**
69+
* Handle the creation of a tag.
70+
*
71+
* @return \Illuminate\Http\RedirectResponse
72+
*/
73+
public function postIndex()
74+
{
75+
$form = $this->tags->getForm();
76+
77+
if (! $form->isValid()) {
78+
return $this->redirectRoute('admin.tags.index')
79+
->withErrors($form->getErrors())
80+
->withInput();
81+
}
82+
83+
$tag = $this->tags->create($form->getInputData());
84+
85+
return $this->redirectRoute('admin.tags.index');
86+
}
87+
88+
/**
89+
* Handle the editting of a tag.
90+
*
91+
* @param mixed $id
92+
* @return \Illuminate\Http\RedirectResponse
93+
*/
94+
public function postView($id)
95+
{
96+
$form = $this->tags->getForm();
97+
98+
if (! $form->isValid()) {
99+
return $this->redirectRoute('admin.tags.view', $id)
100+
->withErrors($form->getErrors())
101+
->withInput();
102+
}
103+
104+
$tag = $this->tags->update($id, $form->getInputData());
105+
106+
return $this->redirectRoute('admin.tags.view', $id);
107+
}
108+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
namespace Controllers\Admin;
4+
5+
use Controllers\BaseController;
6+
use Tricks\Repositories\UserRepositoryInterface;
7+
8+
class UsersController extends BaseController
9+
{
10+
/**
11+
* User repository.
12+
*
13+
* @var \Tricks\Repositories\UserRepositoryInterface
14+
*/
15+
protected $users;
16+
17+
/**
18+
* Create a new UsersController instance.
19+
*
20+
* @param \Tricks\Repositories\UserRepositoryInterface $users
21+
* @return void
22+
*/
23+
public function __construct(UserRepositoryInterface $users)
24+
{
25+
parent::__construct();
26+
27+
$this->users = $users;
28+
}
29+
30+
/**
31+
* Show the users index page.
32+
*
33+
* @return \Response
34+
*/
35+
public function getIndex()
36+
{
37+
$users = $this->users->findAllPaginated();
38+
39+
$this->view('admin.users.list', compact('users'));
40+
}
41+
}

0 commit comments

Comments
 (0)