mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 06:53:46 +08:00
a23d0f9961
Currently the process of adding a custom image to badge is quite clunky; you have to upload your image to a topic, and then copy the image URL and pasting it in a text field. Besides being clucky, if the topic or post that contains the image is deleted, the image will be garbage-collected in a few days and the badge will lose the image because the application is not that the image is referenced by a badge. This commit improves that by adding a proper image uploader widget for badge images.
205 lines
3.8 KiB
SCSS
205 lines
3.8 KiB
SCSS
// Styles for admin/badges
|
|
.admin-badges {
|
|
// flex page layout
|
|
.badges {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
.badges-header {
|
|
display: flex;
|
|
align-items: center;
|
|
flex: 1 0 100%;
|
|
.create-new-badge {
|
|
margin-left: auto;
|
|
}
|
|
}
|
|
.content-list {
|
|
flex: 0 0 27%;
|
|
}
|
|
.current-badges {
|
|
display: flex;
|
|
justify-content: center;
|
|
flex: 1 1 72%;
|
|
}
|
|
}
|
|
.badges-header {
|
|
padding: 10px 0;
|
|
border-top: 1px solid var(--primary-low);
|
|
border-bottom: 1px solid var(--primary-low);
|
|
.badges-heading {
|
|
margin: 0;
|
|
padding: 0 10px;
|
|
}
|
|
}
|
|
.content-list {
|
|
.admin-badge-list {
|
|
height: 70vh;
|
|
overflow-y: scroll;
|
|
border-right: 1px solid var(--primary-low);
|
|
border-left: 1px solid var(--primary-low);
|
|
border-bottom: 1px solid var(--primary-low);
|
|
.admin-badge-list-item {
|
|
&:first-child {
|
|
border-top: none;
|
|
}
|
|
&:last-child {
|
|
border-top: none;
|
|
}
|
|
}
|
|
.list-badge {
|
|
float: right;
|
|
font-size: $font-down-1;
|
|
font-weight: normal;
|
|
padding: 0 6px;
|
|
color: var(--secondary);
|
|
background-color: var(--tertiary-medium);
|
|
border-radius: 3px;
|
|
}
|
|
}
|
|
.user-badge {
|
|
border: none;
|
|
background-color: unset;
|
|
}
|
|
}
|
|
.current-badge {
|
|
margin: 20px;
|
|
p.help {
|
|
margin: 0;
|
|
margin-top: 5px;
|
|
color: var(--primary-medium);
|
|
font-size: $font-down-1;
|
|
}
|
|
.badge-grouping-control {
|
|
display: flex;
|
|
align-items: center;
|
|
.badge-selector {
|
|
margin-right: 5px;
|
|
}
|
|
}
|
|
|
|
.icon-picker {
|
|
width: 350px;
|
|
}
|
|
}
|
|
.form-horizontal {
|
|
.radios {
|
|
display: flex;
|
|
|
|
.radio-label {
|
|
margin-right: 1.5em;
|
|
}
|
|
}
|
|
|
|
.ace-wrapper {
|
|
position: relative;
|
|
height: 270px;
|
|
.ace_editor {
|
|
position: absolute;
|
|
left: 0;
|
|
right: 0;
|
|
top: 0;
|
|
bottom: 0;
|
|
}
|
|
&[data-disabled="true"] {
|
|
cursor: not-allowed;
|
|
opacity: 0.5;
|
|
.ace_editor {
|
|
pointer-events: none;
|
|
.ace_cursor {
|
|
visibility: hidden;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
textarea {
|
|
height: 200px;
|
|
}
|
|
}
|
|
.current-badge-actions {
|
|
margin: 10px;
|
|
padding: 10px;
|
|
border-top: 1px solid var(--primary-low);
|
|
}
|
|
.buttons {
|
|
display: flex;
|
|
align-items: center;
|
|
button {
|
|
margin-right: 0.5em;
|
|
}
|
|
.saving {
|
|
order: 3;
|
|
}
|
|
}
|
|
}
|
|
|
|
.award-badge {
|
|
margin: 15px 0 0 15px;
|
|
float: left;
|
|
|
|
.badge-preview {
|
|
min-height: 110px;
|
|
max-width: 300px;
|
|
display: flex;
|
|
align-items: center;
|
|
background-color: var(--primary-very-low);
|
|
border: 1px solid var(--primary-low);
|
|
padding: 0 10px 0 10px;
|
|
|
|
img,
|
|
svg {
|
|
width: 60px;
|
|
height: 60px;
|
|
}
|
|
|
|
.badge-display-name {
|
|
margin-left: 5px;
|
|
}
|
|
}
|
|
.badge-required {
|
|
font-weight: bold;
|
|
}
|
|
}
|
|
|
|
// badge-grouping modal
|
|
.badge-groupings-modal {
|
|
.badge-groupings {
|
|
margin-bottom: 10px;
|
|
}
|
|
.badge-groupings-list {
|
|
list-style: none;
|
|
margin: 0;
|
|
.badge-grouping-item {
|
|
border-bottom: 1px solid var(--primary-low);
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 5px 0;
|
|
}
|
|
.badge-grouping {
|
|
.badge-grouping-name-input {
|
|
margin: 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// badge preview modal
|
|
.badge-query-preview {
|
|
.badge-errors,
|
|
.badge-query-plan {
|
|
padding: 5px;
|
|
background-color: var(--primary-low);
|
|
}
|
|
.count-warning {
|
|
background-color: var(--danger-low);
|
|
margin-bottom: 5px;
|
|
padding: 10px;
|
|
p {
|
|
margin: 0;
|
|
}
|
|
.heading {
|
|
color: var(--danger);
|
|
font-weight: bold;
|
|
}
|
|
}
|
|
}
|