Move /profile_photo to Module\Settings\Profile\Photo
This commit is contained in:
parent
2fa873fe06
commit
0d1befdf2d
13 changed files with 426 additions and 421 deletions
55
view/templates/settings/profile/photo/crop.tpl
Normal file
55
view/templates/settings/profile/photo/crop.tpl
Normal file
|
@ -0,0 +1,55 @@
|
|||
<div class="generic-page-wrapper">
|
||||
<h1>{{$title}}</h1>
|
||||
<p id="cropimage-desc">
|
||||
{{$desc nofilter}}
|
||||
</p>
|
||||
|
||||
<div id="cropimage-wrapper">
|
||||
<p><img src="{{$image_url}}" id="croppa" class="imgCrop" alt="{{$title}}"></p>
|
||||
</div>
|
||||
|
||||
<div id="cropimage-preview-wrapper" >
|
||||
<div id="previewWrap" class="crop-preview"></div>
|
||||
</div>
|
||||
|
||||
<form action="settings/profile/photo/crop/{{$resource}}" id="crop-image-form" method="post">
|
||||
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
|
||||
|
||||
<input type="hidden" name="xstart" id="x1" />
|
||||
<input type="hidden" name="ystart" id="y1" />
|
||||
<input type="hidden" name="height" id="height" />
|
||||
<input type="hidden" name="width" id="width" />
|
||||
|
||||
<div id="settings-profile-photo-crop-submit-wrapper" class="pull-right settings-submit-wrapper">
|
||||
{{if $skip}}
|
||||
<button type="submit" name="action" id="settings-profile-photo-crop-skip" class="btn" value="skip">{{$skip}}</button>
|
||||
{{/if}}
|
||||
<button type="submit" name="action" id="settings-profile-photo-crop-submit" class="btn btn-primary" value="crop">{{$crop}}</button>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
||||
var image = document.getElementById('croppa');
|
||||
var cropper = new Cropper(image, {
|
||||
aspectRatio: 1,
|
||||
viewMode: 1,
|
||||
preview: '#profile-photo-wrapper, .crop-preview',
|
||||
crop: function(e) {
|
||||
$('#x1').val(e.detail.x);
|
||||
$('#y1').val(e.detail.y);
|
||||
$('#width').val(e.detail.width);
|
||||
$('#height').val(e.detail.height);
|
||||
},
|
||||
});
|
||||
|
||||
var skip_button = document.getElementById('settings-profile-photo-crop-skip');
|
||||
|
||||
skip_button.addEventListener('click', function() {
|
||||
let image_data = cropper.getImageData();
|
||||
cropper.setData({x: 0, y: 0, width: image_data.width, height: image_data.height});
|
||||
})
|
||||
</script>
|
||||
</div>
|
2
view/templates/settings/profile/photo/crop_head.tpl
Normal file
2
view/templates/settings/profile/photo/crop_head.tpl
Normal file
|
@ -0,0 +1,2 @@
|
|||
<script type="text/javascript" src="view/asset/cropperjs/dist/cropper.min.js"></script>
|
||||
<link rel="stylesheet" href="view/asset/cropperjs/dist/cropper.min.css" type="text/css" />
|
25
view/templates/settings/profile/photo/index.tpl
Normal file
25
view/templates/settings/profile/photo/index.tpl
Normal file
|
@ -0,0 +1,25 @@
|
|||
<div class="generic-page-wrapper">
|
||||
<h1>{{$title}}</h1>
|
||||
|
||||
<h2>{{$current_picture}}</h2>
|
||||
<p><img src="{{$avatar}}" alt="{{$current_picture}}"/></p>
|
||||
<h2>{{$upload_picture}}</h2>
|
||||
<form enctype="multipart/form-data" action="settings/profile/photo" method="post">
|
||||
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
|
||||
|
||||
<div id="profile-photo-upload-wrapper" class="form-group field input">
|
||||
<label id="profile-photo-upload-label" for="profile-photo-upload">{{$lbl_upfile}} </label>
|
||||
<input class="form-control" name="userfile" type="file" id="profile-photo-upload" size="48">
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div id="profile-photo-submit-wrapper" class="pull-right settings-submit-wrapper">
|
||||
<button type="submit" name="submit" id="profile-photo-submit" class="btn btn-primary" value="{{$submit}}">{{$submit}}</button>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</form>
|
||||
|
||||
<p id="profile-photo-link-select-wrapper">
|
||||
{{$select nofilter}}
|
||||
</p>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue