From c6c6ddeb3e60aca8779ea28b9dc9c1e52b0460b9 Mon Sep 17 00:00:00 2001 From: Dhaverd Date: Mon, 3 Jun 2024 17:46:20 +0800 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B1=D0=B0=D1=86=D0=B0=D0=BB=20?= =?UTF-8?q?=D1=84=D0=B8=D1=87=D1=83=20=D1=81=20=D0=BE=D1=82=D0=B7=D1=8B?= =?UTF-8?q?=D0=B2=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/RatingController.php | 19 ++++ app/Models/Rating.php | 19 ++++ .../2024_06_03_081209_create_rating_table.php | 29 +++++ resources/css/app.css | 10 ++ resources/views/Schedule.vue | 23 +++- .../views/Schedule/AdditionalButtons.vue | 101 ++++++++++++++++++ resources/views/Schedule/Links.vue | 35 +----- resources/views/Schedule/ScheduleTable.vue | 5 +- routes/api_v1.php | 1 + 9 files changed, 206 insertions(+), 36 deletions(-) create mode 100644 app/Http/Controllers/RatingController.php create mode 100644 app/Models/Rating.php create mode 100644 database/migrations/2024_06_03_081209_create_rating_table.php create mode 100644 resources/views/Schedule/AdditionalButtons.vue diff --git a/app/Http/Controllers/RatingController.php b/app/Http/Controllers/RatingController.php new file mode 100644 index 0000000..779961a --- /dev/null +++ b/app/Http/Controllers/RatingController.php @@ -0,0 +1,19 @@ +rate = $request->rate; + $rating->comment = $request->comment; + $rating->save(); + return ['code' => $rating->save() ? 200 : 500]; + } +} diff --git a/app/Models/Rating.php b/app/Models/Rating.php new file mode 100644 index 0000000..1bd5cf1 --- /dev/null +++ b/app/Models/Rating.php @@ -0,0 +1,19 @@ +id(); + $table->integer('rate')->nullable(); + $table->text('comment')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('rating'); + } +}; diff --git a/resources/css/app.css b/resources/css/app.css index e69de29..4846a2a 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -0,0 +1,10 @@ +.box-gradient { + border: 10px solid transparent; + background: linear-gradient( + #ffffff, + #ffffff) padding-box, + linear-gradient(45deg, + #FF52E5, + #F6D242) border-box; + border-radius: 14px; +} diff --git a/resources/views/Schedule.vue b/resources/views/Schedule.vue index 2105671..a5d15af 100644 --- a/resources/views/Schedule.vue +++ b/resources/views/Schedule.vue @@ -3,37 +3,52 @@

Расписание стримов

{{ parseDate(dates[0].current_date) }} - {{ parseDate(dates[1].current_date) }}

- +

Ссылочки

- + + diff --git a/resources/views/Schedule/AdditionalButtons.vue b/resources/views/Schedule/AdditionalButtons.vue new file mode 100644 index 0000000..0c132fc --- /dev/null +++ b/resources/views/Schedule/AdditionalButtons.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/resources/views/Schedule/Links.vue b/resources/views/Schedule/Links.vue index e36f97b..a9616e2 100644 --- a/resources/views/Schedule/Links.vue +++ b/resources/views/Schedule/Links.vue @@ -7,28 +7,16 @@ data: () => ({ links: ref(), fetching: true, - scheduleStore: useScheduleStore(), - windowHeight: document.documentElement.clientHeight, - windowWidth: document.documentElement.clientWidth, - isWide: window.innerWidth >= 460 + scheduleStore: useScheduleStore() }), + props: { + isWide: Boolean + }, mounted() { this.scheduleStore.getLinks().then(()=>{ this.links = this.scheduleStore.links; this.fetching = false; }); - this.myEventHandler(); - window.addEventListener("resize", this.myEventHandler, { passive: true }); - }, - created() { - window.addEventListener("resize", this.myEventHandler); - }, - methods: { - myEventHandler(e) { - this.windowHeight = document.documentElement.clientHeight; - this.windowWidth = document.documentElement.clientWidth; - this.isWide = this.windowWidth >= 460; - } } } @@ -48,20 +36,5 @@ diff --git a/resources/views/Schedule/ScheduleTable.vue b/resources/views/Schedule/ScheduleTable.vue index 8799b09..d458a64 100644 --- a/resources/views/Schedule/ScheduleTable.vue +++ b/resources/views/Schedule/ScheduleTable.vue @@ -9,6 +9,9 @@ scheduleStore: useScheduleStore(), fetching: true }), + props: { + isWide: Boolean + }, methods: { parseDate(date){ let dateArr = date.split("-"); @@ -27,7 +30,7 @@