Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1041c9a
Showing
284 changed files
with
29,756 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/bootstrap/compiled.php | ||
/vendor | ||
composer.phar | ||
composer.lock | ||
.DS_Store | ||
Thumbs.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
web1: | ||
document_root: public | ||
php_version: 5.4.14 | ||
php_upload_max_filesize: "10M" | ||
php_post_max_size: "10M" | ||
php_extensions: | ||
- mbstring | ||
- mcrypt | ||
- curl | ||
- gd | ||
- pdo_mysql | ||
- redis | ||
- zip | ||
- xcache | ||
php_session_save_handler: redis | ||
php_session_save_path: "tcp://tunnel.pagodabox.com:6379" | ||
shared_writable_dirs: | ||
- app/storage/cache | ||
- app/storage/logs | ||
- app/storage/meta | ||
- app/storage/sessions | ||
- app/storage/views | ||
- public/img/screenshots | ||
- public/img/avatars | ||
- public/img/avatar | ||
- public/img/screenshots/temp | ||
after_build: | ||
- "if [ ! -f composer.phar ]; then curl -s http://getcomposer.org/installer | php; fi; php composer.phar install --prefer-source" | ||
after_deploy: | ||
- "rm -f app/storage/cache/*" | ||
- "php artisan cache:clear" | ||
- "rm -f app/storage/views/*" | ||
before_deploy: | ||
- "php artisan migrate" | ||
cache1: | ||
type: redis | ||
|
||
db1: | ||
type: mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2011-2014 Stidges and Maksim Surguy | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<?php | ||
|
||
namespace Controllers\Admin; | ||
|
||
use Controllers\BaseController; | ||
use Illuminate\Support\Facades\Input; | ||
use Tricks\Repositories\CategoryRepositoryInterface; | ||
|
||
class CategoriesController extends BaseController | ||
{ | ||
/** | ||
* Category repository. | ||
* | ||
* @var \Tricks\Repositories\CategoryRepositoryInterface | ||
*/ | ||
protected $categories; | ||
|
||
/** | ||
* Create a new CategoriesController instance. | ||
* | ||
* @param \Tricks\Repositories\CategoryRepositoryInterface $categories | ||
* @return void | ||
*/ | ||
public function __construct(CategoryRepositoryInterface $categories) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->categories = $categories; | ||
} | ||
|
||
/** | ||
* Show the admin categories index page. | ||
* | ||
* @return \Response | ||
*/ | ||
public function getIndex() | ||
{ | ||
$categories = $this->categories->findAll('order', 'asc'); | ||
|
||
$this->view('admin.categories.list', compact('categories')); | ||
} | ||
|
||
/** | ||
* Handle the creation of a category. | ||
* | ||
* @return \Illuminate\Http\RedirectResponse | ||
*/ | ||
public function postIndex() | ||
{ | ||
$form = $this->categories->getForm(); | ||
|
||
if (! $form->isValid()) { | ||
return $this->redirectRoute('admin.categories.index') | ||
->withErrors($form->getErrors()) | ||
->withInput(); | ||
} | ||
|
||
$category = $this->categories->create($form->getInputData()); | ||
|
||
return $this->redirectRoute('admin.categories.index'); | ||
} | ||
|
||
/** | ||
* Update the order of the categories. | ||
* | ||
* @return \Response | ||
*/ | ||
public function postArrange() | ||
{ | ||
$decoded = Input::get('data'); | ||
|
||
if ($decoded) { | ||
$this->categories->arrange($decoded); | ||
} | ||
|
||
return 'ok'; | ||
} | ||
|
||
/** | ||
* Show the category edit form. | ||
* | ||
* @param mixed $id | ||
* @return \Response | ||
*/ | ||
public function getView($id) | ||
{ | ||
$category = $this->categories->findById($id); | ||
|
||
$this->view('admin.categories.edit', compact('category')); | ||
} | ||
|
||
/** | ||
* Handle the editting of a category. | ||
* | ||
* @param mixed $id | ||
* @return \Illuminate\Http\RedirectResponse | ||
*/ | ||
public function postView($id) | ||
{ | ||
$form = $this->categories->getForm(); | ||
|
||
if (! $form->isValid()) { | ||
return $this->redirectRoute('admin.categories.view', $id) | ||
->withErrors($form->getErrors()) | ||
->withInput(); | ||
} | ||
|
||
$category = $this->categories->update($id, $form->getInputData()); | ||
|
||
return $this->redirectRoute('admin.categories.view', $id); | ||
} | ||
|
||
/** | ||
* Delete a category from the database. | ||
* | ||
* @param mixed $id | ||
* @return \Illuminate\Http\RedirectResponse | ||
*/ | ||
public function getDelete($id) | ||
{ | ||
$this->categories->delete($id); | ||
|
||
return $this->redirectRoute('admin.categories.index'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<?php | ||
|
||
namespace Controllers\Admin; | ||
|
||
use Controllers\BaseController; | ||
use Tricks\Repositories\TagRepositoryInterface; | ||
|
||
class TagsController extends BaseController | ||
{ | ||
/** | ||
* Tag repository. | ||
* | ||
* @var \Tricks\Repositories\TagRepositoryInterface | ||
*/ | ||
protected $tags; | ||
|
||
/** | ||
* Create a new TagsController instance. | ||
* | ||
* @param \Tricks\Repositories\TagRepositoryInterface $tags | ||
* @return void | ||
*/ | ||
public function __construct(TagRepositoryInterface $tags) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->tags = $tags; | ||
} | ||
|
||
/** | ||
* Show the tags index page. | ||
* | ||
* @return \Response | ||
*/ | ||
public function getIndex() | ||
{ | ||
$tags = $this->tags->findAll(); | ||
|
||
$this->view('admin.tags.list', compact('tags')); | ||
} | ||
|
||
/** | ||
* Delete a tag from the database. | ||
* | ||
* @param mixed $id | ||
* @return \Illuminate\Http\RedirectResponse | ||
*/ | ||
public function getDelete($id) | ||
{ | ||
$this->tags->delete($id); | ||
|
||
return $this->redirectRoute('admin.tags.index'); | ||
} | ||
|
||
/** | ||
* Show the tag edit form. | ||
* | ||
* @param mixed $id | ||
* @return \Response | ||
*/ | ||
public function getView($id) | ||
{ | ||
$tag = $this->tags->findById($id); | ||
|
||
$this->view('admin.tags.edit', compact('tag')); | ||
} | ||
|
||
/** | ||
* Handle the creation of a tag. | ||
* | ||
* @return \Illuminate\Http\RedirectResponse | ||
*/ | ||
public function postIndex() | ||
{ | ||
$form = $this->tags->getForm(); | ||
|
||
if (! $form->isValid()) { | ||
return $this->redirectRoute('admin.tags.index') | ||
->withErrors($form->getErrors()) | ||
->withInput(); | ||
} | ||
|
||
$tag = $this->tags->create($form->getInputData()); | ||
|
||
return $this->redirectRoute('admin.tags.index'); | ||
} | ||
|
||
/** | ||
* Handle the editting of a tag. | ||
* | ||
* @param mixed $id | ||
* @return \Illuminate\Http\RedirectResponse | ||
*/ | ||
public function postView($id) | ||
{ | ||
$form = $this->tags->getForm(); | ||
|
||
if (! $form->isValid()) { | ||
return $this->redirectRoute('admin.tags.view', $id) | ||
->withErrors($form->getErrors()) | ||
->withInput(); | ||
} | ||
|
||
$tag = $this->tags->update($id, $form->getInputData()); | ||
|
||
return $this->redirectRoute('admin.tags.view', $id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace Controllers\Admin; | ||
|
||
use Controllers\BaseController; | ||
use Tricks\Repositories\UserRepositoryInterface; | ||
|
||
class UsersController extends BaseController | ||
{ | ||
/** | ||
* User repository. | ||
* | ||
* @var \Tricks\Repositories\UserRepositoryInterface | ||
*/ | ||
protected $users; | ||
|
||
/** | ||
* Create a new UsersController instance. | ||
* | ||
* @param \Tricks\Repositories\UserRepositoryInterface $users | ||
* @return void | ||
*/ | ||
public function __construct(UserRepositoryInterface $users) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->users = $users; | ||
} | ||
|
||
/** | ||
* Show the users index page. | ||
* | ||
* @return \Response | ||
*/ | ||
public function getIndex() | ||
{ | ||
$users = $this->users->findAllPaginated(); | ||
|
||
$this->view('admin.users.list', compact('users')); | ||
} | ||
} |
Oops, something went wrong.