Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: introducing cropper in session speaker form for speaker #3819

Merged
merged 8 commits into from Jan 24, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions app/styles/components/speaker-list.scss
Expand Up @@ -13,3 +13,19 @@
.word-break {
overflow-wrap: break-word;
}

.thumbnail-square {
kushthedude marked this conversation as resolved.
Show resolved Hide resolved
height: 220px;
overflow:hidden;
position: relative;
width: 220px;
kushthedude marked this conversation as resolved.
Show resolved Hide resolved
}

.thumbnail-square img {
position: absolute;
left: 50%;
top: 50%;
height: 100%;
width: auto;
transform: translate(-50%, -50%);
}
24 changes: 16 additions & 8 deletions app/templates/components/forms/session-speaker-form.hbs
Expand Up @@ -146,11 +146,15 @@
{{#if (eq field.type 'image')}}
{{widgets/forms/image-upload
imageUrl=(mut (get data.speaker field.fieldIdentifier))
label=(t 'Logo')
needsCropper=true
maze-runnar marked this conversation as resolved.
Show resolved Hide resolved
label=(t 'Speaker Image')
id=(if field.isRequired (concat 'speaker_' field.fieldIdentifier '_required') (concat 'speaker_' field.fieldIdentifier))
icon='image'
aspectRatio = (array 2 2)
hint=(t 'Select an image')
maxSizeInKb=1000}}
maxSizeInKb=1000
helpText=(t 'We recommend using a 1:1 ratio image')
requiresDivider=true}}
{{/if}}
{{#if (eq field.type 'select')}}
{{#if (eq field.fieldIdentifier 'country')}}
Expand Down Expand Up @@ -239,12 +243,16 @@
{{/if}}
{{#if (eq field.type 'image')}}
{{widgets/forms/image-upload
imageUrl=(mut (get data.speaker field.fieldIdentifier))
label=(t 'Logo')
id=(if field.isRequired (concat 'speaker_' field.fieldIdentifier '_required') (concat 'speaker_' field.fieldIdentifier))
icon='image'
hint=(t 'Select an image')
maxSizeInKb=1000}}
imageUrl=(mut (get data.speaker field.fieldIdentifier))
needsCropper=true
maze-runnar marked this conversation as resolved.
Show resolved Hide resolved
label=(t 'Speaker Image')
id=(if field.isRequired (concat 'speaker_' field.fieldIdentifier '_required') (concat 'speaker_' field.fieldIdentifier))
maze-runnar marked this conversation as resolved.
Show resolved Hide resolved
icon='image'
aspectRatio = (array 2 2)
hint=(t 'Select an image')
maxSizeInKb=1000
helpText=(t 'We recommend using a 1:1 ratio image')
requiresDivider=true}}
{{/if}}
{{#if (eq field.type 'select')}}
{{#if (eq field.fieldIdentifier 'country')}}
Expand Down
5 changes: 3 additions & 2 deletions app/templates/components/public/speaker-item.hbs
@@ -1,8 +1,9 @@
{{#ui-accordion}}
<div class="title">
<div class="ui">
<img alt="speaker" class="ui medium rounded image" src="{{if speaker.thumbnailImageUrl speaker.thumbnailImageUrl (if speaker.photoUrl speaker.photoUrl '/images/placeholders/avatar.png')}}">
<br>
<div class="thumbnail-square">
<img alt="speaker" class="ui rounded image" src="{{if speaker.thumbnailImageUrl speaker.thumbnailImageUrl (if speaker.photoUrl speaker.photoUrl '/images/placeholders/avatar.png')}}">
</div>
<h3 class="ui centered header less margin">
{{speaker.name}}
</h3>
Expand Down