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

mentor-practices.vueを非vue化 #7484

Merged
merged 5 commits into from
Mar 9, 2024
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: 3 additions & 1 deletion app/controllers/mentor/practices_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ class Mentor::PracticesController < ApplicationController
before_action :set_course, only: %i[new]
before_action :set_practice, only: %i[edit update]

def index; end
def index
@practices = Practice.preload(:categories, :products, :reports, :questions).order(:id)
end

def new
@practice = Practice.new
Expand Down
39 changes: 0 additions & 39 deletions app/javascript/components/mentor-practice-modal.vue

This file was deleted.

100 changes: 0 additions & 100 deletions app/javascript/components/mentor-practices.vue

This file was deleted.

2 changes: 0 additions & 2 deletions app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ import QuestionPage from '../components/question-page.vue'
import QuestionEdit from '../components/question-edit.vue'
import SadReports from '../components/sad_reports.vue'
import UserProducts from '../components/user-products.vue'
import MentorPractices from '../components/mentor-practices.vue'
import ActionCompletedButton from '../components/action-completed-button.vue'
import CourseBooks from '../components/course-books.vue'

Expand All @@ -103,7 +102,6 @@ mounter.addComponent(QuestionPage)
mounter.addComponent(QuestionEdit)
mounter.addComponent(SadReports)
mounter.addComponent(UserProducts)
mounter.addComponent(MentorPractices)
mounter.addComponent(ActionCompletedButton)
mounter.addComponent(CourseBooks)
mounter.mount()
Expand Down
45 changes: 45 additions & 0 deletions app/views/mentor/practices/_mentor_practices.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.admin-table.is-grab id='mentor-practices'
table.admin-table__table
thead.admin-table__header
tr.admin-table__labels
th.admin-table__label
| プラクティス
th.admin-table__label
| 所属カテゴリー
th.admin-table__label
| 提出物
th.admin-table__label
| 日報
th.admin-table__label
| Q&A
th.admin-table__label.actions
| 編集
tbody.admin-table__items
- practices.each do |practice|
tr.admin-table__item
td.admin-table__item-value
= link_to practice_path(practice)
= practice.title
td.admin-table__item-value.is-text-align-right
- practice.categories.each do |category|
p
= category.name
- if practice.submission
td.admin-table__item-value.is-text-align-right
= link_to practice_products_path(practice) do
= practice.products.size
- else
td.admin-table__item-value.is-text-align-center
span.admin-table__item-blank
| 不要
td.admin-table__item-value.is-text-align-right
= link_to practice_reports_path(practice) do
= practice.reports.size
td.admin-table__item-value.is-text-align-right
= link_to practice_questions_path(practice) do
= practice.questions.size
td.admin-table__item-value.is-text-align-center
ul.is-inline-buttons
li
= link_to edit_mentor_practice_path(practice), class: 'a-button is-sm is-secondary is-icon'
i.fa-solid.fa-pen
2 changes: 1 addition & 1 deletion app/views/mentor/practices/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ main.page-main
hr.a-border
.page-body
.container.is-lg
div(data-vue="MentorPractices")
= render 'mentor_practices', practices: @practices