5
+<div class="breadcrumbs">
6
+<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
7
+&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
8
+&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a>
9
+&rsaquo; <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
10
+&rsaquo; {% translate 'History' %}
11
+</div>
12
+{% endblock %}
13
+
14
+{% block content %}
15
+<div id="content-main">
16
+<div class="module">
17
+
18
+{% if action_list %}
19
+    <table id="change-history">
20
+        <thead>
21
+        <tr>
22
+            <th scope="col">{% translate 'Date/time' %}</th>
23
+            <th scope="col">{% translate 'User' %}</th>
24
+            <th scope="col">{% translate 'Action' %}</th>
25
+        </tr>
26
+        </thead>
27
+        <tbody>
28
+        {% for action in action_list %}
29
+        <tr>
30
+            <th scope="row">{{ action.action_time|date:"DATETIME_FORMAT" }}</th>
31
+            <td>{{ action.user.get_username }}{% if action.user.get_full_name %} ({{ action.user.get_full_name }}){% endif %}</td>
32
+            <td>{{ action.get_change_message }}</td>
33
+        </tr>
34
+        {% endfor %}
35
+        </tbody>
36
+    </table>
37
+{% else %}
38
+    <p>{% translate 'This object doesn’t have a change history. It probably wasn’t added via this admin site.' %}</p>
39
+{% endif %}
40
+</div>
41
+</div>
42
+{% endblock %}

+ 12 - 0
app/templates/admin/pagination.html

@@ -0,0 +1,12 @@
1
+{% load admin_list %}
2
+{% load i18n %}
3
+<p class="paginator">
4
+{% if pagination_required %}
5
+{% for i in page_range %}
6
+    {% paginator_number cl i %}
7
+{% endfor %}
8
+{% endif %}
9
+{{ cl.result_count }} {% if cl.result_count == 1 %}{{ cl.opts.verbose_name }}{% else %}{{ cl.opts.verbose_name_plural }}{% endif %}
10
+{% if show_all_url %}<a href="{{ show_all_url }}" class="showall">{% translate 'Show all' %}</a>{% endif %}
11
+{% if cl.formset and cl.result_count %}<input type="submit" name="_save" class="default" value="{% translate 'Save' %}">{% endif %}
12
+</p>

+ 10 - 0
app/templates/admin/popup_response.html

@@ -0,0 +1,10 @@
1
+{% load i18n static %}<!DOCTYPE html>
2
+<html>
3
+  <head><title>{% translate 'Popup closing…' %}</title></head>
4
+  <body>
5
+    <script id="django-admin-popup-response-constants"
6
+            src="{% static "admin/js/popup_response.js" %}"
7
+            data-popup-response="{{ popup_response_data }}">
8
+    </script>
9
+  </body>
10
+</html>

+ 0 - 0
app/templates/admin/prepopulated_fields_js.html


部分文件因为文件数量过多而无法显示

load youtube api in page · 83c14ce5b7 - Gogs: Simplico Git Service
Explorar el Código

load youtube api in page

golf %!s(int64=3) %!d(string=hace) años
padre
commit
83c14ce5b7

+ 1 - 7
src/app/news/news.page.ts

@@ -10,8 +10,6 @@ import { map } from 'rxjs/operators';
10 10
 })
