mirror of
https://github.com/flarum/core.git
synced 2025-07-31 05:30:38 +02:00
AdminUX Overhaul (#2409)
- Extensions now have their own pages - The API for extensions to register permissions and settings has been overhauled via the `flarum/admin/utils/ExtensionData` util - An extension grid has been added as a widget to the Dashboard page
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
@import "common/common";
|
||||
|
||||
@import "admin/AdminHeader";
|
||||
@import "admin/AdminNav";
|
||||
@import "admin/DashboardPage";
|
||||
@import "admin/BasicsPage";
|
||||
@import "admin/PermissionsPage";
|
||||
@import "admin/EditGroupModal";
|
||||
@import "admin/ExtensionsPage";
|
||||
@import "admin/ExtensionPage";
|
||||
@import "admin/ExtensionWidget";
|
||||
@import "admin/AppearancePage";
|
||||
@import "admin/MailPage";
|
||||
|
19
less/admin/AdminHeader.less
Normal file
19
less/admin/AdminHeader.less
Normal file
@@ -0,0 +1,19 @@
|
||||
.AdminHeader {
|
||||
background: @control-bg;
|
||||
margin-bottom: 20px;
|
||||
padding: 20px 0;
|
||||
|
||||
h2 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 10px;
|
||||
color: @muted-color;
|
||||
}
|
||||
|
||||
.AdminHeader-description {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.icon {
|
||||
margin-right: 15px;
|
||||
}
|
||||
}
|
@@ -1,17 +1,85 @@
|
||||
@admin-pane-width: 300px;
|
||||
@admin-pane-width: 250px;
|
||||
|
||||
.App {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.AdminLinkButton-description {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.AdminContent {
|
||||
padding: 20px 0;
|
||||
}
|
||||
.App-content .sideNavOffset {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.Header-controls {
|
||||
> li {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@media @phone {
|
||||
.Dropdown-menu {
|
||||
height: 70vh;
|
||||
|
||||
.item-search {
|
||||
margin: 10px;
|
||||
|
||||
.SearchBar {
|
||||
width: 100%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ExtensionNavButton {
|
||||
.Button-label {
|
||||
margin-left: 30px;
|
||||
}
|
||||
.ExtensionIcon {
|
||||
margin: 0 0 0 -4px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media @tablet {
|
||||
.item-search{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ExtensionItem, .item-search {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.ExtensionListTitle {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media @phone, @tablet {
|
||||
.App-nav .AdminNav {
|
||||
.Dropdown-menu {
|
||||
> li {
|
||||
.ExtensionListTitle {
|
||||
color: @muted-color;
|
||||
text-transform: uppercase;
|
||||
margin: 25px 0 10px 15px;
|
||||
}
|
||||
|
||||
.ExtensionIcon {
|
||||
margin: -2px -29px;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
font-size: 12.5px;
|
||||
|
||||
.icon {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media @desktop, @desktop-hd {
|
||||
.App-nav {
|
||||
position: absolute;
|
||||
@@ -20,60 +88,84 @@
|
||||
width: @admin-pane-width;
|
||||
.box-shadow(0 6px 6px @shadow-color);
|
||||
background: @body-bg;
|
||||
border-top: 1px solid @control-bg;
|
||||
z-index: @zindex-pane;
|
||||
overflow: auto;
|
||||
overflow-y: scroll;
|
||||
padding-bottom: 40px;
|
||||
|
||||
.affix & {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
.App-content .sideNavOffset {
|
||||
margin-left: @admin-pane-width;
|
||||
}
|
||||
.App-nav .AdminNav {
|
||||
.Dropdown-menu > li {
|
||||
> a {
|
||||
padding: 15px 15px 15px 45px;
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
white-space: normal;
|
||||
.Dropdown-menu {
|
||||
.item-search {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
> a, > a:hover, &.active > a {
|
||||
color: @muted-color;
|
||||
}
|
||||
> a:hover {
|
||||
background: @control-bg;
|
||||
}
|
||||
&.active > a {
|
||||
background: @control-bg;
|
||||
font-weight: normal;
|
||||
|
||||
.Button-label, .Button-icon {
|
||||
> li {
|
||||
> a {
|
||||
padding: 10px 10px 10px 45px;
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
}
|
||||
> a,
|
||||
> a:hover,
|
||||
&.active > a {
|
||||
color: @text-color;
|
||||
font-weight: bold;
|
||||
}
|
||||
> a:hover {
|
||||
background: @control-bg;
|
||||
}
|
||||
&.active > a {
|
||||
background: @primary-color;
|
||||
font-weight: normal;
|
||||
|
||||
.Button-label,
|
||||
.Button-icon {
|
||||
color: @body-bg;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.Button-icon {
|
||||
float: left;
|
||||
font-size: 13px !important;
|
||||
margin-left: -25px !important;
|
||||
margin-top: 4px !important;
|
||||
}
|
||||
.Button-label {
|
||||
padding-left: 5px;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.Search-input,
|
||||
.SearchBar {
|
||||
max-width: 215px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.ExtensionListTitle {
|
||||
color: @muted-color;
|
||||
text-transform: uppercase;
|
||||
margin: 25px 0 15px 15px;
|
||||
}
|
||||
|
||||
.ExtensionIcon {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
font-size: 15px;
|
||||
margin-left: -29px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
}
|
||||
.Button-icon {
|
||||
float: left;
|
||||
margin-left: -30px;
|
||||
font-size: 14px;
|
||||
margin-top: 4px !important;
|
||||
}
|
||||
.Button-label {
|
||||
display: block;
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
margin: 0 0 5px;
|
||||
}
|
||||
.AdminLinkButton-description {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
@@ -85,4 +177,33 @@
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.ExtensionListItem-Dot {
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
border-radius: 50%;
|
||||
display: inline-block;
|
||||
right: 13px;
|
||||
margin: 6px 5px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.ExtensionNavButton {
|
||||
.Button-label {
|
||||
display: inline-block;
|
||||
max-width: calc(100% - 18px);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
vertical-align: middle;
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.ExtensionListItem-Dot.enabled {
|
||||
background-color: #2ECC40;
|
||||
}
|
||||
.ExtensionListItem-Dot.disabled {
|
||||
background-color: #FF4136;
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
.AppearancePage {
|
||||
|
||||
@media @desktop-up {
|
||||
.container {
|
||||
max-width: 600px;
|
||||
padding: 30px;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,4 @@
|
||||
.BasicsPage {
|
||||
padding: 20px 0;
|
||||
|
||||
@media @desktop-up {
|
||||
.container {
|
||||
|
@@ -1,18 +1,11 @@
|
||||
.DashboardPage {
|
||||
background: @control-bg;
|
||||
background: @body-bg;
|
||||
color: @control-color;
|
||||
min-height: 100vh;
|
||||
|
||||
@media @desktop-up {
|
||||
.container {
|
||||
padding: 30px;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.DashboardWidget {
|
||||
background: @body-bg;
|
||||
.Widget {
|
||||
background: @control-bg;
|
||||
color: @text-color;
|
||||
border-radius: @border-radius;
|
||||
padding: 20px;
|
||||
|
153
less/admin/ExtensionPage.less
Normal file
153
less/admin/ExtensionPage.less
Normal file
@@ -0,0 +1,153 @@
|
||||
.ExtensionPage {
|
||||
min-height: 110vh;
|
||||
|
||||
.ExtensionPage-header {
|
||||
.ExtensionTitle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
margin: 20px 0 15px;
|
||||
}
|
||||
|
||||
.helpText {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
.ExtensionPage-header,
|
||||
.ExtensionPage-permissions-header {
|
||||
background: @control-bg;
|
||||
|
||||
h2 {
|
||||
color: @muted-color;
|
||||
|
||||
span {
|
||||
font-size: 13px;
|
||||
color: @muted-color;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.Button-icon {
|
||||
display: unset;
|
||||
}
|
||||
|
||||
ul {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
> li {
|
||||
display: inline;
|
||||
color: @muted-color;
|
||||
margin-left: 13px;
|
||||
|
||||
|
||||
> a {
|
||||
color: @muted-color;
|
||||
}
|
||||
|
||||
> .icon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ExtensionPage-headerItems {
|
||||
padding: 15px 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.Checkbox {
|
||||
margin: 5px 0 0 0;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.Checkbox.off {
|
||||
.Checkbox-display {
|
||||
background: @muted-more-color;
|
||||
}
|
||||
}
|
||||
|
||||
.ExtensionInfo {
|
||||
margin-left: auto;
|
||||
|
||||
.item-authors {
|
||||
a {
|
||||
color: @muted-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.ExtensionName {
|
||||
display: inline-block;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.ExtensionIcon {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
font-size: 15px;
|
||||
margin-left: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.ExtensionPage-headerTopItems {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
@media (max-width: @screen-phone-max) {
|
||||
.ExtensionPage-headerTopItems {
|
||||
float: right;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.item-website, .item-source, .item-documentation {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.ExtensionPage-settings {
|
||||
margin-top: 20px;
|
||||
padding: 10px 0;
|
||||
|
||||
input {
|
||||
max-width: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
.ExtensionPage-subHeader {
|
||||
color: @muted-color;
|
||||
font-weight: normal;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
.ExtensionPage-permissions {
|
||||
|
||||
@media @phone {
|
||||
> .container {
|
||||
overflow-x: scroll;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.ExtensionPage-permissions-header {
|
||||
margin: 20px 0 20px;
|
||||
padding: 5px 0;
|
||||
}
|
||||
}
|
||||
}
|
93
less/admin/ExtensionWidget.less
Normal file
93
less/admin/ExtensionWidget.less
Normal file
@@ -0,0 +1,93 @@
|
||||
.ExtensionsWidget {
|
||||
background-color: @body-bg;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ExtensionsWidget-list {
|
||||
> .container {
|
||||
padding: 0;
|
||||
background-color: @body-bg;
|
||||
|
||||
.ExtensionList-Category {
|
||||
background: @control-bg;
|
||||
padding: 20px 0 20px 20px;
|
||||
margin-bottom: 20px;
|
||||
border-radius: @border-radius;
|
||||
|
||||
.ExtensionList-Label {
|
||||
margin-top: 0;
|
||||
color: @muted-color;
|
||||
}
|
||||
}
|
||||
|
||||
.ExtensionGroup {
|
||||
margin-bottom: 20px;
|
||||
|
||||
h3 {
|
||||
color: @muted-color;
|
||||
text-transform: uppercase;
|
||||
font-size: 12px;
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.ExtensionList {
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
display: grid;
|
||||
grid-gap: 10px;
|
||||
grid-template-columns: repeat(auto-fit, 90px);
|
||||
margin-bottom: 0;
|
||||
|
||||
> li {
|
||||
text-align: left;
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ExtensionListItem.disabled {
|
||||
.ExtensionListItem-title {
|
||||
opacity: 0.5;
|
||||
color: @muted-color;
|
||||
}
|
||||
|
||||
.ExtensionListItem-icon {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
.ExtensionListItem {
|
||||
transition: .15s ease-in-out;
|
||||
|
||||
&:hover {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.ExtensionListItem-title {
|
||||
display: block;
|
||||
text-align: center;
|
||||
margin-top: 5px;
|
||||
color: @text-color;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ExtensionIcon {
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
background: @control-bg;
|
||||
color: @control-color;
|
||||
border-radius: 6px;
|
||||
display: inline-flex;
|
||||
font-size: 45px;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
vertical-align: middle;
|
||||
}
|
@@ -1,115 +0,0 @@
|
||||
@extension-list-column-width: 410px;
|
||||
|
||||
.ExtensionsPage-header {
|
||||
padding: 20px 0;
|
||||
background: @control-bg;
|
||||
}
|
||||
|
||||
.ExtensionsPage-list {
|
||||
padding: 30px 0;
|
||||
}
|
||||
.ExtensionGroup {
|
||||
margin-bottom: 20px;
|
||||
|
||||
h3 {
|
||||
color: @muted-color;
|
||||
text-transform: uppercase;
|
||||
font-size: 12px;
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.ExtensionList {
|
||||
columns: 3;
|
||||
column-width: @extension-list-column-width;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
.clearfix();
|
||||
|
||||
> li {
|
||||
-webkit-column-break-inside: avoid;
|
||||
break-inside: avoid-column;
|
||||
page-break-inside: avoid;
|
||||
text-align: left;
|
||||
position: relative;
|
||||
border-radius: 4px;
|
||||
transition: background .2s;
|
||||
}
|
||||
}
|
||||
.ExtensionListItem.disabled {
|
||||
.ExtensionListItem-title {
|
||||
opacity: 0.5;
|
||||
color: @muted-color;
|
||||
}
|
||||
.ExtensionListItem-icon {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
.ExtensionListItem {
|
||||
padding: 10px;
|
||||
}
|
||||
.ExtensionListItem:hover {
|
||||
background: @control-bg;
|
||||
}
|
||||
.ExtensionListItem-content {
|
||||
padding: 0 50px;
|
||||
min-height: 40px;
|
||||
}
|
||||
.ExtensionListItem-main {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.ExtensionListItem-title {
|
||||
display: inline-block;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
padding-right: 10px;
|
||||
}
|
||||
.ExtensionListItem-version {
|
||||
color: @muted-more-color;
|
||||
font-size: 11px;
|
||||
font-weight: normal;
|
||||
display: inline-flex;
|
||||
}
|
||||
.ExtensionListItem-controls {
|
||||
float: right;
|
||||
display: none;
|
||||
margin-right: -50px;
|
||||
margin-top: 1px;
|
||||
|
||||
.ExtensionListItem:hover &, &.open {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.ExtensionListItem-description {
|
||||
font-size: 11px;
|
||||
font-weight: normal;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
.ExtensionIcon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: @control-bg;
|
||||
color: @control-color;
|
||||
border-radius: 6px;
|
||||
display: inline-block;
|
||||
font-size: 20px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
margin-left: -50px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
@media (max-width: @extension-list-column-width) {
|
||||
.ExtensionListItem-description {
|
||||
display: none;
|
||||
}
|
||||
.ExtensionListItem-version {
|
||||
display: block;
|
||||
margin-top: 8px;
|
||||
}
|
||||
}
|
@@ -1,5 +1,4 @@
|
||||
.MailPage {
|
||||
padding: 20px 0;
|
||||
|
||||
@media @desktop-up {
|
||||
.container {
|
||||
|
@@ -1,6 +1,11 @@
|
||||
.PermissionsPage-groups {
|
||||
background: @control-bg;
|
||||
padding: 20px 0;
|
||||
border-radius: @border-radius;
|
||||
max-width: calc(~'100% - 60px');
|
||||
display: block;
|
||||
margin-left: 30px;
|
||||
overflow-x: auto;
|
||||
padding: 8px 0 8px;
|
||||
}
|
||||
.Group {
|
||||
width: 90px;
|
||||
|
Reference in New Issue
Block a user