Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ohmg/conf/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def user_info_from_request(request):
"is_authenticated": False,
"is_staff": False,
"perms": [],
"loaded_maps": [],
}
return user_info

Expand Down
22 changes: 15 additions & 7 deletions ohmg/frontend/svelte_components/src/components/map/Map.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import MapContributors from '../tables/MapContributors.svelte';
import Sessions from '../tables/Sessions.svelte';
import Layers from '../tables/Layers.svelte';

import Breadcrumbs from './Breadcrumbs.svelte';

Expand Down Expand Up @@ -478,6 +479,7 @@
{id: "details", title: "Details"},
{id: "stats", title: "Stats"},
{id: "activity", title: "Activity"},
{id: "layers", title: "Layers"},
]} bind:activeTab={detailsSectionActiveTab}>
{#if detailsSectionActiveTab == "details"}
<Details {MAP} {SESSION_SUMMARY} />
Expand All @@ -490,13 +492,19 @@
</div>
<MapContributors {CONTEXT} mapId={MAP.identifier} />
{:else if detailsSectionActiveTab == "activity"}
<div>
<p>
Below is complete record of all preparation or georeferencing actions that have been performed on documents
within this map. Currently, trimming or "multimask" work is not reflected in this table.
</p>
</div>
<Sessions {CONTEXT} mapFilter={{ id: MAP.identifier }} showMap={false} paginate={true} limit="50" />
<div>
<p>
Below is complete record of all preparation or georeferencing actions that have been performed on documents
within this map. Currently, trimming or "multimask" work is not reflected in this table.
</p>
</div>
<Sessions {CONTEXT} mapFilter={{ id: MAP.identifier }} showMap={false} paginate={true} limit="50" />
{:else if detailsSectionActiveTab == "layers"}
{#if CONTEXT.user.is_staff}
<Layers {CONTEXT} mapFilter={{ id: MAP.identifier }} showMap={false}/>
{:else}
<em>coming soon!</em>
{/if}
{/if}
</TabbedSection>
</ExpandableSection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
}
td {
white-space: nowrap;
padding: 2px 0.5em 2px 0;
padding: 2px 0.25em;
vertical-align: middle;
}
td.ts-col {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
<td>
<Link href={`/layer/${lyr.id}`} title={lyr.nickname}>
<div class="thumb-container">
<img style="width:100%; height:auto;" src={lyr.urls.thumbnail} alt={lyr.nickname} />
<img src={lyr.urls.thumbnail} alt={lyr.nickname} />
</div>
{lyr.nickname}</Link>
</td>
Expand Down Expand Up @@ -213,7 +213,7 @@
}
td {
white-space: nowrap;
padding: 2px 0.5em;
padding: 2px 0.25em;
vertical-align: middle;
}
.table-container {
Expand All @@ -224,6 +224,9 @@
display: inline-block;
text-align: center;
}
.thumb-container > img {
max-height: 50px;
}
.filter-level {
max-width: calc(100% - 75px);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,7 @@
<th><SortableHeader title="Map" /></th>
{/if}
{#if showResource}
<th title="Document, Region, or Layer for this work">
<div>
<span style="font-weight:400; margin-right:.5em;">Resource</span><input
type="checkbox"
bind:checked={showThumbs}
title="Show thumbnails"
/>
</div>
</th>
<th><SortableHeader title="Resource" alt="Document, Region, or Layer for this work" bind:toggleVar={showThumbs}/></th>
{/if}
<th><SortableHeader title="Stage" value={'stage'} bind:sortDir bind:sortParam bind:offset /></th>
<th><SortableHeader title="Result" value={'note'} bind:sortDir bind:sortParam bind:offset /></th>
Expand Down Expand Up @@ -211,7 +203,7 @@
{#if s.doc2}
{#if showThumbs}
<div class="thumb-container">
<img style="max-height:50px;" src={s.doc2.urls.thumbnail} alt={s.doc2.nickname} />
<img src={s.doc2.urls.thumbnail} alt={s.doc2.nickname} />
</div>
{/if}
<Link href={s.doc2.urls.resource} title={s.doc2.nickname}>
Expand All @@ -224,7 +216,7 @@
{#if s.lyr2}
{#if showThumbs}
<div class="thumb-container">
<img style="max-height:50px;" src={s.lyr2.urls.thumbnail} alt={s.reg2.nickname} />
<img src={s.lyr2.urls.thumbnail} alt={s.reg2.nickname} />
</div>
{/if}
<Link href={s.lyr2.urls.resource} title={s.lyr2.nickname}>
Expand Down Expand Up @@ -278,7 +270,7 @@
}
td {
white-space: nowrap;
padding: 2px 0.5em 2px 0;
padding: 2px 0.25em;
vertical-align: middle;
}
.table-container {
Expand All @@ -289,6 +281,9 @@
display: inline-block;
text-align: center;
}
.thumb-container > img {
max-height: 50px;
}
@media screen and (max-width: 768px) {
.filter-level,
:global(.filter-input),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export let value = null;
export let items = [];
export let placeholder = 'Choose a filter...';
export let containerStyles = 'width:300px;';
export let containerStyles = 'width:225px;';
export let offset = 0;
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,42 @@
export let offset = 0;
export let sortParam = null;
export let sortDir = 'asc';
export let toggleVar = null;

let popup = alt ? alt : `Sort by ${value}`;

$: active = sortParam == value;
</script>

{#if sortParam}
<button
title={popup}
on:click={() => {
sortDir = !active ? 'asc' : sortDir == 'asc' ? 'des' : 'asc';
sortParam = value;
offset = 0;
}}
>
<span style="margin-right: .25em;">{title}</span>
{#if active}
{#if sortDir == 'asc'}
<SortAscending />
<div style="display:flex; padding:.25em;">
<span style="margin-top:.25em;">{title}</span>
{#if sortParam}
<button
title={popup}
style="margin-left:.25em; display:flex;"
on:click={() => {
sortDir = !active ? 'asc' : sortDir == 'asc' ? 'des' : 'asc';
sortParam = value;
offset = 0;
}}
>
{#if active}
{#if sortDir == 'asc'}
<SortAscending />
{:else}
<SortDescending />
{/if}
{:else}
<SortDescending />
<List style="color:gray;" />
{/if}
{:else}
<List style="color:gray;" />
{/if}
</button>
{:else}
<span title={alt} style="font-weight:400; display: flex; padding: 0.5em;">
{title}
</span>
{/if}
</button>
{/if}
{#if toggleVar != null}
<input style="margin-left:.25em;" type="checkbox" bind:checked={toggleVar} />
{/if}
</div>

<style>
button {
display: flex;
padding: 0.5em;
}
button:hover {
background: #f7f1e1;
color: #333;
Expand Down
Loading