Browse Source

Add agency logo image upload validation

Write CONCEPT.md
Update README.md
Add app.name config
Update login page, register page, sidebar and footer section
pull/1/head
Nafies Luthfi 8 years ago
parent
commit
31429a12c3
  1. 4
      CONCEPT.md
  2. 28
      README.md
  3. 4
      app/Http/Controllers/Users/AgencyController.php
  4. 13
      config/app.php
  5. 2
      resources/lang/id/nav_menu.php
  6. 1
      resources/lang/id/validation.php
  7. 2
      resources/views/auth/login.blade.php
  8. 3
      resources/views/auth/register.blade.php
  9. 2
      resources/views/layouts/guest.blade.php
  10. 9
      resources/views/layouts/partials/footer.blade.php
  11. 2
      resources/views/layouts/partials/sidebar.blade.php
  12. 2
      storage/app/.gitignore
  13. BIN
      storage/app/sample-image.jpg
  14. BIN
      storage/app/sample-image.png
  15. 6
      tests/Feature/AgencyProfileTest.php

4
readme.md → CONCEPT.md

@ -1,6 +1,6 @@
# Project Management Office
# Free PMO
Project Management Office, is a project management tool for freelancers and agencies to manage and monitor their project easier.
Free PMO adalah sebuah tool untuk mempermudah pengelolaan dan monitor project bagi feelancer dan agensi.
## Konsep

28
README.md

@ -0,0 +1,28 @@
# Free PMO
Free PMO adalah sebuah tool untuk mempermudah pengelolaan dan monitor project bagi feelancer dan agensi.
#### Tagline
> Show our clients that we are managing our projects professionally.
## Tentang
## Cara Install
#### Spesifikasi Server
#### Tahapan Install
## Kontributor
## Lisensi
## Cara Berkontribusi
#### Membuat Issue
#### Membuat Pull Request
## Screenshots

4
app/Http/Controllers/Users/AgencyController.php

