Juan Carlos преди 5 години
родител
ревизия
d80c08b5a5

+ 23 - 66
marktplatz/forms.py

@@ -9,6 +9,7 @@ from django.urls import reverse, reverse_lazy
 from django.forms import formset_factory
 from django.forms.widgets import HiddenInput
 from django.forms.models import inlineformset_factory
+# from django.views.generic.edit.FormMixin
 # from crispy_forms.layout.buttons import Submit, InputButton
 
 from crispy_forms.layout import Layout, Field, Fieldset, Div, Row, Column, HTML, ButtonHolder, Submit
@@ -31,6 +32,18 @@ def extend_help_text( help_text, myList ):
         return extended_text
 
 
+class GeneralFields(forms.Form):
+    terms = forms.BooleanField(required=True,  label= ('Ich akzeptiere die <a href="{}"> Datenschutzrichtlinie und habe sie gelesen.</a>' )  )
+
+    def __init__(self, *args, **kwargs):
+        super(GeneralFields, self).__init__(*args, **kwargs)
+        drurl = reverse_lazy( 'pages-generic', kwargs=  { 'page': 'DATENSCHUTZRICHTLINIE' } )
+        tmurl = reverse_lazy( 'pages-generic', kwargs=  { 'page': 'TEILNAHME' } )
+        self.fields ['terms'].label = 'Ich akzeptiere die <a href="{}"> Datenschutzrichtlinie</a> sowie die  <a href="{}"> Teilnahmebedingungen</a> und habe sie gelesen.'.format(drurl, tmurl)
+
+
+
+
 class textSearchForm(forms.Form):
 
     mywidget = forms.TextInput(  attrs={'onfocus': "this.value=''", 'class' : "border-thin"}  )
@@ -46,13 +59,10 @@ class textSearchForm(forms.Form):
                Div('searchText',  css_class='col-sm-6 col-6'),
                Div(
                    ButtonHolder(
-                       Submit('submit', 'Suche', css_class='border-thin border-dark mybtn')
+                       Submit('submit', 'Suche', css_class='border-thin mybtn')
                    ),
                css_class='col-sm-6 col-6'),
-               css_class='form-row  row'),
-
-               # Submit('submit', 'Submit', css_class='btn border-dark rounded-0 mybtn'),
-
+               css_class='form-row row mab-search-bar'),
            )
 
 
@@ -70,20 +80,17 @@ class searchAgentForm(forms.ModelForm):
         ),
     )
 
+    # def __init__(self, *args, **kwargs):
+    #     super().__init__(*args, **kwargs)
+    #     self.fields ['ort'].label = 'Ich akzeptiere die <a href="{}"> Datenschutzrichtlinie</a> sowie die  <a href="{}"> Teilnahmebedingungen</a> und habe sie gelesen.'.format(drurl, tmurl)
 
-class AgentNewslwtterForm(forms.Form, searchAgentForm):
+
+class AgentNewslwtterForm( searchAgentForm, GeneralFields):
 
     email_field = forms.EmailField( label = 'Email', required=True, max_length=254 )
     subscribe = forms.BooleanField( label = 'Newsletter abonnieren', help_text='', required = False )
     captcha = CaptchaField( label = 'Bitte lösen Sie die Gleichung', generator='captcha.helpers.math_challenge' )
 
-
-    # def clean(self):
-    #     # Then call the clean() method of the super  class
-    #     cleaned_data = super(AgentNewslwtterForm, self).clean()
-    #     cleaned_data['email'] = cleaned_data['email_field']
-    #     return cleaned_data
-
     def __init__(self, *args, **kwargs):
         super(searchAgentForm, self).__init__(*args, **kwargs)
         self.helper = FormHelper(self)
@@ -94,60 +101,22 @@ class AgentNewslwtterForm(forms.Form, searchAgentForm):
             self.agent_layout,
            'email_field',
            'subscribe',
+           'terms',
            'captcha',
            ButtonHolder(
                Submit('submit', 'Anmelden', css_class='border-thin border-dark mybtn')
            ),
