This commit is contained in:
vaishk 2017-08-03 23:14:00 +05:30
parent 3f57e0ca15
commit 268900b7b9
18 changed files with 315 additions and 47 deletions

View File

@ -2,6 +2,7 @@ body {
background-color: #000000 !important; background-color: #000000 !important;
font-size: 14px !important; font-size: 14px !important;
color: #ffffff !important; color: #ffffff !important;
overflow-x: hidden;
} }
.content_detail { .content_detail {
@ -39,6 +40,10 @@ body, h1, h2, h3, h4, h5, h6 {
font-size: 0.7em; font-size: 0.7em;
} }
.news {
padding-left: 10px;
}
.special-column { .special-column {
padding-left: 0em !important; padding-left: 0em !important;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -27,7 +27,12 @@ urlpatterns = [
url(r'^$', views.index, name='index'), url(r'^$', views.index, name='index'),
url(r'^events/(?P<shortname>\w+)/$', views.events, name='events'), url(r'^events/(?P<shortname>\w+)/$', views.events, name='events'),
url(r'^projects/(?P<shortname>\w+)/$', views.projects, name='projects'), url(r'^projects/(?P<shortname>\w+)/$', views.projects, name='projects'),
url(r'^works/(?P<shortname>\w+)/$', views.works, name='works'),
url(r'^texts/(?P<shortname>\w+)/$', views.texts, name='texts'),
url(r'^work/', views.work),
url(r'^project/', views.project), url(r'^project/', views.project),
url(r'^event/', views.event),
url(r'^text/', views.text),
url(r'^markdownx/', include(markdownx)), url(r'^markdownx/', include(markdownx)),
url(r'^photologue/', include('photologue.urls', namespace='photologue')), url(r'^photologue/', include('photologue.urls', namespace='photologue')),
url(r'^gallerylist/$', GalleryListView.as_view(), name='gallery-list'), url(r'^gallerylist/$', GalleryListView.as_view(), name='gallery-list'),

View File

@ -22,8 +22,8 @@
<li><a href="http://127.0.0.1:8000/">HOME</a></li> <li><a href="http://127.0.0.1:8000/">HOME</a></li>
<li>ABOUT</li> <li>ABOUT</li>
<li><a href="/project">PROJECTS</a></li> <li><a href="/project">PROJECTS</a></li>
<li><a href="http://127.0.0.1:8000/">EVENTS</a></li> <li><a href="/event">EVENTS</a></li>
<li>WORKS</li> <li><a href="/work">WORKS</a></li>
<li>TEXTS</li> <li>TEXTS</li>
<li>CONTACT</li> <li>CONTACT</li>
</ul> </ul>

View File

@ -0,0 +1,52 @@
{% extends 'base.html' %}
{% block content %}
{% for content in featured %}
<div class="large-8 medium-8 columns special-column">
<img src="http://camputer.org/images/{{content.image}}">
<div class="index-text">
<h4><a href="/{{content.type}}/{{ content.shortname }}/" class="big-title">{{content.title}} </a></h4>
<h6 class="big-date"> <font color="#ef4e5c"> <b> {{ content.datestart }} </b></font> <br/>
Camp Roof </h6>
<p> {{content.body|striptags|truncatechars:250}} <a href="/{{content.type}}/{{ content.shortname }}">read more</a> </p>
</div>
{% endfor %}
</div>
<div class="large-4 medium-4 columns">
<h4 class="sidebar-h4"> Upcoming Events </h4>
<div class="row">
{% for content in latest_content_list %}
{% if content.type_id == 1 %}
<div class="row right-items">
<div class= "small-12 columns">
<h6> {{ content.title }} <br />
{{ content.formatted_header|safe }}
</h6>
</div>
</div>
{% endif %}
{% if content.type_id == 0 %}
<div class="row right-items">
<div class="small-6 columns">
<img src="http://camputer.org/images/{{ content.image }}">
</div>
<div class="small-6 columns">
<a href="/{{content.type}}/{{ content.shortname }}/" class="sidebar-title">{{ content.title }}</a>
<h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{ content.datestart }} </b></font> <br/>
We will add a place to fill this text </h6>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endblock %}

View File

@ -24,6 +24,7 @@
<div class="large-4 medium-4 columns"> <div class="large-4 medium-4 columns">
{% if events.children.all %}
<h4 class="sidebar-h4"> Related </h4> <h4 class="sidebar-h4"> Related </h4>
{% for child in events.children.all %} {% for child in events.children.all %}
<div class="row related-row"> <div class="row related-row">
@ -32,38 +33,29 @@
</div> </div>
<div class="small-6 columns"> <div class="small-6 columns">
<h6><a href="http://127.0.0.1:8000/{{child.type}}/{{child.shortname}}" class="sidebar-title"> {{child}} </a> </h6> <h6><a href="http://127.0.0.1:8000/{{child.type}}/{{child.shortname}}" class="sidebar-title"> {{child}} </a> </h6>
<h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{ child.datestart }} {% if child.dateend %} - {{child.dateend}} {% endif %} </b></font> <br/>
{{child.place}} </h6>
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
<h4 class="sidebar-h4"> Upcoming Events </h4> {% endif %}
<h4 class="sidebar-h4">Events </h4>
<div class="row"> <div class="row">
{% for events in latest_content_list %} {% for events in latest_content_list %}
{% if events.type_id == 1 %}
<div class="row right-items">
<div class= "small-12 columns">
<h6> {{ events.title }} <br />
{{ events.formatted_header|safe }}
</h6>
</div>
</div>
{% endif %}
{% if events.type_id == 0 %}
<div class="row right-items"> <div class="row right-items">
<div class="small-6 columns"> <div class="small-6 columns">
<img src="http://camputer.org/images/{{ events.image }}"> <img src="http://camputer.org/images/{{ events.image }}">
</div> </div>
<div class="small-6 columns"> <div class="small-6 columns">
<a href="/{{events.type}}/{{ events.shortname }}/" >{{ events.title }}</a> <a href="/{{events.type}}/{{ events.shortname }}/" >{{ events.title }}</a>
<h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{ events.datestart }} </b></font> <br/> <h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{ events.datestart }} </b></font> <br/></h6>
{{ events.typefilter }}</h6> <p> {{events.header|striptags|truncatechars:200}} </p>
</div> </div>
</div> </div>
{% endif %}
{% endfor %} {% endfor %}

