|
11 | 11 | <link rel="icon" |
12 | 12 | href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>📦</text></svg>"> |
13 | 13 |
|
14 | | - <meta name="description" content="" /> |
| 14 | + <meta name="description" content="BlogPost & Twitter Bot" /> |
15 | 15 | <meta name="keywords" content="" /> |
16 | 16 | <title>{{title}} | TheCollector</title> |
17 | 17 | </head> |
|
22 | 22 | <div class="row"> |
23 | 23 | <div class="col-12"> |
24 | 24 | <div class="header__content"> |
25 | | - {% if user.is_authenticated %} |
26 | | - <a href="{% url 'logout' %}" class="header__login"><svg xmlns="http://www.w3.org/2000/svg" width="512" |
27 | | - height="512" viewBox="0 0 512 512"> |
28 | | - <path |
29 | | - d="M176,176V136a40,40,0,0,1,40-40H424a40,40,0,0,1,40,40V376a40,40,0,0,1-40,40H216a40,40,0,0,1-40-40V336" |
30 | | - style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px" /> |
31 | | - <polyline points="272 336 352 256 272 176" |
32 | | - style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px" /> |
33 | | - <line x1="48" y1="256" x2="336" y2="256" |
34 | | - style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px" /> |
35 | | - </svg><span>Logout</span></a> |
36 | | - {% else %} |
37 | | - <a href="{% url 'login' %}" class="header__login"><svg xmlns="http://www.w3.org/2000/svg" width="512" |
38 | | - height="512" viewBox="0 0 512 512"> |
39 | | - <path |
40 | | - d="M176,176V136a40,40,0,0,1,40-40H424a40,40,0,0,1,40,40V376a40,40,0,0,1-40,40H216a40,40,0,0,1-40-40V336" |
41 | | - style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px" /> |
42 | | - <polyline points="272 336 352 256 272 176" |
43 | | - style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px" /> |
44 | | - <line x1="48" y1="256" x2="336" y2="256" |
45 | | - style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px" /> |
46 | | - </svg><span>Login</span></a> |
47 | | - {% endif %} |
48 | | - <button href="#" class="header__color" id="swap"> |
| 25 | + <a href="{% url 'home' %}" class="header__logo"> |
| 26 | + <img src="{% static 'img/logo.png' %}" alt="" /> |
| 27 | + </a> |
| 28 | + <button href="#" class="header__color" id="switch" aria-label="switch-mode"> |
49 | 29 | <svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"> |
50 | 30 | <line x1="256" y1="48" x2="256" y2="96" |
51 | 31 | style="fill: none; stroke-linecap: round; stroke-miterlimit: 10; stroke-width: 32px" /> |
|
68 | 48 | </svg> |
69 | 49 | </button> |
70 | 50 | <nav class="header__nav"> |
71 | | - {% if user.is_authenticated %} |
72 | 51 | <a href="{% url 'home' %}">Home</a> |
| 52 | + {% if user.is_authenticated %} |
73 | 53 | <a href="{% url 'my_posts' %}">My Posts</a> |
74 | 54 | <a href="{% url 'profile' %}">My profile</a> |
75 | | - <a href="{% url 'about' %}">How to use</a> |
76 | 55 | {% else %} |
77 | | - <a href="{% url 'home' %}">Home</a> |
78 | 56 | <a href="{% url 'register' %}">Register</a> |
79 | | - <a href="{% url 'about' %}">How to use</a> |
80 | 57 | {% endif %} |
| 58 | + <a href="{% url 'about' %}">How to use</a> |
81 | 59 | </nav> |
82 | | - <a href="{% url 'home' %}" class="header__logo"> |
83 | | - <img src="{% static 'img/logo.png' %}" alt="" /> |
84 | | - </a> |
85 | | - <button class="header__menu" type="button"> |
| 60 | + {% if user.is_authenticated %} |
| 61 | + <a href="{% url 'logout' %}" class="header__login"><svg xmlns="http://www.w3.org/2000/svg" width="512" |
| 62 | + height="512" viewBox="0 0 512 512"> |
| 63 | + <path |
| 64 | + d="M176,176V136a40,40,0,0,1,40-40H424a40,40,0,0,1,40,40V376a40,40,0,0,1-40,40H216a40,40,0,0,1-40-40V336" |
| 65 | + style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px" /> |
| 66 | + <polyline points="272 336 352 256 272 176" |
| 67 | + style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px" /> |
| 68 | + <line x1="48" y1="256" x2="336" y2="256" |
| 69 | + style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px" /> |
| 70 | + </svg><span>Logout</span></a> |
| 71 | + {% else %} |
| 72 | + <a href="{% url 'login' %}" class="header__login"><svg xmlns="http://www.w3.org/2000/svg" width="512" |
| 73 | + height="512" viewBox="0 0 512 512"> |
| 74 | + <path |
| 75 | + d="M176,176V136a40,40,0,0,1,40-40H424a40,40,0,0,1,40,40V376a40,40,0,0,1-40,40H216a40,40,0,0,1-40-40V336" |
| 76 | + style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px" /> |
| 77 | + <polyline points="272 336 352 256 272 176" |
| 78 | + style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px" /> |
| 79 | + <line x1="48" y1="256" x2="336" y2="256" |
| 80 | + style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px" /> |
| 81 | + </svg><span>Login</span></a> |
| 82 | + {% endif %} |
| 83 | + <button class="header__menu" type="button" aria-label="header-menu"> |
86 | 84 | <span></span> |
87 | 85 | <span></span> |
88 | 86 | <span></span> |
|
100 | 98 | <div class="row"> |
101 | 99 | <div class="col-12"> |
102 | 100 | <div class="footer__content"> |
103 | | - <small class="footer__copyright"></small> |
104 | | - |
105 | 101 | <a href="#" class="footer__logo"> |
106 | 102 | <img src="{% static 'img/logo.png' %}" alt="" /> |
107 | 103 | </a> |
| 104 | + <small class="footer__copyright"></small> |
108 | 105 | </div> |
109 | 106 | </div> |
110 | 107 | </div> |
|
148 | 145 | }; |
149 | 146 |
|
150 | 147 | socket.onmessage = function recieve(message) { |
151 | | - |
| 148 | + |
152 | 149 | const data = JSON.parse(message.data); |
153 | 150 | const post = data.event |
154 | 151 | console.log(post) |
|
0 commit comments