Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.2]tooltip, popover のマークアップを Bootstrap5 の標準に修正 #5465

Merged
merged 2 commits into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions codeception/_support/Page/Admin/NewsManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function 新規登録()

public function 一覧_編集($rowNum)
{
$this->tester->click(".c-contentsArea .list-group > li:nth-child(${rowNum}) a[title=編集]");
$this->tester->click(".c-contentsArea .list-group > li:nth-child(${rowNum}) a[data-bs-original-title=編集]");

return $this;
}
Expand All @@ -66,7 +66,7 @@ public function 一覧_下へ($rowNum)

public function 一覧_削除($rowNum)
{
$this->tester->click(".c-contentsArea .list-group > li:nth-child(${rowNum}) [title=削除] a");
$this->tester->click(".c-contentsArea .list-group > li:nth-child(${rowNum}) [data-bs-original-title=削除] a");

return $this;
}
Expand Down
4 changes: 2 additions & 2 deletions codeception/_support/Page/Admin/SystemMemberManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ public static function go($I)

public function 編集($name)
{
$this->tester->click("//*[@id='form1']//tr/td[1][contains(text(), '{$name}')]/parent::tr//*[@data-original-title='編集']");
$this->tester->click("//*[@id='form1']//tr/td[1][contains(text(), '{$name}')]/parent::tr//*[@data-bs-original-title='編集']");

return $this;
}

public function 削除($name)
{
$this->tester->click("//*[@id='form1']//tr/td[1][contains(text(), '{$name}')]/parent::tr//*[@data-original-title='削除']/a");
$this->tester->click("//*[@id='form1']//tr/td[1][contains(text(), '{$name}')]/parent::tr//*[@data-bs-original-title='削除']/a");
$this->tester->wait(1);
$this->tester->click('.modal .btn-ec-delete');

Expand Down
25 changes: 13 additions & 12 deletions html/template/admin/assets/js/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,26 @@ var mainNavArea = function() {
mainNavArea();

//Bootstrap ツールチップ
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl)
});

/** @deprecated プラグイン等の後方互換用 */
var toolTip = function() {
$(function() {
$('[data-tooltip="true"]').tooltip();
})
};

toolTip();

//popover ポップオーバー
// header
var popoverHeader = function() {
$(function() {
$('.c-headerBar__userMenu').popover({
container: 'body'
})
})
};
popoverHeader();
// all page
// popover ポップオーバー
var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
return new bootstrap.Popover(popoverTriggerEl)
});

