diff --git a/prefix_finder/frontend/static/css/main.css b/prefix_finder/frontend/static/css/main.css index c410626..c532d61 100644 --- a/prefix_finder/frontend/static/css/main.css +++ b/prefix_finder/frontend/static/css/main.css @@ -538,6 +538,10 @@ fieldset { background-color: #C02942; } +.card--deprecated header { + background-color: rgba(0, 0, 0, 0.7);; +} + .topbar { position: relative; background-color: rgba(0, 0, 0, 0.05); @@ -876,6 +880,9 @@ fieldset { .list-group--fallback h1 { background-color: #C02942; } +.list-group--deprecated h1 { + background-color:rgba(0, 0, 0, 0.7); +} .single-content { margin-left: auto; @@ -919,6 +926,7 @@ fieldset { font-weight: 400; } } + .single-content__header { background-color: #00a6ab; } @@ -940,6 +948,11 @@ fieldset { .single-content__header .button { float: right; } + +.single-content__header_warning { + background-color: lightcoral; +} + @media (min-width: 64em) { .single-content__main { float: left; @@ -998,7 +1011,6 @@ fieldset { .single-categories__item { padding: 15px; - background-color: rgba(0, 0, 0, 0.1); } @media (min-width: 64em) { .single-categories__item { @@ -1019,12 +1031,6 @@ fieldset { .single-categories__item p span { font-weight: 100; } -.single-categories--coverage { - background-color: rgba(0, 166, 171, 0.1); -} -.single-categories--sectors { - background-color: rgba(227, 168, 48, 0.1); -} .single-suggest { padding: 20px; @@ -1086,25 +1092,28 @@ fieldset { .single-sidebar__block p:last-child { padding-bottom: 20px; } -.single-sidebar--dark { +.single-content--dark { background-color: rgba(0, 0, 0, 0.7); + padding: 5px 20px; } -.single-sidebar--dark h2, .single-sidebar--dark p { +.single-content--dark h2, .single-content--dark p { color: white; } -.single-sidebar--dark code { +.single-content--dark code { padding: 4px; background-color: rgba(255, 255, 255, 0.1); font-family: "Lucida Console", "Courier New", monospace; color: white; } -.single-sidebar--dark pre { +.single-content--dark pre { background-color: rgba(255, 255, 255, 0.1); padding-top: 20px; padding-bottom: 5px; + padding-left: 10px; + padding-right: 10px; margin-bottom: 20px; } -.single-sidebar--dark pre code { +.single-content--dark pre code { background-color: transparent; } @@ -1301,20 +1310,6 @@ fieldset { padding: 5px 10px; color: white; } -.about-page__half--left { - display: inline-block; - vertical-align: top; - width: 50%; - margin-right: -5px; - padding-right: 10px; - -} -.about-page__half--right { - display: inline-block; - vertical-align: top; - width: 50%; - padding-left: 10px; -} .about-page__code { background-color: #e0e0e0; margin-bottom: 20px; @@ -1402,3 +1397,6 @@ fieldset { .sidebar .chosen-drop { width: 100%; } +.align-right { + text-align: right; +} diff --git a/prefix_finder/frontend/templates/about.html b/prefix_finder/frontend/templates/about.html index 72916ab..a6ab31e 100644 --- a/prefix_finder/frontend/templates/about.html +++ b/prefix_finder/frontend/templates/about.html @@ -2,13 +2,13 @@ {% load i18n %} {% block main %}
- {% include "sidebar.html" %} + {% include "sidebar.html" with sidebar_show_about_link=False %}

{% trans "About" %}

-
+

What?

org-id.guide is the easiest, quickest and most accurate way to locate organization identifiers.

We maintain a register of organization lists. Those lists, in turn, provide unique identifiers for companies, charities, government agencies and other kinds of organizations.

@@ -16,7 +16,7 @@

What?

Many of the lists in our register are official identifier sources (such as a country company register); other lists may be maintained by third-parties. When we can, we link out to websites where you can look up a specific organization, although we also include codes for lists that don't provide a public search service.

We welcome new additions or updates to the register. We don't pre-judge the kinds of lists that should be included - but we do make sure the register includes good meta-data. We use that meta-data to provide a quality score that indicates how accessible and stable identifiers from the list are likely to be.

-
+

Why?

org-id.guide has been created by a partnership of open data standards groups in order to provide a robust, shared approach to the use of open, interoperable and unambiguous organization identifers.

It is a collaborative project designed to fill a gap in our shared data infrastructure.

@@ -35,7 +35,7 @@

Why?

How do I use it?

-
+

Data creators

Are you collecting or publishing data about organizations?

First, make sure you are collecting an identifier for each organization, as well as a name. You can lookup the best identifier list to use based on the country, organization type, or sector you are managing data for.

@@ -51,7 +51,7 @@

Data creators

}
-
+

