Skip to content

Commit c45639d

Browse files
committed
216-Add FAQ-mhered-first commit
1 parent b28109f commit c45639d

16 files changed

Lines changed: 141 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 2.2.24 on 2021-10-19 20:54
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('about', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.AlterModelOptions(
14+
name='ally',
15+
options={'ordering': ['name']},
16+
),
17+
]

apps/faq/__init__.py

Whitespace-only changes.

apps/faq/admin.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.
4+
from .models import FAQItem
5+
6+
admin.site.register(FAQItem)
7+
8+
"""
9+
# una referencia de pycan:
10+
11+
from . import models
12+
13+
14+
@admin.register(models.Ally)
15+
class AllyAdmin(admin.ModelAdmin):
16+
list_display = (
17+
'name',
18+
'url',
19+
'twitter',
20+
'email',
21+
)
22+
"""

apps/faq/apps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class FaqConfig(AppConfig):
5+
name = 'faq'
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Django 2.2.24 on 2021-10-22 18:11
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
initial = True
9+
10+
dependencies = [
11+
]
12+
13+
operations = [
14+
migrations.CreateModel(
15+
name='FAQItem',
16+
fields=[
17+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18+
('question', models.CharField(max_length=200)),
19+
('answer', models.TextField()),
20+
],
21+
),
22+
]

apps/faq/migrations/__init__.py

Whitespace-only changes.

apps/faq/models.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from django.db import models
2+
3+
4+
class FAQItem(models.Model):
5+
'''Preguntas frecuentes'''
6+
7+
question = models.CharField(max_length=200)
8+
answer = models.TextField()
9+
10+
def __str__(self):
11+
return self.question

apps/faq/static/faq/main.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@import 'apps/commons/static/commons/css/base';
2+
@import 'apps/commons/static/commons/css/dyn-anchors';
3+
@import 'apps/commons/static/commons/css/override';
4+
@import 'apps/commons/static/commons/css/variables';

apps/faq/templates/faq/base.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% extends "base.html" %}
2+
3+
{% load utils %}
4+
5+
{% block style %}
6+
<link rel="stylesheet" href="{{ assets|get_asset_key:'about/custom.min.css' }}">
7+
{% endblock style %}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{% extends "faq/base.html" %}
2+
3+
{% block title %}Asociación - {{ block.super }}{% endblock %}
4+
5+
{% block body_class %}about-index{% endblock %}
6+
7+
{% block content %}
8+
<h1 class="title">FAQ</h1>
9+
<div class="intro">
10+
<p>Bienvenido a nuestra seccion de respuestas a preguntas frecuentes</p>
11+
</div>
12+
13+
{% for faq in faqs %}
14+
<article class="faq" id="faq{{ faq.id }}">
15+
<div class="message-header dyn-anchor-heading">
16+
<a id="#faq{{ faq.id }}">
17+
Q: {{ faq.question }}
18+
</a>
19+
</div>
20+
<div class="faq-answer">
21+
<p>{{ faq.answer|linebreaksbr }}</p>
22+
</div>
23+
</article>
24+
{% endfor %}
25+
26+
{% endblock content %}

0 commit comments

Comments
 (0)