From 8434983d5ed8ae2e3480f1b95126f884fc8a9b72 Mon Sep 17 00:00:00 2001 From: anurag singh Date: Sat, 18 May 2024 16:31:44 +0530 Subject: [PATCH 1/2] updated landing page with cool ui --- .../core/__pycache__/views.cpython-312.pyc | Bin 5908 -> 6125 bytes newsaggregator/core/views.py | 5 + newsaggregator/db.sqlite3 | Bin 188416 -> 188416 bytes .../__pycache__/settings.cpython-312.pyc | Bin 3455 -> 3439 bytes newsaggregator/static/assets/css/userauth.css | 11 +- .../static/assets/images/sign-in-animate.svg | 1 + .../static/assets/images/sign-up-animate.svg | 1 + .../templates/components/navbar.html | 3 +- newsaggregator/templates/partials/base.html | 7 + .../templates/partials/base_auth.html | 26 ++- .../templates/userauths/sign-in.html | 106 ++++++------ .../templates/userauths/sign-up.html | 156 +++++++++--------- 12 files changed, 166 insertions(+), 150 deletions(-) create mode 100644 newsaggregator/static/assets/images/sign-in-animate.svg create mode 100644 newsaggregator/static/assets/images/sign-up-animate.svg diff --git a/newsaggregator/core/__pycache__/views.cpython-312.pyc b/newsaggregator/core/__pycache__/views.cpython-312.pyc index 2bcb8c26fa2d3e0f6b135de08787e48cd0ca613a..d9fa301aa8fd87441cc274ad0b448248426c31fd 100644 GIT binary patch delta 433 zcmbQD_g0_pG%qg~0}v>5dZd|%OyrYbiej9oaipG!A(c6WZw>!yMvyE6LyBMv!)geV zAxZ*6RtQN}5<^xPNmdF&Rs=~_8Y(M-uvio>y_ub{nTPSo=5F45jJ%0J#}rEgi3Wxb zESt;tmoTyMr{*SR=4{pwl4In_07-uXOFx+$B)pU>=|VvAg`%>nJmr%aMGo?|BWs_0 zUStAqAF{~i98pU~#`BYxiTT%mKShu4G%qg~0}%KSJ# jxWD`-J|#x;PacdcK$1rWNZ7D2T7TwYVYDo=1?m9+kjgt~ diff --git a/newsaggregator/core/views.py b/newsaggregator/core/views.py index 3ffcc4b..954ca5c 100644 --- a/newsaggregator/core/views.py +++ b/newsaggregator/core/views.py @@ -57,6 +57,7 @@ def news_list(request): "object_list": headlines,} return render(request, "core/index.html", context) +@login_required(login_url='userauths:sign-in') def index(request): Headline.objects.all().delete() session = requests.Session() @@ -93,12 +94,14 @@ def index(request): } return render(request, "core/index.html", context) +@login_required(login_url='userauths:sign-in') def about(request): context={ } return render(request, "core/about.html", context) +@login_required(login_url='userauths:sign-in') def contact(request): today_date = datetime.now().strftime('%Y-%m-%d') if request.method == "POST": @@ -129,12 +132,14 @@ def contact(request): } return render(request,"core/contact.html",context) +@login_required(login_url='userauths:sign-in') def advertise(request): context={ } return render(request, "core/advertise.html", context) +@login_required(login_url='userauths:sign-in') def privacy(request): context={ diff --git a/newsaggregator/db.sqlite3 b/newsaggregator/db.sqlite3 index 6bd9a6f0f0938a68f16ca520716fb7e3f8b545cd..1bf81a6fa56a5c99428860df39a54dde751e62ba 100644 GIT binary patch delta 1333 zcmd6lyK@?65WoRhfRW+DW1LLJQ6yU`)ByK>Aj{E#fJ4CXIPp>n#OrvRj=SSHfv%CU zCQYg+DO6;VNoMROjmJa5Op1&%cIz(b(j+r(k}Cgz6cUdeq+}*3(|-Hy?r(p)_n$7@ zf4cDTE%WioyCL)OlReFEwvNB|Lwg>Z!(jp+0gvko=i#-T1;4{#e>sNTFYId%?%3y( z$2`+)z%{AXtYD-%B&9}M7$}g|)1gLNCHjX|R3*wr$b5( z#T#2?;XqEtWt3KxT+ApCF-;Onh5bm3kBD3-Yd}g+%auxvqhiUM3i4vjh%@0 zLNG5xcp-Qhh64~3z;PdpK@dSdxMTa%%TUG-hf@>PJ}r8h1G=qfjUjbVQDmu88_3n_ z|3QrSAH<0LfR<7RDk88v+bJ=uzMmkmM6WJaIhw<_4jZv_VNmu;R5vpW&x)B^ApxuIhr|+7w@a?qvuMRM}Yj&AN8;srQv|nY`Pd64VZ=a5qEQ#yX%)KBO zhEu1{mn?VPBfoVf!GH7g-lFBLBUv08k(k`wmwK$hg!ybCNe?@#`E-_4ceN59L<`9h z9)?1lI3L*x7ll4qDile!!`EmkpNn(i#;X}|FH9{%bO1xAEAe3{LK5)bBhwQm2m~c7 zU7f%QdULTURoeT$nk-ei1U_1ypFv!|{R**Amy3nSl#h+X)Iy4qc9BqmUlk)2Nmk-< zmC%U1h~XIB4y(n;cD>&S<}fyttqgV&)g6>;H!mYX0T}j?B#sdHB}6Cy(LNldNQ{~i zwY3(3zeCUn1aH0pef>_*6W^l6Yq?@FnI28bOO{7&w-uC4-~^PxOYj_g4fOH#y*NN_ d&iT!+2Yyq=dTVao{8z0DE#@aD?_1of3o@r&@yqjk%6H@dTwH7j$U$p?k$1L ljKt!i)WV92qN0+j+@j>okC;O_*t8q?Z-{AZw&gKm1OR^e8}tAG diff --git a/newsaggregator/static/assets/css/userauth.css b/newsaggregator/static/assets/css/userauth.css index 345916d..35b6ff3 100644 --- a/newsaggregator/static/assets/css/userauth.css +++ b/newsaggregator/static/assets/css/userauth.css @@ -30,7 +30,6 @@ body { } .container { - height: 100vh; display: flex; flex-direction: column; } @@ -42,9 +41,6 @@ body { .main-content { margin: 32px auto; - display: flex; - align-items: center; - justify-content: center; max-width: 935px; flex-grow: 1; } @@ -131,7 +127,7 @@ body { .box { border: 1px solid var(--box-border-color); - background-color: var(--box-bg); + background-color: var(--background-primary); border-radius: 3px; } @@ -142,6 +138,9 @@ body { .form-content .logo { text-align: center; + display: flex; + align-items: center; + justify-content: center; height: 51px; width: 175px; margin: 22px auto 12px; @@ -229,7 +228,7 @@ body { display: inline; } -.btn-group { +.btn-groupss { padding: 8px 40px; } diff --git a/newsaggregator/static/assets/images/sign-in-animate.svg b/newsaggregator/static/assets/images/sign-in-animate.svg new file mode 100644 index 0000000..59839e5 --- /dev/null +++ b/newsaggregator/static/assets/images/sign-in-animate.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/newsaggregator/static/assets/images/sign-up-animate.svg b/newsaggregator/static/assets/images/sign-up-animate.svg new file mode 100644 index 0000000..d20da0e --- /dev/null +++ b/newsaggregator/static/assets/images/sign-up-animate.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/newsaggregator/templates/components/navbar.html b/newsaggregator/templates/components/navbar.html index d504e15..7e7963a 100644 --- a/newsaggregator/templates/components/navbar.html +++ b/newsaggregator/templates/components/navbar.html @@ -33,7 +33,8 @@ Contact -
  • {% if not request.user %} +
  • + {% if not request.user.is_authenticated %} Sign-in/Sign-up {% else %} Sign-out diff --git a/newsaggregator/templates/partials/base.html b/newsaggregator/templates/partials/base.html index 69fb6f4..01267ee 100644 --- a/newsaggregator/templates/partials/base.html +++ b/newsaggregator/templates/partials/base.html @@ -17,6 +17,7 @@ + @@ -42,6 +43,11 @@ {% block category %} {% endblock category %} {% block index %} + + + {% block authentication %} + {% endblock authentication %} + {% endblock index %} {% include 'components/footer.html' %} @@ -53,6 +59,7 @@ + diff --git a/newsaggregator/templates/partials/base_auth.html b/newsaggregator/templates/partials/base_auth.html index d303242..9944559 100644 --- a/newsaggregator/templates/partials/base_auth.html +++ b/newsaggregator/templates/partials/base_auth.html @@ -4,22 +4,36 @@ - Intern - - + Onion News + + + - - {% block content %} + {% block authentication %} - {% endblock content %} + {% endblock authentication %} + +
    + + {% block category %} + {% endblock category %} + {% block index %} + {% endblock index %} +
    + {% include 'components/footer.html' %} + + diff --git a/newsaggregator/templates/userauths/sign-in.html b/newsaggregator/templates/userauths/sign-in.html index 8c2b2a5..e9313ab 100644 --- a/newsaggregator/templates/userauths/sign-in.html +++ b/newsaggregator/templates/userauths/sign-in.html @@ -1,69 +1,63 @@ -{% extends 'partials/base_auth.html' %} +{% extends 'partials/base.html' %} {% load static %} -{% block content %} +{% block authentication %}
    -
    -
    - - -
    - {% csrf_token %} -
    -{% endblock content %} \ No newline at end of file +{% endblock authentication %} \ No newline at end of file diff --git a/newsaggregator/templates/userauths/sign-up.html b/newsaggregator/templates/userauths/sign-up.html index 76f5db9..503bacd 100644 --- a/newsaggregator/templates/userauths/sign-up.html +++ b/newsaggregator/templates/userauths/sign-up.html @@ -1,94 +1,88 @@ -{% extends 'partials/base_auth.html' %} +{% extends 'partials/base.html' %} {% load static %} -{% block content %} +{% block authentication %}
    -
    -
    - - - -
    - {% csrf_token %} -
    -{% endblock content %} \ No newline at end of file +{% endblock authentication %} \ No newline at end of file From 7c689fefcbb75c80d23e4bf364fd950989aa7c9d Mon Sep 17 00:00:00 2001 From: anurag singh Date: Sat, 18 May 2024 16:39:17 +0530 Subject: [PATCH 2/2] updated style --- newsaggregator/db.sqlite3 | Bin 188416 -> 188416 bytes .../templates/userauths/sign-in.html | 2 +- .../templates/userauths/sign-up.html | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/newsaggregator/db.sqlite3 b/newsaggregator/db.sqlite3 index 1bf81a6fa56a5c99428860df39a54dde751e62ba..e34c82e3477efd4aaa187f6dff1cac1d36a6f526 100644 GIT binary patch delta 51 zcmZoTz};|wdxA7$%S0Jx#+HoiVcJ>d9 HKi>lY$+8k3 delta 51 zcmV-30L=e@zzcxD3y>QDgOMCV0fVt%q>lp!3JS9ako^w>2M+#&2cWkHpaK0)0|yT% Jw+HY6`R~<$614yT diff --git a/newsaggregator/templates/userauths/sign-in.html b/newsaggregator/templates/userauths/sign-in.html index e9313ab..b47d1fc 100644 --- a/newsaggregator/templates/userauths/sign-in.html +++ b/newsaggregator/templates/userauths/sign-in.html @@ -9,7 +9,7 @@
    -
    +