Skip to content

Commit 4ba3b0a

Browse files
committed
WIP on list page
1 parent 2da6296 commit 4ba3b0a

2 files changed

Lines changed: 119 additions & 62 deletions

File tree

prefix_finder/frontend/static/css/main.css

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,7 @@ fieldset {
926926
font-weight: 400;
927927
}
928928
}
929+
929930
.single-content__header {
930931
background-color: #00a6ab;
931932
}
@@ -947,6 +948,11 @@ fieldset {
947948
.single-content__header .button {
948949
float: right;
949950
}
951+
952+
.single-content__header_warning {
953+
background-color: lightcoral;
954+
}
955+
950956
@media (min-width: 64em) {
951957
.single-content__main {
952958
float: left;
@@ -1005,7 +1011,6 @@ fieldset {
10051011

10061012
.single-categories__item {
10071013
padding: 15px;
1008-
background-color: rgba(0, 0, 0, 0.1);
10091014
}
10101015
@media (min-width: 64em) {
10111016
.single-categories__item {
@@ -1026,12 +1031,6 @@ fieldset {
10261031
.single-categories__item p span {
10271032
font-weight: 100;
10281033
}
1029-
.single-categories--coverage {
1030-
background-color: rgba(0, 166, 171, 0.1);
1031-
}
1032-
.single-categories--sectors {
1033-
background-color: rgba(227, 168, 48, 0.1);
1034-
}
10351034

10361035
.single-suggest {
10371036
padding: 20px;
@@ -1093,25 +1092,28 @@ fieldset {
10931092
.single-sidebar__block p:last-child {
10941093
padding-bottom: 20px;
10951094
}
1096-
.single-sidebar--dark {
1095+
.single-content--dark {
10971096
background-color: rgba(0, 0, 0, 0.7);
1097+
padding: 5px 20px;
10981098
}
1099-
.single-sidebar--dark h2, .single-sidebar--dark p {
1099+
.single-content--dark h2, .single-content--dark p {
11001100
color: white;
11011101
}
1102-
.single-sidebar--dark code {
1102+
.single-content--dark code {
11031103
padding: 4px;
11041104
background-color: rgba(255, 255, 255, 0.1);
11051105
font-family: "Lucida Console", "Courier New", monospace;
11061106
color: white;
11071107
}
1108-
.single-sidebar--dark pre {
1108+
.single-content--dark pre {
11091109
background-color: rgba(255, 255, 255, 0.1);
11101110
padding-top: 20px;
11111111
padding-bottom: 5px;
1112+
padding-left: 10px;
1113+
padding-right: 10px;
11121114
margin-bottom: 20px;
11131115
}
1114-
.single-sidebar--dark pre code {
1116+
.single-content--dark pre code {
11151117
background-color: transparent;
11161118
}
11171119

prefix_finder/frontend/templates/list.html

Lines changed: 105 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -8,80 +8,135 @@
88
{% include "sidebar.html" with sidebar_show_download_links=False %}
99

1010
<div class="main-content single-content">
11-
<header class="single-content__header">
11+
12+
<header class="single-content__header {% if org_list.deprecated %}single-content__header_warning{% endif %}">
1213
<a href="{{ org_list.url }}" class="button" target="_blank"><i class="material-icons" title="Visit website for this list">launch</i></a>
1314
<h1>{{ org_list.name.en }} <span>({{ org_list.code }})</span></h1>
15+
16+
{% if org_list.deprecated %}
17+
<h1>This list is deprecated and should only be used for historical information!</h1>
18+
{% endif %}
1419
</header>
1520

16-
<div class="single-content__sidebar single-sidebar">
17-
<div class="single-sidebar__block quality-chart quality-chart--high" data-chart="{{ org_list.quality }}">
18-
<div id="quality-chart-container"></div>
19-
</div>
20-
<div class="quality-chart__list-type quality-chart--high">
21-
<p>List Type: <span>{{ org_list.listType }}</span></p>
22-
</div>
2321

24-
<div class="single-sidebar__block single-sidebar--dark">
22+
<div class="single-content__block single-description">
23+
<h2>Description</h2>
24+
<p>{{ org_list.description.en|urlize|linebreaks }}</p>
25+
</div>
26+
27+
{% if not org_list.deprecated %}
28+
<div class="single-content__block single-content--dark">
2529
<h2>How to use</h2>
2630
<p>The code for this list is <br/><code>{{ org_list.code }}</code>. When you have located the organization you wish to identify in this list, you should either:</p>
2731
<p>Enter it in an identifier database field prefixed with <code>{{ org_list.code }}</code>.</p>
2832
<pre>
2933
<code>{{ org_list.code }}-[ IDENTIFIER ]</code>
3034
</pre>
3135
{% if org_list.access.exampleIdentifiers|length >= 1 %}
32-
{% if org_list.access.exampleIdentifiers|length == 1 %}
33-
<h2>Example</h2>
34-
{% else %}
35-
<h2>Examples</h2>
36-
{% endif %}
37-
<pre>
38-
{% for x in org_list.access.exampleIdentifiers|split_examples:","|slice:":3" %}
36+
{% if org_list.access.exampleIdentifiers|length == 1 %}
37+
<h2>Example</h2>
38+
{% else %}
39+
<h2>Examples</h2>
40+
{% endif %}
41+
<pre>
42+
{% for x in org_list.access.exampleIdentifiers|split_examples:","|slice:":3" %}
3943
<code>{{ org_list.code }}-{{ x }}</code>
40-
{% endfor %}
41-
</pre>
44+
{% endfor %}
45+
</pre>
4246
{% endif %}
4347
<p>Alternatively, use it within a two-part identifier, with <code>{{ org_list.code }}</code> as the 'scheme', and the identifier you have located as the 'identifier' field. </p>
4448
</div>
45-
</div>
4649

47-
<div class="single-content__main">
4850

49-
<div class="single-content__block single-description">
50-
<h2>Description</h2>
51-
<p>{{ org_list.description.en|urlize|linebreaks }}</p>
51+
<div class="single-meta-info__instructions">
52+
{% if org_list.access.onlineAccessDetails %}
53+
<h3>Search options</h3>
54+
<p>{{ org_list.access.onlineAccessDetails|urlize|linebreaks }}</p>
55+
{% endif %}
56+
<h3>Find and use identifiers</h3>
57+
{% if org_list.access.guidanceOnLocatingIds %}
58+
<p>{{ org_list.access.guidanceOnLocatingIds|urlize|linebreaks }}</p>
59+
{% endif %}
60+
{% if org_list.access.publicDatabase %}
61+
<p>Search the list <a href="{{ org_list.access.publicDatabase }}" target="_blank">here</a>.</p>
62+
{% elif org_list.url %}
63+
<p><a href="{{ org_list.url }}" target="_blank">Visit the website.</a></p>
64+
{% endif %}
5265
</div>
66+
67+
{% endif %}
5368

54-
<div class="single-content__block single-meta-info">
55-
<ul class="single-meta-info__categories single-categories">
56-
<li class="single-categories__item single-categories--coverage">
57-
<p>Coverage: {% for code, title, disabled in org_list.coverage_codes_and_titles %}<span><abbr title="{{ title }}">{{ code }}</abbr>{% if not forloop.last %},{% endif %} </span>{% endfor %}</p>
69+
70+
<div class="single-content__block single-meta-info">
71+
<ul class="single-meta-info__categories single-categories">
72+
<li class="single-categories__item">
73+
<p>Coverage: {% for code, title, disabled in org_list.coverage_codes_and_titles %}<span><abbr title="{{ title }}">{{ code }}</abbr>{% if not forloop.last %},{% endif %} </span>{% endfor %}</p>
74+
</li>
75+
{% if org_list.subnationalCoverage %}
76+
<li class="single-categories__item">
77+
<p>Subnational jurisdiction: {% for code in org_list.subnationalCoverage %}<span>{{ code }}{% if not forloop.last %},{% endif %} </span>{% endfor %}</p>
5878
</li>
79+
{% endif %}
5980

60-
{% if org_list.sector %}
61-
<li class="single-categories__item single-categories--sectors">
62-
<p>Sectors: {% for x in org_list.sector %}<span>{{ x }}{% if not forloop.last %},{% endif %} </span>{% endfor %}</p>
63-
</li>
64-
{% endif %}
65-
</ul>
81+
{% if org_list.structure %}
82+
<li class="single-categories__item">
83+
<p>Legal structure: {% for code in org_list.structure %}<span>{{ code }}{% if not forloop.last %},{% endif %} </span>{% endfor %}</p>
84+
</li>
85+
{% endif %}
6686

67-
<div class="single-meta-info__instructions">
68-
{% if org_list.access.onlineAccessDetails %}
69-
<h3>Search options</h3>
70-
<p>{{ org_list.access.onlineAccessDetails|urlize|linebreaks }}</p>
71-
{% endif %}
72-
<h3>Find and use identifiers</h3>
73-
{% if org_list.access.guidanceOnLocatingIds %}
74-
<p>{{ org_list.access.guidanceOnLocatingIds|urlize|linebreaks }}</p>
75-
{% else %}
76-
<p><a href="{{ org_list.url }}" target="_blank">Visit the website.</a></p>
77-
{% endif %}
78-
</div>
79-
</div>
87+
{% if org_list.sector %}
88+
<li class="single-categories__item">
89+
<p>Sectors: {% for x in org_list.sector %}<span>{{ x }}{% if not forloop.last %},{% endif %} </span>{% endfor %}</p>
90+
</li>
91+
{% endif %}
8092

81-
<div class="single-content__block single-suggest">
82-
<p>You can suggest an edit to our information about this list by <a href="https://github.com/org-id/register/issues/new">posting an issue</a> or <a href="https://github.com/org-id/register/edit/{{ branch }}/lists/{{ org_list.code|lower|split_on:"-"|first }}/{{ org_list.code|lower }}.json">submitting a pull request</a>.</p>
83-
<p>The <a href="http://docs.org-id.guide/en/latest/contribute/#proposing-a-correction-or-update" target="_blank">contributors handbook</a> details how to propose changes to an existing list, and how you can request or propose a new list.</p>
84-
</div>
93+
<li class="single-categories__item">
94+
<p>List Type: <span>{{ org_list.listType }}</span></p>
95+
</li>
96+
97+
<!-- access_availableOnline Access - Available online? boolean View -->
98+
<!-- access_onlineAccessDetails Access - Online access details string View -->
99+
<!-- access_publicDatabase Access - List URL string View -->
100+
<!-- access_guidanceOnLocatingIds Access - How to locate identifiers string View -->
101+
<!-- access_exampleIdentifiers Access - Example identifiers string View -->
102+
<!-- access_languages Access - Languages list-strings View -->
103+
104+
<!-- data_availability Dataset access - Data availability list-strings View -->
105+
<!-- data_dataAccessDetails Dataset access - Data access details string View -->
106+
<!-- data_features Dataset access - Dataset features list-strings View -->
107+
<!-- data_licenseStatus Dataset access - License status string View -->
108+
<!-- data_licenseDetails Dataset access - License details string View -->
109+
110+
<!-- meta_source Meta - Source string View -->
111+
<!-- meta_lastUpdated Meta - Last updated string View -->
112+
113+
114+
{% if org_list.links.opencorporates %}
115+
<li class="single-categories__item">
116+
<p>Open Corporates Link: <span><a href="{{ org_list.links.opencorporates }}">{{ org_list.links.opencorporates }}</a></span></p>
117+
</li>
118+
{% endif %}
119+
120+
{% if org_list.links.wikipedia %}
121+
<li class="single-categories__item">
122+
<p>Wikipedia page: <span><a href="{{ org_list.links.wikipedia }}">{{ org_list.links.wikipedia }}</a></span></p>
123+
</li>
124+
{% endif %}
125+
126+
{% if org_list.formerPrefixes %}
127+
<li class="single-categories__item">
128+
<p>Former list codes: {% for x in org_list.formerPrefixes %}<span>{{ x }}{% if not forloop.last %},{% endif %} </span>{% endfor %}</p>
129+
</li>
130+
{% endif %}
131+
132+
133+
</ul>
134+
135+
</div>
136+
137+
<div class="single-content__block single-suggest">
138+
<p>You can suggest an edit to our information about this list by <a href="https://github.com/org-id/register/issues/new">posting an issue</a> or <a href="https://github.com/org-id/register/edit/{{ branch }}/lists/{{ org_list.code|lower|split_on:"-"|first }}/{{ org_list.code|lower }}.json">submitting a pull request</a>.</p>
139+
<p>The <a href="http://docs.org-id.guide/en/latest/contribute/#proposing-a-correction-or-update" target="_blank">contributors handbook</a> details how to propose changes to an existing list, and how you can request or propose a new list.</p>
85140
</div>
86141
</div>
87142
</main>

0 commit comments

Comments
 (0)