Data users

If you’ve come across an organization identifier, you can use org-id.guide to find out more about it and where to locate related open data.

diff --git a/prefix_finder/frontend/templates/list.html b/prefix_finder/frontend/templates/list.html index 906bdf6..249c755 100644 --- a/prefix_finder/frontend/templates/list.html +++ b/prefix_finder/frontend/templates/list.html @@ -5,83 +5,145 @@ {% block main %}
- {% include "sidebar.html" %} + {% include "sidebar.html" with sidebar_show_download_links=False %}
-
+ +
launch

{{ org_list.name.en }} ({{ org_list.code }})

+ + {% if org_list.deprecated %} +

This record is deprecated and should only be used for interpreting older datasets.

+ {% endif %}
-
diff --git a/prefix_finder/frontend/templates/results-list.html b/prefix_finder/frontend/templates/results-list.html new file mode 100644 index 0000000..947fe37 --- /dev/null +++ b/prefix_finder/frontend/templates/results-list.html @@ -0,0 +1,42 @@ +
+
+
+
+
+
+

{{ result.name.en }}

+

{{ result.code }}

+
+ +
+
+

{{ result.description.en|truncatewords_html:50 }}

+
+ +
+ {% if result.coverage %} +
    +

    Countries

    + {% for coverage in result.coverage %} +
  • {{ coverage }}
  • + {% endfor %} +
+ {% endif %} + + {% if result.sector %} +
    +

    Sectors

    + {% for sector in result.sector %} +
  • {{ sector }}
  • + {% endfor %} +
+ {% endif %} +
+
+ + +
+
\ No newline at end of file diff --git a/prefix_finder/frontend/templates/results.html b/prefix_finder/frontend/templates/results.html index 306da14..93cca3e 100644 --- a/prefix_finder/frontend/templates/results.html +++ b/prefix_finder/frontend/templates/results.html @@ -3,7 +3,7 @@ {% block main %}
- {% include "sidebar.html" %} + {% include "sidebar.html" with sidebar_show_download_links=False %}
@@ -19,49 +19,7 @@

Suggested Lists

{% for result in all_results.suggested %} -
-
-
-
-
-
-

{{ result.name.en }}

-

{{ result.code }}

-
- -
-
-

{{ result.description.en|truncatewords_html:50 }}

-
- -
- {% if result.coverage %} -
    -

    Countries

    - {% for coverage in result.coverage %} -
  • {{ coverage }}
  • - {% endfor %} -
- {% endif %} - - {% if result.sector %} -
    -

    Sectors

    - {% for sector in result.sector %} -
  • {{ sector }}
  • - {% endfor %} -
- {% endif %} -
-
- - -
-
+ {% include "results-list.html" with result_class="suggested" %} {% endfor %}
@@ -80,49 +38,7 @@

Possible Lists

{% for result in all_results.recommended %} -
-
-
-
-
-
-

{{ result.name.en }}

-

{{ result.code }}

-
- -
-
-

{{ result.description.en|truncatewords_html:50 }}

-
- -
- {% if result.coverage %} -
    -

    Countries

    - {% for coverage in result.coverage %} -
  • {{ coverage }}
  • - {% endfor %} -
- {% endif %} - - {% if result.sector %} -
    -

    Sectors

    - {% for sector in result.sector %} -
  • {{ sector }}
  • - {% endfor %} -
- {% endif %} -
-
- - -
-
+ {% include "results-list.html" with result_class="possible" %} {% endfor %}
@@ -139,52 +55,28 @@

Fall back identifier sources

{% for result in all_results.other %} -
-
-
-
-
-
-

{{ result.name.en }}

-

{{ result.code }}

-
- -
-
-

{{ result.description.en|truncatewords_html:50 }}

