Skip to content

Commit 61137ad

Browse files
committed
Relocate faq app into about app
1 parent 1b39ddc commit 61137ad

21 files changed

Lines changed: 37 additions & 74 deletions

File tree

apps/about/admin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ class AllyAdmin(admin.ModelAdmin):
1111
'twitter',
1212
'email',
1313
)
14+
15+
16+
admin.site.register(models.FAQItem)
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
# Generated by Django 2.2.24 on 2021-10-22 18:11
1+
# Generated by Django 2.2.24 on 2021-10-26 17:43
22

33
from django.db import migrations, models
44

55

66
class Migration(migrations.Migration):
77

8-
initial = True
9-
108
dependencies = [
9+
('about', '0002_auto_20211019_2054'),
1110
]
1211

1312
operations = [

apps/about/models.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,13 @@ def __str__(self):
1616

1717
class Meta:
1818
ordering = ['name']
19+
20+
21+
class FAQItem(models.Model):
22+
'''Preguntas frecuentes'''
23+
24+
question = models.CharField(max_length=200)
25+
answer = models.TextField()
26+
27+
def __str__(self):
28+
return self.question
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.faq-index {
2+
p {
3+
padding-top: 0.5rem;
4+
padding-bottom: 0.5rem;
5+
}
6+
7+
.dyn-anchor-link i:hover {
8+
color: tomato;
9+
}
10+
}

apps/about/static/about/css/main.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
@import './about-us';
44
@import './allies';
5+
@import './faq';
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "faq/base.html" %}
1+
{% extends "about/base.html" %}
22

33
{% block title %}Asociación - {{ block.super }}{% endblock %}
44

@@ -13,9 +13,8 @@ <h1 class="title">FAQ</h1>
1313
{% for faq in faqs %}
1414
<article class="faq" id="faq{{ faq.id }}">
1515
<div class="message-header dyn-anchor-heading">
16-
<a id="#faq{{ faq.id }}">
17-
Q: {{ faq.question }}
18-
</a>
16+
{{ faq.question }}
17+
<a class="dyn-anchor-link" href="#faq{{ faq.id }}"><i class="fas fa-link"></i></a>
1918
</div>
2019
<div class="faq-answer">
2120
<p>{{ faq.answer|linebreaksbr }}</p>

apps/about/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
path('join/', views.join, name='join'),
1111
path('history/', views.history, name='history'),
1212
path('allies/', views.allies, name='allies'),
13+
path('faq/', views.faq_list, name='faq'),
1314
]

apps/about/views.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from apps.members.models import Position
66

7-
from .models import Ally
7+
from .models import Ally, FAQItem
88

99
logger = logging.getLogger(__name__)
1010

@@ -35,3 +35,8 @@ def history(request):
3535
def allies(request):
3636
allies = Ally.objects.all()
3737
return render(request, 'about/allies.html', {'allies': allies})
38+
39+
40+
def faq_list(request):
41+
faqs = FAQItem.objects.order_by('id')
42+
return render(request, 'about/faq_list.html', {'faqs': faqs})

apps/commons/templates/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<a class="navbar-item {% is_active 'about:history' %}" href="{% url 'about:history' %}">Historia</a>
2626
<a class="navbar-item {% is_active 'about:join' %}" href="{% url 'about:join' %}">¡Únete!</a>
2727
<a class="navbar-item {% is_active 'about:allies' %}" href="{% url 'about:allies' %}">Aliados</a>
28-
<a class="navbar-item {% is_active 'faq:faq_list' %}" href="{% url 'faq:faq_list' %}">FAQ</a>
28+
<a class="navbar-item {% is_active 'about:faq' %}" href="{% url 'about:faq' %}">FAQ</a>
2929
</div>
3030
</div>
3131
<div class="navbar-item has-dropdown is-hoverable">

apps/faq/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)