|
|
@@ -94,81 +94,108 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="form-box">
|
|
|
- <fieldset>
|
|
|
- <legend>{{ t('Set Profile Image') }}</legend>
|
|
|
- <div class="form-group">
|
|
|
- <div id="pictureUploadFormMessage"></div>
|
|
|
- <label for="" class="col-sm-3 control-label">
|
|
|
- {{ t('Current Image') }}
|
|
|
- </label>
|
|
|
- <div class="col-sm-9">
|
|
|
- <p>
|
|
|
- <img src="{{ user|picture }}" width="64" id="settingUserPicture"><br>
|
|
|
- </p>
|
|
|
- <p>
|
|
|
- {% if user.image %}
|
|
|
- <form action="/me/picture/delete" method="post" class="form-horizontal" role="form" onsubmit="return window.confirm('{{ t('Delete this image?') }}');">
|
|
|
- <button type="submit" class="btn btn-danger">{{ t('Delete Image') }}</button>
|
|
|
- </form>
|
|
|
- {% endif %}
|
|
|
- </p>
|
|
|
+ <form action="/me/imagetype" method="post" class="form" role="form">
|
|
|
+ <fieldset>
|
|
|
+ <legend>{{ t('Set Profile Image') }}</legend>
|
|
|
+ <div class="form-group col-sm-offset-1 col-sm-4">
|
|
|
+ <div class="radio">
|
|
|
+ <h4>
|
|
|
+ <input type="radio" name="userForm[isGravaterEnabled]" value="true" {% if user.isGravaterEnabled %}checked="checked"{% endif %}>
|
|
|
+ <img src="https://www.gravatar.com/avatar/00000000000000000000000000000000?s=24" /> Gravater
|
|
|
+ </h4>
|
|
|
+ </div>
|
|
|
+ </div><!-- /.col-sm* -->
|
|
|
+ <div class="form-group col-sm-4">
|
|
|
+ <div class="radio">
|
|
|
+ <h4>
|
|
|
+ <input type="radio" name="userForm[isGravaterEnabled]" value="false" {% if !user.isGravaterEnabled %}checked="checked"{% endif %}>{{ t('Upload Image') }}
|
|
|
+ </h4>
|
|
|
</div>
|
|
|
- </div> {# /.form-group# #}
|
|
|
+
|
|
|
+ <div class="form-group">
|
|
|
+ <div id="pictureUploadFormMessage"></div>
|
|
|
+ <label for="" class="col-sm-6 control-label">
|
|
|
+ {{ t('Current Image') }}
|
|
|
+ </label>
|
|
|
+ <div class="col-sm-6">
|
|
|
+ <p>
|
|
|
+ <img src="{{ user|picture }}" width="64" id="settingUserPicture"><br>
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ {% if user.image %}
|
|
|
+ <form action="/me/picture/delete" method="post" class="form-horizontal" role="form" onsubmit="return window.confirm('{{ t('Delete this image?') }}');">
|
|
|
+ <button type="submit" class="btn btn-danger">{{ t('Delete Image') }}</button>
|
|
|
+ </form>
|
|
|
+ {% endif %}
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </div><!-- /.form-group -->
|
|
|
+
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="" class="col-sm-6 control-label">
|
|
|
+ {{ t('Upload new image') }}
|
|
|
+ </label>
|
|
|
+ <div class="col-sm-6">
|
|
|
+ {% if isUploadable() %}
|
|
|
+ <form action="/_api/me/picture/upload" id="pictureUploadForm" method="post" class="form-horizontal" role="form" enctype="multipart/form-data">
|
|
|
+ <input name="userPicture" type="file" accept="image/*">
|
|
|
+ <div id="pictureUploadFormProgress">
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ {% else %}
|
|
|
+ * {{ t('page_me.form_help.profile_image1') }}<br>
|
|
|
+ * {{ t('page_me.form_help.profile_image2') }}<br>
|
|
|
+ {% endif %}
|
|
|
+ </div>
|
|
|
+ </div><!-- /.form-group -->
|
|
|
+
|
|
|
+ </div><!-- /.col-sm- -->
|
|
|
|
|
|
<div class="form-group">
|
|
|
- <label for="" class="col-sm-3 control-label">
|
|
|
- {{ t('Upload new image') }}
|
|
|
- </label>
|
|
|
- <div class="col-sm-9">
|
|
|
- {% if isUploadable() %}
|
|
|
- <form action="/_api/me/picture/upload" id="pictureUploadForm" method="post" class="form-horizontal" role="form" enctype="multipart/form-data">
|
|
|
- <input name="userPicture" type="file" accept="image/*">
|
|
|
- <div id="pictureUploadFormProgress">
|
|
|
- </div>
|
|
|
- </form>
|
|
|
- {% else %}
|
|
|
- * {{ t('page_me.form_help.profile_image1') }}<br>
|
|
|
- * {{ t('page_me.form_help.profile_image2') }}<br>
|
|
|
- {% endif %}
|
|
|
+ <div class="col-sm-offset-4 col-sm-6">
|
|
|
+ <button type="submit" class="btn btn-primary">{{ t('Update') }}</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
</fieldset>
|
|
|
- </div>
|
|
|
- <script>
|
|
|
- $(function()
|
|
|
- {
|
|
|
- $("#pictureUploadForm input[name=userPicture]").on('change', function(){
|
|
|
- var $form = $('#pictureUploadForm');
|
|
|
- var fd = new FormData($form[0]);
|
|
|
- if ($(this).val() == '') {
|
|
|
- return false;
|
|
|
- }
|
|
|
+ </form>
|
|
|
+ </div><!-- /.form-box -->
|
|
|
|
|
|
- $('#pictureUploadFormProgress').html('<img src="/images/loading_s.gif"> アップロード中...');
|
|
|
- $.ajax($form.attr("action"), {
|
|
|
- type: 'post',
|
|
|
- processData: false,
|
|
|
- contentType: false,
|
|
|
- data: fd,
|
|
|
- dataType: 'json',
|
|
|
- success: function(data){
|
|
|
- if (data.status) {
|
|
|
- $('#settingUserPicture').attr('src', data.url + '?time=' + (new Date()));
|
|
|
- $('#pictureUploadFormMessage')
|
|
|
- .addClass('alert alert-success')
|
|
|
- .html('変更しました');
|
|
|
- } else {
|
|
|
- $('#pictureUploadFormMessage')
|
|
|
- .addClass('alert alert-danger')
|
|
|
- .html('変更中にエラーが発生しました。');
|
|
|
- }
|
|
|
- $('#pictureUploadFormProgress').html('');
|
|
|
- }
|
|
|
- });
|
|
|
+ <script>
|
|
|
+ $(function()
|
|
|
+ {
|
|
|
+ $("#pictureUploadForm input[name=userPicture]").on('change', function(){
|
|
|
+ var $form = $('#pictureUploadForm');
|
|
|
+ var fd = new FormData($form[0]);
|
|
|
+ if ($(this).val() == '') {
|
|
|
return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ $('#pictureUploadFormProgress').html('<img src="/images/loading_s.gif"> アップロード中...');
|
|
|
+ $.ajax($form.attr("action"), {
|
|
|
+ type: 'post',
|
|
|
+ processData: false,
|
|
|
+ contentType: false,
|
|
|
+ data: fd,
|
|
|
+ dataType: 'json',
|
|
|
+ success: function(data){
|
|
|
+ if (data.status) {
|
|
|
+ $('#settingUserPicture').attr('src', data.url + '?time=' + (new Date()));
|
|
|
+ $('#pictureUploadFormMessage')
|
|
|
+ .addClass('alert alert-success')
|
|
|
+ .html('変更しました');
|
|
|
+ } else {
|
|
|
+ $('#pictureUploadFormMessage')
|
|
|
+ .addClass('alert alert-danger')
|
|
|
+ .html('変更中にエラーが発生しました。');
|
|
|
+ }
|
|
|
+ $('#pictureUploadFormProgress').html('');
|
|
|
+ }
|
|
|
});
|
|
|
+ return false;
|
|
|
});
|
|
|
- </script>
|
|
|
+ });
|
|
|
+ </script>
|
|
|
|
|
|
<div class="row">
|
|
|
{% if googleLoginEnabled() %}
|