Skip to content

Commit c181da0

Browse files
committed
guide editing & fixes
1 parent 2992657 commit c181da0

File tree

1 file changed

+24
-26
lines changed

1 file changed

+24
-26
lines changed

docs/guide/index.md

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Next, there are meta title and description sections:
121121
@section('meta_description', _p('pages.leads.meta_description', 'meta_description'))
122122
```
123123

124-
Here we can once more see how `_p()` helper localization function is used. The first argument is the file.key string, if we open newly created `resources/lang/en/pages.php` file it'll contain different translation strings:
124+
Here we can once more see how `_p()` helper localization function is used. The first argument is the `file.key` string, if we open newly created `resources/lang/en/pages.php` file it'll contain different translation strings:
125125

126126
```php
127127
<?php
@@ -136,27 +136,27 @@ return [
136136
];
137137
```
138138

139-
The second argument is a default value, which will be added to the localization file if key doesn't exist. Thus, by the time the interface build process is completed, you will have a complete base language file, ready for translation.
139+
The second argument is a default value, which will be added to the localization file if key doesn't exist. Thus, by the time the interface build process is completed, you'll have full base language file, ready for translation.
140140

141-
Further in the template we can see `create_button` section, which determines how "floating" action button looks like:
141+
Further, in the template, we can see `create_button` section, which determines how the "floating" action button looks and behaves like:
142142

143143
```html
144144
@section('create_button')
145145
<button class="frame__header-add" @click="AWES.emit('modal::leads.open')"><i class="icon icon-plus"></i></button>
146146
@endsection
147147
```
148148

149-
Next goes `group filter` component:
149+
For now, just ignore `@click` code, we'll explain it later. Next goes `group filter` component:
150150

151151
```php
152152
@filtergroup(['filter' => ['' => 'All', '1' => 'Public', '0' => 'Private'], 'variable' => 'is_public'])
153153
```
154154

155155
<img src="https://static.awes.io/docs/guide/02_filter_group_component.png" alt="Awes.io">
156156

157-
If we click on one of the filters, we'll see that it modifies `is_public` URL's parameter to respective value. Our component will track these changes and send server requests to get filtered data. We will return to this topic when we'll create additional filters ourselves.
157+
If we click on one of the filters, we'll see that it modifies `is_public` URL's parameter to respective value. Our component tracks these changes and sends server requests to get filtered data. We return to this topic later when will be creating additional filters ourselves.
158158

159-
After filters, we can see one more very useful component - context menu, which in this case, controls ordering our leads by their names.
159+
Moving on, we can see one more very useful component - `context menu`, which in this case, controls the ordering of our leads by their names.
160160

161161
```html
162162
<context-menu button-class="filter__slink" right>
@@ -168,7 +168,7 @@ After filters, we can see one more very useful component - context menu, which i
168168
</context-menu>
169169
```
170170

171-
Sorting is another topic we'll analyze in the future, when we'll build our custom filters based on repositories.
171+
Sorting is another topic we'll analyze in the future when we build our custom filters based on repositories.
172172

173173
Next is the button to open main filters panel, for now, it only displays one parameter, but we'll add more, later:
174174

@@ -190,9 +190,9 @@ Next is the button to open main filters panel, for now, it only displays one par
190190
</filter-wrapper>
191191
</slide-up-down>
192192
```
193-
<img src="https://static.awes.io/docs/guide/03_main_filters.png" alt="Awes.io">
193+
<img src="https://static.awes.io/docs/guide/03_main_filters.png" alt="Awes.io" class="mb-20">
194194

