mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Name the Local area, say what each News section needs, and credit its sources
Local reads the area at the view centre (`/outline?at=`) and asks the feed
for its reports (`at`): the area is outlined faintly on the globe and named
at the top of the section ("News from Kazakhstan"; within 500 km at sea).
A disputed area is named as itself. A read that a newer look replaced, or
one left behind by a switch to Conflicts, is dropped, and a server without
the area route is asked once.
A section read from a key the server lacks says which key it needs
(503 `no_key`), that the key was refused (`key_rejected`) or that its
daily allowance is spent (`key_quota`); the other section keeps reading.
Liveuamap and World News API join the key registry.
Cards name the service a report came through ("via GDELT Project"), and
Liveuamap and Natural Earth are credited once their data shows. Economy is
a category of its own. Disputed-area labels are smaller and show the name
only; outlines keep up to 300 parts.
This commit is contained in:
1 parent
fa736a7cd5
commit
edb5837ae5
27 files changed
+1343
-154
No files matched your search
@@ -5,12 +5,14 @@ import UiButton from '../kit/UiButton.vue';
|
||||
|
||||
// One event in the News panel: the publisher's
|
||||
// picture when the event has one, the headline, a mono meta line (severity
|
||||
// marker, category, place, sources, age), who reported it, and its
|
||||
// attestation and media chips. A click chooses it (the layer flies there and
|
||||
// opens its card on the globe); open, it plays the post's clip when it has
|
||||
// one (on request, with sound and controls), and shows the summary, the other
|
||||
// sides' reports and the link to the original article. The layer computes every
|
||||
// value shown (feedCardView in src/layers/news/model.js).
|
||||
// marker, category, place, sources, age), who reported it, its attestation
|
||||
// and media chips, and the service it came through ("via …"), which some ask
|
||||
// to be credited wherever their reports show. A click chooses it (the layer
|
||||
// flies there and opens its card on the globe); open, it plays the post's
|
||||
// clip when it has one (on request, with sound and controls), and shows the
|
||||
// summary, the other sides' reports and the link to the original article.
|
||||
// The layer computes every value shown (feedCardView in
|
||||
// src/layers/news/model.js).
|
||||
const props = defineProps({
|
||||
item: { type: Object, required: true },
|
||||
open: { type: Boolean, default: false },
|
||||
@@ -108,6 +110,7 @@ const meta = () =>
|
||||
>{{ chip.label }}</span
|
||||
></span
|
||||
>
|
||||
<span v-if="item.via" class="news-card__via ui-mono">{{ item.via }}</span>
|
||||
</button>
|
||||
<div v-if="open" class="news-card__open">
|
||||
<video
|
||||
|
||||
@@ -11,9 +11,13 @@ import NewsCard from './NewsCard.vue';
|
||||
// fewer where the host serves less), or a shorter one chosen at the
|
||||
// top (24/12/6/3/1 h), and two sections. Conflicts: hotspot chips, the
|
||||
// severity floor, the chosen event and a continuous feed, newest first.
|
||||
// Local: every report near the view centre while the camera is low, which the
|
||||
// map then shows instead of the hotspots' news. It renders the `feed` view the news
|
||||
// layer publishes and acts only through `onParams`.
|
||||
// Local: every report in the area at the view centre (its country, a large
|
||||
// country's state; within a radius at sea) while the camera is low, named at
|
||||
// the top, which the map then shows, outlined, instead of the hotspots' news.
|
||||
// A section read from a key the server lacks (or whose allowance for the day
|
||||
// is spent) says which key instead. It
|
||||
// renders the `feed` view the news layer publishes and acts only through
|
||||
// `onParams`.
|
||||
const props = defineProps({
|
||||
view: { type: Object, default: null },
|
||||
onParams: { type: Function, default: () => {} },
|
||||
@@ -75,6 +79,15 @@ const selectedApart = computed(() => {
|
||||
: props.view.items.some((item) => item.id === chosen.id);
|
||||
return listed ? null : chosen;
|
||||
});
|
||||
// What Local reads: the area named, else the radius; neither while the
|
||||
// first area is being named, so the radius does not flash before it.
|
||||
const areaHead = computed(() => {
|
||||
const inView = props.view?.inView;
|
||||
if (!inView?.active) return '';
|
||||
if (inView.area) return t('News from {area}', { area: inView.area });
|
||||
if (inView.areaLoading) return '';
|
||||
return t('Within {km} km of the view centre', { km: inView.radiusKm });
|
||||
});
|
||||
const status = computed(() => {
|
||||
const view = props.view;
|
||||
if (!view) return '';
|
||||
@@ -162,11 +175,20 @@ const clear = () => props.onParams({ clear: true });
|
||||
class="news-readout__section"
|
||||
:aria-label="t('Local')"
|
||||
>
|
||||
<p v-if="areaHead" class="news-readout__head news-readout__area ui-mono">
|
||||
{{ areaHead }}
|
||||
</p>
|
||||
<UiEmpty
|
||||
v-if="!view.inView.active"
|
||||
class="news-readout__empty"
|
||||
:title="t('Zoom in to see local news')"
|
||||
/>
|
||||
<UiEmpty
|
||||
v-else-if="view.inView.key"
|
||||
class="news-readout__empty"
|
||||
:title="view.inView.key.title"
|
||||
:hint="view.inView.key.hint"
|
||||
/>
|
||||
<p v-else-if="view.inView.error" class="news-readout__status">
|
||||
{{ view.inView.error }}
|
||||
</p>
|
||||
@@ -202,8 +224,14 @@ const clear = () => props.onParams({ clear: true });
|
||||
:aria-label="t('Latest news')"
|
||||
>
|
||||
<h3 class="news-readout__head ui-mono">{{ t('Latest') }}</h3>
|
||||
<UiEmpty
|
||||
v-if="view.key"
|
||||
class="news-readout__empty"
|
||||
:title="view.key.title"
|
||||
:hint="view.key.hint"
|
||||
/>
|
||||
<ol
|
||||
v-if="view.items.length"
|
||||
v-else-if="view.items.length"
|
||||
class="news-readout__list news-readout__feed"
|
||||
>
|
||||
<li v-for="item in view.items" :key="item.id">
|
||||
|
||||
Reference in new issue
Block a user