Skip to content
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
6 changes: 5 additions & 1 deletion src/pyvecorg/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def parse_members(rows):


def coerce_member(member):
return {
result = {
'name': strip_whitespace(member.get('nickname', member.get('name'))),
'role': strip_whitespace(member.get('role', 'member')),
'github': strip_whitespace(member.get('github')),
Expand All @@ -52,6 +52,10 @@ def coerce_member(member):
'linkedin': strip_whitespace(member.get('linkedin')),
'avatar_filename': strip_whitespace(member.get('avatar_filename')),
}
if coc_mail := strip_whitespace(member.get('coc_mail')):
result['coc_mail'] = coc_mail
return result



def strip_whitespace(value):
Expand Down
26 changes: 22 additions & 4 deletions src/pyvecorg/data/coc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ text:

## Co dělat, když jste svědky nebo oběťmi nepřijatelného chování

Pokud jste obětí nebo svědkem nepřijatelného chování, nebo máte jakékoliv jiné obavy, co nejdříve to nahlaste organizátorům akce.
Pokud jste obětí nebo svědkem nepřijatelného chování, nebo máte jakékoliv jiné obavy, co nejdříve to nahlaste na jeden z kontaktů uvedený níže.

Náš tým se postará o to, abyste byli v bezpečí. Jakmile budete v bezpečí, požádáme vás o podrobnosti o tom, co se stalo. Chápeme, že to může být nepříjemné, ale budeme s vámi jednat s respektem a můžete si přivést někoho na podporu. Nebudeme vás nutit konfrontovat nikoho osobně a vaše identita zůstane anonymní.

Expand All @@ -57,10 +57,19 @@ text:

## Řešení stížností

Pokud máte pocit, že jste byli neprávem obviněni z porušení tohoto Kodexu chování, můžete se obrátit na jednoho z organizátorů akce s popisem vaší stížnosti.
Pokud máte pocit, že jste byli neprávem obviněni z porušení tohoto Kodexu chování, můžete se obrátit na kontakty níže.

Vaše stížnost bude vyřešena v souladu s našimi vnitřními pravidly.

## Kontakty

Hlášení a stížnosti posílejte na následující kontakty:

* Pokud má akce (např. konference) vlastní seznam kontaktů, využijte ten.
* Pokud nemá, nebo ho nechcete využít (např. se obáváte střetu zájmů), pošlete stížnost na e-mail [board@pyvec.org](mailto:board@pyvec.org?subject=Kodex chování). Stížnost přijde všem členům výboru spolku Pyvec.
* Nechcete-li, aby stížnost četl celý výbor, můžete se obrátit na tyto jeho jednotlivé členy:
{COC_MEMBER_LIST}

## Inspirace

Tento Kodex chování byl inspirován [Berlínským kodexem chování](https://berlincodeofconduct.org/) a kodexem chování [JS Conf](https://2018.jsconf.eu/code-of-conduct/).
Expand Down Expand Up @@ -109,7 +118,7 @@ text:

## If You Witness or Are Subject to Unacceptable Behavior

If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible.
If you are subject to or witness unacceptable behavior, or have any other concerns, please notify one of the contacts listed below.

Our staff will ensure you are safe. Once safe, we’ll ask you to tell us about what happened. This can be upsetting, but we’ll handle it as respectfully as possible, and you can bring someone to support you. You won’t be asked to confront anyone and we won’t tell anyone who you are.

Expand All @@ -119,10 +128,19 @@ text:

## Addressing Grievances

If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify one of the event organizers with a concise description of your grievance.
If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify one of the contacts below with a concise description of your grievance.

Your grievance will be handled in accordance with our existing governing policies.

## Contacts

Please send reports and grievances to the following contacts:

* If the event (for example, a conference) publishes a Code of Conduct contacts, notify them.
* Otherwise, or if you don't want to use those contacts (for example, you are worried about a conflict of interest), send an email to [board@pyvec.org](mailto:board@pyvec.org?subject=Code of Conduct). The message will reach the Pyvec Board of directors.
* If you do not want the whole Board to read your message, you can contact its members individually:
{COC_MEMBER_LIST}

## Credits

This Code of Conduct was inspired by the [Berlin](https://berlincodeofconduct.org/) and [JS Conf](https://2018.jsconf.eu/code-of-conduct/) codes of conduct.
3 changes: 3 additions & 0 deletions src/pyvecorg/data/definitions/member_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
},
"avatar_filename": {
"type": "string"
},
"coc_mail": {
"type": "string"
}
},
"additionalProperties": false,
Expand Down
24 changes: 22 additions & 2 deletions src/pyvecorg/templates/coc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,29 @@

{% block cover %}{% endblock %}

{% macro coc_contact_list() -%}
<ul>
{% if members_list %}
{% for member in members_list.board %}
{% if 'coc_mail' in member %}
<li>
{{ member.name }}:
<a href="mailto:{{ member.coc_mail }}">
{{ member.coc_mail }}
</a>
</li>
{% endif %}
{% endfor %}
{% endif %}
</ul>
{%- endmacro %}

{% block content %}
<div class="container">
<h2 id="coc">{{ coc.heading }}</h2>
{{ coc.text|markdown }}
{{ coc.text
| markdown
| replace('{COC_MEMBER_LIST}', coc_contact_list())
}}
</div>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion src/pyvecorg/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ def coc(lang):
context = select_language(data, lang)
context['lang'] = lang
context['this'] = 'coc'
return render_template('coc.html', **context)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated :)

return render_template('coc.html', **context)
6 changes: 6 additions & 0 deletions tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ def test_coerce_member_whitespace():
assert coerce_member(member)['mastodon'] == '@pyconcz@floss.social'


def test_coerce_member_coc_mail():
member = {'coc_mail': ' inbox@example.com'}

assert coerce_member(member)['coc_mail'] == 'inbox@example.com'


@pytest.mark.parametrize('value, expected', [
(None, None),
('', None),
Expand Down
Loading