Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various bugfixes !! #527

Merged
merged 7 commits into from
Dec 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions main/migrations/0066_auto_20201223_0731.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.13 on 2020-12-23 07:31

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('main', '0065_auto_20201202_0159'),
]

operations = [
migrations.AlterField(
model_name='drive',
name='slug',
field=models.SlugField(max_length=255, null=True, unique=True),
),
]
2 changes: 1 addition & 1 deletion main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class Drive(models.Model):
"""

id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
slug = models.SlugField(null=True, unique=True)
slug = models.SlugField(max_length=255, null=True, unique=True)
name = models.CharField(max_length=128)
description = models.CharField(max_length=700, blank=True, null=True)
state = models.CharField(
Expand Down
25 changes: 21 additions & 4 deletions main/static/main/js/geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,23 @@ if (filterStack === null) filterStack = [];
if (bboxStack === null) bboxStack = [];

// change "Show Examples" to "Hide Examples" on click
// TODO: change this to be updated for languages automatically, rather than manually
function changeText(element) {
if (element.innerText == "Show Examples") {
element.innerText = "Hide Examples";
var target_id = element.getAttribute("data-target").replace("#","");
var targetVis = document.getElementById(target_id).classList.contains("show");
var txt = element.innerText;
if (!targetVis) {
if (txt == "Show Examples") {
element.innerText = "Hide Examples";
} else if (txt == "Mostar ejemplos") {
element.innerText = "Ocultar ejemplos";
}
} else {
element.innerText = "Show Examples";
if (txt == "Hide Examples") {
element.innerText = "Show Examples";
} else if (txt == "Ocultar ejemplos"){
element.innerText = "Mostar ejemplos";
}
}
}

Expand Down Expand Up @@ -202,7 +214,10 @@ function createCommPolygon() {
// it means a community with a population between 480,000 & 2,400,000
var polyFilter = JSON.parse(sessionStorage.getItem("bgFilter"));

if (polyFilter === null) return false;
if (polyFilter === null) {
triggerMissingPolygonError();
return false;
}
if (polyFilter.length > 802) {
triggerDrawError(
"polygon_size",
Expand Down Expand Up @@ -1003,6 +1018,8 @@ map.on("style.load", function () {
var queryFeatures = map.queryRenderedFeatures(bbox, {
layers: [state + "-census-shading"],
});
// if no features are found - probably selected an invalid area (outside state) or some other error occurred
if (queryFeatures.length == 0) return;
var isChanged = false; // store only valid moves in stack
var features = []; // the features in click radius
var currentBbox; // the current selection area bounding box
Expand Down
4 changes: 2 additions & 2 deletions main/templates/account/signup_login.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{% include './signup.html'%}

<div class="auth-divider-wrap col-lg-1">
<div class="auth-divider"></div>
<div class="auth-divider d-none d-lg-block"></div>
</div>

{% include './login.html'%}
Expand All @@ -32,4 +32,4 @@

{% block script %}
<script type="text/javascript" src="{% static 'main/js/auth.js' %}"></script>
{% endblock %}
{% endblock %}
3 changes: 2 additions & 1 deletion main/templates/main/entry.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
var organization_name = "{{organization_name}}";
var state = "{{state}}";
var address_required = "{{address_required}}";
var language = "{{LANGUAGE_CODE}}"
mixpanel.track("Entry Page Loaded",
{
"drive_id": drive_id,
Expand Down Expand Up @@ -398,7 +399,7 @@ <h5 class="card-text">Community Needs and Concerns</h5>
</p>
<div class="accordion" id="other_interests_accordion">
<button class="btn btn-link text-left pl-0" type="button" data-toggle="collapse" onclick="changeText(this)" data-target="#other_interests_example" aria-expanded="false" aria-controls="collapseOne">
{% trans "Show Example" %}
{% trans "Show Examples" %}
</button>
<div id="other_interests_example" class="collapse" aria-labelledby="other_interests_accordion" data-parent="#other_interests_accordion">
<p class="collapse-in ml-0">
Expand Down