소스 검색

URLs, + minor changes

Juan Carlos 5 년 전
부모
커밋
b9f39dec87

+ 2 - 2
marktplatz/models.py

@@ -84,7 +84,7 @@ class Product(models.Model):
     FREI = [
         ('JAJA', 'Platz frei'),
         ('WART', 'Projekt mit Warteliste'),
-        ('NEIN', 'Nein und es gibt keine Warteliste'),
+        ('NEIN', 'Projekt ohne Warteliste'),
     ]
 
     RECHTSFORM = [
@@ -146,7 +146,7 @@ class Product(models.Model):
     beschreibung    = TextField   ( 'Projektbeschreibung', max_length = 2048, help_text="Beschreibung des Projektes", null = True, blank=True )
     learning        = CharField   ( 'Learning', max_length = 256, help_text="Learning", null = True, blank=True )
     gruendungsjahr  = IntegerField( 'Gründungsjahr', help_text="Gründungsjahr des Projekts", validators=[MinValueValidator(0), MaxValueValidator(9999)], null = True, blank=True )
-    betriebgenommen = IntegerField( 'in Betrieb genommen im Jahr', help_text="Wann wurde das Projekt in Betrieb genommen?", validators=[MinValueValidator(0), MaxValueValidator(9999)], null = True, blank=True )
+    betriebgenommen = IntegerField( 'in Betrieb genommen im Jahr', default='2020', help_text="Wann wurde das Projekt in Betrieb genommen?", validators=[MinValueValidator(0), MaxValueValidator(9999)], null = True, blank=True )
     status          = CharField   ( 'Status',    max_length = 3,    choices=STATUS, default='ENT', help_text="Was ist der Status des Projektes" , null = True, blank=True )
     adresse         = CharField   ( 'Adresse',   max_length = 256,  help_text="Adresse des Projektes", null = True, blank=True )
     plz             = CharField   ( 'Adresse',   max_length = 256,  help_text="PLZ des Projektes", null = True, blank=True )

+ 2 - 2
marktplatz/templates/marktplatz/modal-share.html

@@ -66,7 +66,7 @@
           </div>
           </div>
             <div class="col-sm-4">
-              <div class="cursor-pointer" onclick="myFunction()">
+              <div class="cursor-pointer" onclick="">
 
               <a href="mailto:?subject={{  product.wohnprojekt  }}&body=Guten%20Tag!%0D%0A%0D%0AIch%20finde%20das%20folgende%20Projekt%20sehr%20interesant!%0D%0A%0D%0A{% fullurl 'product-detail-embed' pk=product.wohnprojekt.pk %}"><i class="fas fa-envelope"></i> <br>Send mail</a>
             </div>
@@ -107,7 +107,7 @@
       copyText.select();
       copyText.setSelectionRange(0, 99999)
       document.execCommand("copy");
-      alert("Copied the text: " + copyText.value);
+      alert("Der Text wurde in der Zwischenablage kopiert: " + copyText.value);
     }
 
     </script>

+ 7 - 7
marktplatz/templates/marktplatz/myProducts.html

