Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: c3nav/c3nav
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: johanvdw/c3nav
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fosdem_2020
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 9 commits
  • 5 files changed
  • 1 contributor

Commits on Jan 5, 2020

  1. Copy the full SHA
    9e425e8 View commit details

Commits on Jan 9, 2020

  1. Fix validation error

    double hypens are allowed according to the original code
    johanvdw committed Jan 9, 2020
    Copy the full SHA
    dd75663 View commit details
  2. Allow underscore in slug

    compatibility with pentabarf
    johanvdw committed Jan 9, 2020
    Copy the full SHA
    d194094 View commit details

Commits on Jan 17, 2020

  1. Fix typo

    johanvdw committed Jan 17, 2020
    Copy the full SHA
    39be5c7 View commit details

Commits on Jan 19, 2020

  1. Remove the link to the c3nav app for FOSDEM

    As this app is not working with FOSDEM it is confusing to keep the link.
    
    It would be nicer to make this a configuration option - will discuss
    upstream.
    johanvdw committed Jan 19, 2020
    Copy the full SHA
    b71be95 View commit details

Commits on Jan 25, 2020

  1. Copy the full SHA
    c0b554c View commit details
  2. Copy the full SHA
    317d90f View commit details

Commits on Nov 19, 2022

  1. Copy the full SHA
    76e17a9 View commit details

Commits on Jan 15, 2023

  1. Fix issue with psycopg2

    johanvdw committed Jan 15, 2023
    Copy the full SHA
    52993c5 View commit details
2 changes: 1 addition & 1 deletion src/c3nav/mapdata/models/locations.py
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ def select_related_target(self):


validate_slug = RegexValidator(
r'^[a-z0-9]+(--?[a-z0-9]+)*\Z',
r'^[a-z0-9]+([-_]?[a-z0-9]+)*\Z',
# Translators: "letters" means latin letters: a-z and A-Z.
_('Enter a valid location slug consisting of lowercase letters, numbers or hyphens, '
'not starting or ending with hyphens or containing consecutive hyphens.'),
11 changes: 7 additions & 4 deletions src/c3nav/mapdata/render/renderdata.py
Original file line number Diff line number Diff line change
@@ -85,14 +85,16 @@ def rebuild():
last_interpolator = NearestNDInterpolator(np.array([[0, 0]]), np.array([float(level.base_altitude)]))

for i, level in enumerate(levels):
print("we are at level_id:" + str(level.id) + " level slug: "+level.slug)
print("on top of:" + str(level.on_top_of_id))
if level.on_top_of_id is not None:
continue

print("we continue")
map_history = MapHistory.open_level(level.pk, 'base')

sublevels = tuple(sublevel for sublevel in levels
if sublevel.on_top_of_id == level.pk or sublevel.base_altitude <= level.base_altitude)

print("sublevels" + str([l.slug for l in sublevels]))
level_crop_to = {}

# choose a crop area for each level. non-intermediate levels (not on_top_of) below the one that we are
@@ -147,11 +149,12 @@ def rebuild():

# go through sublevels, get their level geometries and crop them
lowest_important_level_passed = False
for sublevel in sublevels:
for sublevel in reversed(sublevels):
try:
crop_to = level_crop_to[sublevel.pk]
except KeyError:
break
print ("in except, sublevel_pk: " + str(sublevel.pk))
break;

old_geoms = single_level_geoms[sublevel.pk]

6 changes: 4 additions & 2 deletions src/c3nav/site/static/site/js/c3nav.js
Original file line number Diff line number Diff line change
@@ -1346,7 +1346,8 @@ c3nav = {
}

// setup user location control
c3nav._userLocationControl = new UserLocationControl().addTo(c3nav.map);
// disabled for FOSDEM
// c3nav._userLocationControl = new UserLocationControl().addTo(c3nav.map);

L.control.zoom({
position: 'bottomright'
@@ -1979,7 +1980,8 @@ UserLocationControl = L.Control.extend({
},

onAdd: function () {
this._container = L.DomUtil.create('div', 'leaflet-control-user-location leaflet-bar ' + this.options.addClasses);
// disable location for FOSDEM
// this._container = L.DomUtil.create('div', 'leaflet-control-user-location leaflet-bar ' + this.options.addClasses);
this._button = L.DomUtil.create('a', 'material-icons', this._container);
this._button.innerHTML = c3nav._map_material_icon(c3nav.hasLocationPermission() ? 'location_searching' : 'location_disabled');
this._button.classList.toggle('control-disabled', !c3nav.hasLocationPermission());
6 changes: 6 additions & 0 deletions src/c3nav/site/templates/site/map.html
Original file line number Diff line number Diff line change
@@ -107,15 +107,19 @@ <h3>{% trans 'Wifi-based location' %}</h3>
<i class="icon material-icons">place</i>
<input type="text" autocomplete="off" spellcheck="false" placeholder="{% trans 'Search any location…' %}">
<small></small>
{% if app %}
<button class="button-clear locate material-icons">location_disabled</button>
{% endif %}
<button class="button-clear clear material-icons">clear</button>
</div>
<div class="location locationinput empty" id="destination-input">
<i class="icon material-icons">place</i>
<input type="text" autocomplete="off" spellcheck="false" placeholder="{% trans 'Search any location…' %}">
<small></small>
<button class="button-clear random material-icons" href="/random/">casino</button>
{% if app %}
<button class="button-clear locate material-icons">location_disabled</button>
{% endif %}
<button class="button-clear clear material-icons">clear</button>
</div>
<i class="material-icons" id="route-dots">more_vert</i>
@@ -211,12 +215,14 @@ <h2>{% trans 'Route options' %}</h2>
</section>
</div>
</section>
{% if app %}
<div class="app-ads">
<div id="android-app-ad">
<a href="#" class="close"><i class="material-icons">close</i></a>
{% blocktrans with play_url="https://play.google.com/store/apps/details?id=de.c3nav.droid" apk_url="https://github.com/c3nav/c3nav-android/releases" %}Get the c3nav Android app on <a href="{{ play_url }}" target="_blank">Google Play</a> or <a href="{{ apk_url }}" target="_blank">download the APK!</a>{% endblocktrans %}
</div>
</div>
{% endif %}
{% else %}
<a id="embed-logo" class="embed-link" target="_blank">{% if header_logo %}<img src="{% static header_logo %}">{% else %}<span>c3nav</span>{% endif %}</a>
<a id="embed-open" class="embed-link" target="_blank">{% trans 'open in c3nav' %}</a>
2 changes: 1 addition & 1 deletion src/requirements/postgres.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
psycopg2-binary
psycopg2-binary>=2.8,<2.9