|
45 | 45 | Volume {{ latestMagazine.volume }}. Issue |
46 | 46 | {{ latestMagazine.issue }}. |
47 | 47 | </div> |
48 | | - <div class="text-xl text-gray-600 mb-1 uppercase"> |
| 48 | + <router-link |
| 49 | + :to="generatePermalink(latestMagazine)" |
| 50 | + class="text-xl text-gray-600 mb-1 uppercase hover:text-primary-dark block" |
| 51 | + > |
49 | 52 | {{ latestMagazine.incident_name }} |
50 | | - </div> |
| 53 | + </router-link> |
51 | 54 | <div class="text-base mb-1 uppercase"> |
52 | 55 | {{ latestMagazine.subtitle }} |
53 | 56 | </div> |
|
56 | 59 | {{ formatDate(latestMagazine.timeframe_start) }} - |
57 | 60 | {{ formatDate(latestMagazine.timeframe_end) }} |
58 | 61 | </div> |
| 62 | + <div v-if="latestMagazine.doi" class="text-sm text-gray-600 mb-1"> |
| 63 | + doi: |
| 64 | + <a |
| 65 | + :href="`https://doi.org/${latestMagazine.doi}`" |
| 66 | + target="_blank" |
| 67 | + class="text-blue-700 hover:underline" |
| 68 | + > |
| 69 | + {{ latestMagazine.doi }} |
| 70 | + </a> |
| 71 | + </div> |
59 | 72 | <div class="mt-4 flex gap-2"> |
60 | 73 | <a |
61 | 74 | v-if="latestPrimaryEdition?.file_details?.general_file_url" |
|
125 | 138 | <div class="text-sm mb-1"> |
126 | 139 | Volume {{ magazine.volume }}. Issue {{ magazine.issue }}. |
127 | 140 | </div> |
128 | | - <div class="text-lg text-gray-600 mb-1 uppercase"> |
| 141 | + <router-link |
| 142 | + :to="generatePermalink(magazine)" |
| 143 | + class="text-lg text-gray-600 mb-1 uppercase hover:text-primary-dark block" |
| 144 | + > |
129 | 145 | {{ magazine.incident_name }} |
130 | | - </div> |
| 146 | + </router-link> |
131 | 147 | <div class="text-base mb-1 uppercase"> |
132 | 148 | {{ magazine.subtitle }} |
133 | 149 | </div> |
134 | 150 | <div class="text-sm text-gray-600 mb-1 uppercase"> |
135 | | - {{ formatDate(magazine.timeframeStart) }} - |
136 | | - {{ formatDate(magazine.timeframeEnd) }} |
| 151 | + {{ formatDate(magazine.timeframe_start) }} - |
| 152 | + {{ formatDate(magazine.timeframe_end) }} |
| 153 | + </div> |
| 154 | + <div v-if="magazine.doi" class="text-sm text-gray-600 mb-1"> |
| 155 | + doi: |
| 156 | + <a |
| 157 | + :href="`https://doi.org/${magazine.doi}`" |
| 158 | + target="_blank" |
| 159 | + class="text-blue-700 hover:underline" |
| 160 | + > |
| 161 | + {{ magazine.doi }} |
| 162 | + </a> |
137 | 163 | </div> |
138 | 164 | <div class="mt-2 flex gap-2"> |
139 | 165 | <a |
@@ -242,8 +268,9 @@ interface Magazine { |
242 | 268 | volume: number; |
243 | 269 | issue: number; |
244 | 270 | publish_at: string; |
245 | | - timeframeStart: string; |
246 | | - timeframeEnd: string; |
| 271 | + timeframe_start: string; |
| 272 | + timeframe_end: string; |
| 273 | + doi: string | null; |
247 | 274 | editions: MagazineEdition[]; |
248 | 275 | } |
249 | 276 |
|
@@ -289,6 +316,12 @@ function parsePermalink(permalink: string) { |
289 | 316 | }; |
290 | 317 | } |
291 | 318 |
|
| 319 | +// Generate permalink for a magazine |
| 320 | +function generatePermalink(magazine: Magazine): string { |
| 321 | + const incidentIds = magazine.incident_ids.join('_'); |
| 322 | + return `/magazine?s=${incidentIds}.${magazine.volume}.${magazine.issue}`; |
| 323 | +} |
| 324 | +
|
292 | 325 | async function fetchMagazines(page = 1): Promise<void> { |
293 | 326 | loading.value = true; |
294 | 327 |
|
|
0 commit comments