diff --git a/Dockerfile b/Dockerfile index 0764b62..e3a2b8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ file \ gettext \ git \ + unrar-free \ + p7zip-full \ && rm -rf /var/lib/apt/lists/* RUN set -eux; \ diff --git a/assets/controllers/import_match_controller.js b/assets/controllers/import_match_controller.js new file mode 100644 index 0000000..e53d91d --- /dev/null +++ b/assets/controllers/import_match_controller.js @@ -0,0 +1,51 @@ +import { Controller } from '@hotwired/stimulus'; + +export default class extends Controller { + static targets = ["checkbox", "modal", "modalContent"] + + toggleAllCheckboxes(event) { + this.checkboxTargets.forEach(checkbox => { + checkbox.checked = event.target.checked; + }); + } + + updateMangaInfo(event) { + const select = event.target; + const selectedOption = select.options[select.selectedIndex]; + const mangaInfo = JSON.parse(selectedOption.dataset.mangaInfo); + } + + showDetails(event) { + const fileId = event.currentTarget.dataset.fileId; + const select = document.querySelector(`select[name="manga_slug[${fileId}]"]`); + const mangaInfo = JSON.parse(select.options[select.selectedIndex].dataset.mangaInfo); + + this.modalContentTarget.innerHTML = ` +
Author: ${mangaInfo.author || 'N/A'}
+Publication Year: ${mangaInfo.publicationYear || 'N/A'}
+Genres: ${mangaInfo.genres ? mangaInfo.genres.join(', ') : 'N/A'}
+Description: ${this.truncate(mangaInfo.description || 'N/A', 200)}
+