Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/hamid' into Ali
Browse files Browse the repository at this point in the history
  • Loading branch information
AlirezaAlgo committed Dec 30, 2014
2 parents 3f09029 + 3d49a5e commit 0fee1f9
Show file tree
Hide file tree
Showing 16 changed files with 278 additions and 117 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ and run the composer update command, the package and its dependencies will be in

```bash
php artisan asset:publish "serverfireteam/panel"
php artisan asset:publish "zofe/rapyd"
php artisan asset:publish "serverfireteam/rapyd-laravel"
```

5. Go to the root of your project and run this command in order to set up the database
Expand Down
44 changes: 34 additions & 10 deletions public/css/global.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
body{
background-color:@color-1;
}
.sidebar .sidebar-nav.navbar-collapse li a
{
color : rgba(255,255,255,.9);
}
.navbar .badge {
color: @badge-color;
border:1px solid #999;
background-color: transparent;

}


.panel{
border-width: 1px;
border-style: solid ;
Expand Down Expand Up @@ -111,13 +126,22 @@
{
transition: all ease 250ms;
}
.btn-primary
{
background-color: @body-bg;
border-color: darken(@body-bg,10%);

&:hover
{

}
}




/* Smartphones (portrait) ----------- */
/* @screen-xs is Deprecated as of v3.0.1 Bootstrap ----------- */
@media(max-width:767px){
.loading h1
{
margin:-47% auto;
}
.btn-resp-sidebar
{
float: left;
top: 25px;
left: 8px;
}
}

7 changes: 7 additions & 0 deletions public/css/styles.css

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion public/css/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ and open the template in the editor.
Author : alireza
*/


/*color.adobe.com*/
/*https://color.adobe.com/Colors-of-Rio-color-theme-1785951/edit/?copy=true&base=3&rule=Custom&selected=0&name=Copy%20of%20Colors%20of%20Rio&mode=rgb&rgbvalues=0.91,0.228392,0.146314,1,0.913725,0.639216,0.596078,0.8,0.588235,0,0.2694440000000001,0.39,0.098039,0.105882,0.156863&swatchOrder=0,1,2,3,4*/

@color-1 : #191B28; // blue
@color-2 : #004563; // light blue
@color-3 : #98CC96; // ultra light blue
@color-4 : #FFE9A3; // close white
@color-5 : #E83A25; // red


@font-family-base: Abel,sans-serif;
@body-bg: #304269;
@navbar-height: 0px;
@navbar-height: 0px;


@brand-success: #59CC8C;
@btn-success-color: #fff;
@btn-success-bg: #59CC8C;
Binary file added public/img/Thumbs.db
Binary file not shown.
8 changes: 5 additions & 3 deletions public/js/sb-admin-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ $(function() {
})
})
$(document ).ready(function(){
setTimeout(function(){
$('.loading').fadeOut('normal');
},1000);

$('.loading').fadeOut('normal');
$('.box-holder,.table').addClass('animated fadeInRight');
$('.dashboard-title').addClass('animated fadeInUp');


})
2 changes: 1 addition & 1 deletion src/Serverfireteam/Panel/libs/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static function create()
'addUrl'=>'panel/'.$value.'/edit',
);
else
throw new Exception('Model name doesnt match config.crudItems in '.$value);
throw new \Exception('Model name doesnt match config.crudItems in '.$value);
}

