forked from MapComplete/MapComplete
		
	More layout tweaks
This commit is contained in:
		
							parent
							
								
									8081f8da04
								
							
						
					
					
						commit
						6e276291f0
					
				
					 10 changed files with 55 additions and 15 deletions
				
			
		|  | @ -65,7 +65,8 @@ | ||||||
|             "title": "Missing items" |             "title": "Missing items" | ||||||
|         }, |         }, | ||||||
|         "noDataLoaded": "The external website has no linked data that could be loaded", |         "noDataLoaded": "The external website has no linked data that could be loaded", | ||||||
|         "overwrite": "Overwrite in OpenStreetMap" |         "overwrite": "Overwrite in OpenStreetMap", | ||||||
|  |         "title": "Structured data loaded from the external website" | ||||||
|     }, |     }, | ||||||
|     "favourite": { |     "favourite": { | ||||||
|         "loginNeeded": "<h3>Log in</h3>A personal layout is only available for OpenStreetMap users", |         "loginNeeded": "<h3>Log in</h3>A personal layout is only available for OpenStreetMap users", | ||||||
|  |  | ||||||
|  | @ -22,6 +22,21 @@ | ||||||
|     width: unset; |     width: unset; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | .mapping-icon-small-width { | ||||||
|  |     width: 1.5rem; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .mapping-icon-medium-width { | ||||||
|  |     width: 3rem; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .mapping-icon-large-width { | ||||||
|  |     width: 5rem; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| .mapping-icon-small { | .mapping-icon-small { | ||||||
|     /* A mapping icon type */ |     /* A mapping icon type */ | ||||||
|     width: 1.5rem; |     width: 1.5rem; | ||||||
|  |  | ||||||
|  | @ -41,13 +41,13 @@ | ||||||
|         class="link-no-underline flex items-center self-end" |         class="link-no-underline flex items-center self-end" | ||||||
|       > |       > | ||||||
|         <PencilAltIcon slot="image" class="h-8 w-8 p-2" /> |         <PencilAltIcon slot="image" class="h-8 w-8 p-2" /> | ||||||
|         <Tr slot="message" t={Translations.t.userinfo.editDescription} /> |         <Tr t={Translations.t.userinfo.editDescription} /> | ||||||
|       </a> |       </a> | ||||||
|     {:else} |     {:else} | ||||||
|       <Tr t={Translations.t.userinfo.noDescription} /> |       <Tr t={Translations.t.userinfo.noDescription} /> | ||||||
|       <a href={osmConnection.Backend() + "/profile/edit"} target="_blank" class="flex items-center"> |       <a href={osmConnection.Backend() + "/profile/edit"} target="_blank" class="flex items-center"> | ||||||
|         <PencilAltIcon slot="image" class="h-8 w-8 p-2" /> |         <Pencil class="h-8 w-8 p-2" /> | ||||||
|         <Tr slot="message" t={Translations.t.userinfo.noDescriptionCallToAction} /> |         <Tr t={Translations.t.userinfo.noDescriptionCallToAction} /> | ||||||
|       </a> |       </a> | ||||||
|     {/if} |     {/if} | ||||||
|   </div> |   </div> | ||||||
|  |  | ||||||
|  | @ -13,6 +13,7 @@ | ||||||
|   import Translations from "../i18n/Translations" |   import Translations from "../i18n/Translations" | ||||||
|   import Tr from "../Base/Tr.svelte" |   import Tr from "../Base/Tr.svelte" | ||||||
|   import AccordionSingle from "../Flowbite/AccordionSingle.svelte" |   import AccordionSingle from "../Flowbite/AccordionSingle.svelte" | ||||||
|  |   import GlobeAlt from "@babeard/svelte-heroicons/mini/GlobeAlt" | ||||||
| 
 | 
 | ||||||
|   export let externalData: Store< |   export let externalData: Store< | ||||||
|     | { success: { content: Record<string, string> } } |     | { success: { content: Record<string, string> } } | ||||||
|  | @ -40,7 +41,10 @@ | ||||||
|   </div> |   </div> | ||||||
| {:else if $externalData["success"] !== undefined} | {:else if $externalData["success"] !== undefined} | ||||||
|   <AccordionSingle> |   <AccordionSingle> | ||||||
|     <span slot="header">Structured data from the website</span> |     <span slot="header" class="flex"> | ||||||
|  |       <GlobeAlt class="w-6 h-6"/> | ||||||
|  |       <Tr t={Translations.t.external.title}/> | ||||||
|  |     </span> | ||||||
|   <ComparisonTable |   <ComparisonTable | ||||||
|     externalProperties={$externalData["success"]} |     externalProperties={$externalData["success"]} | ||||||
|     {state} |     {state} | ||||||
|  |  | ||||||
|  | @ -93,7 +93,7 @@ | ||||||
|         <Tr t={t.currentLicense.Subs({ license: $licenseStore })} /> |         <Tr t={t.currentLicense.Subs({ license: $licenseStore })} /> | ||||||
|       </button> |       </button> | ||||||
|       <br /> |       <br /> | ||||||
|       <Tr t={t.respectPrivacy} /> |       <Tr cls="subtle italic" t={t.respectPrivacy} /> | ||||||
|     </div> |     </div> | ||||||
|   </div> |   </div> | ||||||
| </LoginToggle> | </LoginToggle> | ||||||
|  |  | ||||||
|  | @ -1,17 +1,23 @@ | ||||||
| <script lang="ts"> | <script lang="ts"> | ||||||
|   import Icon from "./Icon.svelte" |   import Icon from "./Icon.svelte" | ||||||
|  |   import { twMerge } from "tailwind-merge" | ||||||
| 
 | 
 | ||||||
|   /** |   /** | ||||||
|    * Renders a 'marker', which consists of multiple 'icons' |    * Renders a 'marker', which consists of multiple 'icons' | ||||||
|    */ |    */ | ||||||
|   export let icons: { icon: string; color: string }[] |   export let icons: { icon: string; color: string }[] | ||||||
|  |   /** | ||||||
|  |    * Class which is applied onto the individual icons | ||||||
|  |    */ | ||||||
|  |   export let clss = "" | ||||||
|  |   export let size = "w-full h-full" | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| {#if icons !== undefined && icons.length > 0} | {#if icons !== undefined && icons.length > 0} | ||||||
|   <div class="relative h-full w-full"> |   <div class={twMerge("relative", size)}> | ||||||
|     {#each icons as icon} |     {#each icons as icon} | ||||||
|       <div class="absolute top-0 left-0 h-full w-full"> |       <div class="absolute top-0 left-0 h-full w-full"> | ||||||
|         <Icon icon={icon.icon} color={icon.color} /> |         <Icon icon={icon.icon} color={icon.color} {clss} /> | ||||||
|       </div> |       </div> | ||||||
|     {/each} |     {/each} | ||||||
|   </div> |   </div> | ||||||
|  |  | ||||||
|  | @ -28,11 +28,12 @@ | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| {#if config !== undefined && (config?.condition === undefined || config.condition.matchesProperties($tags))} | {#if config !== undefined && (config?.condition === undefined || config.condition.matchesProperties($tags))} | ||||||
|   <div {id} class={twMerge("link-underline inline-block w-full h-full", extraClasses)}> |   <div {id} class={twMerge("link-underline flex flex-col w-full", extraClasses)}> | ||||||
|     {#if $trs.length === 1} |     {#if $trs.length === 1} | ||||||
|       <TagRenderingMapping mapping={$trs[0]} {tags} {state} {selectedElement} {layer} clss={config?.classes?.join(" ") ?? ""}/> |       <TagRenderingMapping mapping={$trs[0]} {tags} {state} {selectedElement} {layer} | ||||||
|  |                            clss={config?.classes?.join(" ") ?? ""} /> | ||||||
|     {/if} |     {/if} | ||||||
|     {#if $trs.length > 1} |         {#if $trs.length > 1} | ||||||
|       <ul> |       <ul> | ||||||
|         {#each $trs as mapping} |         {#each $trs as mapping} | ||||||
|           <li> |           <li> | ||||||
|  |  | ||||||
|  | @ -106,7 +106,7 @@ | ||||||
|         </button> |         </button> | ||||||
|       </TagRenderingQuestion> |       </TagRenderingQuestion> | ||||||
|     {:else} |     {:else} | ||||||
|       <div class="low-interaction flex items-center justify-between overflow-hidden rounded px-2"> |       <div class="low-interaction flex items-center justify-between overflow-hidden rounded pl-2"> | ||||||
|         <TagRenderingAnswer id={answerId} {config} {tags} {selectedElement} {state} {layer} /> |         <TagRenderingAnswer id={answerId} {config} {tags} {selectedElement} {state} {layer} /> | ||||||
|         <EditButton |         <EditButton | ||||||
|           arialabel={config.editButtonAriaLabel} |           arialabel={config.editButtonAriaLabel} | ||||||
|  |  | ||||||
|  | @ -7,6 +7,7 @@ | ||||||
|   import LayerConfig from "../../../Models/ThemeConfig/LayerConfig" |   import LayerConfig from "../../../Models/ThemeConfig/LayerConfig" | ||||||
|   import { twJoin } from "tailwind-merge" |   import { twJoin } from "tailwind-merge" | ||||||
|   import Icon from "../../Map/Icon.svelte" |   import Icon from "../../Map/Icon.svelte" | ||||||
|  |   import Marker from "../../Map/Marker.svelte" | ||||||
| 
 | 
 | ||||||
|   export let selectedElement: Feature |   export let selectedElement: Feature | ||||||
|   export let tags: UIEventSource<Record<string, string>> |   export let tags: UIEventSource<Record<string, string>> | ||||||
|  | @ -30,13 +31,22 @@ | ||||||
|       | "large-height" |       | "large-height" | ||||||
|       | string |       | string | ||||||
|   } |   } | ||||||
|  |   function iconToMarker(spec: string) { | ||||||
|  |     return spec.split(";").map(subspec => { | ||||||
|  |       const [icon, color] = subspec.split(":") | ||||||
|  |       return { | ||||||
|  |         icon, color: color ?? "black" | ||||||
|  |       } | ||||||
|  |     }) | ||||||
|  |   } | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| {#if mapping.icon !== undefined} | {#if mapping.icon !== undefined} | ||||||
|   <div class="inline-flex items-center"> |   <div class="inline-flex items-center"> | ||||||
|     <Icon |     <Marker | ||||||
|       icon={mapping.icon} |       icons={iconToMarker(mapping.icon)} | ||||||
|       clss={twJoin(`mapping-icon-${mapping.iconClass ?? "small"}`, "mr-2")} |       size={twJoin(`mapping-icon-${mapping.iconClass ?? "small"}-height mapping-icon-${mapping.iconClass ?? "small"}-width`, "mr-2", "shrink-0 mx-2")} | ||||||
|  |       clss={`mapping-icon-${mapping.iconClass ?? "small"}`} | ||||||
|     /> |     /> | ||||||
|     <SpecialTranslation t={mapping.then} {tags} {state} {layer} feature={selectedElement} {clss} /> |     <SpecialTranslation t={mapping.then} {tags} {state} {layer} feature={selectedElement} {clss} /> | ||||||
|   </div> |   </div> | ||||||
|  |  | ||||||
|  | @ -325,6 +325,8 @@ | ||||||
|           </div> |           </div> | ||||||
| 
 | 
 | ||||||
|           {#if config.questionhint} |           {#if config.questionhint} | ||||||
|  |             <span class="italic"> | ||||||
|  | 
 | ||||||
|             {#if config.questionHintIsMd} |             {#if config.questionHintIsMd} | ||||||
|               <Markdown srcWritable={config.questionhint.current} /> |               <Markdown srcWritable={config.questionhint.current} /> | ||||||
|             {:else} |             {:else} | ||||||
|  | @ -338,6 +340,7 @@ | ||||||
|                 /> |                 /> | ||||||
|               </div> |               </div> | ||||||
|             {/if} |             {/if} | ||||||
|  |             </span> | ||||||
|           {/if} |           {/if} | ||||||
|         </legend> |         </legend> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue