juan carlos carvajal bermudez 5 лет назад
Родитель
Сommit
4b83361afa

+ 32 - 10
marktplatz/models.py

@@ -1,4 +1,5 @@
 from django.db import models
 from django.db import models
+from django.core.validators import MinValueValidator, MaxValueValidator
 from django.contrib.auth.models import User
 from django.contrib.auth.models import User
 from imagekit.models import ImageSpecField
 from imagekit.models import ImageSpecField
 from imagekit.processors import ResizeToFill
 from imagekit.processors import ResizeToFill
@@ -89,8 +90,8 @@ class Contact(models.Model):
     city = models.CharField(verbose_name="Stadt", blank=True,max_length = 100)
     city = models.CharField(verbose_name="Stadt", blank=True,max_length = 100)
     country = models.CharField(verbose_name="Land", blank=True,max_length = 100)
     country = models.CharField(verbose_name="Land", blank=True,max_length = 100)
     email = models.EmailField(verbose_name="E-Mail-Addresse", unique=True)
     email = models.EmailField(verbose_name="E-Mail-Addresse", unique=True)
-    phonenumber = models.CharField(verbose_name="Telefonnummer", blank=True,max_length = 100)
-    alternate_phonenumber = models.CharField(verbose_name="Telefonnummer", blank = True,max_length = 100)
+    phonenumber = models.CharField(verbose_name="1. Telefonnummer", blank=True,max_length = 100)
+    alternate_phonenumber = models.CharField(verbose_name="2. Telefonnummer", blank = True,max_length = 100)
     skype_name = models.CharField(verbose_name="Skype", blank=True,max_length = 300)
     skype_name = models.CharField(verbose_name="Skype", blank=True,max_length = 300)
     website = models.URLField(verbose_name="Website", blank=True)
     website = models.URLField(verbose_name="Website", blank=True)
 
 
@@ -182,12 +183,12 @@ class Product(models.Model):
     claim        = models.CharField( 'Claim / Untertitel', max_length = 256, help_text="Claim / Untertitel", null = True, blank=True )
     claim        = models.CharField( 'Claim / Untertitel', max_length = 256, help_text="Claim / Untertitel", null = True, blank=True )
     beschreibung = models.CharField( 'Beschreibung', max_length = 256, help_text="Beschreibung des Projektes", null = True, blank=True )
     beschreibung = models.CharField( 'Beschreibung', max_length = 256, help_text="Beschreibung des Projektes", null = True, blank=True )
     learning     = models.CharField( 'Learning', max_length = 256, help_text="Learning", null = True, blank=True )
     learning     = models.CharField( 'Learning', max_length = 256, help_text="Learning", null = True, blank=True )
