Browse Source

...

master
Volker Birk 3 years ago
parent
commit
42a1deee3f
20 changed files with 167 additions and 162 deletions
  1. +1
    -0
      .hgignore
  2. +5
    -0
      contribution/settings.py
  3. +106
    -0
      locale/de/LC_MESSAGES/django.po
  4. +2
    -1
      register/admin.py
  5. +1
    -0
      register/fixtures/init.py
  6. +1
    -1
      register/migrations/0001_initial.py
  7. +20
    -2
      register/migrations/0002_auto_20181125_1424.py
  8. +3
    -4
      register/migrations/0003_auto_20181125_1432.py
  9. +0
    -32
      register/migrations/0004_auto_20181124_1917.py
  10. +0
    -25
      register/migrations/0005_content.py
  11. +0
    -25
      register/migrations/0006_auto_20181124_1941.py
  12. +0
    -18
      register/migrations/0007_delete_content.py
  13. +0
    -20
      register/migrations/0008_patch_comment.py
  14. +0
    -20
      register/migrations/0009_softwareproject_license.py
  15. +15
    -1
      register/models.py
  16. +7
    -10
      register/views.py
  17. +2
    -1
      requirements.txt
  18. +1
    -1
      templates/register/cla.html.en
  19. +1
    -1
      templates/register/index.html
  20. +2
    -0
      templates/register/register_account.html

+ 1
- 0
.hgignore View File

@ -3,5 +3,6 @@ syntax: glob
*.pyc
__pycache__
*.swp
*.mo
ws
db.sqlite3

+ 5
- 0
contribution/settings.py View File

@ -123,6 +123,11 @@ USE_L10N = True
USE_TZ = True
ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window
LOCALE_PATHS = [
'locale',
]
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/


+ 106
- 0
locale/de/LC_MESSAGES/django.po View File

@ -0,0 +1,106 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-11-25 15:48+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: register/views.py:15
msgid "Thank you for offering code contribution!"
msgstr "Danke für das Angebot einer Code-Contribution!"
#: templates/register/index.html:9
msgid "How do you want to contribute?"
msgstr "Auf welche Weise möchtest Du beitragen?"
#: templates/register/index.html:13
msgid "Contribute anonymously"
msgstr "Anonym beitragen"
#: templates/register/index.html:14
msgid "Register for contribution"
msgstr "Für einen Beitrag registrieren"
#: templates/register/index.html:15
msgid "I'm already registered"
msgstr "Ich bin bereits registriert"
#: templates/register/patch.html:8
msgid "Thank you for supplying a patch anonymously!"
msgstr "Danke für den anonym eingesandten Patch!"
#: templates/register/patch.html:9
msgid ""
"For being anonymous in the Web p≡p is recommending the use of the\n"
" <a href=\"https://www.torproject.org/download/download-easy.html\" "
"target=\"_blank\">Tor Browser</a>.</p>\n"
" "
msgstr ""
#: templates/register/patch.html:13
msgid ""
"To supply your patch, please fill out the following\n"
" fields! You can just copy and paste your patch into the Patch field.\n"
" Don't forget to select the project your patch is meant to be used for.\n"
" If applicable please fill out the comments field and give a short\n"
" description what your patch does."
msgstr ""
#: templates/register/patch.html:24
msgid "Accept and submit"
msgstr ""
#: templates/register/register_account.html:15
msgid "Accept and register"
msgstr ""
#: templates/register/softwareproject_list.html:8
msgid ""
"If you're already a registered contributor, then you can\n"
" find information about the state of development of the p≡p project "
"you're\n"
" interested in by either browsing the repo or the ticket system of the\n"
" project you're interested in, or by sending an email to the maintainer.\n"
" "
msgstr ""
#: templates/register/softwareproject_list.html:14
msgid "Please use this directory for finding the needed links"
msgstr ""
#: templates/register/softwareproject_list.html:16
msgid "Software projects of p≡p"
msgstr ""
#: templates/register/softwareproject_list.html:20
msgid "Software project"
msgstr ""
#: templates/register/softwareproject_list.html:22
msgid "Maintainer"
msgstr ""
#: templates/register/softwareproject_list.html:23
msgid "Email"
msgstr ""
#: templates/register/thanks_anonymous.html:9
msgid "We got your submission."
msgstr ""
#: templates/register/thanks_anonymous.html:9
msgid "Thank you!"
msgstr ""

+ 2
- 1
register/admin.py View File

@ -1,6 +1,6 @@
from django.contrib import admin
from modeltranslation.admin import TranslationAdmin
from .models import SoftwareProject, Patch
from .models import SoftwareProject, Patch, Contributor
class PatchInline(admin.StackedInline):
@ -18,3 +18,4 @@ class SoftwareProjectAdmin(TranslationAdmin):
admin.site.register(SoftwareProject, SoftwareProjectAdmin)
admin.site.register(Contributor)

+ 1
- 0
register/fixtures/init.py
File diff suppressed because it is too large
View File


+ 1
- 1
register/migrations/0001_initial.py View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-11-24 15:09
# Generated by Django 1.11.14 on 2018-11-25 14:24
from __future__ import unicode_literals
from django.db import migrations


register/migrations/0002_auto_20181124_1510.py → register/migrations/0002_auto_20181125_1424.py View File


register/migrations/0003_auto_20181124_1512.py → register/migrations/0003_auto_20181125_1432.py View File


+ 0
- 32
register/migrations/0004_auto_20181124_1917.py View File

