Skip to content

Commit

Permalink
Allow show/hide of example records (default: hidden). (codeforamerica…
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesiarmes authored Nov 16, 2022
1 parent f9d6551 commit 41f18ea
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
22 changes: 17 additions & 5 deletions app/views/classifications/call_types/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
<div class="w-full">
<%= render 'shared/classifications/header' %>
<div class="responsive-container">
<div class="mt-12 px-4 py-5 sm:px-6">
<div class="mt-12 px-4 py-5 sm:px-6" data-controller="visibility">
<h6><%= @data_set.title %></h6>
<h2><%= @call_type.value %></h2>
<div class="flex flex-col lg:flex-row justify-between">
<div>
<h2><%= @call_type.value %></h2>
</div>
<div class="mb-8">
<button id="show-examples" class="button" data-action="click->visibility#show" data-visibility-target="temporaryHide">
<%= t('.show_examples') %>
</button>
<button class="button hidden" data-action="click->visibility#hide" data-visibility-target="hide">
<%= t('.hide_examples') %>
</button>
</div>
</div>
<div class="text-black pb-8">
Please review the sample call records for this call type. From there, please classify the
call type to the best of your ability by searching below for different common incident types.
After you've selected an incident type, you can choose how confident you are about your selection.
If you are unable to identify a common incident type to map to this call type,
you can choose to skip this call type classification.
</div>
<section id="call-types-examples" class="bg-white mb-16">
<section id="call-types-examples" class="bg-white mb-16 hidden" data-visibility-target="hide">
<h4 class="px-6 pt-6 border-b-2 border-gray-200">
Example Call Type Records
</h4>
Expand Down Expand Up @@ -52,10 +64,10 @@
</div>
<div class="mb-8">
<button id="show-apco" class="button" data-action="click->visibility#show" data-visibility-target="temporaryHide">
View all APCO codes
<%= t('.view_codes') %>
</button>
<button class="button hidden" data-action="click->visibility#hide" data-visibility-target="hide">
Hide APCO codes
<%= t('.hide_codes') %>
</button>
</div>
</div>
Expand Down
5 changes: 5 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ en:
call_types:
completed: "This data set has already been fully classified."
user_completed: "You have already classified all call types for this data set."
show:
show_examples: "Show example records"
hide_examples: "Hide example records"
view_codes: "View all APCO codes"
hide_codes: "Hide APCO codes"
data_sets:
title: "Datasets"
analyze:
Expand Down
Binary file modified doc/assets/classification-value.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc/data_classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ classify:
2. The value being classified
3. Instructions for the classification process
4. A set of example records with that value (default: 5)
5. Show or hide the example records (hidden on page load)

_Note: If you are the first user to classify a value, it may take a minute for
the page to load while the examples are pulled from the source document._
Expand Down

0 comments on commit 41f18ea

Please sign in to comment.