Skip to content

Commit

Permalink
Merge pull request #271 from open-plan-tool/feature/reach-out-users
Browse files Browse the repository at this point in the history
Reach out users for sponsor
  • Loading branch information
Bachibouzouk authored Sep 16, 2024
2 parents 179f830 + ccb865a commit 686234f
Show file tree
Hide file tree
Showing 8 changed files with 353 additions and 178 deletions.
Binary file modified app/locale/de/LC_MESSAGES/django.mo
Binary file not shown.
455 changes: 281 additions & 174 deletions app/locale/de/LC_MESSAGES/django.po

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions app/projects/models/base_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ class Timeseries(models.Model):
settings.AUTH_USER_MODEL, on_delete=models.CASCADE, null=True, blank=True
)
# TODO check that if both a user and scenario are provided the scenario belongs to the user
scenario = models.ForeignKey(
Scenario, on_delete=models.CASCADE, null=True, blank=True
)
# scenario = models.ForeignKey(
# Scenario, on_delete=models.CASCADE, null=True, blank=True
# )
ts_type = models.CharField(max_length=12, choices=MVS_TYPE, blank=True, null=True)

open_source = models.BooleanField(
Expand Down
1 change: 1 addition & 0 deletions app/projects/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,5 @@
),
# User Feedback
path("user_feedback", user_feedback, name="user_feedback"),
path("sponsor/feature", sponsor_feature, name="sponsor_feature"),
]
20 changes: 19 additions & 1 deletion app/projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
from django.http import HttpResponseForbidden, JsonResponse
from django.http.response import Http404
from django.utils.translation import gettext_lazy as _
from django.utils.safestring import mark_safe
from django.shortcuts import *
from django.urls import reverse
from django.core.exceptions import PermissionDenied
from django.views.decorators.http import require_http_methods
from django.contrib import messages

from jsonview.decorators import json_view
from datetime import datetime
from users.models import CustomUser
Expand Down Expand Up @@ -152,6 +154,11 @@ def user_feedback(request):
return render(request, "feedback.html", {"form": form})


@require_http_methods(["GET", "POST"])
def sponsor_feature(request):
return render(request, "legal/sponsor_feature.html")


@login_required
@json_view
@require_http_methods(["GET"])
Expand Down Expand Up @@ -501,6 +508,16 @@ def project_search(request, proj_id=None, scen_id=None):
usecase_qs=UseCase.objects.all(), usecase_url=reverse("usecase_search")
)

if request.user.id == 1:
messages.info(
request,
mark_safe(
_(
"<p>Hello dear open-plan-tool user!</br></br> We would just like to let you know we are looking for your inputs in terms of features ideas or feature sponsor. Please check out the new navigation bar link 'Sponsor new features' for more information</br></br>Thank you for using open-plan-tool</p>"
)
),
)

return render(
request,
"project/project_search.html",
Expand Down Expand Up @@ -538,9 +555,10 @@ def project_duplicate(request, proj_id):
new_proj_id = load_project_from_dict(dm, user=request.user)
else:
messages.error(
request,
_(
"You cannot duplicate a shared project without the owner granting you 'edit' rights"
)
),
)
new_proj_id = project.id

Expand Down
4 changes: 4 additions & 0 deletions app/templates/legal/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ <h2>{% translate "open_plan project website" %}</h2>
<div class="standard-layout__paragraph standard-layout__paragraph--foreground">
<h2>{% translate "Feedback or question?" %}</h2>
{% url 'user_feedback' as url_feedback %}
{% url 'sponsor_feature' as url_sponsor %}
{% blocktranslate with url_github="https://github.com/orgs/open-plan-tool/projects/5" %}
<p>You can always <a href="{{url_feedback}}">leave us a comment or feedback</a> on things you would improve. You can also visit <a href="{{url_github}}" target="_blank" rel="noreferrer">our github project page</a> to see which bugs are being fixed and which new features are being developed.</p>
{% endblocktranslate %}
{% blocktranslate %}
<p>If you wish to sponsor a new feature of open-plan-tool, please visit our <a href="{{url_sponsor}}" target="_blank" rel="noreferrer">sponsoring page<a></p>
{% endblocktranslate %}
</div>
<div class="standard-layout__paragraph standard-layout__paragraph--small">
<h2>Github</h2>
Expand Down
42 changes: 42 additions & 0 deletions app/templates/legal/sponsor_feature.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{% extends 'base.html' %}
{% load i18n %}


{% block title %} {% translate "Sponsor - open-plan-tool" %} {% endblock title%}

<!-- WRITE HTML CODE WITHIN THESE block content TAGS -->
{% block content %}
<main>
<section class="header">
<div>
<div class="header__left"></div>
<h1 class="header__title">{% translate "Sponsor new features" %}</h1>
<div class="header__back"></div>
</div>
</section>
<section class="standard-layout">
<div>
<div class="standard-layout__paragraph standard-layout__paragraph--foreground">
<h2>{% translate "You wish a feature would be added to open-plan-tool?" %}</h2>
{% url 'user_feedback' as url_feedback %}
{% blocktranslate with url_op="https://open-plan-tool.org/index_en.html" %}
<p>
The open-plan-tool was developed within the <a href="{{url_op}}" target="_blank">open_plan project</a> which ended in June 2023. Since then the tool has remained online but with limited to no budget to fix bugs or develop new features wished by users. If you are an enterprise and wish to use the open-plan-tool with an extra feature and are able to sponsor it (fully or partly), please contact us at <a href="mailto:open_plan@rl-institut.de">open_plan@rl-institut.de</a> or via our <a target="_blank" href="{{url_feedback}}">feedback page</a>

{% endblocktranslate %}
</div>

<div class="standard-layout__paragraph">
<!--h2>Other paragraph type</h2-->
</div>
<div class="standard-layout__paragraph standard-layout__paragraph--small">
<h2>{% translate "We also welcome ideas or wishes from users and would then list them on this page." %}</h2>

</div>


</div>
</section>
</main>
{% endblock content %}

3 changes: 3 additions & 0 deletions app/templates/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
<li class="nav-item">
<a class="nav-link" href="{% url 'usecase_search' %}">{% translate "Use cases" %}</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'sponsor_feature' %}"><span class="badge bg-secondary">New</span> {% translate "Sponsor new features" %} </a>
</li>
{% if user.is_authenticated %}
<li class="nav-item">
<a class="nav-link" href="{% url 'user_feedback' %}">{% translate "Feedback" %}</a>
Expand Down

0 comments on commit 686234f

Please sign in to comment.