-               # Submit('submit', 'Submit', css_class='btn border-dark rounded-0 mybtn'),
-
-           )
-
-
-
-
-
-
-# class MarktSubscribeRequestForm(SubscribeRequestForm, searchAgentForm):
-#     """
-#     Request subscription to the newsletter. Will result in an activation email
-#     being sent with a link where one can edit, confirm and activate one's
-#     subscription.
-#     """
-#
-#     newsletter = Newsletter.objects.get(title="Test")
-#     subscribeForm = SubscribeRequestForm(request.POST or None, newsletter=newsletter)
-#
-#     def __init__(self, *args, **kwargs):
-#         super(MarktSubscribeRequestForm, self).__init__(*args, **kwargs)
-#         self.helper = FormHelper()
-#         # self.helper.form_tag = False
-#         self.helper.layout = Layout(
-#             self.agent_layout,
-#            'email_field',
-#
-#                # Submit('submit', 'Submit', css_class='btn border-dark rounded-0 mybtn'),
-#
-#            )
-
-
+       )
 
 
 
-class RegisterForm(forms.ModelForm):
-    drurl = reverse_lazy( 'pages-generic', kwargs=  { 'page': 'DATENSCHUTZRICHTLINIE' } )
-    terms = forms.BooleanField(required=True,  label= ('Ich akzeptiere die <a href="{}"> Datenschutzrichtlinie und habe sie gelesen.</a>' )  )
+class RegisterForm(forms.ModelForm, GeneralFields):
 
     class Meta:
         model = Contact
         fields = ('first_name','last_name','adress','postcode','city','country',
                   'email','phonenumber','alternate_phonenumber','skype_name','website', 'terms')
 
-    def __init__(self, *args, **kwargs):
-        super(RegisterForm, self).__init__(*args, **kwargs)
-        drurl = reverse_lazy( 'pages-generic', kwargs=  { 'page': 'DATENSCHUTZRICHTLINIE' } )
-        tmurl = reverse_lazy( 'pages-generic', kwargs=  { 'page': 'TEILNAHME' } )
-        self.fields ['terms'].label = 'Ich akzeptiere die <a href="{}"> Datenschutzrichtlinie</a> sowie die  <a href="{}"> Teilnahmebedingungen</a> und habe sie gelesen.'.format(drurl, tmurl)
-
 class SignUpForm(UserCreationForm):
     captcha = CaptchaField( generator='captcha.helpers.math_challenge' )
 
@@ -308,18 +277,6 @@ class LinkForm(forms.ModelForm):
         model = Link
         fields = ('link_description','link')
 
-    #def __init__(self, *args, **kwargs):
-    #    super(LinkForm, self).__init__(*args, **kwargs)
-    #    self.helper = FormHelper()
-    #    self.helper.field_class = 'form_border'
-    #    self.helper.form_tag = False
-    #    self.helper.layout = Layout(
-    #        Fieldset(
-    #            Div(Div('link_description', css_class='form-group col-md-5 mb-0'),
-    #            Div('link', css_class='form-group col-md-5 mb-0'),
-    #                css_class='form-row')
-    #        ))
-
 
 LinkFormSet = inlineformset_factory(Product,Link, fields = ['link_description','link'], form=LinkForm, extra=3, can_delete=False)
 

+ 24 - 24
marktplatz/models.py

