Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip
  • Loading branch information
djaiss committed Feb 6, 2018
commit 6643e6dd0f959cc4783e895421c814f12df2a58a
41 changes: 41 additions & 0 deletions app/Helpers/DateHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,45 @@ public static function getNextTheoriticalBillingDate(String $interval)

return Carbon::now()->addYear();
}

public static function getListOfMonths()
{
// Carbon::setLocale(auth()->user()->locale);
// $months = [];
// $currentDate = Carbon::now();
// $currentDate->day = 1;

// for ($month = 1; $month < 13; $month++) {
// $currentDate->month = $month;
// array_push($months, $currentDate->formatLocalized('%B'));
// }

Carbon::setLocale(auth()->user()->locale);
$months = collect([]);
$currentDate = Carbon::now();
$currentDate->day = 1;

for ($month = 1; $month < 13; $month++) {
$currentDate->month = $month;
$months->push(['id' => $month, 'name' => $currentDate->formatLocalized('%B')]);
}

return $months;
}

public static function getListOfDays()
{
// $days = [];

// for ($day = 1; $day < 32; $day++) {
// array_push($days, $day);
// }

$days = collect([]);
for ($day = 1; $day < 32; $day++) {
$days->push(['id' => $day, 'name' => $day]);
}

return $days;
}
}
2 changes: 2 additions & 0 deletions app/Http/Controllers/ContactsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ public function edit(Contact $contact)
{
return view('people.edit')
->withContact($contact)
->withDays(\App\Helpers\DateHelper::getListOfDays())
->withMonths(\App\Helpers\DateHelper::getListOfMonths())
->withGenders(auth()->user()->account->genders);
}

Expand Down
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion public/css/app.css

Large diffs are not rendered by default.

69 changes: 52 additions & 17 deletions public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/stripe.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"/js/app.js": "/js/app.js?id=6cc2828b4da3a47cda38",
"/css/app.css": "/css/app.css?id=a4eb5c954e4ef0e3faba",
"/js/app.js": "/js/app.js?id=dd1db1a7d4108bc695f1",
"/css/app.css": "/css/app.css?id=b715f2b5161aa9e796f2",
"/css/stripe.css": "/css/stripe.css?id=b5558190ef4a3ff3c475",
"/js/stripe.js": "/js/stripe.js?id=69c2f12776a85b85804e"
"/js/stripe.js": "/js/stripe.js?id=224f8e93189950454c6a"
}
30 changes: 15 additions & 15 deletions resources/assets/js/components/partials/form/SpecialDate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
<div class="flex">
<form-select
v-model="selectedMonth"
:options="genders"
:options="months"
v-bind:id="'month'"
v-bind:title="''" class="mr3">
</form-select>
<form-select
v-model="selectedDay"
:options="genders"
:options="days"
v-bind:id="'month'"
v-bind:title="''">
</form-select>
Expand All @@ -65,6 +65,16 @@
v-model='selectedDate'
:input-class="'br2 f5 w-100 ba b--black-40 pa2 outline-0'">
</v-date-picker>
<div class="mt3 form-information-message br2">
<div class="pa3 flex">
<div class="mr3">
<svg viewBox="0 0 20 20"><g fill-rule="evenodd"><circle cx="10" cy="10" r="9" fill="currentColor"></circle><path d="M10 0C4.486 0 0 4.486 0 10s4.486 10 10 10 10-4.486 10-10S15.514 0 10 0m0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8m1-5v-3a1 1 0 0 0-1-1H9a1 1 0 1 0 0 2v3a1 1 0 0 0 1 1h1a1 1 0 1 0 0-2m-1-5.9a1.1 1.1 0 1 0 0-2.2 1.1 1.1 0 0 0 0 2.2"></path></g></svg>
</div>
<div class="">
If you indicate an exact birthdate for this person, we will create a new reminder for you - so you'll be notified every year when it's time to celebrate this person's birthdate.
</div>
</div>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -94,21 +104,11 @@
},

props: {
value: null,
options: {
days: {
type: Array,
},
title: {
type: String,
},
id: {
type: String,
},
excludedId: {
type: String,
},
required: {
type: Boolean,
months: {
type: Array,
},
},

Expand Down
12 changes: 12 additions & 0 deletions resources/assets/sass/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ $border-color: #dfdfdf;
box-shadow: inset 0 3px 0 0 #ed6347, inset 0 0 0 0 transparent, 0 0 0 1px rgba(63,63,68,.05), 0 1px 3px 0 rgba(63,63,68,.15);
}

.form-information-message {
border-top: 1px solid #46C1BF;
background-color: #E0F5F5;
box-shadow: inset 0 3px 0 0 #47c1bf, inset 0 0 0 0 transparent, 0 0 0 1px rgba(63,63,68,.05), 0 1px 3px 0 rgba(63,63,68,.15);

svg {
width: 20px;
fill: #00848e;
color: #fff;
}
}

// Utilities
.border-bottom {
border-bottom: 1px solid $border-color;
Expand Down
5 changes: 4 additions & 1 deletion resources/views/people/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@
{{-- Birthdate --}}
<div class="pa4-ns ph3 pv2 bb b--gray-monica">
<div class="mb3 mb0-ns">
<form-specialdate></form-specialdate>
<form-specialdate
v-bind:months="{{ $months }}"
v-bind:days="{{ $days }}"
></form-specialdate>
</div>
</div>

Expand Down