View File

@ -3,17 +3,13 @@
{% block content %} {% block content %}
{% for content in latest_content_list %} {% for content in homepage %}
{% if forloop.counter == 4 %}
<div class="large-8 medium-8 columns special-column"> <div class="large-8 medium-8 columns special-column">
<img src="http://camputer.org/images/{{content.image}}">
<div class="index-text"> <div class="index-text">
<h4><a href="/{{content.type}}/{{ content.shortname }}/" class="big-title">{{content.title}} </a></h4> <h4 class="big-title">{{content.title}} </a></h4>
<h6 class="big-date"> <font color="#ef4e5c"> <b> {{ content.datestart }} </b></font> <br/> <p> {{content.header}} </p>
Camp Roof </h6> <p> {{content.body}} </p>
<p> {{content.body|striptags|truncatechars:250}} <a href="/{{content.type}}/{{ content.shortname }}">read more</a> </p>
</div> </div>
{% endif %}
{% endfor %} {% endfor %}
</div> </div>
@ -26,8 +22,9 @@
<div class="row right-items"> <div class="row right-items">
<div class= "small-12 columns"> <div class= "small-12 columns">
<h6> {{ content.title }} <br /> <h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{content.datestart}} </b>
{{ content.formatted_header|safe }} {{ content.title }} <br />
{{ content.formatted_header|safe }} </font>
</h6> </h6>
</div> </div>
</div> </div>
@ -40,8 +37,9 @@
</div> </div>
<div class="small-6 columns"> <div class="small-6 columns">
<a href="/{{content.type}}/{{ content.shortname }}/" class="sidebar-title">{{ content.title }}</a> <a href="/{{content.type}}/{{ content.shortname }}/" class="sidebar-title">{{ content.title }}</a>
<h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{ content.datestart }} </b></font> <br/> <h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{ content.datestart }} {% if content.dateend %} - {{content.dateend}} {% endif %} </b></font> <br/>
We will add a place to fill this text </h6> {{content.place}} </h6>
<p> {{content.header|striptags|truncatechars:100}} </p>
</div> </div>
</div> </div>
{% endif %} {% endif %}

