Compare commits
2 commits
a7010dad53
...
63097ea17e
Author | SHA1 | Date | |
---|---|---|---|
63097ea17e | |||
53cb37897a |
5 changed files with 41 additions and 23 deletions
3
CHANGELOG
Normal file
3
CHANGELOG
Normal file
|
@ -0,0 +1,3 @@
|
|||
0.2.0
|
||||
|
||||
* Group e-mails by first character in the group creation/edition form.
|
|
@ -53,6 +53,12 @@ class CustomersGroupsController extends Controller {
|
|||
->pluck('emails')
|
||||
->flatten()
|
||||
->sortBy('email');
|
||||
// Group Emails by their first character.
|
||||
// This is used to display them in collapsible groups.
|
||||
$emails = $emails->mapToGroups(function ($email) {
|
||||
$first_character = substr($email->email, $offset = 0, $length = 1);
|
||||
return [ $first_character => $email ];
|
||||
});
|
||||
|
||||
return view('mmfcustomersgroups::groups/edit', [
|
||||
'mailboxes' => $mailboxes,
|
||||
|
|
|
@ -84,7 +84,14 @@
|
|||
</label>
|
||||
<div class="col-sm-6">
|
||||
<div class="multi-container">
|
||||
@foreach ( $emails as $email )
|
||||
@foreach ( $emails as $first_character => $emails_group )
|
||||
<details>
|
||||
<summary
|
||||
style="display: list-item; counter-increment: list-item 0; list-style: disclosure-closed inside; cursor: pointer;"
|
||||
>
|
||||
{{ $first_character }}…
|
||||
</summary>
|
||||
@foreach ( $emails_group as $email )
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label
|
||||
|
@ -106,6 +113,8 @@
|
|||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</details>
|
||||
@endforeach
|
||||
</div>
|
||||
{{-- @include('partials/field_error', ['field'=>'emails.*']) --}}
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "millions-missing-france/freescout-customers-groups",
|
||||
"description": "Freescout customers groups - Set groups of Freescout Customers for easier group emailing",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.0",
|
||||
"type": "library",
|
||||
"license": ["AGPL-3.0-only"],
|
||||
"authors": [
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "MMFCustomersGroups",
|
||||
"alias": "mmfcustomersgroups",
|
||||
"description": "Freescout customers groups - Set groups of Freescout Customers for easier group emailing",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.0",
|
||||
"detailsUrl": "",
|
||||
"author": "Millions Missing FRANCE",
|
||||
"authorUrl": "info@millionsmissing.fr",
|
||||
|
|
Loading…
Reference in a new issue