Skip to content

Commit 42a5ef4

Browse files
authored
CONCD-1077 various fixes and tweaks, mostly UI (#2696)
* CONCD-1049 Open footer links in new tabs * CONCD-1064 Padding needed between save/submit/undo/redo buttons when stacked * CONCD-1045 Padding needed between banner button and X * CONCD-1080 update Twitter/X icon in the footer * CONCD-1080 add the X logo to our bitmap, instead of as a separate file * CONCD-975 site header: responsive layout * CONCD-1061 Contrast and brightness filter numerical dropdowns are cut off * CONCD-1069 Add count to Completed Campaigns page * CONCD-1069 added unit test
1 parent b7d04e0 commit 42a5ef4

File tree

10 files changed

+36
-18
lines changed

10 files changed

+36
-18
lines changed
5.1 KB
Loading

concordia/static/img/twitter-icon.png

-303 Bytes
Binary file not shown.

concordia/static/scss/base.scss

+4
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,10 @@ button.btn-outline-primary:hover {
15181518
}
15191519
}
15201520

1521+
.row > .filter-buttons {
1522+
width: 1.8rem;
1523+
}
1524+
15211525
#ocr-transcription-link {
15221526
pointer-events: auto;
15231527
}

concordia/templates/base.html

+8-8
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ <h1 class="logo-by-the-people m-0 -d-flex -align-items-center">
8585
<li class="nav-item dropdown nav-dropdown">
8686
<a id="topnav-campaigns-dropdown-toggle" class="nav-link
8787
{% if 'campaigns' in PATH_LEVEL_1 %}active{% endif %}" href="{% url 'campaign-topic-list' %}" data-bs-toggle="dropdown" aria-haspopup="true"
88-
aria-expanded="false">Campaigns <span class="fa fa-chevron-down text-primary"></span></a>
88+
aria-expanded="false">Campaigns&nbsp;<span class="fa fa-chevron-down text-primary"></span></a>
8989
<div class="dropdown-menu" aria-labelledby="topnav-campaigns-dropdown-toggle">
9090
<a class="dropdown-item" href="{% url 'campaign-topic-list' %}">All Campaigns</a>
9191
<a class="dropdown-item" href="{% url 'transcriptions:completed-campaign-list' %}">Completed Campaigns</a>
@@ -96,7 +96,7 @@ <h1 class="logo-by-the-people m-0 -d-flex -align-items-center">
9696
<a id="topnav-help-dropdown-toggle" class="nav-link
9797
{% if PATH_LEVEL_1 == 'help-center' or 'get-started' in PATH_LEVEL_1 %}active{% endif %}"
9898
href="{% url 'help-center' %}" rel="nofollow" data-bs-toggle="dropdown" aria-haspopup="true"
99-
aria-expanded="false">How-To <span class="fa fa-chevron-down text-primary"></span></a>
99+
aria-expanded="false">How-To&nbsp;<span class="fa fa-chevron-down text-primary"></span></a>
100100
<div class="dropdown-menu"
101101
aria-labelledby="topnav-help-dropdown-toggle">
102102
<a class="dropdown-item" href="{% url 'welcome-guide' %}"
@@ -191,20 +191,20 @@ <h2 class="h3 fw-normal text-center text-lg-start">Follow
191191
text-lg-start">
192192
<li class="list-inline-item link-github">
193193
<a href="https://github.com/LibraryOfCongress/concordia"
194-
title="GitHub">
194+
title="GitHub" target="_blank">
195195
<span class="bitmap-icon github-icon"></span>
196196
</a>
197197
</li>
198198
<li class="list-inline-item link-twitter">
199199
<a href="https://www.twitter.com/Crowd_LOC"
200-
title="Twitter">
200+
title="Twitter" target="_blank">
201201
<span class="bitmap-icon twitter-icon"></span>
202202
</a>
203203
</li>
204204
<li class="list-inline-item link-email">
205205
<a
206206
href="https://updates.loc.gov/accounts/USLOC/subscriber/new?topic_id=USLOC_175"
207-
title="Newsletter">
207+
title="Newsletter" target="_blank">
208208
<span class="bitmap-icon email-icon"></span>
209209
</a>
210210
</li>
@@ -214,13 +214,13 @@ <h2 class="h3 fw-normal text-center text-lg-start">Follow
214214
<ul class="list-unstyled list-inline small fw-bold mb-0
215215
text-center text-lg-start">
216216
<li class="list-inline-item mb-1"><a
217-
href="/for-educators/">For Educators</a></li>
217+
href="/for-educators/" target="_blank">For Educators</a></li>
218218
<li class="list-inline-item mb-1"><a
219-
href="https://historyhub.history.gov/community/crowd-loc">Discuss</a></li>
219+
href="https://historyhub.history.gov/community/crowd-loc" target="_blank">Discuss</a></li>
220220
<li class="list-inline-item mb-1"><a href="https://ask.loc.gov/crowd" target="_blank" rel=noopener>Contact
221221
Us</a></li>
222222
<li class="list-inline-item"><a
223-
href="{% url 'welcome-guide' %}">Help</a></li>
223+
href="{% url 'welcome-guide' %}" target="_blank">Help</a></li>
224224
</ul>
225225
</div>
226226
<div class="col-lg-auto align-self-center">

concordia/templates/home.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<div id="homepage-contribute-container" class="container my-4">
1717
<div class="px-default ms-md-3 mb-5">
1818
<div class="alert {{ banner.alert_class }} alert-dismissible w-100 d-flex" id="banner-{{ banner.slug }}" role="alert">
19-
<div class="d-flex flex-1 justify-content-center">
19+
<div class="d-flex flex-1 justify-content-center me-2">
2020
<a class="btn {{ banner.btn_class }}" href="{{ banner.link }}"{% if banner.open_in_new_window_tab %} target="_blank"{% endif %}>
2121
{{ banner.text }}
2222
</a>