@@ -24,15 +24,15 @@ $('form').submit(function () {
 
 {% 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>
+    <caption>Projekte</caption>
 
      <thead class="">
     <tr>
         <th scope="col"></th>
-        <th scope="col"> Product</th>
-        <th scope="col"> Category</th>
-        <th scope="col"> Editable</th>
-        <th scope="col"> Delete</th>
+        <th scope="col"> Projekt</th>
+        <th scope="col"> </th>
+        <th scope="col"> Bearbeiten</th>
+        <th scope="col"> Löschen</th>
 
     </tr>
     {% for product in product_list %}
@@ -44,8 +44,8 @@ $('form').submit(function () {
         {{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"> <a href="{% url 'product-delete' pk=product.pk %}" target="" rel="">Delete</a>   </td>
+        <td scope="col"> {% if product.edit %} <a href="{% url 'edit-product' product.pk %}"> Projekt bearbeiten</a> ; <a href="{% url 'add-Image' product.pk %}"> Media bearbeiten </a> {% else %} Es kann nicht bearbeitet werden {% endif %} </td>
+        <td scope="col"> <a href="{% url 'product-delete' pk=product.pk %}" target="" rel="">Löschen</a>   </td>
 
     </tr>
     {% endfor %}

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

@@ -119,6 +119,7 @@ color: #469CA8;
 								Wohnung frei.
 								{% if product.kfrei %}
 									{{ product.kfrei }}
+									{% if product.wohnprojekt.email  %}<p>{{ product.wohnprojekt.email | obfuscate_mailto:'<i class="fas fa-envelope"></i> Email'  }}</p>{% endif %}
 								{% endif %}
 							{% endif %}
 
@@ -139,7 +140,7 @@ color: #469CA8;
 						{{  product.mitmachen  }}
 					</div> -->
 
-					<p>{% if product.wohnprojekt.inseratstext  %}<strong>{% field_name product.wohnprojekt 'inseratstext' %}</strong>:<br>{{ product.wohnprojekt.inseratstext }}{% endif %}</p>
+					<p>{% if product.wohnprojekt.inseratstext  %}<strong>{% field_name product.wohnprojekt 'inseratstext' %}</strong>:<br>{{ product.wohnprojekt.inseratstext }} {% if product.wohnprojekt.email  %}<p>{{ product.wohnprojekt.email | obfuscate_mailto:'<i class="fas fa-envelope"></i> Email'  }}</p>{% endif %}{% endif %}</p>
 
 					<div class="">
 						&nbsp;
@@ -214,8 +215,8 @@ color: #469CA8;
 					<p>{% if product.wohnprojekt.sonderwohnformen  %}<strong>{% field_name product.wohnprojekt 'sonderwohnformen' %}</strong>: {{ product.wohnprojekt.sonderwohnformen }}{% endif %}</p>
 					<p><strong>Besondere Zielgruppen</strong>: {{ product.wohnprojekt.zielgruppen }}</p>
 					<p><strong>Freiraumangebote</strong>: {{ product.wohnprojekt.freiraumangebote }}</p>
+					<p>{% if product.wohnprojekt.oekologie  %}<strong>{% field_name product.wohnprojekt 'oekologie' %}</strong>: {{ product.wohnprojekt.oekologie }}{% endif %}</p>
 					<p>{% if product.wohnprojekt.schwerpunkt  %}<strong>{% field_name product.wohnprojekt 'schwerpunkt' %}</strong>: {{ product.wohnprojekt.schwerpunkt }}{% endif %}</p>
-					<p>{{ product.wohnprojekt.oekologie }}</p>
 
 
 					<br />
@@ -223,19 +224,19 @@ color: #469CA8;
 					<br />
 
 					<p>{{ product.wohnprojekt.get_altneu_display }}, {{ product.wohnprojekt.bauweise }}</p>
-					<p>Bautr&auml;ger: {{ product.wohnprojekt.bautraeger }}</p>
+					<p><strong>Bautr&auml;ger</strong>: {{ product.wohnprojekt.bautraeger }}</p>
 					<p>{% if product.wohnprojekt.wohnbaufoerderung  %}<strong>{% field_name product.wohnprojekt 'wohnbaufoerderung' %}:</strong>  {{ product.wohnprojekt.wohnbaufoerderung }}{% endif %}</p>
 					<p>im Haus Wohnen ca {{ product.wohnprojekt.aerwachsene }} Erwachsene und {{  product.wohnprojekt.akinder }} Kinder.
 						Anzahl an Mitglieder: {{ product.wohnprojekt.amitglieder }}
 					</p>
 					<p>{% if product.wohnprojekt.awohnungen  %}<strong>{% field_name product.wohnprojekt 'awohnungen' %}:</strong>  {{  product.wohnprojekt.awohnungen  }} Wohnungen{% endif %}</p>
 					<p>{% if product.wohnprojekt.gaestwohnungen  %}<strong>{% field_name product.wohnprojekt 'gaestwohnungen' %}:</strong>  {{ product.wohnprojekt.gaestwohnungen }}{% endif %}</p>
-					<p>{% if product.wohnprojekt.wohnflaeche  %}<strong>{% field_name product.wohnprojekt 'wohnflaeche' %}:</strong>  {{ product.wohnprojekt.wohnflaeche }}{% endif %}</p>
-			    <p>{% if product.wohnprojekt.gewerbeflaechen  %}<strong>{% field_name product.wohnprojekt 'gewerbeflaechen' %}:</strong>  {{ product.wohnprojekt.gewerbeflaechen }}{% endif %}</p>
-			    <p>{% if product.wohnprojekt.gemeinschaftsflaeche  %}<strong>{% field_name product.wohnprojekt 'gemeinschaftsflaeche' %}:</strong>  {{ product.wohnprojekt.gemeinschaftsflaeche }}{% endif %}</p>
-			    <p>{% if product.wohnprojekt.sonstige_flaechen  %}<strong>{% field_name product.wohnprojekt 'sonstige_flaechen' %}:</strong>  {{ product.wohnprojekt.sonstige_flaechen }}{% endif %}</p>
-			    <p>{% if product.wohnprojekt.flaeche  %}<strong>Fläche:</strong>  {{ product.wohnprojekt.flaeche }}{% endif %}</p>
-					<p>{% if product.wohnprojekt.kflaechen  %}<strong>{% field_name product.wohnprojekt 'kflaechen' %}:</strong>  {{ product.wohnprojekt.kflaechen }}{% endif %}</p>
+					<p>{% if product.wohnprojekt.wohnflaeche  %}<strong>{% field_name product.wohnprojekt 'wohnflaeche' %}:</strong>  {{ product.wohnprojekt.wohnflaeche }} m<sup>2</sup>{% endif %}</p>
+			    <p>{% if product.wohnprojekt.gewerbeflaechen  %}<strong>{% field_name product.wohnprojekt 'gewerbeflaechen' %}:</strong>  {{ product.wohnprojekt.gewerbeflaechen }} m<sup>2</sup>{% endif %}</p>
+			    <p>{% if product.wohnprojekt.gemeinschaftsflaeche  %}<strong>{% field_name product.wohnprojekt 'gemeinschaftsflaeche' %}:</strong>  {{ product.wohnprojekt.gemeinschaftsflaeche }} m<sup>2</sup>{% endif %}</p>
+			    <p>{% if product.wohnprojekt.sonstige_flaechen  %}<strong>{% field_name product.wohnprojekt 'sonstige_flaechen' %}:</strong>  {{ product.wohnprojekt.sonstige_flaechen }} m<sup>2</sup>{% endif %}</p>
+			    <p>{% if product.wohnprojekt.flaeche  %}<strong>Fläche:</strong>  {{ product.wohnprojekt.flaeche }} m<sup>2</sup>{% endif %}</p>
+					<p>{% if product.wohnprojekt.kflaechen  %}<strong>{% field_name product.wohnprojekt 'kflaechen' %}:</strong>  {{ product.wohnprojekt.kflaechen }} m<sup>2</sup>{% endif %}</p>
 					<p>Im Haus arbeiten ca {{ product.wohnprojekt.parbeiten }} Personen {% if product.wohnprojekt.karbeiten  %}{{ product.wohnprojekt.karbeiten }}{% endif %}</p>
 					<p>{% if product.wohnprojekt.raumangebot  %}<strong>{% field_name product.wohnprojekt 'raumangebot' %}:</strong>  {{ product.wohnprojekt.raumangebot }}{% endif %}</p>
 			    <p>{% if product.wohnprojekt.kraumangebot  %}<strong>{% field_name product.wohnprojekt 'kraumangebot' %}:</strong>  {{ product.wohnprojekt.kraumangebot }}{% endif %}</p>
@@ -248,7 +249,7 @@ color: #469CA8;
 					<p>{{ product.wohnprojekt.adresse }}, {{ product.wohnprojekt.get_ort_display }}</p>
 
 					{% if product.wohnprojekt.email  %}<p>{{ product.wohnprojekt.email | obfuscate_mailto:'<i class="fas fa-envelope"></i> Email'  }}</p>{% endif %}
-					<p><a href="{{  product.wohnprojekt.website }}">Webseite</a></p>
+					{% if product.wohnprojekt.website  %}<p><a href="{{  product.wohnprojekt.website }}" target="_blank" rel="noopener">Webseite</a></p>{% endif %}
 
 
 					<br />

+ 2 - 2
marktplatz/urls.py

@@ -7,10 +7,10 @@ from django.views.generic import RedirectView, TemplateView
 from django.conf.urls import url, include
 
 urlpatterns = [
-    path('', RedirectView.as_view(url='products/'), name='index'),
+    path('', RedirectView.as_view(url='projects/'), name='index'),
     path('about/', views.about, name='about'),
     path('submit/', views.submit, name='submit'),
-    path('products/', views.ProductsView.as_view(), name='products'),
+    path('projects/', views.ProductsView.as_view(), name='products'),
     path('products/search', views.SearchProductsView.as_view(), name='search-products'),
     path('products-list/', views.ProductsListView.as_view(), name='products-list'),
     path('products-list/embed', views.ProductsListView.as_view(  embed=True,  ), name='products-list-embed'),

+ 1 - 1
project_base/settings.py

@@ -327,7 +327,7 @@ WSGI_APPLICATION = 'project_base.wsgi.application'
 #EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
 EMAIL_BACKEND = 'post_office.EmailBackend'
 
-LOGIN_REDIRECT_URL = '/mab/home/'
+LOGIN_REDIRECT_URL = '/gem/home/'
 LOGOUT_REDIRECT_URL = 'products'
 
 

+ 1 - 1
project_base/templates/newsletter/message/subscribe.html

@@ -12,7 +12,7 @@
 you, or someone in your name requested a subscription to {{ title }}.
 
 If you would like to confirm your subscription, please follow this activation link:
-http://{{ domain }}{{ url }}
+<p><a href="http://{{ domain }}{{ url }}">http://{{ domain }}{{ url }}</a></p>
 
 Kind regards,{% endblocktrans %}
 {{ newsletter.sender }}

+ 2 - 2
project_base/urls.py

@@ -32,7 +32,7 @@ from .views import *
 urlpatterns = [
     path('admin/', admin.site.urls),
     url(r'^captcha/',  include('captcha.urls')),
-    path('mab/', include('marktplatz.urls')),
+    path('gem/', include('marktplatz.urls')),
 
 
     path('login/',                   auth_views.LoginView.as_view(template_name="auth/login.html"), name='mab_login'),
@@ -60,7 +60,7 @@ urlpatterns = [
     path('accounts/reset/done/', auth_views.PasswordResetCompleteView.as_view(template_name="auth/password_reset_complete.html"), name='password_reset_complete'),
 
     #redirects to marktplatz
-    path('', RedirectView.as_view(url='/mab/')),
+    path('', RedirectView.as_view(url='/gem/')),
 
     path('accounts/', include('django.contrib.auth.urls')),
     path('newsletter/', include('newsletter.urls')),