Skip to content

Commit

Permalink
Home Page
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubh-Nisar committed Jul 2, 2020
1 parent 2df1f20 commit 4fcc083
Show file tree
Hide file tree
Showing 15 changed files with 160 additions and 3 deletions.
Binary file modified CODEMIX/CODEMIX/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file modified CODEMIX/CODEMIX/__pycache__/settings.cpython-38.pyc
Binary file not shown.
Binary file added CODEMIX/CODEMIX/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added CODEMIX/CODEMIX/__pycache__/wsgi.cpython-38.pyc
Binary file not shown.
8 changes: 7 additions & 1 deletion CODEMIX/CODEMIX/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [os.path.join(BASE_DIR,'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand Down Expand Up @@ -118,3 +118,9 @@
# https://docs.djangoproject.com/en/3.0/howto/static-files/

STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR,'static'),
]
STATIC_ROOT = os.path.join(BASE_DIR,'assets')
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
7 changes: 6 additions & 1 deletion CODEMIX/CODEMIX/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import include, path
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
path('admin/', admin.site.urls),
path('', include('home.urls')),
]

urlpatterns = urlpatterns + static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)
Empty file added CODEMIX/db.sqlite3
Empty file.
Binary file added CODEMIX/home/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added CODEMIX/home/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added CODEMIX/home/__pycache__/views.cpython-38.pyc
Binary file not shown.
7 changes: 7 additions & 0 deletions CODEMIX/home/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.contrib import admin
from django.urls import include, path
from . import views

urlpatterns = [
path('', views.home, name='home'),
]
5 changes: 4 additions & 1 deletion CODEMIX/home/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from django.shortcuts import render

from django.http import HttpResponse
# Create your views here.

def home(request):
return render(request, 'home.html')
Binary file added CODEMIX/static/images/buyer_avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CODEMIX/static/images/farmer_avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
136 changes: 136 additions & 0 deletions CODEMIX/templates/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{% load static %}
{% static "images" as baseUrl %}
<!DOCTYPE html>
<html>
<head>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">

<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>SellBuy | Home</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300&display=swap');
a{
text-decoration: none;
}

#navStyle{
background-image: linear-gradient(to right, #434343 0%, black 100%);
text-align: center;
}
#navStyle a{
color : grey;
}
#navh2{
font-family: 'Montserrat', sans-serif;
letter-spacing: 12px;
margin: 0 auto 0 auto;
padding-top: 5px !important;
text-transform: uppercase;
}
#pushDown{
padding-top: 20px !important;
}
#avatarImg{
border-radius: 50%;
padding-top: 30px;
max-width: 300px;
margin-left: auto;
margin-right: auto;
}
#greyBar{
border-left: grey 3px solid;
padding-left:5px;
margin-top: 5px;
}
#loginBtn{
background-color: #333 !important;
}
#priceBtn{
border: #333 1.5px solid;
border-radius: 12px;
padding: 8px;
margin-left: 10px;

}
#priceBtn:hover{
color: white;
background-color: #333;
}
@media(max-width:500px){
nav{
min-height:65px;
}
#priceBtn{
float: left !important;
margin-left: 0;
margin-top: 8px;
}
}
</style>
</head>

<body>
<nav id="navStyle">
<div class="nav-wrapper">
<a href="/"><h2 id="navh2">SellBuy</h2></a>
</div>
</nav>
<div class="container" id='pushDown'>
<div class="row">
<div class="col s6">
<div class="card">
<div class="card-image">
<img id="avatarImg" src="{% static 'images/farmer_avatar.png' %}" alt="Farmer-Profile">
</div>
<div class="card-content">
<p>
<hr>
<span id="greyBar">FARMER</span>
</p>
</div>
<div class="card-action">
<a href="farmer/farmerlogin" class='btn center-align' id='loginBtn'>Farmer</a>
</div>
</div>
</div>

<div class="col s6">
<div class="card">
<div class="card-image">
<img id="avatarImg" src="{% static 'images/buyer_avatar.png' %}" alt="Buyer-Profile">
</div>
<div class="card-content">
<p>
<hr>
<span id="greyBar">BUYER</span>
</p>
</div>
<div class="card-action">
<a href="buyer/buyerlogin" class='btn center-align' id='loginBtn'>Buyer</a>
</div>
</div>
</div>
</div>

<footer class="left-align">
<p>
SellBuy is a Web-Application intended to provide a smooth and easy transaction of crops between Farmers and Buyers.
<hr>
Watch latest prices of crop you want to Buy / Sell.
<a href="price" class='right' id='priceBtn'>Current Price List</a>

</p>
</footer>
</div>
<!--<img src="{% static 'images/buyer_avatar.png' %}" alt=""> -->
<!-- jQuery cdn -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<!--JavaScript at end of body for optimized loading-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
</body>
</html>

0 comments on commit 4fcc083

Please sign in to comment.