-
- -
- {% if result.coverage %} -
    -

    Countries

    - {% for coverage in result.coverage %} -
  • {{ coverage }}
  • - {% endfor %} -
- {% endif %} + {% include "results-list.html" with result_class="fallback" %} + {% endfor %} +
+
- {% if result.sector %} -
    -

    Sectors

    - {% for sector in result.sector %} -
  • {{ sector }}
  • - {% endfor %} -
- {% endif %} -
-
+
+
+

Deprecated lists

+ {% if all_results.deprecated %} +

The following lists are for reference only. You may see them used in old data.

+ {% else %} +

No deprecated lists meet the search criteria.

+ {% endif %} +
- - -
+
+ {% for result in all_results.deprecated %} + {% include "results-list.html" with result_class="deprecated" %} {% endfor %}
+
{% endblock %} diff --git a/prefix_finder/frontend/templates/sidebar.html b/prefix_finder/frontend/templates/sidebar.html index 4b11671..08c55a9 100644 --- a/prefix_finder/frontend/templates/sidebar.html +++ b/prefix_finder/frontend/templates/sidebar.html @@ -6,9 +6,9 @@ diff --git a/prefix_finder/frontend/views.py b/prefix_finder/frontend/views.py index 0474aa6..63c382b 100644 --- a/prefix_finder/frontend/views.py +++ b/prefix_finder/frontend/views.py @@ -119,25 +119,29 @@ def augment_quality(schemas, org_id_lists): for prefix in org_id_lists: quality = 0 quality_explained = {} - for item in (prefix.get('data', {}).get('availability') or []): - value = availabilty_score.get(item) - if value: - quality += value - quality_explained["Availability: " + availabilty_names[item]] = value - else: - print('No availiablity type {}. Found in code {}'.format(item, prefix['code'])) - if prefix['data'].get('licenseStatus'): - quality += license_score[prefix['data']['licenseStatus']] - quality_explained["License: " + license_names[prefix['data']['licenseStatus']]] = license_score[prefix['data']['licenseStatus']] + if prefix.get("deprecated"): + quality_explained["Deprecated"] = 0 + else: + for item in (prefix.get('data', {}).get('availability') or []): + value = availabilty_score.get(item) + if value: + quality += value + quality_explained["Availability: " + availabilty_names[item]] = value + else: + print('No availiablity type {}. Found in code {}'.format(item, prefix['code'])) + + if prefix['data'].get('licenseStatus'): + quality += license_score[prefix['data']['licenseStatus']] + quality_explained["License: " + license_names[prefix['data']['licenseStatus']]] = license_score[prefix['data']['licenseStatus']] - if prefix.get('listType'): - value = listtype_score.get(prefix['listType']) - if value: - quality += value - quality_explained["List type: " + listtype_names[prefix['listType']]] = value - else: - print('No licenseStatus for {}. Found in code {}'.format(prefix['listType'], prefix['code'])) + if prefix.get('listType'): + value = listtype_score.get(prefix['listType']) + if value: + quality += value + quality_explained["List type: " + listtype_names[prefix['listType']]] = value + else: + print('No licenseStatus for {}. Found in code {}'.format(prefix['listType'], prefix['code'])) prefix['quality_explained'] = quality_explained prefix['quality'] = min(quality, 100) @@ -316,7 +320,8 @@ def filter_and_score_results(query,use_branch="main"): all_results = {"suggested": [], "recommended": [], - "other": []} + "other": [], + "deprecated": [],} if not indexed: return all_results @@ -324,7 +329,9 @@ def filter_and_score_results(query,use_branch="main"): for num, value in enumerate(sorted(indexed.values(), key=lambda k: -(k['relevance'] * 100 + k['quality']))): add_titles(value) - if (value['relevance'] >= RELEVANCE["SUGGESTED_RELEVANCE_THRESHOLD"] + if (value.get("deprecated")): + all_results['deprecated'].append(value) + elif (value['relevance'] >= RELEVANCE["SUGGESTED_RELEVANCE_THRESHOLD"] and value['quality'] > RELEVANCE["SUGGESTED_QUALITY_THRESHOLD"] and not all_results['suggested'] or (all_results['suggested'] and value['relevance'] == all_results['suggested'][0]['relevance'])): all_results['suggested'].append(value)