/** @deprecated プラグイン等の後方互換用 */
var popoverAll = function() {
$(function() {
$('[data-toggle="popover"]').popover();
Expand Down
6 changes: 3 additions & 3 deletions src/Eccube/Resource/template/admin/Content/block.twig
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ file that was distributed with this source code.
<div class="row">
<div class="col-6 text-end">
<a href="{{ url('admin_content_block_edit', {id: Block.id}) }}"
class="btn btn-ec-actionIcon mr-3" data-tooltip="true"
data-placement="top" title="{{ 'admin.common.edit'|trans }}">
class="btn btn-ec-actionIcon mr-3" data-bs-toggle="tooltip"
data-bs-placement="top" title="{{ 'admin.common.edit'|trans }}">
<i class="fa fa-pencil fa-lg text-secondary"></i>
</a>
</div>
{% if Block.deletable %}
<div class="col-6">
<div class="d-inline-block mr-3" data-tooltip="true" data-placement="top" title="{{ 'admin.common.delete'|trans }}">
<div class="d-inline-block mr-3" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'admin.common.delete'|trans }}">
<a href="#" data-bs-toggle="modal" data-bs-target="#confirmModal-{{ Block.id }}" class="btn btn-ec-actionIcon">
<i class="fa fa-close fa-lg text-secondary"></i>
</a>
Expand Down
6 changes: 3 additions & 3 deletions src/Eccube/Resource/template/admin/Content/block_edit.twig
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ file that was distributed with this source code.
<div class="card-body">
<div class="row mb-2">
<div class="col-2">
<div class="d-inline-block" data-tooltip="true" data-placement="top" title="{{ 'tooltip.content.block_name'|trans }}">
<div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.content.block_name'|trans }}">
<span>{{ 'admin.content.block_name'|trans }}</span><i class="fa fa-question-circle fa-lg ml-1"></i>
</div>
<span class="badge bg-primary ml-1">{{ 'admin.common.required'|trans }}</span>
Expand All @@ -88,7 +88,7 @@ file that was distributed with this source code.
</div>
<div class="row mb-2">
<div class="col-2">
<div class="d-inline-block" data-tooltip="true" data-placement="top" title="{{ 'tooltip.content.block_file_name'|trans }}">
<div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.content.block_file_name'|trans }}">
<span>{{ 'admin.content.block_file_name'|trans }}</span><i class="fa fa-question-circle fa-lg ml-1"></i>
</div>
<span class="badge bg-primary ml-1">{{ 'admin.common.required'|trans }}</span>
Expand All @@ -107,7 +107,7 @@ file that was distributed with this source code.
</div>
<div class="row mb-2">
<div class="col-2">
<div class="d-inline-block" data-tooltip="true" data-placement="top" title="{{ 'tooltip.content.block_source_code'|trans }}">
<div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.content.block_source_code'|trans }}">
<span>{{ 'admin.content.block_source_code'|trans }}</span><i class="fa fa-question-circle fa-lg ml-1"></i>
</div>
<span class="badge bg-primary ml-1">{{ 'admin.common.required'|trans }}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Resource/template/admin/Content/css.twig
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<!-- コード -->
<div class="row mb-2">
<div class="col-2">
<div class="d-inline-block" data-tooltip="true" data-placement="top" title="{{ 'tooltip.content.css_source_code'|trans }}">
<div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.content.css_source_code'|trans }}">
<span>{{ 'admin.content.page_source_code'|trans }}</span><i class="fa fa-question-circle fa-lg ml-1"></i>
</div>
<span class="badge bg-primary ml-1">{{ 'admin.common.required'|trans }}</span>
Expand Down
12 changes: 6 additions & 6 deletions src/Eccube/Resource/template/admin/Content/file.twig
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ file that was distributed with this source code.
<div class="card-header"><span class="card-title">{{ 'admin.content.file.add_file__card_title'|trans }}</span></div>
<div class="card-body">
<div id="upload_box__file" class="row mb-2">
<div class="col-2" data-tooltip="true" data-placement="top" title="{{ 'tooltip.content.file.upload_file'|trans }}"><span>{{ 'admin.content.file.add_file'|trans }}</span><i class="fa fa-question-circle fa-lg ml-1"></i></div>
<div class="col-2" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.content.file.upload_file'|trans }}"><span>{{ 'admin.content.file.add_file'|trans }}</span><i class="fa fa-question-circle fa-lg ml-1"></i></div>
<div class="col mb-3">
<div class="mb-2">
{{ form_widget(form.file) }}{# TODO input type="file" の装飾 #}
Expand Down Expand Up @@ -206,7 +206,7 @@ file that was distributed with this source code.
<td class="align-middle pe-3">
<div class="text-end">
<div class="px-1 d-inline-block">
<div class="d-inline-block" data-tooltip="true" data-placement="top" title="{{ 'admin.common.delete'|trans }}">
<div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'admin.common.delete'|trans }}">
<a class="btn btn-ec-actionIcon action-delete {% if file.is_empty == false %}disabled{% endif %}"
data-bs-toggle="modal" data-bs-target="#confirmModal-{{ loop.index }}">
<i class="fa fa-close fa-lg text-secondary" aria-hidden="true"></i></a>
Expand Down Expand Up @@ -238,22 +238,22 @@ file that was distributed with this source code.
<td class="align-middle pe-3">
<div class="text-end">
<div class="px-1 d-inline-block">
<a class="btn btn-ec-actionIcon action-copy" data-tooltip="true" data-placement="top" title="{{ 'admin.common.copy_path'|trans }}">
<a class="btn btn-ec-actionIcon action-copy" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'admin.common.copy_path'|trans }}">
<i class="fas fa-copy fa-lg text-secondary" aria-hidden="true"></i>
</a>
</div>
<div class="px-1 d-inline-block">
<a href="{{ url('admin_content_file_view') }}?file={{ file.file_path|e('url') }}" target="_blank" class="btn btn-ec-actionIcon action-view" data-tooltip="true" data-placement="top" title="{{ 'admin.common.display'|trans }}">
<a href="{{ url('admin_content_file_view') }}?file={{ file.file_path|e('url') }}" target="_blank" class="btn btn-ec-actionIcon action-view" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'admin.common.display'|trans }}">
<i class="fa fa-eye fa-lg text-secondary" aria-hidden="true"></i>
</a>
</div>
<div class="px-1 d-inline-block">
<a href="{{ url('admin_content_file_download') }}?select_file={{ file.file_path|e('url') }}" class="btn btn-ec-actionIcon action-download" data-tooltip="true" data-placement="top" title="{{ 'admin.common.download'|trans }}">
<a href="{{ url('admin_content_file_download') }}?select_file={{ file.file_path|e('url') }}" class="btn btn-ec-actionIcon action-download" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'admin.common.download'|trans }}">
<i class="fa fa-cloud-download fa-lg text-secondary" aria-hidden="true"></i>
</a>
</div>
<div class="px-1 d-inline-block">
<div class="d-inline-block" data-tooltip="true" data-placement="top" title="{{ 'admin.common.delete'|trans }}">
<div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'admin.common.delete'|trans }}">
<a class="btn btn-ec-actionIcon action-delete" data-bs-toggle="modal" data-bs-target="#confirmModal-{{ loop.index }}">
<i class="fa fa-close fa-lg text-secondary" aria-hidden="true"></i>
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Resource/template/admin/Content/js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<!-- コード -->
<div class="row mb-2">
<div class="col-2">
<div class="d-inline-block" data-tooltip="true" data-placement="top" title="{{ 'tooltip.content.js_source_code'|trans }}">
<div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.content.js_source_code'|trans }}">
<span>{{ 'admin.content.page_source_code'|trans }}</span><i class="fa fa-question-circle fa-lg ml-1"></i>
</div>
<span class="badge bg-primary ml-1">{{ 'admin.common.required'|trans }}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Resource/template/admin/Content/layout.twig
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ file that was distributed with this source code.
<div class="card-header">
<div class="row">
<div class="col-8">
<div class="d-inline-block" data-tooltip="true" data-placement="top" title="{{ 'tooltip.content.layout_edit'|trans }}"><span class="card-title">{{ 'admin.content.layout_edit__card_title'|trans }}</span><i class="fa fa-question-circle fa-lg ml-1"></i></div>
<div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.content.layout_edit'|trans }}"><span class="card-title">{{ 'admin.content.layout_edit__card_title'|trans }}</span><i class="fa fa-question-circle fa-lg ml-1"></i></div>
</div>
<div class="col-4 text-end"><a data-bs-toggle="collapse" href="#layoutBlockEdit" aria-expanded="false" aria-controls="layoutBlockEdit"><i class="fa fa-angle-up fa-lg"></i></a></div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/Eccube/Resource/template/admin/Content/news.twig
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ file that was distributed with this source code.
<div class="col px-0 text-center">
<a class="btn btn-ec-actionIcon"
href="{{ url('admin_content_news_edit', {id: News.id}) }}"
data-bs-toggle="tooltip" data-placement="top"
data-bs-toggle="tooltip" data-bs-placement="top"
title="{{ 'admin.common.edit'|trans }}">
<i class="fa fa-pencil fa-lg text-secondary"></i>
</a>
</div>
<div class="col ps-0 text-center" data-bs-toggle="tooltip"
data-placement="top" title="{{ 'admin.common.delete'|trans }}">
data-bs-placement="top" title="{{ 'admin.common.delete'|trans }}">
<a class="btn btn-ec-actionIcon" data-bs-toggle="modal"
data-bs-target="#delete_{{ News.id }}">
<i class="fa fa-close fa-lg text-secondary"
Expand Down
4 changes: 2 additions & 2 deletions src/Eccube/Resource/template/admin/Content/news_edit.twig
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ file that was distributed with this source code.

