Skip to content

Commit 7ea48d6

Browse files
committed
cleanups
1 parent 750a3bd commit 7ea48d6

File tree

5 files changed

+250
-0
lines changed

5 files changed

+250
-0
lines changed

package-lock.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
@extends('layouts.app')
2+
3+
@section('content')
4+
<div class="container" id="project_container">
5+
<br>
6+
@include('finance.menu', ['active' => 'projects'])
7+
<br><br>
8+
<h1>Create Project</h1>
9+
@include('status', ['errors' => $errors->all()])
10+
<div class="card">
11+
<form action="{{ route('projects.store') }}" method="POST" id="form_project">
12+
@csrf
13+
14+
<div class="card-header">
15+
<span>Project Details</span>
16+
</div>
17+
<div class="card-body">
18+
<div class="form-row">
19+
<div class="form-group col-md-5">
20+
<label for="name" class="field-required">Name</label>
21+
<input type="text" class="form-control" name="name" id="name" placeholder="Name" required="required" value="{{ old('name') }}">
22+
</div>
23+
<div class="form-group offset-md-1 col-md-5">
24+
<label for="client_id" class="field-required">Client</label>
25+
<select name="client_id" id="client_id" class="form-control" required="required">
26+
<option value="">Select Client</option>
27+
@foreach ($clients as $client)
28+
@php
29+
$selected = $client->id == old('client_id') ? 'selected="selected"' : '';
30+
@endphp
31+
<option value="{{ $client->id }}" {{ $selected }}>{{ $client->name }}</option>
32+
@endforeach
33+
</select>
34+
</div>
35+
</div>
36+
<br>
37+
<div class="form-row">
38+
<div class="form-group col-md-5">
39+
<label for="client_project_id" class="field-required">Project ID</label>
40+
<input type="text" class="form-control" name="client_project_id" id="client_project_id" placeholder="Project ID" required="required" value="{{ old('client_project_id') }}">
41+
</div>
42+
<div class="form-group offset-md-1 col-md-5">
43+
<label for="name" class="field-required">Status</label>
44+
<select name="status" id="status" class="form-control" required="required">
45+
@foreach (config('constants.project.status') as $status => $display_name)
46+
<option value="{{ $status }}">{{ $display_name }}</option>
47+
@endforeach
48+
</select>
49+
</div>
50+
</div>
51+
<br>
52+
<div class="form-row">
53+
<div class="form-group col-md-5">
54+
<label for="invoice_email">Email for invoice</label>
55+
<input type="email" class="form-control" name="invoice_email" id="invoice_email" placeholder="Email for invoice" value="{{ old('invoice_email') }}">
56+
</div>
57+
</div>
58+
</div>
59+
<div class="card-footer">
60+
<button type="submit" class="btn btn-primary">Create</button>
61+
</div>
62+
</form>
63+
</div>
64+
</div>
65+
@endsection
+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
@extends('layouts.app')
2+
3+
@section('content')
4+
<div class="container" id="project_container">
5+
<br>
6+
@include('finance.menu', ['active' => 'projects'])
7+
<br><br>
8+
<div class="row">
9+
<div class="col-md-6"><h1>Edit Project</h1></div>
10+
<div class="col-md-6"><a href="{{ route('projects.create') }}" class="btn btn-success float-right">Create Project</a></div>
11+
</div>
12+
13+
14+
@include('status', ['errors' => $errors->all()])
15+
<div class="card">
16+
<form action="{{ route('projects.update', $project->id) }}" method="POST">
17+
18+
{{ csrf_field() }}
19+
{{ method_field('PUT') }}
20+
21+
<div class="card-header">
22+
<span>Project Details</span>
23+
</div>
24+
<div class="card-body">
25+
<div class="form-row">
26+
<div class="form-group col-md-5">
27+
<label for="name" class="field-required">Name</label>
28+
<input type="text" class="form-control" name="name" id="name" placeholder="Name" required="required" value="{{ $project->name }}">
29+
</div>
30+
<div class="form-group offset-md-1 col-md-5">
31+
<label for="client_id" class="field-required">Client</label>
32+
<select name="client_id" id="client_id" class="form-control" required="required">
33+
@foreach ($clients as $client)
34+
@php
35+
$selected = $client->id === $project->client_id ? 'selected="selected"' : '';
36+
@endphp
37+
<option value="{{ $client->id }}" {{ $selected }}>{{ $client->name }}</option>
38+
@endforeach
39+
</select>
40+
</div>
41+
</div>
42+
<br>
43+
<div class="form-row">
44+
<div class="form-group col-md-5">
45+
<label for="client_project_id" class="field-required">Project ID</label>
46+
<input type="text" class="form-control" name="client_project_id" id="client_project_id" placeholder="Project ID" required="required" value="{{ $project->client_project_id }}">
47+
</div>
48+
<div class="form-group offset-md-1 col-md-5">
49+
<label for="name" class="field-required">Status</label>
50+
<select name="status" id="status" class="form-control" required="required">
51+
@foreach (config('constants.project.status') as $status => $display_name)
52+
@php
53+
$selected = $status === $project->status ? 'selected="selected"' : '';
54+
@endphp
55+
<option value="{{ $status }}" {{ $selected }}>{{ $display_name }}</option>
56+
@endforeach
57+
</select>
58+
</div>
59+
</div>
60+
<br>
61+
<div class="form-row">
62+
<div class="form-group col-md-5">
63+
<label for="invoice_email">Email for invoice</label>
64+
<input type="email" class="form-control" name="invoice_email" id="invoice_email" placeholder="Email for invoice" value="{{ $project->invoice_email }}">
65+
</div>
66+
</div>
67+
</div>
68+
<div class="card-footer">
69+
<button type="submit" class="btn btn-primary">Update</button>
70+
</div>
71+
</form>
72+
</div>
73+
@if (sizeof($project->stages))
74+
<h2 class="mt-5">Project Stages</h2>
75+
@foreach ($project->stages as $stage)
76+
<project-stage-component
77+
:stage="{{ json_encode($stage) }}"
78+
:configs="{{ json_encode([
79+
'currencies' => config('constants.currency'),
80+
'projectTypes' => config('constants.project.type'),
81+
'gst' => config('constants.finance.gst'),
82+
'invoiceStatus' => config('constants.finance.invoice.status'),
83+
'chequeStatus' => config('constants.cheque_status'),
84+
'paymentTypes' => config('constants.payment_types'),
85+
'countries' => config('constants.countries')
86+
]) }}"
87+
:client="{{ json_encode($project->client) }}"
88+
:csrf-token="{{ json_encode(csrf_token()) }}"
89+
:project-id="{{ $project->id }}"
90+
:stage-route="{{json_encode( route('project.stage'))}}"
91+
ref="projectStage">
92+
</project-stage-component>
93+
@endforeach
94+
@endif
95+
<project-stage-component
96+
v-show="newStage"
97+
:stage="[]"
98+
:stage-route="{{json_encode( route('project.stage'))}}"
99+
:csrf-token="{{ json_encode(csrf_token()) }}"
100+
:project-id="{{ $project->id }}"
101+
:client="{{ json_encode($project->client) }}"
102+
:configs="{{ json_encode([
103+
'currencies' => config('constants.currency'),
104+
'projectTypes' => config('constants.project.type'),
105+
'gst' => config('constants.finance.gst'),
106+
'invoiceStatus' => config('constants.finance.invoice.status'),
107+
'chequeStatus' => config('constants.cheque_status'),
108+
'paymentTypes' => config('constants.payment_types'),
109+
'countries' => config('constants.countries'),
110+
]) }}"
111+
></project-stage-component>
112+
113+
<button class="btn btn-secondary float-right my-5" type="button" id="project_new_stage" v-show="!newStage" v-on:click="newStage = !newStage">Add new stage</button>
114+
</div>
115+
@endsection
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
@extends('layouts.app')
2+
3+
@section('content')
4+
<div class="container">
5+
<br>
6+
@include('finance.menu', ['active' => 'projects'])
7+
<br><br>
8+
<div class="row">
9+
<div class="col-md-6"><h1>Projects</h1></div>
10+
<div class="col-md-6"><a href="{{ route('projects.create') }}" class="btn btn-success float-right">Create Project</a></div>
11+
</div>
12+
<table class="table table-striped table-bordered">
13+
<tr>
14+
<th>Name</th>
15+
<th>Client</th>
16+
<th>Status</th>
17+
<th>Action</th>
18+
</tr>
19+
@foreach ($projects as $project)
20+
<tr>
21+
<td>
22+
<a href="{{ route('projects.show', $project->id) }}">{{ $project->name }}</a>
23+
</td>
24+
<td>{{ $project->client->name }}</td>
25+
<td>
26+
@switch ($project->status)
27+
@case('active')
28+
<span class="badge badge-pill badge-success">
29+
@break
30+
@case('inactive')
31+
<span class="badge badge-pill badge-danger">
32+
@break
33+
@endswitch
34+
{{ $project->status }}</span>
35+
</td>
36+
<td>
37+
<a href="{{ route('projects.edit', $project->id) }}">Edit</a>
38+
</td>
39+
</tr>
40+
@endforeach
41+
</table>
42+
{{ $projects->links() }}
43+
</div>
44+
@endsection
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@extends('layouts.app')
2+
3+
@section('content')
4+
<div class="container" id="project_container">
5+
<br>
6+
@include('finance.menu', ['active' => 'projects'])
7+
@include('status', ['errors' => $errors->all()])
8+
<br><br>
9+
<div class="row">
10+
<div class="col-md-6"><h1>View Project</h1></div>
11+
</div>
12+
@include('status', ['errors' => $errors->all()])
13+
<div class="card">
14+
<div class="card-header">
15+
<span>Project Details</span>
16+
</div>
17+
<project-details-component
18+
:project="{{$project}}"
19+
:clients="{{$clients}}"
20+
:employees="{{$employees}}"
21+
></project-details-component>
22+
23+
</div>
24+
</div>
25+
@endsection

0 commit comments

Comments
 (0)