Skip to content

Commit

Permalink
IBX-9169: Applied review remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
barw4 committed Nov 18, 2024
1 parent da6cdac commit 20713de
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 16 deletions.
14 changes: 12 additions & 2 deletions src/bundle/Resources/translations/ibexa_trash.en.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
</header>
<body>
<trans-unit id="b789ae7144d8f3797cb4947abe0f9c9b133f9127" resname="search.creator_input.label">
<source>Creator</source>
<target state="new">Creator</target>
<note>key: search.creator_input.label</note>
</trans-unit>
<trans-unit id="3d9f547776de4846ff54fcd1cd173ac5937e5a46" resname="search.creator_input.placeholder">
<source>Search by creator</source>
<target state="new">Search by creator</target>
<source>Type creator's name</source>
<target state="new">Type creator's name</target>
<note>key: search.creator_input.placeholder</note>
</trans-unit>
<trans-unit id="6aa460340bed42d0d1baf9d1ea542c83a3f00821" resname="trash">
Expand All @@ -26,6 +31,11 @@
<target state="new">Restore in a new location</target>
<note>key: trash.button.restore_new_location</note>
</trans-unit>
<trans-unit id="e6c422268f3d22d619c37604653c3761711e9cab" resname="trash.content_not_found">
<source>Sorry, there are no contents for your search.</source>
<target state="new">Sorry, there are no contents for your search.</target>
<note>key: trash.content_not_found</note>
</trans-unit>
<trans-unit id="a644965219fc4d129dd4a5ef1cdb6eb073003702" resname="trash.content_type">
<source>Content type</source>
<target state="new">Content type</target>
Expand Down
36 changes: 22 additions & 14 deletions src/bundle/Resources/views/themes/admin/trash/list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,24 @@
{% endblock %}

{% block content %}
{% set trash_search_params = app.request.get('trash_search') %}
{% set trash_search_params = app.request.get('trash_search') %}
{% set creator = form_search.vars.data ? form_search.vars.data.creator : '' %}
{% set creator_exists = creator is not empty %}

{% set creatorSearch %}
<div class="form-group">
<label class="ibexa-label form-label" for="trash_search_content_type">
{{ 'search.creator_input.placeholder' | trans | desc('Search by creator') }}
{{ 'search.creator_input.label' | trans | desc('Creator') }}
</label>
<div class="ibexa-trash-search-form__item ibexa-trash-search-form__item--creator">
<div class="ibexa-trash-search-form__input-wrapper">
<input
type="text"
class="form-control ibexa-input ibexa-input--text ibexa-trash-search-form__input"
data-content-type-identifiers="{{ user_content_type_identifier | join(',') }}"
value="{{ creator_exists ? ibexa_content_name(creator) : '' }}"
{{ creator_exists ? 'disabled' : '' }}
type="text"
class="form-control ibexa-input ibexa-input--text ibexa-trash-search-form__input"
data-content-type-identifiers="{{ user_content_type_identifier | join(',') }}"
value="{{ creator_exists ? ibexa_content_name(creator) : '' }}"
placeholder="{{ 'search.creator_input.placeholder' | trans | desc('Type creator\'s name') }}"
{{ creator_exists ? 'disabled' : '' }}
>
<button class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--no-text ibexa-btn--reset-creator">
<svg class="ibexa-icon ibexa-icon--tiny-small ibexa-icon--reset">
Expand Down Expand Up @@ -73,6 +74,7 @@
{% endif %}

{% embed '@ibexadesign/ui/component/adaptive_filters/adaptive_filters.html.twig' with {
filters_id: 'ibexa_trash_list',
form: form_search,
is_inside_container: true,
collapsible_items: collapsible_items,
Expand All @@ -83,12 +85,15 @@
{% trans_default_domain 'ibexa_trash' %}

{% block static_left_input %}
{{ form_widget(form_search.content_name) }}
{{ form_widget(form_search.content_name, {
has_search: true,
should_clear_button_send_form: true
})
}}
{{ form_widget(form_search.creator, {'attr': {'hidden': 'hidden'}}) }}
{{ form_widget(form_search.sort, {'attr': {'hidden': 'hidden'}}) }}
{{ form_widget(form_search.trashed_interval, {'attr': {'hidden': 'hidden'}}) }}
{% endblock %}
{% block actions %}{% endblock %}
{% endembed %}

{{ form_start(form_trash_item_restore, {
Expand Down Expand Up @@ -246,18 +251,21 @@
]) %}

{% set has_search_params = trash_search_params|length > 0
? trash_search_params.creator is defined
or trash_search_params.content_type is defined
or trash_search_params.trashed is defined
or trash_search_params.section is defined
? trash_search_params.creator is not empty
or trash_search_params.content_type is not empty
or trash_search_params.trashed is not empty
or trash_search_params.section is not empty
or trash_search_params.content_name is not empty
: false
%}

{% embed '@ibexadesign/ui/component/table/table.html.twig' with {
headline: custom_results_headline ?? results_headline(pager.getNbResults(), has_search_params),
head_cols,
body_rows,
empty_table_info_text: 'trash.empty'|trans|desc('Trash is empty. Content you send to Trash will show up here.'),
empty_table_info_text: has_search_params
? 'trash.content_not_found'|trans|desc('Sorry, there are no contents for your search.')
: 'trash.empty'|trans|desc('Trash is empty. Content you send to Trash will show up here.'),
} %}
{% set modal_create_data_target = 'create-wildcards-modal' %}
{% set modal_delete_data_target = 'delete-wildcards-modal' %}
Expand Down

0 comments on commit 20713de

Please sign in to comment.