<div class="row">
<div class="col-3">
<div class="d-inline-block" data-tooltip="true" data-placement="top" title="{{ 'tooltip.content.news.url'|trans }}">
<div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.content.news.url'|trans }}">
<span>{{ 'admin.content.news.url'|trans }}</span><i class="fa fa-question-circle fa-lg ml-1"></i>
</div>
</div>
Expand All @@ -74,7 +74,7 @@ file that was distributed with this source code.

<div class="row">
<div class="col-3">
<div class="d-inline-block" data-tooltip="true" data-placement="top" title="{{ 'tooltip.content.news.body'|trans }}">
<div class="d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.content.news.body'|trans }}">
<span>{{ 'admin.content.news.body'|trans }}</span><i class="fa fa-question-circle fa-lg ml-1"></i>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Resource/template/admin/Content/page.twig
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ file that was distributed with this source code.
<td class="align-middle pe-3">
<div class="row justify-content-end">
{% if Page.edit_type == constant('Eccube\\Entity\\Page::EDIT_TYPE_USER') %}
<div class="col-auto text-center" data-tooltip="true" data-placement="top" title="{{ 'admin.common.delete'|trans }}">
<div class="col-auto text-center" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'admin.common.delete'|trans }}">
<a class="btn btn-ec-actionIcon" data-bs-toggle="modal" data-bs-target="#delete_{{ Page.id }}">
<i class="fa fa-close fa-lg text-secondary" aria-hidden="true"></i>
</a>
Expand Down
Loading