Skip to content

Commit

Permalink
Force unfurled URLs into separate rows
Browse files Browse the repository at this point in the history
  • Loading branch information
dtdesign committed Aug 22, 2023
1 parent 3bb8ef9 commit 62d94ae
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 23 deletions.
24 changes: 13 additions & 11 deletions com.woltlab.wcf/templates/unfurlUrl.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
{if $object->isPlainUrl()}
<a {anchorAttributes url=$object->url isUgc=$enableUgc}>{$object->title}</a>
{else}
<div class="unfurlUrlCard{*
*}{if $object->hasCoverImage()} unfurlUrlCardCoverImage{/if}{*
*}{if $object->hasSquaredImage()} unfurlUrlCardSquaredImage{/if}{*
*}">
{if !$object->getImageUrl()|empty}
<img src="{$object->getImageUrl()}" height="{$object->height}" width="{$object->width}" class="unfurlUrlImage" alt="" loading="lazy">
{/if}
<div class="unfurlUrlInformation">
<a class="unfurlUrlTitle" {anchorAttributes url=$object->url appendClassname=false isUgc=$enableUgc}>{$object->title}</a>
<div class="unfurlUrlDescription">{$object->description}</div>
<div class="unfurlUrlHost">{$object->getHost()}</div>
<div class="unfurlUrlCardContainer">
<div class="unfurlUrlCard{*
*}{if $object->hasCoverImage()} unfurlUrlCardCoverImage{/if}{*
*}{if $object->hasSquaredImage()} unfurlUrlCardSquaredImage{/if}{*
*}">
{if !$object->getImageUrl()|empty}
<img src="{$object->getImageUrl()}" height="{$object->height}" width="{$object->width}" class="unfurlUrlImage" alt="" loading="lazy">
{/if}
<div class="unfurlUrlInformation">
<a class="unfurlUrlTitle" {anchorAttributes url=$object->url appendClassname=false isUgc=$enableUgc}>{$object->title}</a>
<div class="unfurlUrlDescription">{$object->description}</div>
<div class="unfurlUrlHost">{$object->getHost()}</div>
</div>
</div>
</div>
{/if}
Expand Down
24 changes: 13 additions & 11 deletions wcfsetup/install/files/acp/templates/unfurlUrl.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
{if $object->isPlainUrl()}
<a {anchorAttributes url=$object->url isUgc=$enableUgc}>{$object->title}</a>
{else}
<div class="unfurlUrlCard{*
*}{if $object->hasCoverImage()} unfurlUrlCardCoverImage{/if}{*
*}{if $object->hasSquaredImage()} unfurlUrlCardSquaredImage{/if}{*
*}">
{if !$object->getImageUrl()|empty}
<img src="{$object->getImageUrl()}" height="{$object->height}" width="{$object->width}" class="unfurlUrlImage" alt="" loading="lazy">
{/if}
<div class="unfurlUrlInformation">
<a class="unfurlUrlTitle" {anchorAttributes url=$object->url appendClassname=false isUgc=$enableUgc}>{$object->title}</a>
<div class="unfurlUrlDescription">{$object->description}</div>
<div class="unfurlUrlHost">{$object->getHost()}</div>
<div class="unfurlUrlCardContainer">
<div class="unfurlUrlCard{*
*}{if $object->hasCoverImage()} unfurlUrlCardCoverImage{/if}{*
*}{if $object->hasSquaredImage()} unfurlUrlCardSquaredImage{/if}{*
*}">
{if !$object->getImageUrl()|empty}
<img src="{$object->getImageUrl()}" height="{$object->height}" width="{$object->width}" class="unfurlUrlImage" alt="" loading="lazy">
{/if}
<div class="unfurlUrlInformation">
<a class="unfurlUrlTitle" {anchorAttributes url=$object->url appendClassname=false isUgc=$enableUgc}>{$object->title}</a>
<div class="unfurlUrlDescription">{$object->description}</div>
<div class="unfurlUrlHost">{$object->getHost()}</div>
</div>
</div>
</div>
{/if}
Expand Down
5 changes: 4 additions & 1 deletion wcfsetup/install/files/style/ui/unfurlUrl.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.unfurlUrlCardContainer {
margin: 1em 0 0 0;
}

.unfurlUrlCard {
background-color: var(--wcfContentBackground);
border-radius: 3px;
Expand All @@ -6,7 +10,6 @@
0 1px 2px rgba(0, 0, 0, 0.24);
color: var(--wcfContentText);
display: inline-block;
margin: 1em 0 0 0;
max-width: 100%;
overflow: hidden;
position: relative;
Expand Down

0 comments on commit 62d94ae

Please sign in to comment.