Skip to content

Commit

Permalink
Merge pull request #640 from nearbeach/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
robotichead committed Jul 5, 2024
2 parents c91d5e1 + b514960 commit 7d8b35b
Show file tree
Hide file tree
Showing 25 changed files with 55 additions and 91 deletions.
39 changes: 21 additions & 18 deletions NearBeach/middleware/HandleErrorPages.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from django.http import HttpResponseNotFound, HttpResponseBadRequest
from django.template.loader import get_template
from django.http import HttpResponse
from django.template.loader import get_template, TemplateDoesNotExist
from django.conf import settings
from NearBeach.views.theme_views import get_theme



class TemplateErrorMiddleware:
def __init__(self, get_response):
self.get_response = get_response
Expand All @@ -11,26 +13,27 @@ def __call__(self, request):
# Response
response = self.get_response(request)

if response.status_code == 404:
# Get template
template = get_template('404.html')

# Context
c = {
"theme": get_theme(request),
}

response = HttpResponseNotFound(template.render(c))
# On debug send back response
if settings.DEBUG:
return response

if response.status_code == 500:
# Get template
template = get_template('500.html')
try:
# Error Template
t = get_template(f"{response.status_code}.html")

# Content
# Context
c = {
"nearbeach_title": "error",
"need_tinymce": False,
"theme": get_theme(request),
}

response = HttpResponseBadRequest(template.render(c))

# Return
response = HttpResponse(
t.render(c, request),
status=response.status_code,
)
except TemplateDoesNotExist:
pass
return response

1 change: 1 addition & 0 deletions NearBeach/static/NearBeach/6521.min.js

Large diffs are not rendered by default.

Binary file added NearBeach/static/NearBeach/6521.min.js.gz
Binary file not shown.
1 change: 1 addition & 0 deletions NearBeach/static/NearBeach/8722.min.js

Large diffs are not rendered by default.

Binary file added NearBeach/static/NearBeach/8722.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion NearBeach/static/NearBeach/NearBeach.min.js

Large diffs are not rendered by default.

Binary file modified NearBeach/static/NearBeach/NearBeach.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion NearBeach/static/NearBeach/kanban-information.min.js

Large diffs are not rendered by default.

Binary file modified NearBeach/static/NearBeach/kanban-information.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion NearBeach/static/NearBeach/organisation-modules.min.js

Large diffs are not rendered by default.

Binary file modified NearBeach/static/NearBeach/organisation-modules.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion NearBeach/static/NearBeach/parent-modules.min.js

Large diffs are not rendered by default.

Binary file modified NearBeach/static/NearBeach/parent-modules.min.js.gz
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
18 changes: 2 additions & 16 deletions NearBeach/views/user_job_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,9 @@ def get_my_planning_objects(request, delta=7):
"job_sort_number",
)

results = project_results.union(
task_results
).union(
card_results
).values(
"user_job_id",
"object_type",
"location_id",
"title",
"end_date",
"status",
"higher_order_status",
"job_date",
"job_sort_number",
).order_by("job_sort_number")
results = list(project_results) + list(task_results) + list(card_results)

return json.dumps(list(results), cls=DjangoJSONEncoder)
return json.dumps(results, cls=DjangoJSONEncoder)


@login_required(login_url="login", redirect_field_name="")
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/modules/sub_modules/BugsModule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

<!-- Add Bug Button -->
<!-- TO DO - limit it to certain users -->
<hr/>
<hr v-if="userLevel > 1"/>
<div class="row submit-row">
<div class="col-md-12">
<button
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/modules/sub_modules/ChildSprints.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</button>
</div>
</div>
<hr>
<hr v-if="destination === 'project'" class="mt-4">
</div>

<new-sprint-wizard
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/modules/sub_modules/DocumentsModule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
</div>

<!-- ADD DOCUMENTS AND FOLDER BUTTON -->
<hr/>
<hr v-if="userLevel > 1" />
<div class="btn-group save-changes"
v-if="readOnly === false"
>
Expand Down
3 changes: 1 addition & 2 deletions src/js/components/modules/sub_modules/NotesModule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
></list-notes>

<!-- ADD NOTE HISTORY -->
<!-- TO DO - limit it to certain users -->
<hr/>
<hr v-if="userLevel > 1" />
<div class="row submit-row">
<div class="col-md-12">
<button
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/modules/sub_modules/ObjectLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
</div>

<!-- Submit Button -->
<hr v-if="userLevel > 1" />
<div class="row submit-row">
<div class="col-md-12">
<a
Expand All @@ -81,7 +82,6 @@
>
</div>
</div>
<hr/>

<!-- MODAL FOR NEW OBJECT LINKS -->
<new-link-wizard
Expand Down

0 comments on commit 7d8b35b

Please sign in to comment.