@ -48,7 +48,9 @@ class AgencyController extends Controller
public function logoUpload()
{
$file = request()->validate([
'logo' => 'required|max:100|file_extension:png,jpg',
'logo' => 'required|file_extension:png|max:100|dimensions:min_width=100,max_width=200',
], [
'file_extension' => 'Silakan upload file format <strong>.png</strong>',
]);
\File::delete(public_path('assets/imgs/'.Option::get('agency_logo_path')));

13
config/app.php

@ -4,6 +4,19 @@ return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/
'name' => 'Free PMO',
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|

2
resources/lang/id/nav_menu.php

@ -2,5 +2,5 @@
return [
'dashboard' => 'Dashboard',
'agency' => 'Agensi',
'agency' => 'Profil Agensi',
];

1
resources/lang/id/validation.php

@ -34,6 +34,7 @@ return [
"different" => "Isian :attribute dan :other harus berbeda.",
"digits" => "Isian :attribute harus berupa angka :digits.",
"digits_between" => "Isian :attribute harus antara angka :min dan :max.",
'dimensions' => 'Dimensi file gambar :attribute tidak sesuai.',
"email" => "Isian :attribute harus berupa alamat surel yang valid.",
"exists" => "Isian :attribute yang dipilih tidak valid.",
"filled" => "Bidang isian :attribute wajib diisi.",

2
resources/views/auth/login.blade.php

@ -6,7 +6,7 @@
@include('flash::message')
<div class="login-panel col-md-4 col-md-offset-4 text-center">
{!! appLogoImage() !!}
<h3>{{ Option::get('app_name','Aplikasi Laravel') }}</h3>
<h3>{{ config('app.name') }}</h3>
<div class="panel panel-default">
<div class="panel-body">
{{ Form::open(['route'=>'auth.login']) }}

3
resources/views/auth/register.blade.php

@ -8,7 +8,7 @@
<div class="panel-body">
<div class="text-center">
{!! appLogoImage(['style' => 'width:150px']) !!}
<h3>{{ Option::get('app_name','Aplikasi Laravel') }}</h3>
<h3>{{ config('app.name') }}</h3>
</div>
<hr>
{!! Form::open(['route' => 'app.install', 'class' => '']) !!}
@ -39,7 +39,6 @@
</div>
<div class="form-group">
{!! Form::submit(trans('auth.register'), ['class' => 'btn btn-success']) !!}
{!! link_to_route('auth.login', trans('auth.have_an_account'), [], ['class' => 'btn btn-link pull-right']) !!}
</div>
{!! Form::close() !!}
</div>

2
resources/views/layouts/guest.blade.php

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>@yield('title', Option::get('app_name', 'Aplikasi Laravel'))</title>
<title>@yield('title', config('app.name'))</title>
{!! Html::style('assets/css/app.css') !!}
@yield('ext_css')

9
resources/views/layouts/partials/footer.blade.php

@ -1,7 +1,10 @@
<footer class="footer" id="footer">
<div id="copy" class="hidden-print">
Copyright <span style="font-size:16px">&copy;</span> {{ date('Y') }}
| <a href="{{ Option::get('agency_website','http://jasawebsitebanjarmasin.com') }}" target="_blank" title="{{ Option::get('agency_tagline','Laravel app description') }}">{{ Option::get('agency_name','Aplikasi Laravel') }}</a>
| Develop by <a href="{{ url('https://jasawebsitebanjarmasin.com') }}" target="_blank" title="Jasa Website dan Aplikasi Web Banjarmasin">JWB</a>
Powered by <a href="{{ url('https://github.com/nafiesl/free-pmo') }}" target="_blank">Free PMO</a>,
and developed with pleasure by the
<a href="{{ url('https://github.com/nafiesl/free-pmo/graphs/contributors') }}" target="_blank">
Contributors
</a>
</div>
{{-- Free PMO is an opensource software you are free to remove this footer text or section. --}}
</footer>

2
resources/views/layouts/partials/sidebar.blade.php

@ -11,7 +11,7 @@
<div class="sidebar-nav navbar-collapse">
<a class="navbar-brand text-center" title="Home | {{ Option::get('agency_tagline', 'Laravel app description') }}" href="{{ route('home') }}">
{{ appLogoImage(['class' => 'sidebar-logo']) }}
<div class="small" style="margin-top:10px">{{ Option::get('app_name','Laravel') }}</div>
<div class="small" style="margin-top:10px">{{ config('app.name') }}</div>
</a>
<ul class="nav" id="side-menu">
<li>{!! html_link_to_route('home', trans('nav_menu.dashboard'), [], ['icon' => 'dashboard']) !!}</li>

2
storage/app/.gitignore

@ -1,4 +1,4 @@
*
!public/
!.gitignore
!sample-image.jpg
!sample-image.png

BIN
storage/app/sample-image.jpg

Before

Width: 640  |  Height: 426  |  Size: 78 KiB

BIN
storage/app/sample-image.png

After

Width: 200  |  Height: 133  |  Size: 45 KiB

6
tests/Feature/AgencyProfileTest.php

@ -69,7 +69,7 @@ class AgencyProfileTest extends TestCase
$user = $this->adminUserSigningIn();
$this->visit(route('users.agency.edit'));
$this->attach(storage_path('app/sample-image.jpg'), 'logo');
$this->attach(storage_path('app/sample-image.png'), 'logo');
$this->press(trans('agency.logo_upload'));
$this->see(trans('agency.updated'));
@ -77,9 +77,9 @@ class AgencyProfileTest extends TestCase
$this->seeInDatabase('site_options', [
'key' => 'agency_logo_path',
'value' => 'sample-image.jpg',
'value' => 'sample-image.png',
]);
$this->assertFileExistsThenDelete(public_path('assets/imgs/sample-image.jpg'));
$this->assertFileExistsThenDelete(public_path('assets/imgs/sample-image.png'));
}
}
Loading…
Cancel
Save