mirror of
https://github.com/flarum/core.git
synced 2025-08-08 09:26:34 +02:00
New look for Tags page
This commit is contained in:
@@ -3,6 +3,7 @@ import IndexPage from 'flarum/components/IndexPage';
|
|||||||
import listItems from 'flarum/helpers/listItems';
|
import listItems from 'flarum/helpers/listItems';
|
||||||
import humanTime from 'flarum/helpers/humanTime';
|
import humanTime from 'flarum/helpers/humanTime';
|
||||||
|
|
||||||
|
import tagLabel from 'tags/helpers/tagLabel';
|
||||||
import sortTags from 'tags/utils/sortTags';
|
import sortTags from 'tags/utils/sortTags';
|
||||||
|
|
||||||
export default class TagsPage extends Component {
|
export default class TagsPage extends Component {
|
||||||
@@ -74,19 +75,14 @@ export default class TagsPage extends Component {
|
|||||||
|
|
||||||
{cloud.length ? (
|
{cloud.length ? (
|
||||||
<div className="TagCloud">
|
<div className="TagCloud">
|
||||||
<h4 className="TagCloud-title">{app.trans('tags.tag_cloud_title')}</h4>
|
{cloud.map(tag => {
|
||||||
<div className="TagCloud-content">
|
const color = tag.color();
|
||||||
{cloud.map(tag => {
|
|
||||||
const color = tag.color();
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
<a href={app.route.tag(tag)} config={m.route} style={color ? {color} : ''}>
|
tagLabel(tag, {link: true}),
|
||||||
{tag.name()}
|
' '
|
||||||
</a>,
|
];
|
||||||
' '
|
})}
|
||||||
];
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
) : ''}
|
) : ''}
|
||||||
</div>
|
</div>
|
||||||
|
@@ -1,29 +1,10 @@
|
|||||||
.TagCloud {
|
.TagCloud {
|
||||||
margin-top: 50px;
|
margin-top: 30px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
font-size: 16px;
|
||||||
.TagCloud-title {
|
line-height: 1.6;
|
||||||
font-size: 12px;
|
|
||||||
font-weight: bold;
|
|
||||||
color: @muted-color;
|
|
||||||
text-transform: uppercase;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
.fa();
|
|
||||||
content: @fa-var-tags;
|
|
||||||
margin-right: 5px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.TagCloud-content {
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 1.7;
|
|
||||||
|
|
||||||
&, a {
|
|
||||||
color: @muted-color;
|
|
||||||
}
|
|
||||||
a {
|
a {
|
||||||
margin: 0 6px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
height: 200px;
|
height: 200px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
@media @tablet-up {
|
@media @tablet {
|
||||||
float: left;
|
float: left;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
|
||||||
@@ -29,6 +29,29 @@
|
|||||||
border-bottom-left-radius: @border-radius;
|
border-bottom-left-radius: @border-radius;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@media @desktop-up {
|
||||||
|
float: left;
|
||||||
|
width: 33.333%;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
border-top-left-radius: @border-radius;
|
||||||
|
}
|
||||||
|
&:nth-child(3),
|
||||||
|
&:nth-child(2):last-child,
|
||||||
|
&:first-child:last-child {
|
||||||
|
border-top-right-radius: @border-radius;
|
||||||
|
}
|
||||||
|
&:nth-child(3n):nth-last-child(2),
|
||||||
|
&:nth-child(3n):nth-last-child(3),
|
||||||
|
&:last-child {
|
||||||
|
border-bottom-right-radius: @border-radius;
|
||||||
|
}
|
||||||
|
&:nth-child(3n+1):last-child,
|
||||||
|
&:nth-child(3n+1):nth-last-child(2),
|
||||||
|
&:nth-child(3n+1):nth-last-child(3) {
|
||||||
|
border-bottom-left-radius: @border-radius;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +78,7 @@
|
|||||||
}
|
}
|
||||||
.TagTile-info {
|
.TagTile-info {
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 45px;
|
bottom: 42px;
|
||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
transition: background 0.2s;
|
transition: background 0.2s;
|
||||||
|
|
||||||
@@ -83,18 +106,16 @@
|
|||||||
}
|
}
|
||||||
.TagTile-lastDiscussion {
|
.TagTile-lastDiscussion {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
height: 45px;
|
height: 42px;
|
||||||
padding-top: 12px;
|
padding: 7px 0;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
line-height: 21px;
|
line-height: 21px;
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
border-top: 1px solid rgba(0, 0, 0, 0.15);
|
||||||
&, &:hover {
|
margin: 0 20px;
|
||||||
background: fade(#000, 10%);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover .TagTile-lastDiscussion-title {
|
&:hover .TagTile-lastDiscussion-title {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
|
@@ -38,3 +38,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@media @desktop-up {
|
||||||
|
.TagsPage {
|
||||||
|
.sideNav {
|
||||||
|
.sideNav--horizontal();
|
||||||
|
float: none;
|
||||||
|
width: auto;
|
||||||
|
padding-top: 0;
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.sideNavOffset {
|
||||||
|
margin: 15px 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -15,5 +15,4 @@ tags:
|
|||||||
other: "Choose {count} more tags"
|
other: "Choose {count} more tags"
|
||||||
confirm: Confirm
|
confirm: Confirm
|
||||||
more: More...
|
more: More...
|
||||||
tag_cloud_title: Tags
|
|
||||||
deleted: Deleted
|
deleted: Deleted
|
||||||
|
@@ -39,7 +39,6 @@ class AddClientAssets
|
|||||||
'tags.choose_secondary_tags',
|
'tags.choose_secondary_tags',
|
||||||
'tags.confirm',
|
'tags.confirm',
|
||||||
'tags.more',
|
'tags.more',
|
||||||
'tags.tag_cloud_title',
|
|
||||||
'tags.deleted'
|
'tags.deleted'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user