@@ -96,29 +96,29 @@ class Product(models.Model):
     ]
 
     ORT = [
-        ('1010', '1., Innere Stadt'),
-        ('1020', '2., Leopoldstadt'),
-        ('1030', '3., Landstraße'),
-        ('1040', '4., Wieden'),
-        ('1050', '5., Margareten'),
-        ('1060', '6., Mariahilf'),
-        ('1070', '7., Neubau'),
-        ('1080', '8., Josefstadt'),
-        ('1090', '9., Alsergrund'),
-        ('1100', '10., Favoriten'),
-        ('1110', '11., Simmering'),
-        ('1120', '12., Meidling'),
-        ('1130', '13., Hietzing'),
-        ('1140', '14., Penzing'),
-        ('1150', '15., Rudolfsheim-Fünfhaus'),
-        ('1160', '16., Ottakring'),
-        ('1170', '17., Hernals'),
-        ('1180', '18., Währing'),
-        ('1190', '19., Döbling'),
-        ('1200', '20., Brigittenau'),
-        ('1210', '21., Floridsdorf'),
-        ('1220', '22., Donaustadt'),
-        ('1230', '23., Liesing'),
+        ('1010', 'Wien 1'),
+        ('1020', 'Wien 2'),
+        ('1030', 'Wien 3'),
+        ('1040', 'Wien 4'),
+        ('1050', 'Wien 5'),
+        ('1060', 'Wien 6'),
+        ('1070', 'Wien 7'),
+        ('1080', 'Wien 8'),
+        ('1090', 'Wien 9'),
+        ('1100', 'Wien 10'),
+        ('1110', 'Wien 11'),
+        ('1120', 'Wien 12'),
+        ('1130', 'Wien 13'),
+        ('1140', 'Wien 14'),
+        ('1150', 'Wien 15'),
+        ('1160', 'Wien 16'),
+        ('1170', 'Wien 17'),
+        ('1180', 'Wien 18'),
+        ('1190', 'Wien 19'),
+        ('1200', 'Wien 20'),
+        ('1210', 'Wien 21'),
+        ('1220', 'Wien 22'),
+        ('1230', 'Wien 23'),
         ('GERM', 'Deutschland'),
         ('SCHW', 'Schweiz'),
         ('VORA', 'Vorarlberg'),
@@ -216,7 +216,7 @@ class SearchAgent(models.Model):
         return uuid.uuid1().hex
 
     email           = EmailField         ( 'Email',   max_length = 2048, help_text="Email des Projektes", null = False, blank=False )
-    ort             = MultiSelectField   ( 'Ort', max_length = 4096 ,    choices=Product.ORT, default='WELT', help_text="Ort des Projektes", null = True, blank=False )
+    ort             = MultiSelectField   ( 'Ort', max_length = 4096 ,    choices=Product.ORT, default='', help_text="Ort des Projektes", null = True, blank=False )
     hash            = CharField          ( max_length=255, default=hash_gen )
 
 class Wohnprojekt(Product):

BIN
marktplatz/static/realitylablogo.png


+ 65 - 66
marktplatz/templates/marktplatz/product_overview.html

@@ -22,22 +22,6 @@ $(document).ready(function(){
 
     });
 
-/*
-    $("button#vote").click(function(){
-        $(".card").show();
-        $("button").removeClass("mark");
-
-         $(".card").not(".notvote").hide();
-        $("button#vote").addClass("mark");
-
-        if($(".card").filter(":visible").length < 1){
-            $("#how").fadeIn(200)
-        } else{
-           $("#how").fadeOut(10)
-        }
-    });
-*/
-
 
     {% for country in count_list %}
 
@@ -127,18 +111,25 @@ $(document).ready(function(){
 
 
 <style media="screen">
-  .card-columns .mab-card{
-  width: 97%;
-  height: 95%;
-  display: inline-block;
-  margin-top:4px;
-  max-width: 100%;
+  .card-columns .mab-card {
+    width: 97%;
+    height: 95%;
+    display: inline-block;
+    margin-top: 4px;
+    max-width: 100%;
+    border-color: #469CA8;
+    border-radius: 20px;
   }
 
-  .mab-card-body{
+  .mab-card-body {
 
-  padding: 5px;
-  padding-left: 5px;
+    padding: 10px 10px 10px 10px;
+
+  }
+
+  .mab-card img {
+
+    border-radius: 20px 20px 0 0;
 
   }
 
@@ -157,77 +148,85 @@ $(document).ready(function(){
     background-color: #FFFD;
     border-radius: 150px;
 
-  	font-size: 1.5em;
+    font-size: 1.5em;
     font-weight: bold;
     font-family: NeuzeitGro-Reg;
     text-align: center;
 
-  position: absolute;
-  bottom: 16px;
-  left: 16px;
+    position: absolute;
+    bottom: 16px;
+    left: 16px;
 
 
   }
 
 
   .mab-product-button-text {
-  color: #EA4814;
-  font-size: large;
-  font-weight: bold;
-  text-align: left;
-  /* background-color: rgba(0, 0, 0, 0); */
-  /* text-shadow: 0 0 6px #444, 0 0 20px #888; */
-  vertical-align: bottom;
-  top: 50%;
-  left: 50%;
-  transform: translate(-50%, -50%);
-
-  position: inherit;
+    color: #EA4814;
+    font-size: large;
+    font-weight: bold;
+    text-align: left;
+    /* background-color: rgba(0, 0, 0, 0); */
+    /* text-shadow: 0 0 6px #444, 0 0 20px #888; */
+    vertical-align: bottom;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+
+    position: inherit;
   }
 
   .mab-product-button {
-  	position: absolute;
-  	top: 16px;
-  	right: 16px;
-  	background-color: #EDBBA8;
-  	border: 2px solid #EA4814;
-  	border-radius: 50%;
-  	width: 5em;
-  	height: 5em;
-  	text-align: center;
-  	transform: rotate(15deg);
+    position: absolute;
+    top: 16px;
+    right: 16px;
+    background-color: #EDBBA8;
+    border: 2px solid #EA4814;
+    border-radius: 50%;
+    width: 5em;
+    height: 5em;
+    text-align: center;
+    transform: rotate(15deg);
   }
 
 
   .mab-product-vote {
 
-  position: absolute;
-  top: 8px;
-  right: 16px;
-  color: white;
-  font-size: large
+    position: absolute;
+    top: 8px;
+    right: 16px;
+    color: white;
+    font-size: large
   }
 
   .mab-card-text {
 
-  color: black;
-  margin-top: 0px;
+    color: black;
+    margin-top: 0px;
+    line-height: 2.25em;
   }
+
   .card-columns .mab-card-highlight {
 
-  /* background-color: #f0faf0; */
+    box-shadow: 0 4px 8px 0 rgba(70, 156, 168, 0.2), 0 6px 20px 0 rgba(70, 156, 168, 0.19);
+    margin-bottom: 40px;
+  }
+
+  .tag-line {
+
+    line-height: 2.25em;
 
-  box-shadow: 0 4px 8px 0 rgba(70, 156, 168, 0.2), 0 6px 20px 0 rgba(70, 156, 168,  0.19);
-  margin-bottom: 40px;
   }
 
   .tag-container {
 
-  /* border-bottom: 1px solid #469CA8; */
 
   }
 
+  .mab-search-bar {
 
+    padding-top: 4px;
+  }
 
 
 </style>
@@ -253,7 +252,7 @@ $(document).ready(function(){
 
 
 
-  <div class="row border-dark collapse navbar-collapse" id="tags">
+  <div class="row border-dark collapse navbar-collapse tag-line" id="tags">
 
     <div class="container-fluid">
       <button id='show' class="border-thin mybtn " style="margin-right: 2px;margin-bottom: 2px">#Show All</button>
@@ -330,11 +329,11 @@ $(document).ready(function(){
 
   {% for product in wohnprojekt_list %}
 
-
-  <div class="mab-card  {{product.ort}} {{product.status}} {{product.frei}} {{product.altneu}} card rounded-0 border-0 {% if product.frei == 'JAJA' %} mab-card-highlight {% endif %}" style="">
+  <!-- rounded-0 border-0 -->
+  <div class="mab-card  {{product.ort}} {{product.status}} {{product.frei}} {{product.altneu}} card  {% if product.frei == 'JAJA' %} mab-card-highlight {% endif %}" style="">
     <a href="{% url 'product-detail' product.pk %}">
       <div style="position: relative;text-align: center;">
-        <img class="{% if user.is_authenticated %}{% get_vote_class product user %} {% endif %} {% for category in product.category.all %} {{category.short_name}} {% endfor %} card-img-top rounded-0" src="{{product.media_set.first.image_norm.url}}" alt="image">
+        <img class="{% if user.is_authenticated %}{% get_vote_class product user %} {% endif %} {% for category in product.category.all %} {{category.short_name}} {% endfor %} card-img-top" otherclass="rounded-0"  src="{{product.media_set.first.image_norm.url}}" alt="image">
         <div class="mab-product-title" style=""><span>{{product.name }}</span></div>
 
         {% if product.frei == 'JAJA' %} <div class="mab-product-button" style="">  <div class="mab-product-button-text">

+ 5 - 0
project_base/templates/base_generic.html

@@ -343,6 +343,11 @@
 
 </div>
 
+{% if not embed %}
+
+{% include "footer.html" %}
+
+{% endif %}
 
 
 </body>

+ 38 - 0
project_base/templates/footer.html

@@ -0,0 +1,38 @@
+{% load fullurl %}
+{% load static %}
+
+<hr />
+<div class="container-fluid">
+  <div class="row">
+    <div class="col-sm-4">
+      <img src="{% static 'realitylablogo.png' %}" alt="" width="150" height="auto" />
+    </div>
+    <div class="col-sm-4">
+      <p>
+        Eine Website von
+        <a href="https://realitylab.at/">realitylab</a>
+        <a href="{% url 'pages-generic'  page='DATENSCHUTZRICHTLINIE' %}">Datenschutzerk&auml;rung</a> |
+        <a href="{% url 'pages-generic'  page='IMPRESSUM'  %}">Impressum</a>
+      </p>
+    </div>
+    <div class="col-sm-4 float-right">
+      <span class="float-right" >
+        &copy; {% now 'Y' %} realitylab gmbh. Alle Rechte vorbehalten
+      </span>
+    </div>
+  </div>
+</div>
+
+<div class="container-fluid">
+  <div class="row">
+    <div class="col-sm-4">
+      &nbsp;
+    </div>
+    <div class="col-sm-4">
+      &nbsp;
+    </div>
+    <div class="col-sm-4">
+      &nbsp;
+    </div>
+  </div>
+</div>