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

Midhat/euro python logo #127

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
18 changes: 18 additions & 0 deletions pyconbalkan/cfp/migrations/0011_auto_20181018_1949.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.0.5 on 2018-10-18 19:49

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('cfp', '0010_cfp_active'),
]

operations = [
migrations.AlterField(
model_name='cfp',
name='active',
field=models.BooleanField(default=False),
),
]
52 changes: 52 additions & 0 deletions pyconbalkan/core/static/css/components/faq-accordion.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.accordion {
background-color: #eee;
color: #444;
cursor: pointer;
padding: 18px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-size: 15px;
transition: 0.4s;
}

.accordion:hover {
background-color: #ccc;
}

.accordion:after {
content: "\25BA"; /* "play" icon */
float: right;
color: #454444;
font-size: 18px;
line-height: 22px;
/* rotate "play" icon from > (right arrow) to down arrow */
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
}

.active:after {
/* rotate "play" icon from > (right arrow) to ^ (up arrow) */
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
transform: rotate(-90deg);
color: #F58723;
}

.panel {
padding: 0 18px;
background-color: #32383A;
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
}

p {
margin: 20px;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions pyconbalkan/core/static/js/accordion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var acc = document.getElementsByClassName("accordion");
var i;

for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() {
this.classList.toggle("active");
var panel = this.nextElementSibling;
if (panel.style.maxHeight){
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
}
});
}
1 change: 1 addition & 0 deletions pyconbalkan/core/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<link rel="stylesheet" href="{% static 'css/components/timetable.css' %}">
<link rel="stylesheet" href="{% static 'css/helpers/spacing.css' %}">
<link rel="stylesheet" href="{% static 'css/main.css' %}">
<link rel="stylesheet" href="{% static 'css/components/faq-accordion.css' %}">
<link rel="stylesheet" href="https://afeld.github.io/emoji-css/emoji.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">

Expand Down
64 changes: 34 additions & 30 deletions pyconbalkan/core/templates/includes/event_sidebar.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
{% load static %}

<aside class="event-sidebar">
<a href="/" class="logo" title="{{ conference.event }} {{ conference.name }} - {{ conference.city }} {{ conference.year }}"></a>
<hr class="line">
<h1>#{{ conference.number }}</h1>
<p class="event-sidebar__text">
{{ conference.address }}, {{ conference.city }}
</p>
<p class="event-sidebar__text">
<i class="event-sidebar__icon far fa-calendar-alt"></i>
{{ conference.from_date }} - {{ conference.to_date }}
</p>
<p class="event-sidebar__text">
<i class="event-sidebar__icon fas fa-users"></i>
{{ conference.max_attendees }} attendees
</p>
<p class="event-sidebar__text">
<i class="event-sidebar__icon fas fa-globe"></i>
{{ conference.get_type_display }}
</p>
<a href="/" class="logo"
title="{{ conference.event }} {{ conference.name }} - {{ conference.city }} {{ conference.year }}"></a>
<hr class="line">
<h1>#{{ conference.number }}</h1>
<p class="event-sidebar__text">
{{ conference.address }}, {{ conference.city }}
</p>
<p class="event-sidebar__text">
<i class="event-sidebar__icon far fa-calendar-alt"></i>
{{ conference.from_date }} - {{ conference.to_date }}
</p>
<p class="event-sidebar__text">
<i class="event-sidebar__icon fas fa-users"></i>
{{ conference.max_attendees }} attendees
</p>
<p class="event-sidebar__text">
<i class="event-sidebar__icon fas fa-globe"></i>
{{ conference.get_type_display }}
</p>

<div class="event-button__wrapper">
{% if conference.tickets %}
<a class="button button--yellow mb-xs-80" href="{{ conference.tickets }}" target="_blank" role="button">Join Us!</a>
{% endif %}
</div>
<div class="social__links mb-xs-20">
{% if conference.facebook %}<a href="{{ conference.facebook }}" class="facebook" target="_blank"></a>{% endif %}
{% if conference.instagram %}<a href="{{ conference.instagram }}" class="instagram" target="_blank"></a>{% endif %}
{% if conference.twitter %}<a href="{{ conference.twitter }}" class="twitter" target="_blank"></a>{% endif %}
</div>
<h3 class="supported-by">Supported by</h3>
<img class="pfs-logo" src="{% static 'img/pfs-logo.png' %}">
<div class="event-button__wrapper">
{% if conference.tickets %}
<a class="button button--yellow mb-xs-80" href="{{ conference.tickets }}" target="_blank" role="button">Join
Us!</a>
{% endif %}
</div>
<div class="social__links mb-xs-20">
{% if conference.facebook %}<a href="{{ conference.facebook }}" class="facebook" target="_blank"></a>{% endif %}
{% if conference.instagram %}
<a href="{{ conference.instagram }}" class="instagram" target="_blank"></a>{% endif %}
{% if conference.twitter %}<a href="{{ conference.twitter }}" class="twitter" target="_blank"></a>{% endif %}
</div>
<h3 class="supported-by">Supported by</h3>
<img class="pfs-logo" src="{% static 'img/pfs-logo.png' %}">
<div><img class="pfs-logo" src="{% static 'img/euro-python-society.png' %}"></div>
</aside>
1 change: 1 addition & 0 deletions pyconbalkan/core/templates/includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<div class="dropdown-menu">
<a href="/about">About Us</a>
<a href="/faq">F.A.Q</a>
<a href="/organizers">Organizers</a>
<a href="/coc">CoC</a>
</div>
Expand Down
Empty file added pyconbalkan/faq/__init__.py
Empty file.
12 changes: 12 additions & 0 deletions pyconbalkan/faq/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django.contrib import admin

