-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into pdf_entry
- Loading branch information
Showing
70 changed files
with
1,098 additions
and
639 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -126,5 +126,7 @@ gem "rqrcode", "~> 2.0" | |
|
||
gem 'ulid' | ||
|
||
gem 'acts_as_list' | ||
|
||
# PDF tool | ||
gem 'ferrum' |
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
8 changes: 8 additions & 0 deletions
8
app/controllers/admin/qr_code_for_stamp_rallies_controller.rb
This file contains 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,8 @@ | ||
class Admin::QrCodeForStampRalliesController < ApplicationController | ||
include SecuredAdmin | ||
|
||
def show | ||
@stamp_rally_check_point = StampRallyCheckPoint.find(params[:id]) | ||
@qr_code_for_stamp_rally = QrCodeForStampRally.new(@stamp_rally_check_point, @conference) | ||
end | ||
end |
This file contains 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
33 changes: 33 additions & 0 deletions
33
app/controllers/admin/stamp_rally_configures_controller.rb
This file contains 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,33 @@ | ||
class Admin::StampRallyConfiguresController < ApplicationController | ||
include SecuredAdmin | ||
|
||
def create | ||
@stamp_rally_configure = StampRallyConfigure.new(stamp_rally_configure_params.merge(conference:)) | ||
if @stamp_rally_configure.save | ||
flash.now[:notice] = 'スタンプラリー設定を更新しました' | ||
else | ||
render(:new, status: :unprocessable_entity) | ||
end | ||
end | ||
|
||
def update | ||
@stamp_rally_configure = StampRallyConfigure.find(params[:id]) | ||
if @stamp_rally_configure.update(stamp_rally_configure_params) | ||
flash.now[:notice] = 'スタンプラリー設定を更新しました' | ||
else | ||
render(:edit, status: :unprocessable_entity) | ||
end | ||
end | ||
|
||
helper_method :turbo_stream_flash | ||
|
||
private | ||
|
||
def stamp_rally_configure_params | ||
params.require(:stamp_rally_configure).permit(:finish_threshold) | ||
end | ||
|
||
def turbo_stream_flash | ||
turbo_stream.append('flashes', partial: 'flash') | ||
end | ||
end |
This file contains 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 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 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 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 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,36 @@ | ||
import { Controller } from "@hotwired/stimulus"; | ||
import { Sortable } from "sortablejs"; | ||
|
||
export default class extends Controller { | ||
connect() { | ||
this.sortable = new Sortable(this.element, { | ||
animation: 150, | ||
onEnd: this.end.bind(this), | ||
}); | ||
} | ||
|
||
async end(event) { | ||
console.log("event: ", event); | ||
console.log("event.item: ", event.item); | ||
console.log("event.item.dataset: ", event.item.dataset); | ||
const id = event.item.dataset.id; | ||
const conferenceAbbr = event.item.dataset.conferenceAbbr; | ||
const newPosition = event.newIndex; | ||
console.log("event.newIndex: ", event.newIndex); | ||
|
||
try { | ||
const response = await fetch(`/${conferenceAbbr}/admin/stamp_rally_check_points/${id}/reorder`, { | ||
method: "PATCH", | ||
headers: { | ||
"Content-Type": "application/json", | ||
"X-CSRF-Token": document.querySelector("[name=csrf-token]").content, | ||
}, | ||
body: JSON.stringify({ position: newPosition }), | ||
}); | ||
|
||
if (!response.ok) throw new Error("Failed to reorder"); | ||
} catch (error) { | ||
console.error("Reordering failed", error); | ||
} | ||
} | ||
} |
This file contains 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 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 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,11 @@ | ||
.square-card { | ||
padding-top: 100%; | ||
position: relative; | ||
} | ||
.square-card .content { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
} |
This file contains 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 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
Oops, something went wrong.