]> git.mxchange.org Git - friendica.git/commitdiff
Frio: new photos upload template (#5637)
authorrabuzarus <rabuzarus@t-online.de>
Mon, 20 Aug 2018 04:29:50 +0000 (06:29 +0200)
committerHypolite Petovan <mrpetovan@eml.cc>
Mon, 20 Aug 2018 04:29:50 +0000 (00:29 -0400)
* frio - add missing page template to various photo pages (fix missing background)

* frio - rework photo upload album selection

* frio - rework photo upload button

* frio - fix photo upload button and acl

mod/photos.php
view/js/ajaxupload.js
view/theme/frio/css/style.css
view/theme/frio/js/modal.js
view/theme/frio/templates/photos_default_uploader_box.tpl [new file with mode: 0644]
view/theme/frio/templates/photos_default_uploader_submit.tpl [new file with mode: 0644]
view/theme/frio/templates/photos_upload.tpl

index e2682498be68496734abd80f872e5b9c99f7aec6..e246c98c3d84ccf2712c5acd621a476c908fb34b 100644 (file)
@@ -1093,6 +1093,12 @@ function photos_content(App $a)
                        '$albumselect' => $albumselect,
                        '$permissions' => L10n::t('Permissions'),
                        '$aclselect' => $aclselect_e,
+                       '$lockstate' => is_array($a->user)
+                                       && (strlen($a->user['allow_cid'])
+                                               || strlen($a->user['allow_gid'])
+                                               || strlen($a->user['deny_cid'])
+                                               || strlen($a->user['deny_gid'])
+                                       ) ? 'lock' : 'unlock',
                        '$alt_uploader' => $ret['addon_text'],
                        '$default_upload_box' => ($ret['default_upload'] ? $default_upload_box : ''),
                        '$default_upload_submit' => ($ret['default_upload'] ? $default_upload_submit : ''),
index 1c34b11b9ed87483669acd2faa0c6c62936da49d..131ab078e68f54bcc7ff49acfa92c597c93ba9af 100644 (file)
                 'cursor' : 'pointer'
             });            
 
