Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add reordering functionality for events, media, and opportunities in frontend#9

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Copilot wants to merge2 commits intoweb-deploy
base:web-deploy
Choose a base branch
Loading
fromcopilot/fix-898511bb-8f9b-471b-b4e6-ab8ead211c0f
Draft
Changes fromall 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
57 changes: 57 additions & 0 deletionsfrontend/index.html
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -104,6 +104,25 @@
margin-top: 10px;
}

.reorder-buttons {
display: flex;
gap: 10px;
margin-top: 10px;
}

.move-up-btn,
.move-down-btn {
background-color: #888;
color: white;
padding: 6px 12px;
flex: 1;
}

.move-up-btn:hover,
.move-down-btn:hover {
background-color: #666;
}

#generate-btn {
background-color: #4caf50;
color: white;
Expand DownExpand Up@@ -261,6 +280,35 @@ <h2 style="margin-top: 20px; text-align: center">
return deleteBtn;
}

function createReorderButtons(container, card) {
const buttonContainer = document.createElement("div");
buttonContainer.className = "reorder-buttons";

const moveUpBtn = document.createElement("button");
moveUpBtn.className = "move-up-btn";
moveUpBtn.textContent = "Move Up ↑";
moveUpBtn.addEventListener("click", function () {
const previousCard = card.previousElementSibling;
if (previousCard) {
container.insertBefore(card, previousCard);
}
});

const moveDownBtn = document.createElement("button");
moveDownBtn.className = "move-down-btn";
moveDownBtn.textContent = "Move Down ↓";
moveDownBtn.addEventListener("click", function () {
const nextCard = card.nextElementSibling;
if (nextCard) {
container.insertBefore(nextCard, card);
}
});

buttonContainer.appendChild(moveUpBtn);
buttonContainer.appendChild(moveDownBtn);
return buttonContainer;
}

function addEventForm() {
const card = createFormCard();

Expand DownExpand Up@@ -298,6 +346,9 @@ <h2 style="margin-top: 20px; text-align: center">
descInput.className = "event-desc";
card.appendChild(descGroup);

const reorderButtons = createReorderButtons(eventsContainer, card);
card.appendChild(reorderButtons);

const deleteBtn = createDeleteButton(eventsContainer, card);
card.appendChild(deleteBtn);

Expand DownExpand Up@@ -331,6 +382,9 @@ <h2 style="margin-top: 20px; text-align: center">
descInput.className = "article-desc";
card.appendChild(descGroup);

const reorderButtons = createReorderButtons(articlesContainer, card);
card.appendChild(reorderButtons);

const deleteBtn = createDeleteButton(articlesContainer, card);
card.appendChild(deleteBtn);

Expand All@@ -354,6 +408,9 @@ <h2 style="margin-top: 20px; text-align: center">
descInput.className = "opportunity-desc";
card.appendChild(descGroup);

const reorderButtons = createReorderButtons(opportunitiesContainer, card);
card.appendChild(reorderButtons);

const deleteBtn = createDeleteButton(opportunitiesContainer, card);
card.appendChild(deleteBtn);

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp