Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(blog): created initial blog page #165

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AlumniConnect/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
path('alumnibody/', views.alumniBody),
path('alumnicard/', views.alumniCard, name='alumnicard'),
path('gallery/', include('applications.gallery.urls')),

path('ckeditor/', include('ckeditor_uploader.urls')),
path('awards/', include('applications.awards.urls')),
path('chapter/', include('applications.chapter.urls')),
Expand Down
1 change: 1 addition & 0 deletions AlumniConnect/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def gallery(request):
return render(request, "AlumniConnect/gallery.html")



def job_posting(request):
return render(request, "AlumniConnect/job_posting.html")

Expand Down
3 changes: 2 additions & 1 deletion applications/blog/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.contrib import admin

# Register your models here.


3 changes: 3 additions & 0 deletions applications/blog/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@



Empty file.
3 changes: 0 additions & 3 deletions applications/blog/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
from django.db import models

# Create your models here.
10 changes: 0 additions & 10 deletions applications/blog/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
from django.urls import path

from . import views

app_name = 'blog'

urlpatterns = [

path('', views.index, name='index'),
]
6 changes: 0 additions & 6 deletions applications/blog/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
from django.shortcuts import render


# Create your views here.
def index(request):
return render(request, "blog/home.html")
74 changes: 74 additions & 0 deletions templates/blog/blog_list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{% extends 'globals/base.html' %}
{% load static %}

{% block title %}
Blogs
{% endblock %}

{% block css %}
<link rel="stylesheet" href="{% static 'blog/blog.css' %}" />
{% endblock %}

{% block body %}
{% include 'globals/navbar.html' %}

<div class="p-0 m-0 masthead-bg w-100 parallax shadow-sm" style="min-height:300px !important; height:300px !important; background-position-y: 300px;"></div>

<header class="masthead text-center text-white d-flex" style="height:0px; min-height:300px;">
<div class="container my-auto" style="margin-bottom:50px !important;">
<div class="row">
<div class="col-lg-8 mx-auto align-middle">
<h1 class="text-uppercase mt-4">
<strong>BLOGS</strong>
</h1>
</div>
</div>
</div>
</header>

<section id="services" class="bg-primary p-1">
<div class="container">
<div class="row my-5">
<form method="GET" class="w-100 mb-4">
<div class="form-row">
<div class="col-md-3 mb-3">
<input type="text" class="form-control" name="q" placeholder="Search..." value="{{ request.GET.q }}">
</div>
<div class="col-md-2 mb-3">
<button type="submit" class="btn btn-primary w-100">Search</button>
</div>
</div>
</form>

{% for blog in blogs %}
<div class="col-xl-4 col-md-6 mb-4 mx-auto" style="cursor: pointer" onclick="location.href='{% url 'blog:blog_detail' blog.blog_id %}'">
<div class="card border-0 shadow shadow-on-hover">
<div class="card-body text-center">
<h5 class="card-title mb-0">{{ blog.title }}</h5>
<p>Author: {{ blog.author.username }}</p>
<p>Tags: {{ blog.tags }}</p>
<p>Date Added: {{ blog.date_added }}</p>
<p>
{% if blog.is_self %}
Self
{% else %}
Campaign: {{ blog.campaign.name }}
{% endif %}
</p>
<a href="{% url 'blog:blog_detail' blog.blog_id %}" class="btn btn-primary">View</a>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</section>

<div class="container">
<h6>
<small class="form-text text-muted">Want to start a new <b>Blog</b>? Contact us at <a href="mailto:[email protected]">[email protected]</a></small>
</h6>
</div>

{% include 'globals/footer.html' %}
{% endblock %}
1 change: 0 additions & 1 deletion templates/blog/home.html

This file was deleted.