-    gruendungsjahr  = models.IntegerField('Gründungsjahr', help_text="Gründungsjahr des Projekts", null = True, blank=True )
-    betriebgenommen = models.IntegerField('in Betrieb genommen in Jahr', help_text="Wann wurde das Projekt in Betrieb genommen?" , null = True, blank=True )
-    status  = models.CharField( 'Status',    max_length = 3,    choices=STATUS, default='ENT', help_text="Was ist der Status des Projektes" , null = True, blank=True )
-    adresse = models.CharField( 'Adresse',   max_length = 256,  help_text="Adresse des Projektes", null = True, blank=True )
-    website = models.URLField ( 'Website',   max_length = 2048, help_text="Website des des Projektes", null = True, blank=True )
-    frei    = models.CharField( 'Platz frei', max_length = 4,    choices=FREI, default='NEIN', help_text="Gibt es freie Plätze?", null = True, blank=True )
+    gruendungsjahr  = models.IntegerField('Gründungsjahr', help_text="Gründungsjahr des Projekts", validators=[MinValueValidator(0), MaxValueValidator(9999)], null = True, blank=True )
+    betriebgenommen = models.IntegerField('in Betrieb genommen in Jahr', help_text="Wann wurde das Projekt in Betrieb genommen?", validators=[MinValueValidator(0), MaxValueValidator(9999)], null = True, blank=True )
+    status   = models.CharField( 'Status',    max_length = 3,    choices=STATUS, default='ENT', help_text="Was ist der Status des Projektes" , null = True, blank=True )
+    adresse  = models.CharField( 'Adresse',   max_length = 256,  help_text="Adresse des Projektes", null = True, blank=True )
+    website  = models.URLField ( 'Website',   max_length = 2048, help_text="Website des des Projektes", null = True, blank=True )
+    frei     = models.CharField( 'Platz frei', max_length = 4,    choices=FREI, default='NEIN', help_text="Gibt es freie Plätze?", null = True, blank=True )
     mitmachen  = models.BooleanField( 'Mitmachen möglich', default=False, help_text="Kann jemand mitmachen?", null = True, blank=True )
     mitmachen  = models.BooleanField( 'Mitmachen möglich', default=False, help_text="Kann jemand mitmachen?", null = True, blank=True )
     rechtsform = models.CharField( 'Rechtsform', max_length = 4, choices=RECHTSFORM, default='ANDE', help_text="Rechtsform des Projektes", null = True, blank=True )
     rechtsform = models.CharField( 'Rechtsform', max_length = 4, choices=RECHTSFORM, default='ANDE', help_text="Rechtsform des Projektes", null = True, blank=True )
     ort        = models.CharField( 'Ort',        max_length = 4, choices=ORT, default='WELT', help_text="Ort des Projektes", null = True, blank=True )
     ort        = models.CharField( 'Ort',        max_length = 4, choices=ORT, default='WELT', help_text="Ort des Projektes", null = True, blank=True )
@@ -224,8 +225,29 @@ class Product(models.Model):
             yield (field.verbose_name, field.value_to_string(self))
             yield (field.verbose_name, field.value_to_string(self))
 
 
 
 
-class BuildingProduct(Product):
-    additionalInfo = models.CharField('Product Title',max_length = 100)
+class Wohnprojekt(Product):
+
+    BAUWEISE = [
+        ('HOLZ', 'Holzbau'),
+        ('ALTB', 'Altbau'),
+        ('NEUB', 'Neubau'),
+    ]
+
+    EIGENTUM = [
+        ('GEMIET', 'Generalmiete'),
+        ('WOHNHM', 'Wohnheim'),
+        ('EIGENT', 'Eigentum'),
+        ('GTMIET', 'Getrennte Mietvertäge (Verein mietet GR)'),
+    ]
+
+    UNTERST = [
+        ('GEFOR', 'Gefördert'),
+        ('NICHT', 'Nicht Gefördert'),
+    ]
+
+    anzahlmitglieder  = models.IntegerField('Anzahl der Mitglieder', help_text="Anzahl der Mitglieder", null = True, blank=True )
+    eigentum          = models.CharField( 'Rechtliche Konstruktion', max_length = 6,    choices=EIGENTUM, default='GEMIET', help_text="Rechtliche Konstruktion", null = True, blank=True )
+
 
 
 
 
 @receiver(post_delete, sender=Product)
 @receiver(post_delete, sender=Product)

BIN
marktplatz/static/MAB_logo.png~


BIN
marktplatz/static/logo.png


+ 3 - 3
marktplatz/templates/marktplatz/add.html

@@ -22,7 +22,7 @@
           <div class="">
           <div class="">
   &nbsp;
   &nbsp;
 </div>
 </div>
-<h3>Submit your Product</h3>
+<h3>Reichen Sie Ihr Projekt ein</h3>
                <div class="">
                <div class="">
   &nbsp;
   &nbsp;
 </div>
 </div>
@@ -67,14 +67,14 @@
     </div>
     </div>
              <div class="col-sm-10">
              <div class="col-sm-10">
 
 