11 11
 export class NewsPage implements OnInit {
12 12
 
13
-  // newsdata: any;
14
-  // data: Observable;
15 13
   newsdata: any = [];
16 14
 
17 15
   constructor(private wpgetdataService: WpdataService) { }
@@ -22,13 +20,9 @@ export class NewsPage implements OnInit {
22 20
 
23 21
 
24 22
   ionViewWillEnter() {
25
-    // this.wpgetdataService.getAllNews().subscribe((data => {
26
-    //   console.log("get News:");
27
-    //   console.log(data);
28
-    //   this.newsdata = JSON.parse(data.data);
29 23
     this.wpgetdataService.getAllNews().subscribe((data) => {
30 24
       this.newsdata = data;
31
-      console.log('load Lineup Data');
25
+      console.log('load News Data');
32 26
       console.log(this.newsdata);
33 27
       });
34 28
   }

+ 17 - 40
src/app/youtube/youtube.page.html

@@ -9,7 +9,6 @@
9 9
   </ion-toolbar>
10 10
 </ion-header>
11 11
 <ion-content>
12
-  <img src="../../../assets/img-static/banner-320x50.jpeg" alt="">
13 12
   <ion-grid>
14 13
     <ion-row>
15 14
       <ion-col>
@@ -17,50 +16,28 @@
17 16
         <hr>
18 17
       </ion-col>
19 18
     </ion-row>
19
+  </ion-grid>
20
+  <ion-grid>
20 21
     <ion-row>
21
-      <ion-col size="5">
22
-        <img src="../../assets/img-static/mqdefault-1.jpg">
23
-      </ion-col>
24
-      <ion-col class="ion-align-self-center">Morning Talk [26-10-2022 l 07:30 - 09:00 น. ]</ion-col>
25
-    </ion-row>
26
-    <ion-row>
27
-      <ion-col size="5">
28
-        <img src="../../assets/img-static/mqdefault-2.jpg">
29
-      </ion-col>
30
-      <ion-col class="ion-align-self-center">Golf Trick [26-10-2022 l 09:00 - 10:00 น.]</ion-col>
31
-    </ion-row>
32
-    <ion-row>
33
-      <ion-col size="5">
34
-        <img src="../../assets/img-static/mqdefault-3.jpg">
35
-      </ion-col>
36
-      <ion-col class="ion-align-self-center">เจาะสนามบอลไทย [ 20-10-2022 l 20:00 - 21:30 น. ]</ion-col>
37
-    </ion-row>
38
-    <ion-row>
39
-      <ion-col size="5">
40
-        <img src="../../assets/img-static/mqdefault-2.jpg">
41
-      </ion-col>
42
-      <ion-col class="ion-align-self-center">Golf Trick [26-10-2022 l 09:00 - 10:00 น.]</ion-col>
43
-    </ion-row>
44
-    <ion-row>
45
-      <ion-col size="5">
46
-        <img src="../../assets/img-static/mqdefault-3.jpg">
47
-      </ion-col>
48
-      <ion-col class="ion-align-self-center">เจาะสนามบอลไทย [ 20-10-2022 l 20:00 - 21:30 น. ]</ion-col>
49
-    </ion-row>
50
-    <ion-row>
51
-      <ion-col size="5">
52
-        <img src="../../assets/img-static/mqdefault-2.jpg">
53
-      </ion-col>
54
-      <ion-col class="ion-align-self-center">Golf Trick [26-10-2022 l 09:00 - 10:00 น.]</ion-col>
55
-    </ion-row>
56
-    <ion-row>
57
-      <ion-col size="5">
58
-        <img src="../../assets/img-static/mqdefault-3.jpg">
22
+      <ion-col class="ion-no-padding">
23
+        <img src="../../../assets/img-static/banner-320x50.jpeg" alt="">
59 24
       </ion-col>
60
-      <ion-col class="ion-align-self-center">เจาะสนามบอลไทย [ 20-10-2022 l 20:00 - 21:30 น. ]</ion-col>
61 25
     </ion-row>
62 26
   </ion-grid>
63 27
   <ion-grid>
28
+    <div *ngIf="ytdata">
29
+    <ion-card *ngFor="let yt of ytdata['items']" class="list-card-margin">
30
+      <img [src]="yt.snippet.thumbnails.high.url" [style.width]="'100%'" />
31
+      <ion-card-header>
32
+        <a [routerLink]="['' , ]">
33
+          <ion-card-title class="title-txt-1" [innerHTML]="yt.snippet.title"></ion-card-title>
34
+        </a>
35
+      </ion-card-header>
36
+      <ion-card-content text-justify [innerHTML]="yt.snippet.description" class="content-txt-1"></ion-card-content>
37
+    </ion-card>
38
+    </div>
39
+  </ion-grid>
40
+  <ion-grid>
64 41
     <img src="../../../assets/img-static/banner-320x100.jpeg" alt="">
65 42
   </ion-grid>
66 43
 </ion-content>

+ 26 - 0
src/app/youtube/youtube.page.scss

@@ -1,3 +1,29 @@
1 1
 ion-row {
2 2
     background-color: #fcfcfc !important;
3
+}
4
+
5
+.list-card-margin {
6
+    margin: 0 0 10px 0;
7
+}
8
+
9
+ion-card-header {
10
+    padding: 5px 10px;
11
+}
12
+
13
+.title-txt-1 {
14
+    font-family: Prompt Reg !important;
15
+    font-size: 1.3em;
16
+    line-height: 1.3em;
17
+    color: darkorange;
18
+}
19
+
20
+ion-card-content {
21
+    padding: 0px 10px 10px;
22
+}
23
+
24
+.content-txt-1 {
25
+    font-family: K2D !important;
26
+    font-size: 1em;
27
+    line-height: 1.3em;
28
+    color: darkslategray;
3 29
 }

+ 11 - 1
src/app/youtube/youtube.page.ts

@@ -1,4 +1,5 @@
1 1
 import { Component, OnInit } from '@angular/core';
2
+import { WpdataService } from '../services/wpdata.service';
2 3
 
3 4
 @Component({
4 5
   selector: 'app-youtube',
@@ -7,9 +8,18 @@ import { Component, OnInit } from '@angular/core';
7 8
 })
8 9
 export class YoutubePage implements OnInit {
9 10
 
10
-  constructor() { }
11
+  ytdata: any;
12
+
13
+  constructor(private wpgetdataService: WpdataService) { }
11 14
 
12 15
   ngOnInit() {
13 16
   }
14 17
 
18
+  ionViewWillEnter() {
19
+    this.wpgetdataService.getAllYoutube().subscribe((data) => {
20
+      this.ytdata = data;
21
+      console.log('load Youtube Data');
22
+      console.log(this.ytdata);
23
+    });
24
+  }
15 25
 }