4 | {% for field_item in history_entry.fields.items %}
5 | {% if field_item.0 not in HIDDEN_JOBOFFER_FIELDS %}
6 | {% if field_item.0 == 'description' %}
7 |
14 |
15 | {% endblock %}
16 |
--------------------------------------------------------------------------------
/joboffers/templatetags/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PyAr/pyarweb/f87f93cabcf4602efbeaf38f778c3448e40fc849/joboffers/templatetags/__init__.py
--------------------------------------------------------------------------------
/joboffers/templatetags/history.py:
--------------------------------------------------------------------------------
1 | from django import template
2 | from django.core.exceptions import FieldDoesNotExist
3 |
4 | from ..models import JobOffer
5 |
6 |
7 | register = template.Library()
8 |
9 |
10 | @register.filter
11 | def verbose_name(model, field_name):
12 | """
13 | Get the verbose name for a given model instance and field name.
14 | The model must have the get_options() method implemented
15 | """
16 | meta = model.get_options()
17 |
18 | field = meta.get_field(field_name)
19 | return field.verbose_name
20 |
21 |
22 | @register.filter
23 | def joboffer_verbose_name(field_item):
24 | """
25 | Get the verbose name for a field_item (key-value). It returns the same field_name if the field
26 | is not present in the model anymore. That will be the case of a field removed/renamed in the
27 | model.
28 | The model must have the get_options() method implemented
29 | """
30 | field_name, _ = field_item
31 | meta = JobOffer.get_options()
32 | try:
33 | field = meta.get_field(field_name)
34 | except FieldDoesNotExist:
35 | return field_name
36 | return field.verbose_name
37 |
38 |
39 | @register.filter
40 | def joboffer_value(field_item):
41 | """
42 | Get the human readable value for a joboffer for a key-value pair.
43 | """
44 | field_name, field_value = field_item
45 | meta = JobOffer.get_options()
46 |
47 | try:
48 | field = meta.get_field(field_name)
49 | except FieldDoesNotExist:
50 | return field_value
51 |
52 | attr_name = field.attname # Foreign keys use a different attribute name
53 | joboffer = JobOffer(**{attr_name: field_value})
54 |
55 | display_function = getattr(joboffer, f"get_{field_name}_display", None)
56 |
57 | if display_function:
58 | return display_function()
59 | else:
60 | try:
61 | return getattr(joboffer, field_name)
62 | except ValueError:
63 | return field_value
64 |
65 |
66 | @register.filter
67 | def get_old_field_item(field_update):
68 | """
69 | Get the old key-value for a field_update.
70 | """
71 | return (field_update[0], field_update[1][0])
72 |
73 |
74 | @register.filter
75 | def get_new_field_item(field_update):
76 | """
77 | Get the new key-value for a field_update.
78 | """
79 | return (field_update[0], field_update[1][1])
80 |
--------------------------------------------------------------------------------
/joboffers/tests/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PyAr/pyarweb/f87f93cabcf4602efbeaf38f778c3448e40fc849/joboffers/tests/__init__.py
--------------------------------------------------------------------------------
/joboffers/tests/fixtures.py:
--------------------------------------------------------------------------------
1 | import pytest
2 | import re
3 |
4 | from requests_mock import ANY
5 |
6 | from events.tests.factories import UserFactory
7 |
8 |
9 | @pytest.fixture(name='publisher_client')
10 | def create_publisher_client(client, user_company_profile):
11 | """
12 | Django client fixture with a logged publisher user
13 | """
14 | user = user_company_profile.user
15 | client.force_login(user)
16 |
17 | return client
18 |
19 |
20 | @pytest.fixture(name='admin_user')
21 | def create_admin_user():
22 | """
23 | Create and return a random admin user
24 | """
25 | return UserFactory(is_superuser=True)
26 |
27 |
28 | @pytest.fixture(name='admin_client')
29 | def create_admin_client(client, admin_user):
30 | """
31 | Django client fixture with a logged admin user
32 | """
33 | client.force_login(admin_user)
34 |
35 | return client
36 |
37 |
38 | class DummyTelegram:
39 | """
40 | Convenience wrapper of requests mock to simulate telegram responses and tests messages sent
41 | """
42 | def __init__(self, requests_mock):
43 | self.requests_mock = requests_mock
44 |
45 | @property
46 | def call_history(self):
47 | return [history.qs for history in self.requests_mock.request_history]
48 |
49 |
50 | @pytest.fixture(name='telegram_dummy')
51 | def create_telegram_dummy(requests_mock, settings):
52 | settings.TELEGRAM_BOT_TOKEN = '12345'
53 | settings.TELEGRAM_MESSAGE_PREFIX = '[TEST]'
54 | settings.TELEGRAM_MODERATORS_CHAT_ID = 1
55 |
56 | matcher = re.compile(r'api.telegram.org/bot.*$')
57 | requests_mock.register_uri(ANY, matcher, text='dummy response')
58 |
59 | return DummyTelegram(requests_mock)
60 |
--------------------------------------------------------------------------------
/joboffers/tests/joboffers_descriptions.py:
--------------------------------------------------------------------------------
1 | LONG_JOBOFFER_DESCRIPTION = (
2 | '
Onapsis is rapidly expanding, achieving record growth year after year. '
3 | 'We are seeking passionate contributors who thrive in an open and collaborative environment.'
4 | '
Key activities and responsibilities:
Understand how to'
5 | ' implement an assigned requirement, estimating its effort, proposing different solutions. '
6 | 'Evaluate new technologies related to the core business of the company. Create back-end '
7 | 'automated test cases. Propose improvements to current development procedures. Clearly'
8 | ' document the iteration between modules and their APIs Work collaboratively within a team'
9 | ' of designers and engineers to iterate towards product definition. Be ready to speak your '
10 | 'mind, but also commit to team direction.
'
11 | )
12 |
13 | STRIPPED_LONG_JOBOFFER_DESCRIPTION = (
14 | 'Onapsis is rapidly expanding, achieving record growth year after year. We are seeking'
15 | ' passionate contributors who thrive in an open and collaborative environment. Key activities'
16 | ' and responsibilities: Understand how to implement an assigned requirement, estimating its '
17 | 'effort, proposing different solutions. Evaluate new technologies related to the core business'
18 | ' of the company. Create back-end automated test cases. Propose improvements to current '
19 | 'development procedures. Clearly document the iteration between m'
20 | )
21 |
22 | SHORT_JOBOFFER_DESCRIPTION = '
{% blocktrans with confirmation.email_address.email as email %}Please confirm that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktrans %}
17 | {% blocktrans with site.name as site_name %}Please sign in with one
18 | of your existing third party accounts. Or, sign up
19 | for a {{site_name}} account and sign in below:{% endblocktrans %}
20 |
21 |
22 |
23 |
24 | {% include "socialaccount/snippets/provider_list.html" with process="login" %}
25 |
{% if token_fail %}{% trans "Bad Token" %}{% else %}{% trans "Change Password" %}{% endif %}
12 |
13 | {% if token_fail %}
14 | {% url 'account_reset_password' as passwd_reset_url %}
15 |
{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% endblocktrans %}
16 | {% else %}
17 | {% if form %}
18 |
23 | {% else %}
24 |
{% blocktrans %}We have sent an e-mail to you for verification. Follow the link provided to finalize the signup process. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}
3 | El día {{ email_confirmation.content_object.created_at }}, a través del
4 | sitio de PyAr,
5 | ha solicitado inscribirse al evento {{ event.name|title }}.
6 |
7 |
Para verificar la inscripción haga click en el siguiente link:
8 | {% with confirmation_url=email_confirmation.get_confirmation_url %}
9 |
Nuestro chat original fue el IRC en el servidor de Freenode. En Mayo de 2021 nos mudamos a https://libera.chat.
10 | podes simplemente utilizar tu cliente favorito y conectarte a irc.libera.chat.
11 |
Telegram
12 |
También tenemos un canal en telegram al que podes acceder utilizando este link: https://t.me/pythonargentina
13 |
Bridges
14 |
Todos los canales están conectados con un "bridge" (puente en inglés). Por lo que no importa si estas en Telegram o IRC
15 | vas a poder hablar con los usuarios de cada lado del puente.
16 |
Además tenemos un bridge en Matrix al que podes acceder utilizando este link #pyar:libera.chat
17 |
Código de Conducta
18 |
En todos los canales o eventos te pedimos que leas y respetes nuestro CoC. https://ac.python.org.ar/#coc
19 | {% endblock %}
20 |
--------------------------------------------------------------------------------
/templates/jobs/_jobs_tags.html:
--------------------------------------------------------------------------------
1 | {% load i18n %}
2 |
3 | {% for tag in object.tags.all %}
4 | {{ tag.name }}
5 | {% endfor %}
6 |
--------------------------------------------------------------------------------
/templates/jobs/inactivate_job_email.txt:
--------------------------------------------------------------------------------
1 | Te informamos que tu aviso de trabajo "{{ job_title }}" fue dado de baja.
2 |
3 | Motivo: {{ reason }}
4 | {% if comment %}
5 | Detalles: {{ comment }}
6 | {% endif %}
7 |
8 | El equipo de PyAr.
9 |
--------------------------------------------------------------------------------
/templates/jobs/job_confirm_delete.html:
--------------------------------------------------------------------------------
1 | {% extends "confirm_delete.html" %}
2 | {% load i18n %}
3 |
4 | {% block page_title %}{% trans 'Borrar trabajo' %}{% endblock %}
5 |
6 | {% block return_url %}{% url 'jobs_view' object.slug %}{% endblock %}
--------------------------------------------------------------------------------
/templates/jobs/job_detail.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 | {% load i18n %}
3 | {% load email_obfuscator %}
4 | {% load devtags %}
5 |
6 | {% block title %}
7 | {{ object.title }}
8 | {% endblock %}
9 |
10 | {% block content %}
11 |
12 |
13 |