Added Home Page

Added the Home Page and cleared some code
with_posts
surya 2024-07-07 08:17:43 +05:30
parent 034be678e0
commit 1e7ff8f38d
11 changed files with 28 additions and 66 deletions

View File

@ -3,6 +3,7 @@ from . import views
urlpatterns = [
path('', views.home, name='Home'),
path('news/', views.news, name='News'),
path('blog/<int:pk>', views.BlogDetailView.as_view(), name='Blog'),
path('blog/create/', views.BlogCreateView.as_view(), name='Blog Create'),
path('post/<int:pk>', views.PostDetailView.as_view(), name='Post'),

View File

@ -5,14 +5,10 @@ from .models import *
# Create your views here.
def home(request):
blogs = {
'blog': Blog.objects.all()
}
def news(request):
allow_empty = True
queryset = None
model = Post
model = Blog
paginate_by = None
paginate_orphans = 0
context_object_name = 'posts'
@ -75,3 +71,5 @@ class PostCreateView(LoginRequiredMixin, CreateView):
def about(request):
return render(request, 'blog/about.html', {'title': 'About'})
def home(request):
return render(request, 'index.html', {'title': 'About'})

View File

@ -1,4 +1,4 @@
{% extends 'base2.html' %}
{% extends 'base.html' %}
{% block content %}
{% load markdown_extras %}

View File

@ -1,4 +1,4 @@
{% extends 'base2.html' %}
{% extends 'base.html' %}
{% block content %}
{% load markdown_extras %}

View File

@ -43,13 +43,6 @@
</div>
</div>
{% if user.is_authenticated %}
<form action="{% url 'Post Create' %}" method="get">
{% csrf_token %}
<button href="#" class="btn btn-outline-dark btn-floating" type="submit" style="position: fixed; bottom: 20px; right: 20px; width: 60px; height: 40px;">Post</button>
</form>
{% endif %}
</div>
</div>

20
templates/index.html Normal file
View File

@ -0,0 +1,20 @@
{% extends 'base.html' %}
{% block content %}
<div style="position: absolute; bottom: 1; right: 0;margin: 25px; width: 30%; background-color: rgba(0, 0, 0, 0.6); color: #eeeeee; border-radius: 2px;">
<div style="padding: 20px;">
<h2 style="text-align: justify;">Beyond Heroes</h2>
<p style="text-align: justify;">
The project that rose from the ashes of a game that was once. We aim to recreate the experience that we enjoyed throughout the years, while also adding new features that make it truly <i>Beyond</i> Heroes and Generals.<br>
Join Us on this journey to relive the old days and experience something new by clicking on the button below!
</p>
</div>
</div>
<div style="position: absolute; bottom: 0; right: 0; margin-right: 25px; margin-bottom: 30px;">
<button class="btn" style="padding: 5px 75px; font-family:'Trebuchet MS', sans-serif; font-size: 30px; font-weight: bold; background-color: #139358; color: white; border-radius: 2px;" onmouseover="this.style.backgroundColor='#0f7a4c'" onmouseout="this.style.backgroundColor='#139358'">
To Battle!
</button>
</div>
{% endblock %}

View File

@ -1,18 +0,0 @@
{% extends 'base.html' %}
{% block content %}
<h1 class="display-1">Explore</h1>
<p class="lead">Know your potential</p>
<hr>
<br>
<blockquote>
<h1 class="display-4">Why this community is built</h1>
<p class="h5" style="line-height: 1.5em;">The TechBlog™ community is buit for people who love to share and help other people whenever they get stuck. We have built this platform for people to help each other and make project making fun. We encourage people to get together and work in harmony for the wellbeing of all. People can make groups to work on a project or send blogs or videos that explain a topic or problem very significantly and make work much easier for other co-workers or users. Our main goal is to help everyone and enhance the art of <strong>Problem Solving</strong> through this platform.</p>
</blockquote>
<hr>
<blockquote>
<h1 class="display-4">What do we offer</h1>
<p class="h5" style="line-height: 1.5em;">The TechBlog™ community offers a platform for group work and online chat to all and allow our members to share <em>text, images, videos, codes, projects and even more...</em> with any other member.</p>
</blockquote>
<hr>
<br>
{% endblock %}

View File

@ -1,25 +0,0 @@
{% extends 'base.html' %}
{% block content %}
<h1 class="display-1">People</h1>
<p class="lead">Know the people around you better!</p>
<hr>
<ul style="list-style-type:none; padding-left:10px; padding-right:10px">
{% for object in users %}
<li>
<blockquote class="blockquote">
<a class="h2" style="font-family: rockwell;" href="{% url 'NamedProfile' object.id %}">{{ object.username }}</a>
<!-- <p class="mb-0">{{ object.bio }}</p> -->
<p class="lead">Email: {{ object.email }}</p>
<!-- <footer class="blockquote-footer">posted by <cite title="{{ object.author }}"><a href="#">{{ object.author }}</a></cite> on <cite title="{{ object.date_posted }}">{{ object.date_posted|date:"M j, o" }}</cite></footer>-->
</blockquote>
<hr>
</li>
{% endfor %}
</ul>
<!--<blockquote>-->
<!-- <h1 class="display-4">What do we offer</h1>-->
<!-- <p class="h5" style="line-height: 1.5em;">The TechBlog™ community offers a platform for group work and online chat to all and allow our members to share <em>text, images, videos, codes, projects and even more...</em> with any other member.</p>-->
<!--</blockquote>-->
<!--<hr>-->
<br>
{% endblock %}

View File

@ -51,14 +51,7 @@
</div>
</div>
</div>
{% if user.is_authenticated %}
<form action="{% url 'Post Create' %}" method="get">
{% csrf_token %}
<button href="#" class="btn btn-outline-dark btn-floating" type="submit" style="position: fixed; bottom: 20px; right: 20px; width: 60px; height: 40px;">Post</button>
</form>
{% endif %}
</div>
</div>