-       <p>Please read our <strong  style="cursor:pointer" data-toggle="modal" data-target="#exampleModalLong">Terms of Participation</strong></p>
+       <p>Bitte lesen Sie unsere <strong  style="cursor:pointer" data-toggle="modal" data-target="#exampleModalLong">Teilnahmebedingungen</strong></p>
 
 
                    <!-- Modal -->
                    <!-- Modal -->
                     <div class="modal fade" id="exampleModalLong" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
                     <div class="modal fade" id="exampleModalLong" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
                       <div class="modal-dialog" role="document">
                       <div class="modal-dialog" role="document">
                         <div class="modal-content">
                         <div class="modal-content">
                           <div class="modal-header">
                           <div class="modal-header">
-                            <h5 class="modal-title" id="exampleModalLongTitle">TERMS OF PARTICIPATION</h5>
+                            <h5 class="modal-title" id="exampleModalLongTitle">Teilnahmebedingungen</h5>
                             <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                             <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                               <span aria-hidden="true">&times;</span>
                               <span aria-hidden="true">&times;</span>
                             </button>
                             </button>

+ 4 - 0
project_base/apps.py

@@ -0,0 +1,4 @@
+from constance.apps import ConstanceConfig
+
+class ConstanceBase(ConstanceConfig):
+    verbose_name = "Configuration"

+ 9 - 2
project_base/settings.py

