Skip to content
This repository has been archived by the owner on Jun 19, 2018. It is now read-only.

about us page 1 #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
29 changes: 29 additions & 0 deletions .idea/Njack_website.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

648 changes: 648 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Njack_website/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# Application definition

INSTALLED_APPS = [
'aboutus.apps.AboutusConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
Expand Down
5 changes: 3 additions & 2 deletions Njack_website/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
url(r'^admin/', admin.site.urls),
]
url(r'^aboutus/', include('aboutus.urls')),
]
Empty file added aboutus/__init__.py
Empty file.
8 changes: 8 additions & 0 deletions aboutus/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.contrib import admin

# Register your models here.

from .models import Fill

# Register your models here.
admin.site.register(Fill)
5 changes: 5 additions & 0 deletions aboutus/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class AboutusConfig(AppConfig):
name = 'aboutus'
25 changes: 25 additions & 0 deletions aboutus/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-28 21:24
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Fill',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50)),
('email', models.CharField(max_length=150)),
('message', models.CharField(max_length=10000)),
],
),
]
Empty file added aboutus/migrations/__init__.py
Empty file.
15 changes: 15 additions & 0 deletions aboutus/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from django.db import models
from django.core.urlresolvers import reverse
# Create your models here.
from django.db import models

class Fill(models.Model):
name=models.CharField(max_length=50)
email=models.CharField(max_length=150)
message=models.CharField(max_length=10000)

def get_absolute_url(self):
return reverse('aboutus:detail', kwargs={'pk': self.pk})

def __str__(self):
return self.name
Binary file added aboutus/static/aboutus/images/contactimg.jpg
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 aboutus/static/aboutus/images/njack.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions aboutus/static/aboutus/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

label {
display:block;
margin-top:20px;
letter-spacing:2px;
}
/* Centre the page */
.body {
display:block;
margin:0 auto;
width:576px;
}

/* Centre the form within the page */
form {
margin:0 auto;
width:459px;
}

/* Style the text boxes */
input, textarea {
width:439px;
height:32px;
background:#efefef;
border:1px solid #dedede;
padding:10px;
margin-top:3px;
font-size:0.9em;
color:#3a3a3a;
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
}

textarea {
height:213px;
}
input:focus, textarea:focus {
border:1px solid #97d6eb;
}
#submit {
width:127px;
height:38px;
background:url(images/submit.jpg);
text-indent:-9999px;
border:none;
margin-top:20px;
cursor:pointer;
}

#submit:hover {
opacity:.9;
}
54 changes: 54 additions & 0 deletions aboutus/templates/aboutus/aindex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@



<!--loads static files-->
{% load staticfiles %}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="{% static 'aboutus/style.css' %}"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


<nav class="navbar navbar-inverse">
<div class="container-fluid">
<!--header-->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#topNavBar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">NJACK</a>
</div>
<!--items-->
<div class="collapse navbar-collapse" id="topNavBar">

<ul class="nav navbar-nav">
<li class="active">
<a href="{% url 'aboutus:aindex' %}">
<span class="glyphicon glyphicon-cd" aria-hidden="true"></span>&nbsp;Contact us
</a>
</li>

</ul>
</div>
</div>
</nav>


<a href="{% url 'aboutus:fill-add' %}">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&nbsp; Send us message
</a>


<br><br>
<address>
Mail us at: <a href="mailto:[email protected]">[email protected]</a>.<br>
Visit us at:<a href="https://www.facebook.com/pg/njack.iitp">Facebook</a> <br><br>

</address>
<img src="../../static/aboutus/images/contactimg.jpg"/>



3 changes: 3 additions & 0 deletions aboutus/templates/aboutus/detail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h1>details page</h1>

<h2>your message has been sent</h2>
66 changes: 66 additions & 0 deletions aboutus/templates/aboutus/fill_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!--loads static files-->
{% load staticfiles %}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="{% static 'aboutus/style.css' %}"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


<nav class="navbar navbar-inverse">
<div class="container-fluid">
<!--header-->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#topNavBar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">NJACK</a>
</div>
<!--items-->
<div class="collapse navbar-collapse" id="topNavBar">

<ul class="nav navbar-nav">
<li class="active">
<a href="{% url 'aboutus:aindex' %}">
<span class="glyphicon glyphicon-cd" aria-hidden="true"></span>&nbsp;Contact us
</a>
</li>

</ul>
</div>
</div>
</nav>


<section class="body">
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];?>

<div class="container-fluid">



<div class="panel panel-default">
<div class="panel-body">
<form method="post" action="" enctype="multipart/form-data" >
{% include 'aboutus/form_template.html' %}
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="button" class="btn btn-success">Submit</button>
</div>
</div>

</form>
</div>
</div>


</div>

</section>


14 changes: 14 additions & 0 deletions aboutus/templates/aboutus/form_template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% for field in form %}

<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<span class="text-danger small">{{ field.errors }}</span>
</div>
<label class="control-label col-sm-2">{{ field.label_tag }}</label>
<div class="col-sm-10">{{ field }}</div>


</div>


{% endfor %}
3 changes: 3 additions & 0 deletions aboutus/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
13 changes: 13 additions & 0 deletions aboutus/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from django.conf.urls import url
from django.contrib import admin


app_name='aboutus'
from . import views
urlpatterns = [
#/aboutus/
url(r'^$', views.IndexView.as_view(),name='aindex'),
url(r'^(?P<pk>[0-9]+)/$',views.DetailView.as_view(),name='detail'),
url(r'fill/add/$',views.FillCreate.as_view(),name='fill-add'),

]
20 changes: 20 additions & 0 deletions aboutus/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@


from django.views import generic
from django.views.generic.edit import CreateView,UpdateView, DeleteView
from .models import Fill

class IndexView(generic.ListView):
template_name = 'aboutus/aindex.html'
context_object_name = 'all_details'

def get_queryset(self):
return Fill.objects.all()

class DetailView(generic.DetailView):
model = Fill
template_name = 'aboutus/detail.html'

class FillCreate(CreateView):
model = Fill
fields = ['name','email','message']
Binary file added db.sqlite3
Binary file not shown.
Loading