فهرست منبع

fixed Product > product.

Juan Carlos 5 سال پیش
والد
کامیت
258dd8eea7

+ 10 - 18
marktplatz/forms.py

@@ -68,7 +68,9 @@ class SubmissionForm(forms.ModelForm):
 
     class Meta:
         model = Wohnprojekt
-        fields = ('title','country','city','year','owner','teaser_txt','header','category', 'description_txt', 'terms',
+        fields = (
+        # 'title','country','city','year','owner','teaser_txt','header','category', 'description_txt',
+         'terms',
         'name','claim','beschreibung','learning','gruendungsjahr','betriebgenommen','status','adresse','website','frei','mitmachen','rechtsform','ort','orga',
          'eigentum', 'inseratstext', 'altneu', 'schwerpunkt', 'artmodell', 'bautraeger', 'aerwachsene', 'akinder', 'awohnungen', 'wohnflaeche', 'gewerbeflaechen', 'gemeinschaftsflaeche', 'sonstige_flaechen', 'gemeinschaftr', 'sonderwohnformen', 'raumangebot', 'parbeiten', 'karbeiten', 'bauweise', 'zielgruppen', 'gprojekte', 'oekologie', 'freiraumangebote', 'gaestwohnungen',
          )
@@ -98,19 +100,9 @@ class SubmissionForm(forms.ModelForm):
        #
        #
        #
-
-       self.fields['title'].help_text = ('<i>e.g. Sirius Tower</i>')
-       self.fields['header'].help_text = ('<i>e.g. Skyscraper with heavenly forms </i>')
-       self.fields['city'].help_text = ('<i>e.g. Beijing </i>')
-       self.fields['year'].help_text = ('<i>e.g. 2019</i>')
-       self.fields['owner'].help_text = ('<i>e.g. Cardinal Group</i>')
-       self.fields['category'].help_text = ('<i>Hold CTRL/CMD for multiple selection</i>')
-       self.fields['country'].help_text = ('<i>Hold CTRL/CMD for multiple selection</i>')
-       self.fields['teaser_txt'].help_text = ('<i>e.g. A vibrant new landmark has appeared in the city of Beijing: the luxury shopping center Sirius Tower. Both out- side and inside, the building radiates dy- namism and the kind of bright perfection thatthearchitectreferstoasthe Made in Heaven Effect. Everything about the building moves the eye</i>')
-       self.fields['description_txt'].help_text = ('<i>e.g. A wall of light measuring 3.000 square meters has turned the new head- quarters of the largest Chinese telecom- munications company CXN in Beijing into a spectacular attraction. The stunning building, designed by Domenico Torrone, was o cially opened in September 2008. Located near the freeway to Shanghai it can be seen from miles. The 100-meter- high and 40-meterwide sloping north facade is equipped with around 900 Op- ticron® flat-panel lamps. Because they can be controlled individually with elec- tronic control gear, they form the pixels of a gigantic monochrome display on which still and moving images can be created.</i>')
-
-       self.fields['description_txt'].max_length = 2000
-       self.fields['teaser_txt'].max_length = 750
+       
+       # self.fields['description_txt'].max_length = 2000
+       # self.fields['teaser_txt'].max_length = 750
 
        self.helper = FormHelper()
        #self.helper.field_class = 'form_border'
@@ -163,7 +155,7 @@ class CreditForm(forms.ModelForm):
         model = Credit
         fields = ('owner','architecture','concept','structural_engeneering','facade_design',
                     'face_construction','kinetic_design','light_design','tecnical_layout',
-                    'display_content','light_hardware','lightning_software','Product_coordination',
+                    'display_content','light_hardware','lightning_software','product_coordination',
                     'membrane_skin','interaction_design','sponsor','module_elems')
 
     def __init__(self, *args, **kwargs):
@@ -181,7 +173,7 @@ class CreditForm(forms.ModelForm):
         self.fields['display_content'].help_text = ('<i>e.g. Domenico Torrone;reality check, Munich;</i>')
         self.fields['light_hardware'].help_text = ('<i>e.g. Modul Labs, Berlin</i>')
         self.fields['lightning_software'].help_text = ('<i>e.g. Dimma DMX by Eflux</i>')
-        self.fields['Product_coordination'].help_text = ('<i>e.g. Domenico Torrone and Partners</i>')
+        self.fields['product_coordination'].help_text = ('<i>e.g. Domenico Torrone and Partners</i>')
         self.fields['membrane_skin'].help_text = ('<i>e.g. none</i>')
         self.fields['interaction_design'].help_text = ('<i>e.g. pixeldings, Toronto</i>')
         self.fields['sponsor'].help_text = ('<i>e.g. none</i>')
@@ -199,7 +191,7 @@ class CreditForm(forms.ModelForm):
         self.fields['display_content'].max_length = 100
         self.fields['light_hardware'].max_length = 100
         self.fields['lightning_software'].max_length = 100
-        self.fields['Product_coordination'].max_length = 100
+        self.fields['product_coordination'].max_length = 100
         self.fields['membrane_skin'].max_length = 100
         self.fields['interaction_design'].max_length = 100
         self.fields['sponsor'].max_length = 100
@@ -217,7 +209,7 @@ class CreditForm(forms.ModelForm):
                  Div( Div('kinetic_design',css_class='form-group col-md-5 mb-0'),  Div('light_design',css_class='form-group col-md-5 mb-0'), css_class='form-row'),
                  Div( Div('tecnical_layout',css_class='form-group col-md-5 mb-0'), Div('display_content',css_class='form-group col-md-5 mb-0'), css_class='form-row'),
                  Div( Div('light_hardware',css_class='form-group col-md-5 mb-0'),  Div('lightning_software',css_class='form-group col-md-5 mb-0'), css_class='form-row'),
-                 Div( Div('Product_coordination',css_class='form-group col-md-5 mb-0'),  Div('membrane_skin',css_class='form-group col-md-5 mb-0'), css_class='form-row'),
+                 Div( Div('product_coordination',css_class='form-group col-md-5 mb-0'),  Div('membrane_skin',css_class='form-group col-md-5 mb-0'), css_class='form-row'),
                  Div( Div('interaction_design',css_class='form-group col-md-5 mb-0'),  Div('sponsor',css_class='form-group col-md-5 mb-0'),  css_class='form-row'),
                 Div( Div( 'module_elems',css_class='form-group col-md-5 mb-0'),  css_class='form-row')
             ))

