aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarijus <mario@mariovavti.com>2014-11-01 23:55:36 +0100
committermarijus <mario@mariovavti.com>2014-11-01 23:55:36 +0100
commitdc5e05d3349bc493e4c1f33fb2561bb80ddd0c7f (patch)
treeb0eac5d8b0311972151101b990f7b33dbe35e37c
parent30281b161c6e3089a89c5035498bb72a72e66e4a (diff)
downloadvolse-hubzilla-dc5e05d3349bc493e4c1f33fb2561bb80ddd0c7f.tar.gz
volse-hubzilla-dc5e05d3349bc493e4c1f33fb2561bb80ddd0c7f.tar.bz2
volse-hubzilla-dc5e05d3349bc493e4c1f33fb2561bb80ddd0c7f.zip
even more photos work
-rw-r--r--mod/photos.php20
-rw-r--r--view/css/mod_photos.css62
-rwxr-xr-xview/tpl/album_edit.tpl38
-rwxr-xr-xview/tpl/photo_album.tpl19
-rwxr-xr-xview/tpl/photo_view.tpl109
-rwxr-xr-xview/tpl/photos_upload.tpl15
6 files changed, 103 insertions, 160 deletions
diff --git a/mod/photos.php b/mod/photos.php
index d1f2b4993..48bc6d1e5 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -439,12 +439,8 @@ function photos_content(&$a) {
// URLs:
// photos/name
- // photos/name/upload
- // photos/name/upload/xxxxx (xxxxx is album name)
- // photos/name/album/xxxxx
- // photos/name/album/xxxxx/edit
+ // photos/name/album/xxxxx (xxxxx is album name)
// photos/name/image/xxxxx
- // photos/name/image/xxxxx/edit
if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
@@ -518,10 +514,6 @@ function photos_content(&$a) {
$_is_owner = (local_user() && (local_user() == $owner_uid));
$o .= profile_tabs($a,$_is_owner, $a->data['channel']['channel_address']);
- //
- // dispatch request
- //
-
/**
* Display upload form
*/
@@ -590,6 +582,10 @@ function photos_content(&$a) {
}
+ //
+ // dispatch request
+ //
+
/*
* Display a single photo album
*/
@@ -644,7 +640,8 @@ function photos_content(&$a) {
$albums = ((array_key_exists('albums', $a->data)) ? $a->data['albums'] : photos_albums_list($a->data['channel'],$a->data['observer']));
$edit_tpl = get_markup_template('album_edit.tpl');
$album_edit = replace_macros($edit_tpl,array(
- '$nametext' => t('New album name: '),
+ '$nametext' => t('Enter a new album name'),
+ '$name_placeholder' => t('or select an existing one (doubleclick)'),
'$nickname' => $a->data['channel']['channel_address'],
'$album' => $album_e,
'$albums' => $albums['albums'],
@@ -928,7 +925,8 @@ function photos_content(&$a) {
'rotateccw' => t('Rotate CCW (left)'),
'albums' => $albums['albums'],
'album' => $album_e,
- 'newalbum' => t('New album name'),
+ 'newalbum_label' => t('Enter a new album name'),
+ 'newalbum_placeholder' => t('or select an existing one (doubleclick)'),
'nickname' => $a->data['channel']['channel_address'],
'resource_id' => $ph[0]['resource_id'],
'capt_label' => t('Caption'),
diff --git a/view/css/mod_photos.css b/view/css/mod_photos.css
index 061f2f40a..c37cc3332 100644
--- a/view/css/mod_photos.css
+++ b/view/css/mod_photos.css
@@ -13,70 +13,16 @@
margin: 0 auto;
}
-#photo-photo-end {
- clear: both;
-}
-
-#photo-album-end {
- clear: both;
- margin-bottom: 25px;
-}
-
-#photos-upload-album {
- width: 100%;
-}
-
-#photos-upload-new-end, #photos-upload-exist-end {
- clear: both;
-}
-#photos-upload-exist-end {
- margin-bottom: 15px;
-}
-
-#photos-upload-select-files-text {
- margin-top: 15px;
- margin-bottom: 15px;
-}
-
-#photo-edit-caption-label, #photo-edit-tags-label, #photo-edit-albumname-label, #photo-edit-rotate-label {
- float: left;
- width: 150px;
-}
-
-#photo-edit-perms-end {
- margin-bottom: 15px;
-}
-
-#photo-edit-caption, #photo-edit-newtag, #photo-edit-albumname, #photo-edit-rotate {
- float: left;
- margin-bottom: 25px;
-}
-#photo-edit-link-wrap {
- margin-bottom: 15px;
-}
-
-#photo-edit-caption-end, #photo-edit-tags-end, #photo-edit-albumname-end, #photo-edit-rotate-end, #photos-upload-perms-end, #photos-upload-noshare-end{
- clear: both;
- margin-bottom: 10px;
-}
-
-#photo-edit-rotate-end {
- margin-bottom: 15px;
-}
-
-
-#photo-edit-edit,
+#photo-edit,
#photo-album-edit-wrapper,
#photo-upload-form {
display: none;
}
-#photo-album-edit-submit, #photo-album-edit-drop {
- margin-top: 15px;
- margin-bottom: 15px;
-}
-
#photos-usage-message {
line-height: 22px;
}
+#photos-upload-choose {
+ padding: 2px 12px;
+}
diff --git a/view/tpl/album_edit.tpl b/view/tpl/album_edit.tpl
index a6815352a..f5495f149 100755
--- a/view/tpl/album_edit.tpl
+++ b/view/tpl/album_edit.tpl
@@ -1,22 +1,22 @@
<div id="photo-album-edit-wrapper" class="section-content-tools-wrapper">
-<form name="photo-album-edit-form" id="photo-album-edit-form" action="photos/{{$nickname}}/album/{{$hexalbum}}" method="post" >
-
-
-<label id="photo-album-edit-name-label" for="photo-album-edit-name" >{{$nametext}}</label>
-<input type="text" name="albumname" value="{{$album}}" list="dl-album-edit" />
- <datalist id="dl-album-edit">
- {{foreach $albums as $al}}
- {{if $al.text}}
- <option value="{{$al.text}}">
- {{/if}}
- {{/foreach}}
- </datalist>
-
-<div id="photo-album-edit-name-end"></div>
+ <form name="photo-album-edit-form" id="photo-album-edit-form" action="photos/{{$nickname}}/album/{{$hexalbum}}" method="post" >
+ <div class="form-group">
+ <label id="photo-album-edit-name-label" for="photo-album-edit-name">{{$nametext}}</label>
+ <input type="text" name="albumname" placeholder="{{$name_placeholder}}" value="{{$album}}" class="form-control" list="dl-album-edit" />
+ <datalist id="dl-album-edit">
+ {{foreach $albums as $al}}
+ {{if $al.text}}
+ <option value="{{$al.text}}">
+ {{/if}}
+ {{/foreach}}
+ </datalist>
+ </div>
+ <div class="form-group">
+ <button id="photo-album-edit-submit" type="submit" name="submit" class="btn btn-primary btn-sm pull-right" />{{$submit}}</button>
+ <button id="photo-album-edit-drop" type="submit" name="dropalbum" value="{{$dropsubmit}}" class="btn btn-danger btn-sm pull-left" onclick="return confirmDelete();" />{{$dropsubmit}}</button>
+ </div>
+ </form>
+ <div id="photo-album-edit-end" class="clear"></div>
+</div>
-<input id="photo-album-edit-submit" type="submit" name="submit" value="{{$submit}}" />
-<input id="photo-album-edit-drop" type="submit" name="dropalbum" value="{{$dropsubmit}}" onclick="return confirmDelete();" />
-</form>
-</div>
-<div id="photo-album-edit-end" ></div>
diff --git a/view/tpl/photo_album.tpl b/view/tpl/photo_album.tpl
index 7b1566a15..7175a62da 100755
--- a/view/tpl/photo_album.tpl
+++ b/view/tpl/photo_album.tpl
@@ -1,13 +1,16 @@
<div class="section-title-wrapper">
- <div class="btn-group btn-group-xs pull-right">
- {{if $album_edit.1}}
- <i class="icon-pencil btn btn-default" title="{{$album_edit.0}}" onclick="openClose('photo-album-edit-wrapper'); closeMenu('photo-upload-form');"></i>
- {{/if}}
- <a class="btn btn-default" href="{{$order.1}}" title="{{$order.0}}"><i class="icon-sort"></i></a>
- {{if $can_post}}
- <button class="btn btn-xs btn-success" title="{{$usage}}" onclick="openClose('photo-upload-form'); closeMenu('photo-album-edit-wrapper');"><i class="icon-upload"></i>&nbsp;{{$upload.0}}</button>
- {{/if}}
+ <div class="pull-right">
+ <a class="btn btn-default btn-xs" href="{{$order.1}}" title="{{$order.0}}"><i class="icon-sort"></i></a>
+ <div class="btn-group btn-group-xs">
+ {{if $album_edit.1}}
+ <i class="icon-pencil btn btn-default" title="{{$album_edit.0}}" onclick="openClose('photo-album-edit-wrapper'); closeMenu('photo-upload-form');"></i>
+ {{/if}}
+ {{if $can_post}}
+ <button class="btn btn-xs btn-success" title="{{$usage}}" onclick="openClose('photo-upload-form'); closeMenu('photo-album-edit-wrapper');"><i class="icon-upload"></i>&nbsp;{{$upload.0}}</button>
+ {{/if}}
+ </div>
</div>
+
<h2>{{$album}}</h2>
<div class="clear"></div>
diff --git a/view/tpl/photo_view.tpl b/view/tpl/photo_view.tpl
index d1b077f36..37aab3c96 100755
--- a/view/tpl/photo_view.tpl
+++ b/view/tpl/photo_view.tpl
@@ -2,28 +2,28 @@
<div class="generic-content-wrapper">
<div class="section-title-wrapper">
+ <div class="pull-right">
- <div class="btn-group btn-group-xs pull-right">
- {{if $prevlink}}
- <a href="{{$prevlink.0}}" class="btn btn-default" title="{{$prevlink.1}}"><i class="icon-backward"></i></a>
- {{/if}}
- {{if $nextlink}}
- <a href="{{$nextlink.0}}" class="btn btn-default" title="{{$nextlink.1}}"><i class="icon-forward"></i></a>
- {{/if}}
- </div>
- <div class="btn-group btn-group-xs pull-right dropdown">
{{if $tools}}
- <a class="btn btn-default" title="{{$tools.profile.1}}" href="{{$tools.profile.0}}"><i class="icon-user"></i></a>
+ <a class="btn btn-default btn-xs" title="{{$tools.profile.1}}" href="{{$tools.profile.0}}"><i class="icon-user"></i></a>
{{/if}}
- {{if $edit}}
- <i class="icon-pencil btn btn-default" title="{{$edit.edit}}" onclick="openClose('photo-edit-edit');"></i>
- {{/if}}
-
- {{if $lock}}
- <i class="icon-lock btn btn-default dropdown-toggle" data-toggle="dropdown" title="{{$lock}}" onclick="lockview(event,{{$id}});" ></i><ul id="panel-{{$id}}" class="lockview-panel dropdown-menu"></ul>
- {{/if}}
- &nbsp;
+ <div class="btn-group btn-group-xs dropdown">
+ {{if $edit}}
+ <i class="icon-pencil btn btn-default" title="{{$edit.edit}}" onclick="openClose('photo-edit');"></i>
+ {{/if}}
+ {{if $lock}}
+ <i id="lockview" class="icon-lock btn btn-default dropdown-toggle" data-toggle="dropdown" title="{{$lock}}" onclick="lockview(event,{{$id}});" ></i><ul id="panel-{{$id}}" class="lockview-panel dropdown-menu"></ul>
+ {{/if}}
+ </div>
+ <div class="btn-group btn-group-xs">
+ {{if $prevlink}}
+ <a href="{{$prevlink.0}}" class="btn btn-default" title="{{$prevlink.1}}"><i class="icon-backward"></i></a>
+ {{/if}}
+ {{if $nextlink}}
+ <a href="{{$nextlink.0}}" class="btn btn-default" title="{{$nextlink.1}}"><i class="icon-forward"></i></a>
+ {{/if}}
+ </div>
</div>
<h2>{{if $desc}}{{$desc}}{{elseif $filename}}{{$filename}}{{else}}{{$unknown}}{{/if}}</h2>
@@ -31,55 +31,54 @@
<div class="clear"></div>
</div>
- <div id="photo-edit-edit" class="section-content-tools-wrapper">
+ <div id="photo-edit" class="section-content-tools-wrapper">
<form action="photos/{{$edit.nickname}}/{{$edit.resource_id}}" method="post" id="photo_edit_form">
<input type="hidden" name="item_id" value="{{$edit.item_id}}" />
- <label id="photo-edit-albumname-label" for="photo-edit-albumname">{{$edit.newalbum}}</label>
- <input id="photo-edit-albumname" type="text" name="albname" value="{{$edit.album}}" list="dl-albums" />
- {{if $edit.albums}}
- <datalist id="dl-albums">
- {{foreach $edit.albums as $al}}
- {{if $al.text}}
- <option value="{{$al.text}}">
+ <div class="form-group">
+ <label id="photo-edit-albumname-label" for="photo-edit-albumname">{{$edit.newalbum_label}}</label>
+ <input id="photo-edit-albumname" class="form-control" type="text" name="albname" value="{{$edit.album}}" placeholder="{{$edit.newalbum_placeholder}}" list="dl-albums" />
+ {{if $edit.albums}}
+ <datalist id="dl-albums">
+ {{foreach $edit.albums as $al}}
+ {{if $al.text}}
+ <option value="{{$al.text}}">
+ {{/if}}
+ {{/foreach}}
+ </datalist>
{{/if}}
- {{/foreach}}
- </datalist>
- {{/if}}
- <div id="photo-edit-albumname-end"></div>
+ </div>
+ <div class="form-group">
<label id="photo-edit-caption-label" for="photo-edit-caption">{{$edit.capt_label}}</label>
- <input id="photo-edit-caption" type="text" name="desc" value="{{$edit.caption}}" />
- <div id="photo-edit-caption-end"></div>
- <label id="photo-edit-tags-label" for="photo-edit-newtag" >{{$edit.tag_label}}</label>
- <input name="newtag" id="photo-edit-newtag" title="{{$edit.help_tags}}" type="text" />
- <div id="photo-edit-tags-end"></div>
- <div id="photo-edit-rotate-wrapper">
- <div id="photo-edit-rotate-label">
- {{$edit.rotatecw}}<br>
- {{$edit.rotateccw}}
- </div>
- <input type="radio" name="rotate" value="1" /><br>
- <input type="radio" name="rotate" value="2" />
+ <input id="photo-edit-caption" class="form-control" type="text" name="desc" value="{{$edit.caption}}" />
+ </div>
+ <div class="form-group">
+ <label id="photo-edit-tags-label" for="photo-edit-newtag">{{$edit.tag_label}}</label>
+ <input name="newtag" id="photo-edit-newtag" class="form-control" title="{{$edit.help_tags}}" type="text" />
</div>
- <div id="photo-edit-rotate-end"></div>
- <div id="settings-default-perms" class="settings-default-perms">
- <span id="jot-perms-icon" class="{{$edit.lockstate}}"></span>
- <button class="btn btn-default btn-xs" data-toggle="modal" data-target="#aclModal" onclick="return false;">{{$edit.permissions}}</button>
- {{$edit.aclselect}}
- <div id="settings-default-perms-menu-end"></div>
+ <div class="form-group">
+ <label class="radio-inline" id="photo-edit-rotate-cw-label" for="photo-edit-rotate-cw"><input id="photo-edit-rotate-cw" type="radio" name="rotate" value="1" />{{$edit.rotatecw}}</label>
+ <label class="radio-inline" id="photo-edit-rotate-ccw-label" for="photo-edit-rotate-ccw"><input id="photo-edit-rotate-ccw" type="radio" name="rotate" value="2" />{{$edit.rotateccw}}</label>
+ </div>
+
+ {{$edit.aclselect}}
+
+ <div class="form-group pull-left">
+ <button class="btn btn-danger btn-sm" id="photo-edit-delete-button" type="submit" name="delete" value="{{$edit.delete}}" onclick="return confirmDelete();" />{{$edit.delete}}</button>
+ </div>
+ <div class="form-group btn-group pull-right">
+ <button class="btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" onclick="return false;">
+ <i id="jot-perms-icon" class="{{$edit.lockstate}}"></i>
+ </button>
+ <button class="btn btn-primary btn-sm" type="submit" name="submit" id="photos-edit-submit">{{$edit.submit}}</button>
</div>
- <br/>
- <div id="settings-default-perms-end"></div>
- <input id="photo-edit-submit-button" type="submit" name="submit" value="{{$edit.submit}}" />
- <input id="photo-edit-delete-button" type="submit" name="delete" value="{{$edit.delete}}" onclick="return confirmDelete();" />
- <div id="photo-edit-end"></div>
</form>
+ <div id="photo-edit-end" class="clear"></div>
</div>
<div id="photo-view-wrapper">
-
<div id="photo-photo"><a href="{{$photo.href}}" title="{{$photo.title}}" onclick="$.colorbox({href: '{{$photo.href}}'}); return false;"><img style="width: 100%;" src="{{$photo.src}}"></a></div>
- <div id="photo-photo-end"></div>
+ <div id="photo-photo-end" class="clear"></div>
{{if $tags}}
<div class="photo-item-tools-left" id="in-this-photo">
diff --git a/view/tpl/photos_upload.tpl b/view/tpl/photos_upload.tpl
index 5bb0092d6..7067c84f5 100755
--- a/view/tpl/photos_upload.tpl
+++ b/view/tpl/photos_upload.tpl
@@ -3,7 +3,6 @@
<form action="photos/{{$nickname}}" enctype="multipart/form-data" method="post" name="photos-upload-form" id="photos-upload-form">
<input type="hidden" id="photos-upload-source" name="source" value="photos" />
-
<div class="form-group">
<label for="photos-upload-album">{{$newalbum_label}}</label>
<input type="text" class="form-control" id="photos-upload-album" name="newalbum" placeholder="{{$newalbum_placeholder}}" value="{{$selname}}" list="dl-photo-upload">
@@ -22,17 +21,17 @@
<div class="form-group pull-left">
<input id="photos-upload-choose" type="file" name="userfile" />
</div>
- <div class="btn-group pull-right">
+ <div class="form-group btn-group pull-right">
<button class="btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" onclick="return false;">
- <i id="jot-perms-icon" class="icon-{{$lockstate}} jot-icons"></i>
+ <i id="jot-perms-icon" class="icon-{{$lockstate}}"></i>
</button>
<button class="btn btn-primary btn-sm" type="submit" name="submit" id="photos-upload-submit">{{$submit}}</button>
</div>
{{/if}}
- <div id="photos-upload-new-end"></div>
+ <div id="photos-upload-new-end" class="clear"></div>
- <div class="form-group" id="photos-upload-noshare">
+ <div id="photos-upload-noshare">
<label id="photos-upload-noshare-text" for="photos-upload-noshare" >
<input id="photos-upload-noshare" type="checkbox" name="not_visible" value="1" />&nbsp;{{$nosharetext}}
</label>
@@ -44,12 +43,10 @@
<span id="jot-perms-icon" class="icon-{{$lockstate}}" ></span>
<button class="btn btn-default btn-xs" data-toggle="modal" data-target="#aclModal" onclick="return false;">{{$permissions}}</button>
</div>
- <div id="photos-upload-perms-end"></div>
+ <div id="photos-upload-perms-end" class="clear"></div>
{{$uploader}}
{{/if}}
-
-
- <div class="photos-upload-end" ></div>
</form>
</div>
+ <div class="photos-upload-end" class="clear"></div>
</div>