-
-
Notifications
You must be signed in to change notification settings - Fork 8
[データベース] 各テンプレートで一時保存や公開前ラベルを初期表示画面(一覧画面)に表示 #2382
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
Open
akagane99
wants to merge
5
commits into
opensource-workshop:master
Choose a base branch
from
akagane99:connect-cms-ideas/issues/186
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5dc1295
refactor: データベース, ステータス表示+ボタンの共通部品化、及びdefaultテンプレート対応
akagane99 810e1b2
add: データベース, tableテンプレートのステータスラベル表示対応
akagane99 e8cc38d
add: データベース, design-table-dlテンプレートのステータスラベル表示対応
akagane99 b8fdae7
add: データベース, card_02テンプレートのステータスラベル表示対応
akagane99 58f76ad
change: データベーステンプレート, 不要な行末空白を削除
akagane99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
resources/views/plugins/user/databases/default/databases_include_status_and_button.blade.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| {{-- | ||
| * ステータス表示+ボタン | ||
| * | ||
| * @author 牟田口 満 <akagane99@gmail.com> | ||
| * @category データベース・プラグイン | ||
| * | ||
| * @param $use_button 承認ボタン・編集ボタンを使う | ||
| * @param $add_badge_class ラベルのクラス追加 | ||
| * @param $input データベースの1件のデータ | ||
| * | ||
| * // 暗黙で利用 | ||
| * @param $frame | ||
| * @param $frame_id | ||
| * @param $buckets | ||
| * @param $page | ||
| --}} | ||
| @php | ||
| // 承認ボタン・編集ボタンを使うかどうかのフラグ | ||
| $use_button = $use_button ?? 1; | ||
| // ラベルのクラス追加 | ||
| $add_badge_class = $add_badge_class ?? ''; | ||
| @endphp | ||
|
|
||
| @if ($input->status == 2) | ||
| @can('role_update_or_approval',[[$input, $frame->plugin_name, $buckets]]) | ||
| <span class="badge badge-warning {{$add_badge_class}}">承認待ち</span> | ||
| @endcan | ||
| @if ($use_button) | ||
| @can('posts.approval',[[$input, $frame->plugin_name, $buckets]]) | ||
| <form action="{{url('/')}}/plugin/databases/approval/{{$page->id}}/{{$frame_id}}/{{$input->id}}#frame-{{$frame_id}}" method="post" name="form_approval" class="d-inline"> | ||
| {{ csrf_field() }} | ||
| <button type="submit" class="btn btn-primary btn-sm" onclick="javascript:return confirm('承認します。\nよろしいですか?');"> | ||
| <i class="fas fa-check"></i> <span class="d-none d-sm-inline">承認</span> | ||
| </button> | ||
| </form> | ||
| @endcan | ||
| @endif | ||
| @endif | ||
| @can('role_update_or_approval',[[$input, $frame->plugin_name, $buckets]]) | ||
| @if (!empty($input->expires_at) && $input->expires_at <= Carbon::now()) | ||
| <span class="badge badge-secondary {{$add_badge_class}}">公開終了</span> | ||
| @endif | ||
|
|
||
| @if ($input->posted_at > Carbon::now()) | ||
| <span class="badge badge-info {{$add_badge_class}}">公開前</span> | ||
| @endif | ||
| @endcan | ||
| @can('posts.update',[[$input, $frame->plugin_name, $buckets]]) | ||
| @if ($input->status == 1) | ||
| <span class="badge badge-warning {{$add_badge_class}}">一時保存</span> | ||
| @endif | ||
|
|
||
| @if ($use_button) | ||
| <button type="button" class="btn btn-success btn-sm ml-2" onclick="location.href='{{url('/')}}/plugin/databases/input/{{$page->id}}/{{$frame_id}}/{{$input->id}}#frame-{{$frame_id}}'"> | ||
| <i class="far fa-edit"></i> 編集 | ||
| </button> | ||
| @endif | ||
| @endcan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,6 +62,11 @@ | |
| <td class="{{$column->classname}}"> | ||
| <a href="{{url('/')}}/plugin/databases/detail/{{$page->id}}/{{$frame_id}}/{{$input->id}}#frame-{{$frame_id}}"> | ||
| @include('plugins.user.databases.default.databases_include_value') | ||
|
|
||
| {{-- ステータス表示のみ --}} | ||
| @include('plugins.user.databases.default.databases_include_status_and_button', [ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (意図通りかの確認コメントです) |
||
| 'use_button' => 0, | ||
| ]) | ||
| </a> | ||
| </td> | ||
| @php | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(意図通りかの確認コメントです)
実用上は大きな問題にはならないのですが、バッジの役目が「ステータス表示」と「詳細ページへのナビリンク」の2役になっています。
正味の役割としては「ステータス表示」だけかと思うので、バッジをクリッカブルな要素にすると「クリックして何かが起きる要素なのか?」とユーザによっては期待と実際の挙動にギャップが生じる可能性があるのかなと思いました。
※実用上は実害がない箇所なので、このまま通すことも可能です。