ui and editor updates
This commit is contained in:
parent
018fe37782
commit
0317edec1c
@ -3,6 +3,6 @@ userdata = {
|
|||||||
"intro_content": "<p>Write something about yourself</p>",
|
"intro_content": "<p>Write something about yourself</p>",
|
||||||
"profile_photo": "",
|
"profile_photo": "",
|
||||||
"default_theme": "darkTheme",
|
"default_theme": "darkTheme",
|
||||||
"dark_theme": "{\"theme\": \"Dark Mode\",\"background\": \"bg-dark\",\"textColor\": \"text-white\",\"linkBackground\": \"bg-light\",\"linkTextColor\": \"text-black\",\"captionColor\": \"#8a8a8a\",\"fontAwesomeIcon\": \"faSun\",\"borderColor\": \"secondary\",\"buttonColor\": \"light\",\"navBar\": {\"navBarTheme\": \"navbar-dark\",\"background\": \"bg-secondary\",\"buttonColor\": \"light\"},\"footer\": {\"background\": \"bg-secondary\",\"text\": \"text-black\"}}",
|
"dark_theme": "{\"theme\": \"Dark Mode\",\"background\": \"bg-dark\",\"textColor\": \"text-white\",\"linkBackground\": \"bg-light\",\"linkTextColor\": \"text-black\",\"captionColor\": \"#8a8a8a\",\"fontAwesomeIcon\": \"faSun\",\"borderColor\": \"border-light\",\"buttonColor\": \"light\",\"navBar\": {\"navBarTheme\": \"navbar-dark\",\"background\": \"bg-secondary\",\"buttonColor\": \"light\"},\"footer\": {\"background\": \"bg-secondary\",\"text\": \"text-white\"}}",
|
||||||
"light_theme": "{\"theme\": \"Light Mode\",\"background\": \"bg-light\",\"textColor\": \"text-black\",\"linkBackground\": \"bg-dark\",\"linkTextColor\": \"text-white\",\"captionColor\": \"#605f5f\",\"fontAwesomeIcon\": \"faMoon\",\"borderColor\": \"secondary\",\"buttonColor\": \"dark\",\"navBar\": {\"navBarTheme\": \"navbar-light\",\"background\": \"bg-secondary\",\"buttonColor\": \"light\"},\"footer\": {\"background\": \"bg-secondary\",\"text\": \"text-white\"}}"
|
"light_theme": "{\"theme\": \"Light Mode\",\"background\": \"bg-light\",\"textColor\": \"text-black\",\"linkBackground\": \"bg-dark\",\"linkTextColor\": \"text-white\",\"captionColor\": \"#605f5f\",\"fontAwesomeIcon\": \"faMoon\",\"borderColor\": \"border-secondary\",\"buttonColor\": \"dark\",\"navBar\": {\"navBarTheme\": \"navbar-light\",\"background\": \"bg-secondary\",\"buttonColor\": \"light\"},\"footer\": {\"background\": \"bg-secondary\",\"text\": \"text-black\"}}"
|
||||||
}
|
}
|
||||||
@ -49,9 +49,10 @@ class MediaUpload(APIView):
|
|||||||
else:
|
else:
|
||||||
file_path = f"{file_path_base}/{resource_type}/media/{file_unique_slug+resource_id+f.name}"
|
file_path = f"{file_path_base}/{resource_type}/media/{file_unique_slug+resource_id+f.name}"
|
||||||
|
|
||||||
# Reduce image quality if the file is an image
|
# Reduce image quality if the file is an images
|
||||||
|
print(f.content_type)
|
||||||
if f.content_type.startswith('image'):
|
if f.content_type.startswith('image'):
|
||||||
reduced_image = self.reduce_image_quality(f, quality=65)
|
reduced_image = self.reduce_image_quality(f, quality=40)
|
||||||
default_storage.save(file_path, reduced_image)
|
default_storage.save(file_path, reduced_image)
|
||||||
else:
|
else:
|
||||||
# Save non-image files directly
|
# Save non-image files directly
|
||||||
|
|||||||
@ -7,8 +7,8 @@ def add_initial_values(apps, schema_editor):
|
|||||||
"intro_content": "<p>Write something about yourself</p>",
|
"intro_content": "<p>Write something about yourself</p>",
|
||||||
"profile_photo": "",
|
"profile_photo": "",
|
||||||
"default_theme": "darkTheme",
|
"default_theme": "darkTheme",
|
||||||
"dark_theme": "{\"theme\": \"Dark Mode\",\"background\": \"bg-dark\",\"textColor\": \"text-white\",\"linkBackground\": \"bg-light\",\"linkTextColor\": \"text-black\",\"captionColor\": \"#8a8a8a\",\"fontAwesomeIcon\": \"faSun\",\"borderColor\": \"secondary\",\"buttonColor\": \"light\",\"navBar\": {\"navBarTheme\": \"navbar-dark\",\"background\": \"bg-secondary\",\"buttonColor\": \"light\"},\"footer\": {\"background\": \"bg-secondary\",\"text\": \"text-black\"}}",
|
"dark_theme": "{\"theme\": \"Dark Mode\",\"background\": \"bg-dark\",\"textColor\": \"text-white\",\"linkBackground\": \"bg-light\",\"linkTextColor\": \"text-black\",\"captionColor\": \"#8a8a8a\",\"fontAwesomeIcon\": \"faSun\",\"borderColor\": \"border-light\",\"buttonColor\": \"light\",\"navBar\": {\"navBarTheme\": \"navbar-dark\",\"background\": \"bg-secondary\",\"buttonColor\": \"light\"},\"footer\": {\"background\": \"bg-secondary\",\"text\": \"text-white\"}}",
|
||||||
"light_theme": "{\"theme\": \"Light Mode\",\"background\": \"bg-light\",\"textColor\": \"text-black\",\"linkBackground\": \"bg-dark\",\"linkTextColor\": \"text-white\",\"captionColor\": \"#605f5f\",\"fontAwesomeIcon\": \"faMoon\",\"borderColor\": \"secondary\",\"buttonColor\": \"dark\",\"navBar\": {\"navBarTheme\": \"navbar-light\",\"background\": \"bg-secondary\",\"buttonColor\": \"light\"},\"footer\": {\"background\": \"bg-secondary\",\"text\": \"text-white\"}}"
|
"light_theme": "{\"theme\": \"Light Mode\",\"background\": \"bg-light\",\"textColor\": \"text-black\",\"linkBackground\": \"bg-dark\",\"linkTextColor\": \"text-white\",\"captionColor\": \"#605f5f\",\"fontAwesomeIcon\": \"faMoon\",\"borderColor\": \"border-secondary\",\"buttonColor\": \"dark\",\"navBar\": {\"navBarTheme\": \"navbar-light\",\"background\": \"bg-secondary\",\"buttonColor\": \"light\"},\"footer\": {\"background\": \"bg-secondary\",\"text\": \"text-black\"}}"
|
||||||
}
|
}
|
||||||
UserData = apps.get_model('apimanager', 'userdata')
|
UserData = apps.get_model('apimanager', 'userdata')
|
||||||
UserData.objects.create(
|
UserData.objects.create(
|
||||||
|
|||||||
@ -110,7 +110,8 @@ function Blog(props) {
|
|||||||
<img
|
<img
|
||||||
src={EditableMediaService.getMedia(blogData.coverImage)}
|
src={EditableMediaService.getMedia(blogData.coverImage)}
|
||||||
alt='Banner'
|
alt='Banner'
|
||||||
style={{ width: '100%', height: 'auto', maxHeight: '20vh', objectFit: 'cover' }}
|
className='rounded'
|
||||||
|
style={{ width: '100%', height: 'auto', maxHeight: '50vh', objectFit: 'cover' }}
|
||||||
/>:''
|
/>:''
|
||||||
}
|
}
|
||||||
</Col>
|
</Col>
|
||||||
|
|||||||
@ -72,7 +72,7 @@ function CardListViewer(props) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ModalComponent modalText={modalText} modalTitle={modalTitle} modal={modal} toggle={toggle} confirmAction={deleteResource}/>
|
<ModalComponent modalText={modalText} modalTitle={modalTitle} modal={modal} toggle={toggle} confirmAction={deleteResource}/>
|
||||||
<Card color={props.borderColor} outline className={`my-2 ${props.bgColor}`} style={{'width': props.cardType === 'smallCard' ? '18rem': '100%'}}>
|
<Card outline className={`my-2 ${props.borderColor} ${props.bgColor}`} style={{'width': props.cardType === 'smallCard' ? '18rem': '100%'}}>
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<CardTitle className={`mb-3 ${props.textColor}`} tag='h5'>
|
<CardTitle className={`mb-3 ${props.textColor}`} tag='h5'>
|
||||||
<InputGroup>
|
<InputGroup>
|
||||||
@ -123,7 +123,7 @@ function CardListViewer(props) {
|
|||||||
)
|
)
|
||||||
else
|
else
|
||||||
return (
|
return (
|
||||||
<Card color={props.borderColor} outline className={`my-2 ${props.bgColor}`} style={{'width': props.cardType === 'smallCard' ? '18rem': '100%'}}>
|
<Card outline className={`my-2 ${props.borderColor} ${props.bgColor}`} style={{'width': props.cardType === 'smallCard' ? '18rem': '100%'}}>
|
||||||
{itemObject.coverImage !== '' ? <CardImg src={EditableMediaService.getMedia(itemObject.coverImage)} style={{ 'height': '180px', 'objectFit': 'cover' }} top width='100%' /> : ''}
|
{itemObject.coverImage !== '' ? <CardImg src={EditableMediaService.getMedia(itemObject.coverImage)} style={{ 'height': '180px', 'objectFit': 'cover' }} top width='100%' /> : ''}
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<Link to={`/${props.resourceType}/${itemObject.id}`}>
|
<Link to={`/${props.resourceType}/${itemObject.id}`}>
|
||||||
|
|||||||
@ -69,7 +69,8 @@ function Blog(props) {
|
|||||||
<img
|
<img
|
||||||
src={MediaService.getMedia(blogData.coverImage)}
|
src={MediaService.getMedia(blogData.coverImage)}
|
||||||
alt="Banner"
|
alt="Banner"
|
||||||
style={{ width: '100%', height: 'auto', maxHeight: '20vh', objectFit: 'cover' }}
|
className='rounded'
|
||||||
|
style={{ width: '100%', height: 'auto', maxHeight: '50vh', objectFit: 'cover' }}
|
||||||
/>:''
|
/>:''
|
||||||
}
|
}
|
||||||
</Col>
|
</Col>
|
||||||
|
|||||||
@ -14,10 +14,10 @@ function CardListViewer(props) {
|
|||||||
|
|
||||||
if (props.totalItems > 0 && itemObject && Object.keys(itemObject).length !== 0)
|
if (props.totalItems > 0 && itemObject && Object.keys(itemObject).length !== 0)
|
||||||
return (
|
return (
|
||||||
<Card color={props.borderColor} outline className={`my-2 ${props.bgColor}`} style={{'width': props.cardType === 'smallCard' ? '18rem': '100%'}}>
|
<Card outline className={`my-2 ${props.borderColor} ${props.bgColor}`} style={{'width': props.cardType === 'smallCard' ? '18rem': '100%'}}>
|
||||||
|
<Link to={`/${props.resourceType}/${itemObject.id}`}>
|
||||||
{itemObject.coverImage ? <CardImg src={MediaService.getMedia(itemObject.coverImage)} style={{ 'height': '180px', 'objectFit': 'cover' }} top width='100%' /> : ''}
|
{itemObject.coverImage ? <CardImg src={MediaService.getMedia(itemObject.coverImage)} style={{ 'height': '180px', 'objectFit': 'cover' }} top width='100%' /> : ''}
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<Link to={`/${props.resourceType}/${itemObject.id}`}>
|
|
||||||
<CardTitle className={`${props.textColor}`} tag='h5'>
|
<CardTitle className={`${props.textColor}`} tag='h5'>
|
||||||
{itemObject.name}
|
{itemObject.name}
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
@ -29,8 +29,8 @@ function CardListViewer(props) {
|
|||||||
{itemObject.tagLine}
|
{itemObject.tagLine}
|
||||||
</small>
|
</small>
|
||||||
</CardText>
|
</CardText>
|
||||||
</Link>
|
|
||||||
</CardBody>
|
</CardBody>
|
||||||
|
</Link>
|
||||||
</Card>
|
</Card>
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user