+ 23 - 22
marktplatz/models.py

@@ -40,7 +40,7 @@ class Credit(models.Model):
     display_content = CharField(verbose_name='Display content/ visuals/ showreel',blank = True,max_length = 300)
     light_hardware = CharField(verbose_name='Light hardware (LED hardware)',blank = True,max_length = 300)
     lightning_software = CharField(verbose_name='Lighting control software',blank = True,max_length = 300)
-    Product_coordination = CharField(verbose_name='Product co-ordination',blank = True,max_length = 300)
+    product_coordination = CharField(verbose_name='Product co-ordination',blank = True,max_length = 300)
     membrane_skin = CharField(verbose_name='Membrane skin',blank = True,max_length = 300)
     interaction_design = CharField(verbose_name='Interaction design/ programming',blank = True,max_length = 300)
     sponsor = CharField(verbose_name='Product sponsor/ support',blank = True,max_length = 500)
@@ -202,29 +202,30 @@ class Product(models.Model):
     rechtsform      = CharField   ( 'Rechtsform', max_length = 32, help_text="Rechtsform des Projektes", null = True, blank=True )
     orga            = CharField   ( 'Organisationsform',  max_length = 64, help_text="Organisationsform des Projektes.", null = True, blank=True )
     mitmachen  = BooleanField( 'Mitmachen möglich', default=False, help_text="Kann jemand mitmachen?", null = True, blank=False )
-
-    title = CharField('Product Title',max_length = 100)
+    terms = NullBooleanField(help_text="")
+    
+    title = CharField('Product Title',max_length = 100,null = True, blank=True)
     country = CountryField(blank=True,multiple=True, help_text="")
     city = CharField(max_length = 100,null = True, blank=True, help_text="")
     year = IntegerField('Year of Completion',null = True, blank=True, help_text="")
     owner = CharField(max_length = 300,null = True,blank=True, help_text="")
     teaser_txt = TextField(blank = True, max_length = 1050, help_text="")