@@ -222,6 +222,10 @@ SUBMIT_TEXT = """
 
 
 """
 """
 
 
+CONSTANCE_ADDITIONAL_FIELDS = {
+    'image_field': ['django.forms.ImageField', {}]
+}
+
 CONSTANCE_BACKEND = 'constance.backends.database.DatabaseBackend'
 CONSTANCE_BACKEND = 'constance.backends.database.DatabaseBackend'
 CONSTANCE_CONFIG = {
 CONSTANCE_CONFIG = {
     'ABOUT_CONTENT': (ABOUT_TEXT, 'Text for the about page'),
     'ABOUT_CONTENT': (ABOUT_TEXT, 'Text for the about page'),
@@ -231,6 +235,8 @@ CONSTANCE_CONFIG = {
     'INFO_TXT': (INFO_TXT, 'Text to help with the fill in the submitform'),
     'INFO_TXT': (INFO_TXT, 'Text to help with the fill in the submitform'),
     'SUBMIT_TEXT': (SUBMIT_TEXT, 'Text to welcome to the submitpage'),
     'SUBMIT_TEXT': (SUBMIT_TEXT, 'Text to welcome to the submitpage'),
     'ADMIN_EMAIL': ('juan@mediaarchitecture.org', 'Admin email'),
     'ADMIN_EMAIL': ('juan@mediaarchitecture.org', 'Admin email'),
+    'WEBSITE_TITEL': ('Markplatz', 'Name of the website'),
+    'LOGO_IMAGE': ('logo.png', 'Company logo', 'image_field'),
 }
 }
 
 
 
 
@@ -244,7 +250,8 @@ INSTALLED_APPS = [
     'django.contrib.messages',
     'django.contrib.messages',
     'django.contrib.staticfiles',
     'django.contrib.staticfiles',
     'marktplatz',
     'marktplatz',
-    'constance',
+    #'constance',
+    'project_base.apps.ConstanceBase',
     'constance.backends.database',
     'constance.backends.database',
     'imagekit',
     'imagekit',
     'crispy_forms',
     'crispy_forms',
@@ -381,7 +388,7 @@ AUTH_PASSWORD_VALIDATORS = [
 # Internationalization
 # Internationalization
 # https://docs.djangoproject.com/en/2.0/topics/i18n/
 # https://docs.djangoproject.com/en/2.0/topics/i18n/
 
 
-LANGUAGE_CODE = 'en-us'
+LANGUAGE_CODE = 'de-at'
 
 
 
 
 # Local time zone for this installation. Choices can be found here:
 # Local time zone for this installation. Choices can be found here:

+ 11 - 11
project_base/templates/base_generic.html

@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
-<html lang="en">
+<html lang="de">
 <head>
 <head>
 
 
     <meta charset="UTF-8">
     <meta charset="UTF-8">
-    {% block title %} <title>MAB20</title> {% endblock %}
+    {% block title %} <title>MARKTPLATZ</title> {% endblock %}
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     {% load static %}
     {% load static %}
 
 
@@ -38,18 +38,18 @@
   <div class="collapse navbar-collapse" id="navbarNavAltMarkup">
   <div class="collapse navbar-collapse" id="navbarNavAltMarkup">
 
 
     <div class="navbar-nav navbar-right">
     <div class="navbar-nav navbar-right">
-      <a class="nav-link active nav-right boldkur" style="color: black;    font-weight: bold;" href="{% url 'Products' %}">PROJECTS</a>
-              <a class="nav-link active nav-right boldkur" style="color: black;    font-weight: bold;" href="{% url 'submit' %}">SUBMIT</a>
+      <a class="nav-link active nav-right boldkur" style="color: black;    font-weight: bold;" href="{% url 'Products' %}">MARKTPLATZ</a>
+              <a class="nav-link active nav-right boldkur" style="color: black;    font-weight: bold;" href="{% url 'submit' %}">EINREICHEN</a>
 
 
-        <a class=" nav-link active nav-right boldkur" style="color: black;    font-weight: bold;" href="{% url 'about' %}">ABOUT</a>
+        <a class=" nav-link active nav-right boldkur" style="color: black;    font-weight: bold;" href="{% url 'about' %}">ÜBER UNS</a>
         {% if not user.is_authenticated %}
         {% if not user.is_authenticated %}
-           <a class=" nav-link active nav-right boldkur" style="color: black;    font-weight: bold;" href="{% url 'login' %}">LOGIN</a>
+           <a class=" nav-link active nav-right boldkur" style="color: black;    font-weight: bold;" href="{% url 'login' %}">EINLOGGEN</a>
         {% endif %}
         {% endif %}
 
 
         {% if user.is_authenticated %}
         {% if user.is_authenticated %}
-        <a  class="nav-link nav-right boldkur" style="color: black;    font-weight: bold;" href="{% url 'NewSubmitView'%}?">ADD PROJECT</a>
-        <a  class="nav-link nav-right boldkur" style="color: black;    font-weight: bold;" href="{% url 'MyProducts'%}">MY PROJECTS</a>
-        <a  class="nav-link nav-right boldkur" style="color: black;    font-weight: bold;" href="{% url 'logout'%}?next={{request.path}}">LOGOUT</a>
+        <a  class="nav-link nav-right boldkur" style="color: black;    font-weight: bold;" href="{% url 'NewSubmitView'%}?">PROJEKT EINREICHEN</a>
+        <a  class="nav-link nav-right boldkur" style="color: black;    font-weight: bold;" href="{% url 'MyProducts'%}">MEINE PROJEKTE</a>
+        <a  class="nav-link nav-right boldkur" style="color: black;    font-weight: bold;" href="{% url 'logout'%}?next={{request.path}}">AUSLOGGEN</a>
         {% endif %}
         {% endif %}
 
 
 </div>
 </div>
@@ -71,7 +71,7 @@
      <div class="modal-dialog border border-dark rounded-0" role="document">
      <div class="modal-dialog border border-dark rounded-0" role="document">
          <div class="modal-content rounded-0">
          <div class="modal-content rounded-0">
          <div class="modal-header">
          <div class="modal-header">
-        <h5 class="modal-title" id="exampleModalLabel">Please Log in here:</h5>
+        <h5 class="modal-title" id="exampleModalLabel">Bitte loggen Sie sich hier ein: </h5>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
           <span aria-hidden="true">&times;</span>
           <span aria-hidden="true">&times;</span>
         </button>
         </button>
@@ -102,7 +102,7 @@
           </div>
           </div>
 
 
                <div class="modal-footer">
                <div class="modal-footer">
-    <p><a href="{% url 'password_reset' %}">Lost password?</a></p>
+    <p><a href="{% url 'password_reset' %}">Passwort vergessen?</a></p>
                </div>
                </div>
          </div>
          </div>
 </div>
 </div>