-            var div = document.createElement("div");                        
+            var div = document.createElement("div");
+            div.setAttribute('class', 'ajaxbutton-wrapper');
             addStyles(div, {
                 'display' : 'block',
                 'position' : 'absolute',
index f626af8864215185e9276db63010fb47a88bed8b..b96e53fa1a008a0bcdc0f4b951ae105cdda5600e 100644 (file)
@@ -1422,6 +1422,15 @@ section #jotOpen {
     color: #fff;
 }
 
+.fa.lock:before {
+    font-family: FontAwesome;
+    content: "\f023";
+}
+.fa.unlock:before {
+    font-family: FontAwesome;
+    content: "\f09c";
+}
+
 /* Filebrowser */
 .fbrowser .breadcrumb {
     margin-bottom: 0px;
index 46bb1e5143819306de62c3d93c60a81487bb8928..2b3059eaf1693fd3acf9fe38a13ea6cbfefe0db4 100644 (file)
@@ -12,7 +12,7 @@ $(document).ready(function(){
                // with AjaxUpload.
                $(".fbrowser").remove();
                // Remove the AjaxUpload element.
-               $("[name=userfile]").parent().remove();
+               $(".ajaxbutton-wrapper").remove();
        });
 
        // Clear bs modal on close.
diff --git a/view/theme/frio/templates/photos_default_uploader_box.tpl b/view/theme/frio/templates/photos_default_uploader_box.tpl
new file mode 100644 (file)
index 0000000..2f1f69a
--- /dev/null
@@ -0,0 +1 @@
+<input id="photos-upload-choose" type="file" name="userfile" />
diff --git a/view/theme/frio/templates/photos_default_uploader_submit.tpl b/view/theme/frio/templates/photos_default_uploader_submit.tpl
new file mode 100644 (file)
index 0000000..73d5e50
--- /dev/null
@@ -0,0 +1,2 @@
+
+<button id="photos-upload-submit" class="btn btn-primary">{{$submit|escape:'html'}}</button>
index 1162dc3ac686c2f48179fce565f4af60a3a722bd..f02246c5c785a0c6b6e4f5bfd3c898b2a4140d58 100644 (file)
@@ -5,49 +5,68 @@
        <div id="photos-usage-message">{{$usage}}</div>
 
        <form action="photos/{{$nickname}}" enctype="multipart/form-data" method="post" name="photos-upload-form" id="photos-upload-form">
-               <div id="photos-upload-new-wrapper" >
-                       <div id="photos-upload-newalbum-div">
-                               <label id="photos-upload-newalbum-text" for="photos-upload-newalbum" >{{$newalbum}}</label>
-                       </div>
-                       <input class="form-control" id="photos-upload-newalbum" type="text" name="newalbum" />
-               </div>
-               <div id="photos-upload-new-end"></div>
+               <div id="photos-upload-div" class="form-group">
+                       <label id="photos-upload-text" for="photos-upload-newalbum" >{{$newalbum}}</label>
 
-               <div id="photos-upload-exist-wrapper">
-                       <div id="photos-upload-existing-album-div">
-                               <label id="photos-upload-existing-album-text" for="photos-upload-album-select">{{$existalbumtext}}</label>
-                       </div>
-                       <select class="form-control" id="photos-upload-album-select" name="album" size="4">
-                               {{$albumselect}}
-                       </select>
+                       <input id="photos-upload-album-select" class="form-control" placeholder="{{$existalbumtext}}" list="dl-photo-upload" type="text" name="album" size="4">
+                       <datalist id="dl-photo-upload">{{$albumselect}}</datalist>
                </div>
-               <div id="photos-upload-exist-end"></div>
+               <div id="photos-upload-end" class="clearfix"></div>
 
-               <div id="photos-upload-noshare-div" class="photos-upload-noshare-div pull-left" >
+               <div id="photos-upload-noshare-div" class="photos-upload-noshare-div checkbox pull-left" >
                        <input id="photos-upload-noshare" type="checkbox" name="not_visible" value="1" checked/>
                        <label id="photos-upload-noshare-text" for="photos-upload-noshare" >{{$nosharetext}}</label>
                </div>
 
-               <div id="photos-upload-perms" class="photos-upload-perms pull-right" >
-                       <a href="#photos-upload-permissions-wrapper" id="photos-upload-perms-menu" class="button popupbox" />
-                               <span id="jot-perms-icon" class="icon {{$lockstate}}" ></span>{{$permissions}}
-                       </a>
-               </div>
-               <div id="photos-upload-perms-end" class="clear"></div>
-
-               <div style="display: none;">
-                       <div id="photos-upload-permissions-wrapper">
-                               {{$aclselect}}
+               {{if $alt_uploader}}
+                       <div id="photos-upload-perms" class="pull-right">
+                               <button class="btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" onclick="return false;">
+                                       <i id="jot-perms-icon" class="fa {{$lockstate}}"></i> {{$permissions}}
+                               </button>
                        </div>
-               </div>
+                       <div class="clearfix"></div>
+
+                       <div id="photos-upload-spacer"></div>
 
-               <div id="photos-upload-spacer"></div>
+                       {{$alt_uploader}}
+               {{/if}}
 
-               {{$alt_uploader}}
 
-               {{$default_upload_box}}
-               {{$default_upload_submit}}
+               {{if $default_upload_submit}}
+                       <div class="clearfix"></div>
 
-               <div class="photos-upload-end" ></div>
+                       <div id="photos-upload-spacer"></div>
+
+                       <div class="photos-upload-wrapper">
+                               <div id="photos-upload-perms" class="btn-group pull-right">
+                                       <button class="btn btn-default" data-toggle="modal" data-target="#aclModal" onclick="return false;">
+                                               <i id="jot-perms-icon" class="fa {{$lockstate}}"></i> 
+                                       </button>
+
+                                       {{$default_upload_submit}}
+                               </div>
+                               {{$default_upload_box}}
+                       </div>
+                       <div class="clearfix"></div>
+               {{/if}}
+
+               <div class="photos-upload-end" class="clearfix"></div>
+
+               {{* The modal for advanced-expire *}}
+               <div id="aclModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
+                       <div class="modal-dialog">
+                               <div class="modal-content">
+                                       <div class="modal-header" class="modal-header">
+                                               <button id="modal-close" type="button" class="close" data-dismiss="modal" aria-hidden="true">
+                                                       &times;
+                                               </button>
+                                               <h4 id="modal-title" class="modal-title">{{$permissions}}</h4>
+                                       </div>
+                                       <div id="photos-upload-permissions-wrapper" class="modal-body">
+                                               {{$aclselect}}
+                                       </div>
+                               </div>
+                       </div>
+               </div>
        </form>
 </div>