-    header = CharField(max_length = 900,null = True, help_text="")
-    description_txt = TextField(max_length = 3000,null = True, help_text="")
-    cid = IntegerField(null = True,blank=True, help_text="")
+    header = CharField(max_length = 900 , help_text="",null = True, blank=True)
+    description_txt = TextField(max_length = 3000 ,null = True, blank=True, help_text="")
+    #cid = IntegerField(null = True,blank=True, help_text="")
     class_cid = CharField(null = True,max_length = 3, blank=True, help_text="")
     sumbitted = CharField(null = True,max_length = 10, blank=True, help_text="")
     date_submitted = DateField(auto_now_add=True, help_text="")
-    terms = NullBooleanField(help_text="")
+
     edit = NullBooleanField(help_text="")
     public = NullBooleanField(help_text="")
     photo = CharField(max_length=500, null=True, blank=True, help_text="")
     videocts = CharField(max_length=500, null=True, blank=True, help_text="")
-    category = ManyToManyField(Category, null=True, help_text="")
+    category = ManyToManyField(Category,  help_text="",null = True, blank=True)
     credits = ForeignKey(Credit, null = True,on_delete=models.SET_NULL, help_text="")
-    description = ForeignKey(Description,null = True, on_delete=models.SET_NULL, help_text="")
+    description = ForeignKey(Description,  on_delete=models.SET_NULL, help_text="",null = True, blank=True)
     contact = ForeignKey(Contact, null = True,on_delete=models.SET_NULL, help_text="")
-    interaction = ForeignKey(Interaction, null = True,on_delete = models.SET_NULL, help_text="")
+    #interaction = ForeignKey(Interaction, null = True,on_delete = models.SET_NULL, help_text="")
 
     def __str__(self):
         return str(self.title)
@@ -376,36 +377,36 @@ def auto_delete_reverse_keys(sender, instance, **kwargs):
 
 
 class Link(models.Model):
-    Product = ForeignKey(Product, on_delete=models.CASCADE)
+    product = ForeignKey(Product, on_delete=models.CASCADE)
     link_description = CharField(null=True, blank=True, max_length = 2048)
     link = URLField(null=True, blank=True, max_length = 2048)
 
-def Product_path(instance, filename):
-    return 'marktplatz/media/{0}/{1}'.format(instance.Product.id, filename)
+def product_path(instance, filename):
+    return 'marktplatz/media/{0}/{1}'.format(instance.product.id, filename)
 
 
 class Media(models.Model):
     fs = FileSystemStorage(location=settings.MEDIA_ROOT)
 
-    Product = ForeignKey(Product, on_delete=models.CASCADE)
+    product = ForeignKey(Product, on_delete=models.CASCADE)
     name_for = CharField(blank = True,max_length = 256)
 
     filename = CharField(max_length = 100)
     copyright = CharField(blank=True, max_length = 100)