@ -1,32 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-11-24 19:17
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('register', '0003_auto_20181124_1512'),
]
operations = [
migrations.AddField(
model_name='softwareproject',
name='desc_de',
field=models.TextField(null=True, verbose_name='description'),
),
migrations.AddField(
model_name='softwareproject',
name='desc_en',
field=models.TextField(null=True, verbose_name='description'),
),
migrations.AlterField(
model_name='patch',
name='contributor',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
]

+ 0
- 25
register/migrations/0005_content.py View File

@ -1,25 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-11-24 19:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('register', '0004_auto_20181124_1917'),
]
operations = [
migrations.CreateModel(
name='Content',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('greeting', models.TextField()),
],
options={
'verbose_name_plural': 'Content',
},
),
]

+ 0
- 25
register/migrations/0006_auto_20181124_1941.py View File

@ -1,25 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-11-24 19:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('register', '0005_content'),
]
operations = [
migrations.AddField(
model_name='content',
name='greeting_de',
field=models.TextField(null=True),
),
migrations.AddField(
model_name='content',
name='greeting_en',
field=models.TextField(null=True),
),
]

+ 0
- 18
register/migrations/0007_delete_content.py View File

@ -1,18 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-11-24 19:44
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('register', '0006_auto_20181124_1941'),
]
operations = [
migrations.DeleteModel(
name='Content',
),
]

+ 0
- 20
register/migrations/0008_patch_comment.py View File

@ -1,20 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-11-24 23:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('register', '0007_delete_content'),
]
operations = [
migrations.AddField(
model_name='patch',
name='comment',
field=models.TextField(default='', verbose_name='comment from the author'),
),
]

+ 0
- 20
register/migrations/0009_softwareproject_license.py View File

@ -1,20 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-11-24 23:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('register', '0008_patch_comment'),
]
operations = [
migrations.AddField(
model_name='softwareproject',
name='license',
field=models.CharField(default='GNU General Public License 3.0', max_length=200, verbose_name='GNU License'),
),
]

+ 15
- 1
register/models.py View File

@ -15,13 +15,27 @@ class SoftwareProject(models.Model):
return self.name
class Contributor(models.Model):
name = models.CharField(max_length=200)
email = models.EmailField(default=None, blank=True, null=True)
street = models.CharField(max_length=200)
pc = models.CharField(max_length=20)
city = models.CharField(max_length=200)
country = models.CharField(max_length=200)
applied = models.DateTimeField('date of application', default=timezone.now)
sigend = models.DateTimeField('date of signing', blank=True, null=True)
def __str__(self):
return self.name
class Patch(models.Model):
class Meta:
verbose_name_plural = "Patches"
project = models.ForeignKey(SoftwareProject, default=None)
subm_date = models.DateTimeField('date of submission', default=timezone.now)
contributor = models.ForeignKey(settings.AUTH_USER_MODEL, default=2)
contributor = models.ForeignKey(Contributor, default=1)
patch = models.TextField()
comment = models.TextField('comment from the author', default='')

+ 7
- 10
register/views.py View File

@ -3,11 +3,10 @@ from django.http import HttpResponse, HttpResponseRedirect
from django.template import loader
from django.utils.translation import gettext_lazy as _
from django.utils.translation import get_language
from django.forms import ModelForm, Form, CharField, EmailField
from django.forms import ModelForm, Form, CharField, EmailField, TextInput
from django.views.generic.list import ListView
from simplemathcaptcha.fields import MathCaptchaField
from .models import SoftwareProject, Patch
from .models import SoftwareProject, Patch, Contributor
def index(request):
template = loader.get_template('register/index.html')
@ -25,8 +24,6 @@ class PatchForm(ModelForm):
model = Patch
fields = ('project', 'patch', 'comment')
#captcha = MathCaptchaField()
def anonymous(request):
if request.method == 'POST':
@ -50,11 +47,10 @@ def thanks_anonymous(request):
return HttpResponse(template.render(context, request))
class RegisterAccountForm(Form):
username = CharField(label=_("username"))
first_name = CharField(label=_("first name"))
last_name = CharField(label=_("last name"))
email = EmailField(label=_("email"))
class RegisterAccountForm(ModelForm):
class Meta:
model = Contributor
fields = ('name', 'email', 'street', 'pc', 'city', 'country')
def register_account(request):
@ -69,6 +65,7 @@ def register_account(request):
{
'form': form,
'error_message': error_message,
'cla': "register/cla.html." + get_language(),
}
)


+ 2
- 1
requirements.txt View File

@ -1,2 +1,3 @@
django-modeltranslation >= 0.13b1
django-simple-math-captcha
django-registration

+ 1
- 1
templates/register/cla.html.en View File

@ -2,7 +2,7 @@
<h2>p≡p Foundation – Contributor Copyright Assignment</h2>
<p>p≡p is a project founded, developed, directed and supported by p≡p
<p>p≡p is a project founded, developed, directed and supported by the p≡p
Foundation, Oberer Graben 4, 8400 Winterthur, Switzerland, a non-profit and
tax-exempt foundation founded and registered in Switzerland (UID
CHE‑497.782.377, the "Foundation"), which aims to develop free software to


+ 1
- 1
templates/register/index.html View File

@ -6,7 +6,7 @@
<article>
{% include greeting %}
<p>How do you want to contribute?</p>
<p>{% trans "How do you want to contribute?" %}</p>
</article>
<nav>


+ 2
- 0
templates/register/register_account.html View File

@ -6,6 +6,8 @@
{% block main %}
{% include cla %}
<article>
<form action="{% url 'register_account' %}" method="post" name="register_account" class="table">
{% csrf_token %}


Loading…
Cancel
Save