return $dashboard;
Expand Down
90 changes: 50 additions & 40 deletions src/controllers/RemindersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ class RemindersController extends \Controller {
*/
public function getRemind()
{
return \View::make('panelViews::passwordReminder');
if (\Session::has('message')){
$message = \Session::get('message');
}else{
$message = 'Please Enter Email Address';
}
return \View::make('panelViews::passwordReminder')
->with('message', $message);
}

/**
Expand All @@ -20,14 +26,20 @@ public function getRemind()
*/
public function postRemind()
{


\Config::set('auth.model', 'Serverfireteam\Panel\Admin');
\Config::set('auth.reminder.email', 'panelViews::resetPassword');


switch ($response = \Password::remind(\Input::only('email')))
{

case \Password::INVALID_USER:
return Redirect::back()->with('error', Lang::get($response));
return \Redirect::back()->with('message', \Lang::get($response));

case \Password::REMINDER_SENT:
return Redirect::back()->with('status', Lang::get($response));
return \Redirect::back()->with('message', \Lang::get($response));
}
}

Expand All @@ -41,7 +53,39 @@ public function getReset($token = null)
{
return \View::make('panelViews::passwordReset');
}


public function postReset()
{
\Config::set('auth.model', 'Serverfireteam\Panel\Admin');

$credentials = \Input::only(
'email', 'password', 'password_confirmation', 'token'
);

echo '<pre>';
var_dump($credentials);


$response = \Password::reset($credentials, function($user, $password)
{
$user->password = \Hash::make($password);
$user->save();
});

switch ($response)
{
case \Password::INVALID_PASSWORD:
return \Redirect::back()->with('error', \Lang::get($response));
case \Password::INVALID_TOKEN:
return \Redirect::back()->with('error', \Lang::get($response));
case \Password::INVALID_USER:
return \Redirect::back()->with('error', \Lang::get($response));

case \Password::PASSWORD_RESET:
return \Redirect::to('/panel')->with('message', 'Password Successfully Rested!! Please Log in');
}
}

public function getChangePassword(){

return \View::make('panelViews::passwordChange');
Expand All @@ -61,7 +105,7 @@ public function postChangePassword(){
if ($new_password['password'] == $retype_password['password_confirmation'] ){
$user->password = \Hash::make($new_password['password']);
$user->save();
return \Redirect::to('/panel/changePassword')->with('message', 'Successfully Changed Your PAssword!!');;
return \Redirect::to('/panel/changePassword')->with('message', 'Successfully Changed Your Password!!');;
}else{
return \Redirect::to('/panel/changePassword')
->with('message', 'Passwords not matched!!');
Expand All @@ -72,39 +116,5 @@ public function postChangePassword(){
}
}

/**
* Handle a POST request to reset a user's password.
*
* @return Response
*/
public function postReset()
{
\Config::set('auth.model', 'Serverfireteam\Panel\Admin');

$user = Admin::find(\Auth::user()->id);


$credentials = Input::only(
'email', 'password', 'password_confirmation'
);

$response = Password::reset($credentials, function($user, $password)
{
$user->password = Hash::make($password);

$user->save();
});

switch ($response)
{
case Password::INVALID_PASSWORD:
case Password::INVALID_TOKEN:
case Password::INVALID_USER:
return Redirect::back()->with('error', Lang::get($response));

case Password::PASSWORD_RESET:
return Redirect::to('/');
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function up()
$table->string('persist_code')->nullable();
$table->string('reset_password_code')->nullable();

$table->string('rememberToken', 100)->nullable();
$table->string('remember_token', 100)->nullable();

$table->string('first_name')->nullable();
$table->string('last_name')->nullable();
Expand Down
13 changes: 7 additions & 6 deletions src/models/Admin.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Serverfireteam\Panel;

use Illuminate\Auth\UserTrait;
use Illumiate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
Expand Down Expand Up @@ -32,20 +32,21 @@ public function getAuthPassword()
}

public function getRememberToken(){
return $this->rememberToken;
return $this->remember_token;
}

public function setRememberToken($value){
$this->rememberToken = $value;
$this->remember_token = $value;
}

public function getReminderEmail(){
return \Auth::user()->email;
public function getReminderEmail(){
$email = \Input::only('email');
return $email['email'];
}


public function getRememberTokenName(){
return $this->rememberTokenName;
return $this->remember_token_name;
}

protected $fillable = array('first_name', 'last_name', 'email', 'password');
Expand Down
13 changes: 10 additions & 3 deletions src/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@
\Config::set('auth.model', 'Serverfireteam\Panel\Admin');
\Route::filter('auth', function()
{
if (\Auth::guest()){
return \Redirect::to('/panel/login')->with('message', 'Please Sign In');

if (\Auth::guest()){
if (\Session::has('message')){
$message = \Session::get('message');
}else{
$message = 'Please Enter Email Address';
}
return \Redirect::to('/panel/login')->with('message', $message);
}
});
}
Expand Down Expand Up @@ -94,6 +98,9 @@
}
});

Route::get('/panel/password/reset/{token}', function ($token){
return View::make('panelViews::passwordReset')->with('token', $token);
});

Route::get('/panel/logout', function (){

Expand Down
57 changes: 37 additions & 20 deletions src/views/mainTemplate.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,34 @@

<div id="wrapper">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-static-top fadeInRight" role="navigation" style="margin-bottom: 0">
<nav class="navbar navbar-default navbar-static-top " role="navigation" style="margin-bottom: 0">

<!-- /.navbar-header -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed btn-resp-sidebar" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>

</div>


<!-- /.navbar-top-links -->

<div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav navbar-collapse">
<div class="navbar-default sidebar " role="navigation">
<div class="sidebar-nav navbar-collapse collapse " id="bs-example-navbar-collapse-1">
<ul class="nav" id="side-menu">
<li>
{{link_to('panel', 'Dashboard')}}<i class="fa fa-dashboard fa-fw"></i>
<a href="{{ url('panel') }}" class="{{ (Request::url() === url('panel')) ? 'active' : '' }}"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>

@foreach ( \Config::get('config.crudItems') as $key => $value )
<li>
<a href="{{ url('panel/'.$value.'/all') }}" class="{{ (Request::segment(2)==$value)?'active':'' }}"><i class="fa fa-edit fa-fw"></i> {{{$key}}} <span class="badge pull-right">{{$value::all()->count()}}</span></a>
</li>
@if(is_array(\Config::get('config.crudItems')))
@foreach ( \Config::get('config.crudItems') as $key => $value )
<li>
<a href="{{ url('panel/'.$value.'/all') }}" class="{{ (Request::segment(2)==$value)?'active':'' }}"><i class="fa fa-edit fa-fw"></i> {{{$key}}} <span class="badge pull-right">{{$value::all()->count()}}</span></a>
</li>
@endforeach
@endif
@endforeach
</ul>

</li>
Expand All @@ -49,21 +57,30 @@
<!-- Menu Bar -->
<div class="row">
<div class="col-xs-12 text-a top-icon-bar">
<a href="#"<span class="icon ic-cog"></span></a>
<span class="icon ic-switch"></span>
<div class="btn-group" role="group" aria-label="...">
<div class="btn-group" role="group">
<a type="button" class="btn btn-default dropdown-toggle main-link" data-toggle="dropdown" aria-expanded="false">
settings
<span class="caret fl-right"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li><a href="{{url('panel/edit')}}"><span class="icon ic-cog "></span> Profile Edit </a></li>
<li><a href="{{url('panel/changePassword')}}"><span class="icon ic-cog"></span> Reset Password </a></li>
</ul>
</div>
<a href="{{url('panel/logout')}}" type="button" class="btn btn-default main-link">logout <span class="icon ic-switch fl-right"></span></a>
</div>

<!-- <a href="{{url('panel/logout')}}" > logout <span class="icon ic-cog"></span></a>
<a href="#" > settings <span class="icon ic-switch"></span></a>-->


</div>
</div>

@yield('page-wrapper')

</div>
<!-- /.row -->
<div class="row">
<!-- /.col-lg-8 -->

<!-- /.col-lg-4 -->
</div>
<!-- /.row -->
</div>
<!-- /#page-wrapper -->

Expand Down
Loading

0 comments on commit 0fee1f9

Please sign in to comment.