concordia/templates/transcriptions/asset_detail/editor.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ <h2 id="message-contributors" {% if transcription_status == 'not_started' %}hidd
7676

7777
<div class="print-transcription-text" aria-hidden="true" style="display: none;">{{ transcription.text }}</div>
7878

79-
<div class="my-3 d-print-none d-flex flex-wrap justify-content-center align-items-center">
79+
<div class="mt-3 d-print-none d-flex flex-wrap justify-content-center align-items-center">
8080
{% if transcription_status == 'not_started' or transcription_status == 'in_progress' %}
8181
<div class="form-check mt-0 mb-3 d-flex justify-content-center w-100">
8282
<input id="nothing-to-transcribe" type="checkbox" class="form-check-input" />
@@ -90,16 +90,16 @@ <h2 id="message-contributors" {% if transcription_status == 'not_started' %}hidd
9090
</div>
9191

9292
<div>
93-
<button id="save-transcription-button" disabled type="submit" class="btn btn-primary mx-1" title="Save the text you entered above">
93+
<button id="save-transcription-button" disabled type="submit" class="btn btn-primary mx-1 mb-3" title="Save the text you entered above">
9494
Save
9595
</button>
96-
<button id="rollback-transcription-button" {% if not undo_available %}disabled{% endif %} type="button" class="btn btn-outline-primary mx-1" title="Undo" data-url="{% url 'rollback-transcription' asset_pk=asset.pk %}">
96+
<button id="rollback-transcription-button" {% if not undo_available %}disabled{% endif %} type="button" class="btn btn-outline-primary mx-1 mb-3" title="Undo" data-url="{% url 'rollback-transcription' asset_pk=asset.pk %}">
9797
<span class="fas fa-undo"></span> Undo
9898
</button>
99-
<button id="rollforward-transcription-button" {% if not redo_available %}disabled{% endif %} type="button" class="btn btn-outline-primary mx-1" title="Redo" data-url="{% url 'rollforward-transcription' asset_pk=asset.pk %}">
99+
<button id="rollforward-transcription-button" {% if not redo_available %}disabled{% endif %} type="button" class="btn btn-outline-primary mx-1 mb-3" title="Redo" data-url="{% url 'rollforward-transcription' asset_pk=asset.pk %}">
100100
Redo <span class="fas fa-redo"></span>
101101
</button>
102-
<button id="submit-transcription-button" disabled type="button" class="btn btn-primary mx-1" title="Request another volunteer to review the text you entered above">
102+
<button id="submit-transcription-button" disabled type="button" class="btn btn-primary mx-1 mb-3" title="Request another volunteer to review the text you entered above">
103103
Submit for Review
104104
</button>
105105
</div>

concordia/templates/transcriptions/asset_detail/viewer_filters.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
/>
3939
<label class="visually-hidden" for="gamma">Gamma</label>
4040
</div>
41-
<div class="col p-0">
41+
<div class="col p-0 filter-buttons">
4242
<div class="row m-0">
4343
<button id="gamma-up" type="button" class="arrow-button">
4444
<span class="fas fa-chevron-up" />
@@ -92,7 +92,7 @@
9292
/>
9393
<label class="visually-hidden" for="threshold">Threshold</label>
9494
</div>
95-
<div class="col p-0">
95+
<div class="col p-0 filter-buttons">
9696
<div class="row m-0">
9797
<button id="threshold-up" type="button" class="arrow-button">
9898
<span class="fas fa-chevron-up" />

concordia/templates/transcriptions/campaign_list_small_blocks.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
{% block main_content %}
1616
<div class="container py-3">
1717
<h1>Completed Campaigns</h1>
18-
<div id="campaign-options" class="d-flex flex-wrap justify-content-end my-2">
18+
<div id="campaign-options" class="d-flex flex-wrap my-2">
19+
<div class="d-flex align-items-center me-auto mt-2">Results: {{ result_count }} Campaigns</div>
1920
<div class="d-flex align-items-center ms-3 mt-2">
2021
<label for="view-options" class="pe-1">View</label>
2122
<select id="view-options">

concordia/tests/test_views.py

+11
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,17 @@ def test_queryset(self):
157157
queryset = view.get_queryset()
158158
self.assertEqual(queryset.count(), 1)
159159

160+
def test_context_data(self):
161+
request = RequestFactory().get("/campaigns/completed/")
162+
response = CompletedCampaignListView.as_view()(request)
163+
self.assertIsInstance(response.context_data, dict)
164+
self.assertEqual(response.context_data["result_count"], 2)
165+
166+
request = RequestFactory().get("/campaigns/completed/?type=completed")
167+
response = CompletedCampaignListView.as_view()(request)
168+
self.assertIsInstance(response.context_data, dict)
169+
self.assertEqual(response.context_data["result_count"], 1)
170+
160171
def test_research_centers(self):
161172
today = date.today()
162173

concordia/views.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -940,9 +940,11 @@ def get_queryset(self):
940940
return campaigns.order_by("-completed_date")
941941

942942
def get_context_data(self, **kwargs):
943+
campaigns = self._get_all_campaigns()
943944
data = super().get_context_data(**kwargs)
945+
data["result_count"] = campaigns.count()
944946
data["research_centers"] = ResearchCenter.objects.filter(
945-
campaign__in=self._get_all_campaigns()
947+
campaign__in=campaigns
946948
).distinct()
947949

948950
return data

0 commit comments

Comments
 (0)