-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make institution field use ROR
- Loading branch information
Showing
12 changed files
with
253 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 5.0.3 on 2024-04-01 09:34 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("lab", "0032_alter_participation_project"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="institution", | ||
name="ror_id", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="Research Organization Registry ID", | ||
max_length=255, | ||
null=True, | ||
verbose_name="ROR ID", | ||
), | ||
), | ||
] |
25 changes: 25 additions & 0 deletions
25
lab/migrations/0034_alter_institution_country_alter_institution_name.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 5.0.3 on 2024-04-01 09:56 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("lab", "0033_institution_ror_id"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="institution", | ||
name="country", | ||
field=models.CharField( | ||
blank=True, max_length=255, null=True, verbose_name="country" | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="institution", | ||
name="name", | ||
field=models.CharField(max_length=255, verbose_name="name"), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
lab/static/css/widgets/institution-autocomplete-widget.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.typeahead-field { | ||
position: relative; | ||
display: inline-block; | ||
} | ||
|
||
.typeahead-field .typeahead-list { | ||
background-color: var(--background-default-grey); | ||
position: absolute; | ||
z-index: 1000; | ||
top: 41px; | ||
width: 300px; | ||
max-height: 500px; | ||
overflow: scroll; | ||
left: 0; | ||
right: 0; | ||
} | ||
|
||
.typeahead-field .typeahead-list button { | ||
text-align: left; | ||
padding: .75rem 1rem; | ||
width: 100%; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
{% load i18n %} | ||
|
||
<div class="autocomplete-input flex-container"> | ||
<input name="{{ widget.name }}__name" {% if widget.instance %}value="{{ widget.instance.name }}"{% endif %} list="datalist-{{widget.name}}__choices" id="{{widget.id}}__name" class="fr-input autocomplete-input__name fr-mr-1w" placeholder="{% translate "Institution" %}"> | ||
<datalist id="datalist-{{widget.name}}__choices"> | ||
{% for choice in widget.choices %} | ||
<option value="{{choice.1}}"></option> | ||
{% endfor %} | ||
</datalist> | ||
<div class="typeahead-field fr-mr-1w"> | ||
<input name="{{ widget.name }}__name" {% if widget.instance %}value="{{ widget.instance.name }}"{% endif %} id="{{widget.id}}__name" class="fr-input autocomplete-input__name" placeholder="{% translate "Institution" %}" autocomplete="off"> | ||
<div class="typeahead-list"></div> | ||
</div> | ||
<input name="{{ widget.name }}__country" {% if widget.instance %}value="{{ widget.instance.country }}"{% endif %} id="{{widget.id}}__country" class="fr-input autocomplete-input__country" placeholder="{% translate "Country" %}"> | ||
|
||
<input type="hidden" {% if widget.value %}value="{{ widget.value }}"{% endif %} name="{{ widget.name }}" id="{{widget.id}}" class="fr-input autocomplete-input__id"> | ||
<input type="hidden" {% if widget.instance %}value="{{ widget.instance.ror_id }}"{% endif %} name="{{ widget.name }}__ror_id" id="{{widget.id}}__ror_id" class="fr-input autocomplete-input__ror_id"> | ||
</div> |
Oops, something went wrong.