-    image = ImageField(upload_to=Product_path,storage=fs)
-    image_small = ProcessedImageField(upload_to=Product_path,
+    image = ImageField(upload_to=product_path,storage=fs)
+    image_small = ProcessedImageField(upload_to=product_path,
                                       processors=[ResizeToCover(640, 360)],
                                       format='JPEG',
                                       options={'quality': 90})
-    image_medium= ProcessedImageField(upload_to=Product_path,
+    image_medium= ProcessedImageField(upload_to=product_path,
                                      processors=[ResizeToCover(960, 540)],
                                      format='JPEG',
                                      options={'quality': 90})
-    image_big = ProcessedImageField(upload_to=Product_path,
+    image_big = ProcessedImageField(upload_to=product_path,
                                      processors=[ResizeToCover(1920, 1080)],
                                      format='JPEG',
                                      options={'quality': 90})
-    image_norm = ProcessedImageField(upload_to=Product_path,
+    image_norm = ProcessedImageField(upload_to=product_path,
                                      processors=[Thumbnail(640, 360)],
                                      format='JPEG',
                                      options={'quality': 90},
@@ -515,12 +516,12 @@ def auto_delete_file_on_delete(sender, instance, **kwargs):
 
 
 class Video(models.Model):
-    Product = ForeignKey(Product, on_delete=models.CASCADE)
+    product = ForeignKey(Product, on_delete=models.CASCADE)
     name_for = CharField(blank=True, max_length=256)
 
     filename = CharField(max_length=100)
     copyright = CharField(blank=True, max_length=100)
-    image = FileField(upload_to=Product_path)
+    image = FileField(upload_to=product_path)
 
 @receiver(models.signals.post_delete, sender=Video)
 def auto_delete_video_on_delete(sender, instance, **kwargs):
@@ -555,7 +556,7 @@ def auto_delete_video_on_delete(sender, instance, **kwargs):
 
 
 class Vote(models.Model):
-    Product = ForeignKey(Product, on_delete=models.CASCADE)
+    product = ForeignKey(Product, on_delete=models.CASCADE)
     juryMember = ForeignKey(User, on_delete = models.CASCADE)
     vote = PositiveSmallIntegerField(default=0)
     comment = CharField(blank=True, max_length =300)

BIN
marktplatz/static/MAB2018logo.png


BIN
marktplatz/static/code.jpg


BIN
marktplatz/static/logo_LED.jpg


BIN
marktplatz/static/logo_future.jpg


+ 5 - 16
marktplatz/templates/marktplatz/add.html

@@ -1,7 +1,7 @@
 {% extends "base_generic.html" %}
 {% load static %}
 {% load crispy_forms_tags %}
-{% crispy Product Product.helper %}
+{% crispy product product.helper %}
 {% crispy credits credits.helper %}
 
 {% block content %}
@@ -32,7 +32,7 @@
 </div>
         </div>
     <div class="col-sm-10">
-      {% crispy Product %}
+      {% crispy product %}
     </div>
 
     <div class="col-sm-10">
@@ -47,22 +47,11 @@
     </div>
 
 
-    <div class="col-sm-10">
-      {% if interaction %}
-      {% crispy interaction %}
-      {% endif %}
-
-    </div>
-
-    <div class="col-sm-10">
-      {% if credits %}
-      {% crispy credits %}
-      {% endif %}
-
-    </div>
 
        <div class="col-sm-10">
-      {{ Product.terms|as_crispy_field  }}
+
+         <div class='form-error' style="" >{{ product_errors }}</div>
+      {{ product.terms|as_crispy_field  }}
 
     </div>
              <div class="col-sm-10">

+ 1 - 1
marktplatz/templates/marktplatz/admin_panel.html

@@ -24,7 +24,7 @@
     {% for Product in Product_list %}
     <tr class=""   >
         <td  scope="col"><img src="{{Product.media_set.first.image_small.url}}"  width="50" height="50" alt="{{ Product.pk }}"> </td>
-        <td  scope="col"> <a href="{% url 'Product-detail' Product.pk %}">   {{Product.name|upper }} </a></td>
+        <td  scope="col"> <a href="{% url 'product-detail' Product.pk %}">   {{Product.name|upper }} </a></td>
          <td scope="col">
         {% for category in Product.category.all %}
         {{category.short_name}}{% if not forloop.last %} | {% endif %}

+ 1 - 1
marktplatz/templates/marktplatz/error_404.html

@@ -3,7 +3,7 @@
 <html lang="en">
 <head>
     <meta charset="UTF-8">
-    <title>MAB20</title>
+    <title>{{ config.WEBSITE_TITEL }}</title>
 </head>
 <body>
 <div class="conatiner-fluid" >

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

@@ -10,7 +10,7 @@
 
 <div class="container-fluid">
 
-    <h3 style="margin-top: 10px">{{Product.name}} Media </h3>
+    <h3 style="margin-top: 10px">{{product.name}} Media </h3>
 
  <table class="table table-sm table-hover">
 
@@ -37,7 +37,7 @@
 
 
  </table>
-    <a href="{% url 'Product-detail' pk=Product.pk %}">  <input  class="btn border-dark rounded-0 mybtn" value="Show Site"></a>
+    <a href="{% url 'product-detail' pk=product.pk %}">  <input  class="btn border-dark rounded-0 mybtn" value="Show Site"></a>
 </div >
 
  <div class="">
@@ -160,4 +160,4 @@
   &nbsp;
 </div>
 
-{% endblock %}
+{% endblock %}

+ 10 - 11
marktplatz/templates/marktplatz/myProducts.html

@@ -22,9 +22,9 @@ $('form').submit(function () {
 
 <div class="container-fluid">
 
-<h3 style="margin-top: 10px"> {{user.username}}'s Products </h3>
+<h3 style="margin-top: 10px"> {{user.username}}'s products </h3>
 
-{% if Product_list %}
+{% if product_list %}
  <table class="table table-sm table-hover">
     <caption>* FP = Future trends & Prototypes; AA = Animated Architecture; MA = Money Architecture; SMA = Spatial Media Art; PAUI = Participatory Architecture & Urban Interaction</caption>
 
@@ -36,16 +36,16 @@ $('form').submit(function () {
         <th scope="col"> Editable</th>
 
     </tr>
-    {% for Product in Product_list %}
-    <tr class="{% get_sucsess Product %}"   >
-        <td  scope="col"><img src="{{Product.media_set.first.image_small.url}}"  width="50" height="50" alt="{{ Product.pk }}"> </td>
-        <td  scope="col"> <a href="{% url 'Product-detail' Product.pk %}">   {{Product.name|upper }} </a></td>
+    {% for product in product_list %}
+    <tr class="{% get_sucsess product %}"   >
+        <td  scope="col"><img src="{{product.media_set.first.image_small.url}}"  width="50" height="50" alt="{{ product.pk }}"> </td>
+        <td  scope="col"> <a href="{% url 'product-detail' product.pk %}">   {{product.name|upper }} </a></td>
           <td scope="col">
-        {% for category in Product.category.all %}
+        {% for category in product.category.all %}
         {{category.short_name}}{% if not forloop.last %} | {% endif %}
              {% endfor %}
         </td>
-        <td scope="col"> {% if Product.edit %} <a href="{% url 'edit-Product' Product.pk %}"> edit Product </a> ; <a href="{% url 'add-Image' Product.pk %}"> edit Media </a> {% else %} already sumbitted {% endif %} </td>
+        <td scope="col"> {% if product.edit %} <a href="{% url 'edit-product' product.pk %}"> edit product </a> ; <a href="{% url 'add-Image' product.pk %}"> edit Media </a> {% else %} already sumbitted {% endif %} </td>
 
     </tr>
     {% endfor %}
@@ -54,14 +54,13 @@ $('form').submit(function () {
 
 
  </table>
-    <a href="{% url 'NewSubmitView' %}"><button class="btn border-dark rounded-0 mybtn" type="submit">Add Product </button> </a>
+    <a href="{% url 'NewSubmitView' %}"><button class="btn border-dark rounded-0 mybtn" type="submit">Add product </button> </a>
  {% else %}
 <div class="container-fluid">
 
-    <h6>Seems like you haven't uploaded anything yet :(<br> Start Sumbitting now :  <a href="{% url 'NewSubmitView' %}"><button class="btn border-dark rounded-0 mybtn" type="submit">Add Products </button> </a></h6>
+    <h6>Seems like you haven't uploaded anything yet :(<br> Start Sumbitting now :  <a href="{% url 'NewSubmitView' %}"><button class="btn border-dark rounded-0 mybtn" type="submit">Add products </button> </a></h6>
 </div>
 
 {% endif %}
 
 {% endblock %}
-

+ 15 - 11
marktplatz/templates/marktplatz/project_detail.html → marktplatz/templates/marktplatz/product_detail.html

@@ -31,14 +31,14 @@ $('.gallery').featherlightGallery({
 <div clas="container">
 
 
-<h2 class="titlepro" style="margin-top: 7px;color: black; font-weight: bold">{{ Product.name }}
-      <small class="text-muted">{% if Product.year %} {{ Product.year }}, {% endif %}  {% for country in Product.country %} {{ country.name }}, {% endfor %} {% if Product.city %} {{ Product.city }} {% endif %}</small>
+<h2 class="titlepro" style="margin-top: 7px;color: black; font-weight: bold">{{ product.name }}
+      <small class="text-muted">{% if product.year %} {{ product.year }}, {% endif %}  {% for country in product.country %} {{ country.name }}, {% endfor %} {% if product.city %} {{ product.city }} {% endif %}</small>
 </h2>
-<p class="lead kur"> {{ Product.header }}</p>
+<p class="lead kur"> {{ product.claim }}</p>
   <div class="row" style="display: flex">
 
 
-{% for media in Product.media_set.all %}
+{% for media in product.media_set.all %}
 
          <div style="flex: {% get_ratio media %}">
     <img href="{{media.image_big.url}}" align="middle" src="{{media.image_norm.url }}" class="gallery img-fluid img-responsive"  alt="" style="width: 100%;height: auto;vertical-align: middle;">
@@ -56,17 +56,17 @@ $('.gallery').featherlightGallery({
 
      <div class="col-sm-6">
          <p><h5 class="black"></h5></p>
-          {% for video in Product.video_set.all %}
+          {% for video in product.video_set.all %}
 
           <video autoplay style="width: 100%;height: auto;vertical-align: middle; padding-bottom: 10px" controls>
               <source src="{{video.image.url}}" type="video/mp4">
           </video>
 
       {% endfor %}
-         <p>{{Product.claim}}</p>
-         <p>{{Product.description_txt}}</p>
+         <p>{{product.claim}}</p>
+         <p>{{product.beschreibung}}</p>
 
-         {% for link in Product.link_set.all %}
+         {% for link in product.link_set.all %}
          <p> <a href="{{link.link}}">{{link.link}}</a></p>
 
 
@@ -75,6 +75,8 @@ $('.gallery').featherlightGallery({
 
      </div>
      <div class="col-sm-4">
+
+
          {% if request.user|has_group:"jury" %}
          <p><h5 class="black mediumkur" style="margin: 0px">Please vote here:</h5></p>
             <form class="form-inline needs-validation" method="POST"> {% csrf_token %}
@@ -91,9 +93,11 @@ $('.gallery').featherlightGallery({
 
                 <div class="invalid-feedback"> Please enter a Vote between 0 an 10 </div>
             </form>
-            <p style="margin-top: 4px"><strong>Award Categories:</strong> {% for cat in Product.category.all %} {{cat.name}}{% if not forloop.last %}, {% endif %}{% endfor %}</p>
+            <p style="margin-top: 4px"><strong>Award Categories:</strong> {% for cat in product.category.all %} {{cat.name}}{% if not forloop.last %}, {% endif %}{% endfor %}</p>
          {% endif %}
 
+
+
          <p><h5 class="black mediumkur">Details</h5></p>
 
          {% for field, value in credits %}
@@ -125,12 +129,12 @@ $('.gallery').featherlightGallery({
 
          <p><h5 class="mediumkur">Mediacredits</h5></p>
 
-         {% for media in Product.media_set.all %}
+         {% for media in product.media_set.all %}
          {% if media.copyright %}
           <p class="fieldname"> {{ media.copyright }}</p>
          {% endif %}
          {% endfor %}
-         {% for media in Product.video_set.all %}
+         {% for media in product.video_set.all %}
          {% if media.copyright %}
           <p class="fieldname"> {{ media.copyright }}</p>
          {% endif %}

+ 2 - 2
marktplatz/templates/marktplatz/product_overview.html

@@ -205,7 +205,7 @@ $(document).ready(function(){
   {% for Product in Product_list %}
 
   <div class="mab-card {% for name in Product.country %} {{name.code}} {% endfor %} {{Product.year}} {% for category in Product.category.all %} {{category.short_name}} {% endfor %} card rounded-0 border-0 {% if user.is_authenticated %} {% get_vote_class Product user %} {% endif %}" style="">
-    <a href="{% url 'Product-detail' Product.pk %}">
+    <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">
         <div class="mab-Product-title" style="">{{Product.name|upper }}</div>
@@ -216,7 +216,7 @@ $(document).ready(function(){
     </a>
     <div class="card-body mab-card-body" style="">
       <!--<div class="border-0 d-flex justify-content">
-        <p class="card-title" style="margin-bottom: 3px"><a href="{% url 'Product-detail' Product.pk %}"> {{Product.header }} </a></p>
+        <p class="card-title" style="margin-bottom: 3px"><a href="{% url 'product-detail' Product.pk %}"> {{Product.header }} </a></p>
 
       </div>-->
 

+ 1 - 1
marktplatz/templates/marktplatz/voteDetail.html

@@ -27,7 +27,7 @@
     {% for Product in Product_list %}
     <tr class="{% get_sucsess Product %}"   >
         <td  scope="col"><img src="{{Product.media_set.first.image_small.url}}"  width="50" height="50" alt="image"> </td>
-        <td  scope="col"> <a href="{% url 'Product-detail' Product.pk %}">   {{Product.name|upper }} </a></td>
+        <td  scope="col"> <a href="{% url 'product-detail' Product.pk %}">   {{Product.name|upper }} </a></td>
          <td scope="col">
         {% for category in Product.category.all %}
         {{category.short_name}}{% if not forloop.last %} | {% endif %}

+ 1 - 1
marktplatz/templates/marktplatz/votes_cid.html

@@ -44,7 +44,7 @@ $('form').submit(function () {
     {% for Product in Product_list %}
     <tr class="{% get_sucsess Product %}"   >
         <td  scope="col"><img src="{{Product.media_set.first.image_small.url}}"  width="50" height="50" alt="{{ Product.pk }}"> </td>
-        <td  scope="col"> <a href="{% url 'Product-detail' Product.pk %}">   {{Product.name|upper }} </a></td>
+        <td  scope="col"> <a href="{% url 'product-detail' Product.pk %}">   {{Product.name|upper }} </a></td>
          <td scope="col">
         {% for category in Product.category.all %}
         {{category.short_name}}{% if not forloop.last %} | {% endif %}

+ 8 - 9
marktplatz/templatetags/tags.py

@@ -10,7 +10,7 @@ from ..models import Product, User, Vote, Media, Contact
 def get_vote(Product, user):
     if user.groups.filter(name='jury').exists():
         try:
-            vote = Vote.objects.get(juryMember=user, Product=Product)
+            vote = Vote.objects.get(juryMember=user, product=Product)
         except Vote.DoesNotExist:
             return 'VOTE !'
 
@@ -21,7 +21,7 @@ def get_vote(Product, user):
 def get_int_vote(Product, user):
 
     try:
-        vote = Vote.objects.get(juryMember=user, Product=Product)
+        vote = Vote.objects.get(juryMember=user, product=Product)
 
     except Vote.DoesNotExist:
         return 0
@@ -32,7 +32,7 @@ def get_int_vote(Product, user):
 def get_comment(Product, user):
 
     try:
-        vote = Vote.objects.get(juryMember=user, Product=Product)
+        vote = Vote.objects.get(juryMember=user, product=Product)
 
     except Vote.DoesNotExist:
         return 'Here is some space for your comments (not obligatory)'
@@ -61,7 +61,7 @@ def get_ratio(media):
 @register.simple_tag
 def get_vote_simple(Product, user):
     try:
-        vote = Vote.objects.get(juryMember=user, Product=Product)
+        vote = Vote.objects.get(juryMember=user, product=Product)
 
     except Vote.DoesNotExist:
         return '-'
@@ -72,7 +72,7 @@ def get_vote_simple(Product, user):
 @register.simple_tag
 def get_avg(Product):
     try:
-        votes = Vote.objects.filter(Product=Product)
+        votes = Vote.objects.filter(product=Product)
 
     except Vote.DoesNotExist:
         return '-'
@@ -93,7 +93,7 @@ def get_countries(Product_list):
 def get_vote_class(Product, user):
 
     try:
-        Vote.objects.get(juryMember=user, Product=Product)
+        Vote.objects.get(juryMember=user, product=Product)
 
     except Vote.DoesNotExist:
         return 'notvote'
@@ -103,7 +103,7 @@ def get_vote_class(Product, user):
 @register.simple_tag
 def get_sucsess(Product):
     try:
-        votes = Vote.objects.filter(Product=Product)
+        votes = Vote.objects.filter(product=Product)
 
     except Vote.DoesNotExist:
         return ''
@@ -116,7 +116,7 @@ def get_sucsess(Product):
 @register.simple_tag
 def get_vote_txt(Product, user):
     try:
-        vote = Vote.objects.get(juryMember=user, Product=Product)
+        vote = Vote.objects.get(juryMember=user, product=Product)
 
     except Vote.DoesNotExist:
         return ''
@@ -131,4 +131,3 @@ def has_group(user, group_name):
 def has_Product(user, Product):
     contact = Contact.objects.get(user=user)
     return Product.objects.filter(contact=contact).filter(pk=Product).exists()
-

+ 5 - 7
marktplatz/urls.py

@@ -7,21 +7,19 @@ from django.views.generic import RedirectView
 from django.conf.urls import url, include
 
 urlpatterns = [
-    path('', RedirectView.as_view(url='Products/'), name='index'),
+    path('', RedirectView.as_view(url='products/'), name='index'),
     path('about/', views.about, name='about'),
     path('submit/', views.submit, name='submit'),
-    path('Products/', views.ProductsView.as_view(), name='Products'),
-    path('Product/<int:pk>', views.DetailView.as_view(), name='Product-detail'),
+    path('products/', views.ProductsView.as_view(), name='products'),
+    path('product/<int:pk>', views.DetailView.as_view(), name='product-detail'),
     path('votes/', views.VoteView.as_view(), name='vote-detail'),
     path('votescid/', views.CidView.as_view(), name='votecid-detail'),
     path('admin_panel/', views.AdminView.as_view(), name='admin-panel'),
-    #path('import-old-Products/', importOldProducts.as_view(template_name="mab18/importold.html"), name='import-old-Products'),
-    #path('import-old-json/', importOldJson.as_view(template_name="mab18/importold.html"),name='import-old-json'),
     path('light-box/', lightboximg.as_view(template_name="mab18/importold.html"),name='lightbox'),
     path('register/', views.registerView.as_view(), name='registerView'),
     path('addProduct/', views.NewSubmitView.as_view(), name='NewSubmitView'),
     path('myProducts/', views.UsersProducts.as_view(), name='MyProducts'),
-    path('editProduct/<int:pk>', views.EditView.as_view(), name='edit-Product'),
+    path('editProduct/<int:pk>', views.EditView.as_view(), name='edit-product'),
     path('addImage/<int:pk>', views.uploadView.as_view(), name='add-Image'),
     path('images/<int:pk>', views.MediaView.as_view(), name='media-overview'),
     url(r'^delete_media/(?P<pk>\d+)/$', views.delete_media, name='delete-media'),
@@ -30,4 +28,4 @@ urlpatterns = [
     url(r'^handle_upload$', views.handle_upload, name='file_form_handle_upload'),
     url(r'^upload_mab$', views.handle_upload, name='upload_mab'),
     url(r'^home', views.home, name='home'),
-    ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
+    ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 20 - 35
marktplatz/views.py


+ 5 - 0
project_base/context_processors.py

@@ -0,0 +1,5 @@
+from django.conf import settings # import the settings file
+
+#def constance(request):
+#    # return the value you want as a dictionnary. you may add multiple values in there.
+#    return {'TILES_URL': settings.TILES_URL}

+ 6 - 5
project_base/templates/base_generic.html

@@ -3,7 +3,7 @@
 <head>
 
     <meta charset="UTF-8">
-    {% block title %} <title>MARKTPLATZ</title> {% endblock %}
+    {% block title %} <title>{{ config.WEBSITE_TITEL }}</title> {% endblock %}
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     {% load static %}
 
@@ -28,7 +28,7 @@
 
  <nav class="navbar navbar-expand-sm navbar-fixed-top" style="padding-left: 15px; padding-bottom: 0px; margin-bottom: 2px" >
      <div class="container-fluid rounded-0" style="padding-left: 2px">
-  <a class="navbar-brand navbar-right" href="{% url 'Products' %}">
+  <a class="navbar-brand navbar-right" href="{% url 'products' %}">
      <img src="{% static 'newMAB.png' %}" alt="MAB20" height="40px" width="auto" style="margin: auto; padding-bottom: 2px" >
   </a>
 
@@ -38,7 +38,7 @@
   <div class="collapse navbar-collapse" id="navbarNavAltMarkup">
 
     <div class="navbar-nav navbar-right">
-      <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 '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' %}">ÜBER UNS</a>
@@ -111,12 +111,12 @@
 
 
 
-  </body>
+</body>
 
 <!-- Matomo -->
 <script type="text/javascript">
+  /*
   var _paq = _paq || [];
-  /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
   _paq.push(['trackPageView']);
   _paq.push(['enableLinkTracking']);
   (function() {
@@ -126,6 +126,7 @@
     var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
     g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
   })();
+  */
 </script>
 <!-- End Matomo Code -->
 

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است