View File

@ -4,7 +4,7 @@
{% block content %} {% block content %}
{% for content in content %} {% for content in content %}
{% if forloop.last %} {% if forloop.first %}
<div class="large-8 medium-8 columns special-column"> <div class="large-8 medium-8 columns special-column">
<img src="http://camputer.org/images/{{content.image}}"> <img src="http://camputer.org/images/{{content.image}}">
<div class="index-text"> <div class="index-text">
@ -17,7 +17,7 @@
</div> </div>
<div class="large-4 medium-4 columns"> <div class="large-4 medium-4 columns">
<h4 class="sidebar-h4"> Ongoing Projects </h4> <h4 class="sidebar-h4">Projects </h4>
<div class="row"> <div class="row">
{% for content in content %} {% for content in content %}

View File

@ -16,7 +16,20 @@
{% if latest_content_list %} {% if latest_content_list %}
<div class="large-4 medium-4 columns"> <div class="large-4 medium-4 columns">
<h4 class="sidebar-h4"> Ongoing Projects </h4> {% if projects.children.all %}
<h4 class="sidebar-h4"> Related </h4>
{% for child in projects.children.all %}
<div class="row related-row">
<div class="small-6 columns">
<img src="http://camputer.org/images/{{ child.image }}">
</div>
<div class="small-6 columns">
<h6><a href="http://127.0.0.1:8000/{{child.type}}/{{child.shortname}}" class="sidebar-title"> {{child}} </a> </h6>
</div>
</div>
{% endfor %}
{% endif %}
<h4 class="sidebar-h4">Projects </h4>
<div class="row"> <div class="row">
{% for projects in latest_content_list %} {% for projects in latest_content_list %}
@ -26,13 +39,12 @@
</div> </div>
<div class="small-6 columns"> <div class="small-6 columns">
<a href="/{{projects.type}}/{{ projects.shortname }}/" class="sidebar-title">{{ projects.title }}</a> <a href="/{{projects.type}}/{{ projects.shortname }}/" class="sidebar-title">{{ projects.title }}</a>
<h6 class="sidebar-date"> <font color="#ef4e5c"> <b> {{ projects.datestart }} </b></font> <br/> <p> {{projects.header|striptags|truncatechars:100}} </p>
We will add a place to fill this text </h6>
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
{% else %} {% else %}
<p>No polls are available.</p> <p>No projects.</p>
{% endif %} {% endif %}
</div> </div>
</div> </div>

View File

