Skip to content

Commit 61a67fa

Browse files
committed
update
1 parent 45d3dd2 commit 61a67fa

File tree

11 files changed

+86
-48
lines changed

11 files changed

+86
-48
lines changed

Gemfile.lock

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ GEM
1010
em-websocket (0.5.3)
1111
eventmachine (>= 0.12.9)
1212
http_parser.rb (~> 0)
13-
eventmachine (1.2.7)
1413
eventmachine (1.2.7-x64-mingw32)
1514
ffi (1.17.1-x64-mingw32)
16-
ffi (1.17.1-x64-unknown)
1715
forwardable-extended (2.6.0)
18-
google-protobuf (3.25.6)
16+
google-protobuf (3.25.6-x64-mingw32)
1917
http_parser.rb (0.8.0)
2018
i18n (1.14.7)
2119
concurrent-ruby (~> 1.0)
@@ -64,8 +62,6 @@ GEM
6462
safe_yaml (1.0.5)
6563
sass-embedded (1.63.6-x64-mingw32)
6664
google-protobuf (~> 3.23)
67-
sass-embedded (1.63.6-x64-unknown)
68-
google-protobuf (~> 3.23)
6965
terminal-table (3.0.2)
7066
unicode-display_width (>= 1.1.1, < 3)
7167
unicode-display_width (2.6.0)
@@ -74,7 +70,6 @@ GEM
7470

7571
PLATFORMS
7672
x64-mingw32
77-
x64-unknown
7873

7974
DEPENDENCIES
8075
base64

_config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: "Daffa Blog"
33
description: "Deskripsi singkat tentang blog Anda."
44
baseurl: "" # Jika di root domain, biarkan kosong. Jika di subfolder, misal "/blog"
55
url: "https://daffadevhosting.github.io" # Ganti dengan URL situs Anda
6+
logo: /assets/images/jekyll-logo.png
67

78
# Informasi penulis (opsional)
89
author:
@@ -23,8 +24,8 @@ paginate_path: "/page:num/" # Format URL untuk paginasi
2324

2425
# Konfigurasi SASS/SCSS
2526
sass:
27+
sass_dir: assets/sass # Direktori SASS
2628
style: compressed # Bisa diganti ke expanded untuk debugging
27-
sass_dir: assets/_sass # Direktori SASS
2829

2930
# Exclude (file yang tidak di-render oleh Jekyll)
3031
exclude:

admin/dashboard/post/index.html

Lines changed: 53 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -37,43 +37,59 @@
3737
});
3838

3939
// Ambil daftar postingan
40-
async function fetchPosts() {
41-
const postList = document.getElementById("post-edit-list");
42-
postList.innerHTML = "";
43-
44-
const snapshot = await db.collection("posts").orderBy("timestamp", "desc").get();
45-
snapshot.forEach(doc => {
46-
const post = doc.data();
47-
const postId = doc.id;
48-
49-
const postItem = document.createElement("div");
50-
postItem.innerHTML = `
51-
<ion-card>
52-
<ion-card-header>
53-
<ion-card-title>${post.title}</ion-card-title>
54-
</ion-card-header>
55-
<ion-card-content>
56-
<ion-label class="ion-text-wrap">${post.content.substring(0, 40)}...</ion-label>
57-
</ion-card-content>
58-
<ion-footer>
59-
<ion-toolbar>
60-
<ion-buttons slot="start">
61-
<ion-button color="warning" onclick="editPost('${postId}')">
62-
<ion-icon slot="icon-only" name="create"></ion-icon>
63-
</ion-button>
64-
</ion-buttons>
65-
<ion-buttons slot="end">
66-
<ion-button color="danger" onclick="confirmDelete('${postId}')">
67-
<ion-icon slot="icon-only" name="trash"></ion-icon>
68-
</ion-button>
69-
</ion-buttons>
70-
</ion-toolbar>
71-
</ion-footer>
72-
</ion-card>
73-
`;
74-
postList.appendChild(postItem);
75-
});
76-
}
40+
async function fetchPosts() {
41+
const postList = document.getElementById("post-edit-list");
42+
postList.innerHTML = "";
43+
44+
const snapshot = await db.collection("posts").orderBy("timestamp", "desc").get();
45+
snapshot.forEach(doc => {
46+
const post = doc.data();
47+
const postId = doc.id;
48+
49+
const postItem = document.createElement("div");
50+
postItem.innerHTML = `
51+
<ion-card>
52+
<ion-card-header>
53+
<ion-card-title>${post.title}</ion-card-title>
54+
</ion-card-header>
55+
<ion-card-content>
56+
<ion-label class="ion-text-wrap">${post.content.substring(0, 40)}...</ion-label>
57+
</ion-card-content>
58+
<ion-footer>
59+
<ion-toolbar>
60+
<ion-buttons slot="start">
61+
<ion-button color="primary" class="edit-btn" data-id="${postId}">
62+
<ion-icon slot="icon-only" name="create"></ion-icon>
63+
</ion-button>
64+
</ion-buttons>
65+
<ion-buttons slot="end">
66+
<ion-button color="danger" class="delete-btn" data-id="${postId}">
67+
<ion-icon slot="icon-only" name="trash"></ion-icon>
68+
</ion-button>
69+
</ion-buttons>
70+
</ion-toolbar>
71+
</ion-footer>
72+
</ion-card>
73+
`;
74+
postList.appendChild(postItem);
75+
});
76+
77+
// Tambahkan event listener setelah elemen dimuat
78+
document.querySelectorAll(".edit-btn").forEach(button => {
79+
button.addEventListener("click", event => {
80+
const postId = event.target.closest("ion-button").dataset.id;
81+
editPost(postId);
82+
});
83+
});
84+
85+
document.querySelectorAll(".delete-btn").forEach(button => {
86+
button.addEventListener("click", event => {
87+
const postId = event.target.closest("ion-button").dataset.id;
88+
confirmDelete(postId);
89+
});
90+
});
91+
}
92+
7793

7894
// Fungsi konfirmasi hapus post dengan ion-alert
7995
async function confirmDelete(postId) {

admin/login/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
---
66

77
<div class="content">
8-
<ion-card>
9-
{% include iframe.html %}
8+
<ion-card class="flex_login">
9+
<div class="img_login">
10+
<img class="ion-padding" src="{{site.baseurl}}{{site.logo}}">
11+
</div>
1012
<ion-card-content>
1113
<form id="loginForm">
1214
<ion-list>

assets/css/main.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
---
33

4-
@use "./styles";
4+
@use "styles";

assets/images/.gitkeep

Whitespace-only changes.

assets/images/jekyll-logo.png

213 KB
Loading
File renamed without changes.
File renamed without changes.

assets/_sass/styles.scss renamed to assets/sass/styles.scss

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,28 @@
102102
justify-content: space-between;
103103
margin-top: 20px;
104104
padding: 0 20px;
105-
}
105+
}
106+
.center_parent {
107+
position: fixed;
108+
width: 450px;
109+
top: 50%;
110+
left: 50%;
111+
transform: translate(-50%, -50%);
112+
z-index: 1000;
113+
display: flex;
114+
align-items: center;
115+
justify-content: center;
116+
}
117+
.flex_login {
118+
display: flex;
119+
flex-wrap: nowrap;
120+
align-items: center;
121+
justify-content: center;
122+
@include responsive(mobile) {
123+
flex-wrap: wrap;
124+
}
125+
.img_login {
126+
max-width: 450px;
127+
width: fit-content;
128+
}
129+
}

0 commit comments

Comments
 (0)