From 07a05a8a5b5a45d6693c410b16bf5a7d0c54eb50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8B=AC=20=E5=90=8E=E8=97=A4?= <1823773980@qq.com> Date: Wed, 31 Jan 2024 11:12:08 +0800 Subject: [PATCH 1/5] feat: add notices to a new collection the new collection named todolist, and there are small changes about how the pages look like. --- src/routes/searchChannel.svelte | 3 +- src/routes/selectTags.svelte | 107 ++++++++++++++++++++++++----- src/routes/sendNotification.svelte | 45 +++++++++--- 3 files changed, 126 insertions(+), 29 deletions(-) diff --git a/src/routes/searchChannel.svelte b/src/routes/searchChannel.svelte index 035f7ed..8328a58 100644 --- a/src/routes/searchChannel.svelte +++ b/src/routes/searchChannel.svelte @@ -1,9 +1,10 @@

select tags

-

tags recommended:

-{#each records as record} -
-

#{record.tag}

-
-{/each} -
@@ -57,16 +91,33 @@ bind:value={setag} placeholder="An interesting tag" /> -
-
- +
+ +{#each records as record} +
+

#{record.tag}

+
+{/each} + {#each selectrecord as record} -
-

tittle: {record.tittle}

-

body: {record.body}

-

release_time: {record.release_time}

+ +{/each} + +{#each checktittle as check} +
+

{check.tittle}

+

{check.body}

+

{check.year}年{check.month}月{check.day}日

+
{/each} @@ -75,4 +126,26 @@ display: inline-block; padding: 10px; /* 内边距 */ } + + button { + background-color: #007bff; + color: white; + } + + .results-list { + list-style: none; + padding-left: 0; + } + + .results-list li { + margin-top: 10px; + padding: 10px; + background-color: #f8f9fa; + border-radius: 4px; + } + + .check { + background-color: #f8f9fa; + border-radius: 4px; + } diff --git a/src/routes/sendNotification.svelte b/src/routes/sendNotification.svelte index e2de588..c1e2c65 100644 --- a/src/routes/sendNotification.svelte +++ b/src/routes/sendNotification.svelte @@ -5,8 +5,10 @@ let tittle = ""; let body = ""; - let release_time = ""; let tag = ""; + let currentYear = new Date().getFullYear(); + let currentMonth = new Date().getMonth() + 1; //从0开始 + let currentDate = new Date().getDate(); const pb = new PocketBase(PocketBase_URL); function cancel() { @@ -18,8 +20,10 @@ const data = { tittle: tittle, body: body, - release_time: release_time, tag: tag, + year: currentYear, + month: currentMonth, + day: currentDate, }; try { await pb.collection("notices").create(data); @@ -28,6 +32,16 @@ alert("fail to post"); } } + + const years = Array.from({ length: currentYear - 1999 }, (_, i) => 2000 + i); + const months = Array.from({ length: 12 }, (_, i) => i + 1); + let days; + + $: days = getDaysInMonth(currentYear, currentMonth); + + function getDaysInMonth(year, month) { + return new Date(year, month, 0).getDate(); + }

发布你的第一条通知吧!

@@ -42,15 +56,6 @@
-
- - -
+
+ + + + +
From c330aadd0b659471ff8b5713ff053582ac46ddeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8B=AC=20=E5=90=8E=E8=97=A4?= <1823773980@qq.com> Date: Wed, 31 Jan 2024 11:24:41 +0800 Subject: [PATCH 2/5] feat: add notices to a new collection --- src/routes/selectTags.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/selectTags.svelte b/src/routes/selectTags.svelte index 36e8a0c..d5b6302 100644 --- a/src/routes/selectTags.svelte +++ b/src/routes/selectTags.svelte @@ -2,7 +2,6 @@ import { onMount } from "svelte"; import { PocketBase_URL } from "../utils/api/index"; import PocketBase from "pocketbase"; - import { push } from "svelte-spa-router"; const pb = new PocketBase(PocketBase_URL); let records = []; From 39df4e6b1a2f9926c9ce80089ca341f7d2e13aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8B=AC=20=E5=90=8E=E8=97=A4?= <1823773980@qq.com> Date: Mon, 4 Mar 2024 15:47:45 +0800 Subject: [PATCH 3/5] style: update npm and run format --- src/routes/searchChannel.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/searchChannel.svelte b/src/routes/searchChannel.svelte index 8328a58..467cdd0 100644 --- a/src/routes/searchChannel.svelte +++ b/src/routes/searchChannel.svelte @@ -3,7 +3,6 @@ import { push } from "svelte-spa-router"; import { PocketBase_URL } from "../utils/api/index"; - // 实例化 PocketBase const pb = new PocketBase(PocketBase_URL); let name = ""; // 绑定到输入框的变量,用于存储用户输入的频道名称 From 8d3ac456610219c868cec2c45a7164613893b45f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8B=AC=20=E5=90=8E=E8=97=A4?= <1823773980@qq.com> Date: Mon, 4 Mar 2024 15:54:54 +0800 Subject: [PATCH 4/5] style: run npm format again --- src/routes/searchChannel.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/searchChannel.svelte b/src/routes/searchChannel.svelte index 1cac83f..aa4daf2 100644 --- a/src/routes/searchChannel.svelte +++ b/src/routes/searchChannel.svelte @@ -4,7 +4,6 @@ import { PocketBase_URL } from "../utils/api/index"; import { currentUserEmail } from "../store.js"; - const pb = new PocketBase(PocketBase_URL); let channelNameInput = ""; // 用于存储用户输入的频道名称 From 12069ca84fbbea11ec7b040314dfb14f4521dfaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B7=AF=E5=B0=8F=E9=9B=A8?= <143722071+03130214@users.noreply.github.com> Date: Sun, 17 Mar 2024 18:56:44 +0800 Subject: [PATCH 5/5] feat: lead Profile to the mainpage (#74) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add a new page to search channels * Updated createchannel * feat: refine createchannel * feat: refine createchannel * feat: update searchChannel * refactor: refactor createChannel * feat: add useremail for a channel * feat: can choose the channels your created * refactor: Refactor the code * feat: Added channel deletion and modification * feat: lead Profile to the mainpage * feat: lead Profile to the mainpage --------- Co-authored-by: My Go! <118411001+Clear1oveE@users.noreply.github.com> --- src/components/Navbar.svelte | 2 +- src/router.js | 2 + src/routes/mainpage1.svelte | 135 +++++++++++++++++++++++++++++++++++ 3 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 src/routes/mainpage1.svelte diff --git a/src/components/Navbar.svelte b/src/components/Navbar.svelte index 7daaf0a..7f63e83 100644 --- a/src/components/Navbar.svelte +++ b/src/components/Navbar.svelte @@ -81,7 +81,7 @@ >{$username} -
  • Profile
  • +
  • Profile
  • Mychannels
  • Logout
  • diff --git a/src/router.js b/src/router.js index 55eb40f..e24ca71 100644 --- a/src/router.js +++ b/src/router.js @@ -1,5 +1,6 @@ import Login from "./routes/login.svelte"; import MainPage from "./routes/mainpage.svelte"; +import MainPage1 from "./routes/mainpage1.svelte"; import DoorPage from "./routes/doorPage.svelte"; import Register from "./routes/register.svelte"; import CreateChannel from "./routes/createChannel.svelte"; @@ -20,6 +21,7 @@ export default { "/": DoorPage, "/login": Login, "/main": MainPage, + "/main1": MainPage1, "/register": Register, "/createChannel": CreateChannel, "/checkInformation": CheckInformation, diff --git a/src/routes/mainpage1.svelte b/src/routes/mainpage1.svelte new file mode 100644 index 0000000..94563a8 --- /dev/null +++ b/src/routes/mainpage1.svelte @@ -0,0 +1,135 @@ + + + + +
    + +
    + User Profile +

    {$username}

    + +
    + + +
    + +
    +

    Channels

    +
    + {#each channels as channel} + + {/each} +
    +
    + + +
    +

    Todos

    +
    + {#each todos as todo} + + {/each} +
    +
    +
    +
    + +