195-
Next, we see the usage of one of our most powerful component - Table Builder, which powers `@table` blade component for easy interactive tables set up:
195+
Further, we see the usage of one of our most powerful component - [Table Builder](https://github.com/awes-io/table-builder), which powers `@table` blade component for easy interactive tables set up:
196196

197197
```php
198198
@table([
@@ -205,7 +205,7 @@ Next, we see the usage of one of our most powerful component - Table Builder, wh
205205
...
206206
```
207207

208-
And the last one is the modal window with leads creation form:
208+
And the last one is the `modal window` with leads creation form:
209209

210210
```html
211211
<modal-window name="leads" class="modal_formbuilder" title="Create">
@@ -215,17 +215,15 @@ And the last one is the modal window with leads creation form:
215215
</modal-window>
216216
```
217217

218-
We'll inspect Modal Window and Form Builder components in greater detail later when we'll update our current project.
218+
We'll inspect `Modal Window` and [Form Builder](https://github.com/awes-io/form-builder) components later in greater detail when we update our current project.
219219

220220
# Let's build something new
221221

222222
We got a closer look at the general structure of a generated section. It's time to build something new and get into the platform's details.
223223

224224
## Improving existing filters
225225

226-
Let's go back to our group filter and update it to display leads with different statuses.
227-
228-
Firstly we need to create new migration and add the `status` column to our `leads` table:
226+
Let's go back to our group filter and update it to display leads with different statuses. Firstly we need to create new migration and add the `status` column to our `leads` table:
229227

230228
```php
231229
// database/migrations/XXXX_XX_XX_XXXXXX_add_status_to_leads_table.php
@@ -235,24 +233,22 @@ Schema::table('leads', function (Blueprint $table) {
235233
});
236234
...
237235
```
238-
After migrating, let's add directly to database table couple records with statuses `new` and `closed`:
236+
After migrating, let's add a couple of records with statuses `new` and `closed`, directly to a database table:
239237

240-
<img src="https://static.awes.io/docs/guide/04_leads_with_statuses.png" alt="Awes.io">
238+
<img src="https://static.awes.io/docs/guide/04_leads_with_statuses.png" class="mb-20" alt="Awes.io">
241239

242-
Now if we refresh `/leads` page, we'll see that we need to add a new column to the table in order to see which status lead currently has:
240+
Now if we refresh `/leads` page, we'll discover that we also need to add a new column to the UI table in order to see which status each record currently have:
243241

244242
<img src="https://static.awes.io/docs/guide/05_leads_without_statuses_table.png" alt="Awes.io">
245243

246-
It's time to slightly dive into `table-builder` package functionality. Firstly let's add new `status` column:
244+
It's time to slightly dive into `table-builder` component's functionality. Firstly let's add a new `status` column:
247245

248246
```html
249247
<tb-column name="name" label="{{ _p('pages.leads.table.col.name', 'Name') }}"></tb-column>
250248
<tb-column name="status" label="{{ _p('pages.leads.table.col.status', 'Status') }}"></tb-column>
251249
```
252250

253-
As you can see, we added a new `tb-column` tag. `Name` parameter is a key in the data object, which is just our `status` column name. And we're passing new language string to a label property, as we discussed earlier.
254-
255-
Now if we refresh lead's page, we'll see their statuses:
251+
As you can see, we added a new `tb-column` tag. `Name` parameter is a key in the data object, which is just our `status` field name. And we're also passing new language string to a `label` property, as we've discussed earlier. Now if we refresh lead's page, we'll see their statuses:
256252

257253
<img src="https://static.awes.io/docs/guide/06_leads_with_statuses_table.png" alt="Awes.io">
258254

@@ -269,11 +265,13 @@ Normally we'd have to implement some filtering logic, but thanks to `awes-io/rep
269265
protected $searchable = ['status'];
270266
```
271267

272-
and add `status` to `@table`'s `scope_api_params` property (this will allow the component to track any changes in parameter value and handle them respectively):
268+
and add `status` to `@table`'s `scope_api_params` property (this will allow the component to track any changes in the parameter's value and handle them respectively):
273269

274270
```php
275-
// 'scope_api_params' => ['orderBy', 'is_public', 'name'],
276-
'scope_api_params' => ['orderBy', 'is_public', 'name', 'status'],
271+
@table([
272+
...
273+
// 'scope_api_params' => ['orderBy', 'is_public', 'name'],
274+
'scope_api_params' => ['orderBy', 'is_public', 'name', 'status'],
277275
```
278276

279277
now if we click on filter option, request with `status` parameter will be sent to the server and `repository` package will filter data and return it for `table-builder` to render:
@@ -505,10 +503,10 @@ return [
505503

506504
That's all, now any validation errors will be displayed.
507505

508-
## Custom filters
506+
<!-- ## Custom filters -->
509507

510508
<!-- Building custom scope for searching in several fields. -->
511509

512-
## Notifications
510+
<!-- ## Notifications -->
513511

514512
<!-- success notification after new lead creation-->

0 commit comments

Comments
 (0)