from .models import Faq


class FaqAdmin(admin.ModelAdmin):
class Meta:
model = Faq


admin.site.register(Faq, FaqAdmin)

6 changes: 6 additions & 0 deletions pyconbalkan/faq/api_urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from rest_framework import routers

from pyconbalkan.faq.views import FaqViewSet

router = routers.DefaultRouter()
router.register(r'faq', FaqViewSet)
5 changes: 5 additions & 0 deletions pyconbalkan/faq/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class FaqConfig(AppConfig):
name = 'faq'
26 changes: 26 additions & 0 deletions pyconbalkan/faq/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 2.0.5 on 2018-10-19 20:12

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Faq',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('active', models.BooleanField(default=False)),
('question', models.CharField(blank=True, max_length=100, null=True)),
('answer', models.TextField(blank=True, null=True)),
],
options={
'abstract': False,
},
),
]
Empty file.
11 changes: 11 additions & 0 deletions pyconbalkan/faq/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django.db import models

from pyconbalkan.core.models import ActiveModel


class Faq(ActiveModel):
question = models.CharField(null=True, blank=True, max_length=100)
answer = models.TextField(null=True, blank=True)

def __str__(self):
return self.question
9 changes: 9 additions & 0 deletions pyconbalkan/faq/serializers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from rest_framework import serializers

from pyconbalkan.faq.models import Faq


class FaqSerializer(serializers.ModelSerializer):
class Meta:
model = Faq
fields = '__all__'
41 changes: 41 additions & 0 deletions pyconbalkan/faq/templates/faq.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{% extends "base.html" %}

{% load static %}

{% block main_content %}

{# Faq #}


{% if faq %}
<div class="row">
<h1 class="centered">F.A.Q - Frequently Asked Questions</h1>
<div class="column">

{% for item in faq %}
<button class="accordion">{{ item.question }}</button>
<div class="panel">
<p>{{ item.answer }}</p>
</div>
{% endfor %}
</div>
</div>
{% else %}
<h2 class="title title--white title--medium title--uppercase mt-xs-20 mb-xs-80">
<span class="featured-letter featured-letter--blue">C</span>oming <span
class="featured-letter featured-letter--yellow">S</span>oon
</h2>
{% endif %}


{% if response_guide %}
<a href="{% url 'response_guide' slug=response_guide.slug %}">
<h1>{{ response_guide.title|safe }}</h1>
</a>
{% endif %}

{% endblock %}

{% block scripts %}
<script src="{% static 'js/accordion.js' %}"></script>
{% endblock %}
3 changes: 3 additions & 0 deletions pyconbalkan/faq/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.
20 changes: 20 additions & 0 deletions pyconbalkan/faq/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from django.shortcuts import render
from rest_framework import viewsets

from pyconbalkan.faq.models import Faq
from pyconbalkan.faq.serializers import FaqSerializer
from pyconbalkan.coc.views import coc_view
from pyconbalkan.organizers.views import organizers_list


class FaqViewSet(viewsets.ModelViewSet):
queryset = Faq.objects.all()
serializer_class = FaqSerializer


def faq_view(request):
faq = Faq.objects.filter(active=True)
context = {
'faq': faq,
}
return render(request, 'faq.html', context)
1 change: 1 addition & 0 deletions pyconbalkan/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
'pyconbalkan.news',
'pyconbalkan.coc',
'pyconbalkan.info',
'pyconbalkan.faq',
# others
'rest_framework',
'django_countries',
Expand Down
7 changes: 6 additions & 1 deletion pyconbalkan/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
from pyconbalkan.speaker.views import *
from pyconbalkan.sponsors.api_urls import router as sponsors
from pyconbalkan.sponsors.views import sponsor_view, sponsoring_view, sponsors_view
from pyconbalkan.timetable.views import timetable_view
from pyconbalkan.faq.views import faq_view
from pyconbalkan.faq.api_urls import router as faq

router = routers.DefaultRouter()
router.extend(conference)
Expand All @@ -37,6 +40,7 @@
router.extend(contact)
router.extend(news)
router.extend(coc)
router.extend(faq)

urlpatterns = [
path('', views.home, name='index'),
Expand All @@ -62,11 +66,12 @@
path('admin/', admin.site.urls),
path('api/', include(router.urls)), # API
path('markdownx/', include(markdownx)),
path('faq', faq_view, name='faq')
path('timetable/', serve, {'path': 'pycon-balkan-2018-timetable.pdf', 'document_root': PDF_ROOT}, name='timetable'),
# path('timetable/', timetable_view, name='timetable')
]

# Add Django site authentication urls (for login, logout, password management)
urlpatterns += [
path('accounts/', include('django.contrib.auth.urls')),
]
]