@ -0,0 +1,33 @@
{% extends 'base.html' %}
{% block content %}
{% for content in content %}
{% if forloop.first %}
<div class="large-8 medium-8 columns special-column">
<img src="http://camputer.org/images/{{content.image}}">
<div class="index-text">
<h4><a href="/{{content.type}}/{{ content.shortname }}/" class="big-title">{{content.title}} </a></h4>
<p> {{content.header|striptags}} </p>
<p> {{content.body|striptags}} </p>
</div>
{% endif %}
{% endfor %}
</div>
<div class="large-4 medium-4 columns">
<h4 class="sidebar-h4"> Texts </h4>
<div class="row">
{% for content in content %}
<div class="row right-items">
<a href="/{{content.type}}/{{ content.shortname }}/" class="sidebar-title">{{ content.title }}</a>
<p> {{content.header|striptags|truncatechars:100}} </p>
</div>
{% endfor %}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,52 @@
{% extends 'base.html' %}
{% block content %}
<div class="large-8 medium-8 columns special-column">
<img src="http://camputer.org/images/{{texts.image}}">
<div class="index-text">
<h4><a href="/{{texts.type}}/{{ texts.shortname }}/" class="big-title">{{texts.title}} </a></h4>
<p> {{texts.formatted_header|safe}} </p>
<p> {{texts.formatted_body|safe}} </p>
</div>
</div>
{% if latest_content_list %}
<div class="large-4 medium-4 columns">
{% if texts.children.all %}
<h4 class="sidebar-h4"> Related </h4>
{% for child in texts.children.all %}
<div class="row related-row">
<div class="small-6 columns">
<img src="http://camputer.org/images/{{ child.image }}">
</div>
<div class="small-6 columns">
<h6><a href="http://127.0.0.1:8000/{{child.type}}/{{child.shortname}}" class="sidebar-title"> {{child}} </a> </h6>
</div>
</div>
{% endfor %}
{% endif %}
<h4 class="sidebar-h4"> Texts </h4>
<div class="row">
{% for texts in latest_content_list %}
<div class="row right-items">
<div class="small-6 columns">
<img src="http://camputer.org/images/{{ texts.image }}">
</div>
<div class="small-6 columns">
<a href="/{{texts.type}}/{{ texts.shortname }}/" class="sidebar-title">{{ texts.title }}</a>
<p> {{texts.header|striptags|truncatechars:100}} </p>
</div>
</div>
{% endfor %}
{% else %}
<p>No texts.</p>
{% endif %}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,37 @@
{% extends 'base.html' %}
{% block content %}
{% for content in content %}
{% if forloop.first %}
<div class="large-8 medium-8 columns special-column">
<img src="http://camputer.org/images/{{content.image}}">
<div class="index-text">
<h4><a href="/{{content.type}}/{{ content.shortname }}/" class="big-title">{{content.title}} </a></h4>
<p> {{content.header|striptags}} </p>
</div>
{% endif %}
{% endfor %}
</div>
<div class="large-4 medium-4 columns">
<h4 class="sidebar-h4"> Works </h4>
<div class="row">
{% for content in content %}
<div class="row right-items">
<div class="small-6 columns">
<img src="http://camputer.org/images/{{ content.image }}">
</div>
<div class="small-6 columns">
<a href="/{{content.type}}/{{ content.shortname }}/" class="sidebar-title">{{ content.title }}</a>
<p> {{content.header|striptags|truncatechars:100}} </p>
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,52 @@
{% extends 'base.html' %}
{% block content %}
<div class="large-8 medium-8 columns special-column">
<img src="http://camputer.org/images/{{works.image}}">
<div class="index-text">
<h4><a href="/{{works.type}}/{{ works.shortname }}/" class="big-title">{{works.title}} </a></h4>
<p> {{works.formatted_header|safe}} </p>
<p> {{works.formatted_body|safe}} </p>
</div>
</div>
{% if latest_content_list %}
<div class="large-4 medium-4 columns">
{% if works.children.all %}
<h4 class="sidebar-h4"> Related </h4>
{% for child in works.children.all %}
<div class="row related-row">
<div class="small-6 columns">
<img src="http://camputer.org/images/{{ child.image }}">
</div>
<div class="small-6 columns">
<h6><a href="http://127.0.0.1:8000/{{child.type}}/{{child.shortname}}" class="sidebar-title"> {{child}} </a> </h6>
</div>
</div>
{% endfor %}
{% endif %}
<h4 class="sidebar-h4"> Works </h4>
<div class="row">
{% for works in latest_content_list %}
<div class="row right-items">
<div class="small-6 columns">
<img src="http://camputer.org/images/{{ works.image }}">
</div>
<div class="small-6 columns">
<a href="/{{works.type}}/{{ works.shortname }}/" class="sidebar-title">{{ works.title }}</a>
<p> {{works.header|striptags|truncatechars:100}} </p>
</div>
</div>
{% endfor %}
{% else %}
<p>No works.</p>
{% endif %}
</div>
</div>
{% endblock %}

