Skip to content

Commit

Permalink
Merge pull request #7651 from fjordllc/feature/rewrite-external-entri…
Browse files Browse the repository at this point in the history
…es-from-vue-to-html

みんなのブログを非Vue化(HTMLに変更)
  • Loading branch information
komagata authored Jun 7, 2024
2 parents d567790 + c02cdef commit 1bf80e9
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 165 deletions.
7 changes: 0 additions & 7 deletions app/controllers/api/external_entries_controller.rb

This file was deleted.

4 changes: 3 additions & 1 deletion app/controllers/external_entries_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

class ExternalEntriesController < ApplicationController
def index; end
def index
@external_entries = ExternalEntry.with_avatar.order(published_at: :desc).page(params[:page])
end
end
90 changes: 0 additions & 90 deletions app/javascript/components/external-entries.vue

This file was deleted.

55 changes: 0 additions & 55 deletions app/javascript/components/external-entry.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 @@ -60,7 +60,6 @@ import '../invitation-url-updater.js'

import VueMounter from '../VueMounter.js'
import Books from '../components/books.vue'
import ExternalEntries from '../components/external-entries.vue'
import Questions from '../components/questions.vue'
import WorriedUsers from '../components/worried-users.vue'
import UsersAnswers from '../components/users-answers.vue'
Expand All @@ -79,7 +78,6 @@ import '../stylesheets/application'

const mounter = new VueMounter()
mounter.addComponent(Books)
mounter.addComponent(ExternalEntries)
mounter.addComponent(Questions)
mounter.addComponent(WorriedUsers)
mounter.addComponent(UsersAnswers)
Expand Down
1 change: 1 addition & 0 deletions app/models/external_entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class ExternalEntry < ApplicationRecord
include ActionView::Helpers::AssetUrlHelper
include WithAvatar

belongs_to :user

Expand Down
6 changes: 0 additions & 6 deletions app/views/api/external_entries/_external_entry.json.jbuilder

This file was deleted.

2 changes: 0 additions & 2 deletions app/views/api/external_entries/index.json.jbuilder

This file was deleted.

7 changes: 7 additions & 0 deletions app/views/external_entries/_external_entries.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.page-main
.page-body
.container.is-md
= paginate(@external_entries)
.card-list.a-card
= render(@external_entries)
= paginate(@external_entries)
22 changes: 22 additions & 0 deletions app/views/external_entries/_external_entry.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.card-list-item
.card-list-item__inner
.card-list-item__user
= render('users/icon', user: external_entry.user, image_class: 'card-list-item__user-icon')
.card-list-item__rows
.card-list-item__row
.card-list-item-title
h2.card-list-item-title__title
= link_to external_entry.title, external_entry.url, rel: 'noopener', target: '_blank', class: 'card-list-item-title__link a-text-link'
.card-list-item__row
.card-list-item__summary
p
| #{external_entry.summary}
.card-list-item__row
.card-list-item-meta
.card-list-item-meta__items
.card-list-item-meta__item
time.a-meta
= l(external_entry.published_at)
.card-list-item__thumbnail
= link_to external_entry.url, class: 'card-list-item__thumbnail-inner', target: '_blank', rel: 'noopener' do
= image_tag(external_entry.thumbnail_url, class: 'card-list-item__thumbnail-image')
2 changes: 1 addition & 1 deletion app/views/external_entries/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ header.page-header
| ブログのフィード URL の登録
| をしてください。

div(data-vue="ExternalEntries")
= render('external_entries')
1 change: 0 additions & 1 deletion config/routes/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
resources :books, only: %i(index)
resources :courses, only: %i(index)
resources :footprints, only: %i(index)
resources :external_entries, only: %i(index)
resources :survey_question_listings, only: %i() do
resource :position, only: %i(update), controller: "survey_question_listings/position"
end
Expand Down

0 comments on commit 1bf80e9

Please sign in to comment.