Skip to content

Commit e5c255d

Browse files
authored
Update wiki.html
1 parent e3617f2 commit e5c255d

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/wiki.html

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,16 @@
117117
color: #777;
118118
}
119119

120-
.edit, .delete {
120+
/* Flexbox for Edit and Delete buttons */
121+
.button-container {
122+
display: flex;
123+
gap: 10px;
121124
position: absolute;
122125
top: 10px;
126+
right: 10px;
127+
}
128+
129+
.edit, .delete {
123130
padding: 8px 15px;
124131
border-radius: 5px;
125132
font-size: 1rem;
@@ -130,7 +137,6 @@
130137
.edit {
131138
background-color: #ffcc00;
132139
color: white;
133-
right: 60px;
134140
}
135141

136142
.edit:hover {
@@ -140,7 +146,6 @@
140146
.delete {
141147
background-color: #ff4d4d;
142148
color: white;
143-
right: 10px;
144149
}
145150

146151
.delete:hover {
@@ -215,16 +220,18 @@ <h2>Wikis</h2>
215220
<h3>${wiki.title}</h3>
216221
<p>${wiki.content}</p>
217222
<small>Owner: ${wiki.owner}</small>
218-
${isOwnerOrAdmin(wiki.owner) ? `<button class="edit" onclick="editWiki(${wiki.id}, '${wiki.title}', '${wiki.content}')">Edit</button>` : ''}
219-
${isOwnerOrAdmin(wiki.owner) ? `<button class="delete" onclick="deleteWiki(${wiki.id})">Delete</button>` : ''}
223+
<div class="button-container">
224+
${isOwnerOrAdmin(wiki.owner) ? `<button class="edit" onclick="editWiki(${wiki.id}, '${wiki.title}', '${wiki.content}')">Edit</button>` : ''}
225+
${isOwnerOrAdmin(wiki.owner) ? `<button class="delete" onclick="deleteWiki(${wiki.id})">Delete</button>` : ''}
226+
</div>
220227
`;
221228
wikiList.appendChild(li);
222229
});
223230
};
224231

225232
// Check if user is the owner or admin
226233
const isOwnerOrAdmin = (owner) => {
227-
return owner === username || username === "kRxZy_kRxZy" || username === "MyScratchedAccount" || username === "mcgdj";
234+
return owner === username || username === "krxzy_krxzy" || username === "myscratchedaccount" || username === "mcgdj";
228235
};
229236

230237
// Create a new wiki

0 commit comments

Comments
 (0)