View File

@ -2,7 +2,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.http import HttpResponse from django.http import HttpResponse
from django.shortcuts import get_object_or_404, render from django.shortcuts import get_object_or_404, render
from .models import Content from .models import Content, ContentContent
from django.db.models import Q from django.db.models import Q
from django.views.generic.list import ListView from django.views.generic.list import ListView
from photologue.views import GalleryListView from photologue.views import GalleryListView
@ -12,24 +12,54 @@ from django.core.exceptions import ObjectDoesNotExist
# Create your views here. # Create your views here.
def index(request): def index(request):
latest_content_list = Content.objects.order_by('-datestart')[:8] latest_content_list = Content.objects.order_by('-datestart')[:12]
context = {'latest_content_list': latest_content_list} homepage = Content.objects.filter(type=2).order_by('-datestart')[:1]
context = {'latest_content_list': latest_content_list, 'homepage': homepage}
return render(request, 'index.html', context) return render(request, 'index.html', context)
def project(request): def project(request):
content = Content.objects.filter(type=3) content = Content.objects.filter(type=3).order_by('-datestart')
return render(request, 'project.html', {'content': content}) return render(request, 'project.html', {'content': content})
def work(request):
content = Content.objects.filter(type=4)
return render(request, 'text.html', {'content': content})
def event(request):
latest_content_list = Content.objects.filter(Q(type=0) | Q(type=1)).order_by('-datestart')[:8]
featured = Content.objects.filter(type=0).order_by('-datestart')[:1]
context = {'latest_content_list': latest_content_list, 'featured': featured}
return render(request, 'event.html', context)
def text(request):
content = Content.objects.filter(type=5)
return render(request, 'text.html', {'content': content})
def events(request, shortname): def events(request, shortname):
events = get_object_or_404(Content, shortname=shortname) events = get_object_or_404(Content, shortname=shortname)
gallery = get_or_none(Gallery, slug=shortname) gallery = get_or_none(Gallery, slug=shortname)
latest_content_list = Content.objects.filter(Q(type=0) | Q(type=1)).order_by('-datestart') latest_content_list = Content.objects.filter(type=0).order_by('-datestart')
return render(request, 'events.html', {'events': events, 'latest_content_list': latest_content_list, 'gallery': gallery}) return render(request, 'events.html', {'events': events, 'latest_content_list': latest_content_list, 'gallery': gallery})
def projects(request, shortname): def projects(request, shortname):
projects = get_object_or_404(Content, shortname=shortname) projects = get_object_or_404(Content, shortname=shortname)
gallery = get_or_none(Gallery, slug=shortname)
latest_content_list = Content.objects.filter(type=3) latest_content_list = Content.objects.filter(type=3)
return render(request, 'projects.html', {'projects': projects, 'latest_content_list': latest_content_list}) return render(request, 'projects.html', {'projects': projects, 'latest_content_list': latest_content_list, 'gallery':gallery})
def works(request, shortname):
works = get_object_or_404(Content, shortname=shortname)
gallery = get_or_none(Gallery, slug=shortname)
latest_content_list = Content.objects.filter(type=4)
return render(request, 'works.html', {'works': works, 'latest_content_list': latest_content_list, 'gallery':gallery})
def texts(request, shortname):
texts = get_object_or_404(Content, shortname=shortname)
gallery = get_or_none(Gallery, slug=shortname)
latest_content_list = Content.objects.filter(type=5)
return render(request, 'texts.html', {'texts': texts, 'latest_content_list': latest_content_list, 'gallery':gallery})
class GalleryListViews(ListView): class GalleryListViews(ListView):
queryset = Gallery.objects.on_site().is_public() queryset = Gallery.objects.on_site().is_public()