do not reload page for edit album and some minor cleanup
This commit is contained in:
parent
6ff795a9f2
commit
d192bcad65
@ -661,33 +661,25 @@ function photos_content(&$a) {
|
|||||||
intval($a->pager['itemspage'])
|
intval($a->pager['itemspage'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if($cmd === 'edit') {
|
//edit album name
|
||||||
if(($album !== t('Profile Photos')) && ($album !== 'Profile Photos') && ($album !== 'Contact Photos') && ($album !== t('Contact Photos'))) {
|
$album_edit = null;
|
||||||
if($can_post) {
|
if(($album !== t('Profile Photos')) && ($album !== 'Profile Photos') && ($album !== 'Contact Photos') && ($album !== t('Contact Photos'))) {
|
||||||
if($a->get_template_engine() === 'internal') {
|
if($can_post) {
|
||||||
$album_e = template_escape($album);
|
if($a->get_template_engine() === 'internal') {
|
||||||
}
|
$album_e = template_escape($album);
|
||||||
else {
|
|
||||||
$album_e = $album;
|
|
||||||
}
|
|
||||||
|
|
||||||
$edit_tpl = get_markup_template('album_edit.tpl');
|
|
||||||
$o .= replace_macros($edit_tpl,array(
|
|
||||||
'$nametext' => t('New album name: '),
|
|
||||||
'$nickname' => $a->data['channel']['channel_address'],
|
|
||||||
'$album' => $album_e,
|
|
||||||
'$hexalbum' => bin2hex($album),
|
|
||||||
'$submit' => t('Submit'),
|
|
||||||
'$dropsubmit' => t('Delete Album')
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
else {
|
||||||
}
|
$album_e = $album;
|
||||||
else {
|
}
|
||||||
if(($album !== t('Profile Photos')) && ($album !== 'Profile Photos') && ($album !== 'Contact Photos') && ($album !== t('Contact Photos'))) {
|
$edit_tpl = get_markup_template('album_edit.tpl');
|
||||||
if($can_post) {
|
$album_edit = replace_macros($edit_tpl,array(
|
||||||
$edit = array(t('Edit Album'), $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($album) . '/edit');
|
'$nametext' => t('New album name: '),
|
||||||
}
|
'$nickname' => $a->data['channel']['channel_address'],
|
||||||
|
'$album' => $album_e,
|
||||||
|
'$hexalbum' => bin2hex($album),
|
||||||
|
'$submit' => t('Submit'),
|
||||||
|
'$dropsubmit' => t('Delete Album')
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -727,6 +719,7 @@ function photos_content(&$a) {
|
|||||||
'desc'=> $desc_e,
|
'desc'=> $desc_e,
|
||||||
'ext' => $ext,
|
'ext' => $ext,
|
||||||
'hash'=> $rr['resource_id'],
|
'hash'=> $rr['resource_id'],
|
||||||
|
'unknown' => t('Unknown')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -749,10 +742,11 @@ function photos_content(&$a) {
|
|||||||
$o .= replace_macros($tpl, array(
|
$o .= replace_macros($tpl, array(
|
||||||
'$photos' => $photos,
|
'$photos' => $photos,
|
||||||
'$album' => $album,
|
'$album' => $album,
|
||||||
|
'$album_edit' => array(t('Edit Album'), $album_edit),
|
||||||
'$can_post' => $can_post,
|
'$can_post' => $can_post,
|
||||||
'$upload' => array(t('Upload'), $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/upload/' . bin2hex($album)),
|
'$upload' => array(t('Upload'), $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/upload/' . bin2hex($album)),
|
||||||
'$order' => $order,
|
'$order' => $order,
|
||||||
'$edit' => $edit
|
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -87,28 +87,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#photo-edit-edit {
|
#photo-edit-edit,
|
||||||
|
#photo-album-edit-wrapper {
|
||||||
|
display: none;
|
||||||
padding: 7px 10px;
|
padding: 7px 10px;
|
||||||
margin-bottom: 3px;
|
margin-bottom: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#photo-edit-end {
|
|
||||||
margin-bottom: 35px;
|
|
||||||
}
|
|
||||||
#photo-caption {
|
|
||||||
margin-top: 15px;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#photo-album-edit-submit, #photo-album-edit-drop {
|
#photo-album-edit-submit, #photo-album-edit-drop {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#photo-album-edit-drop {
|
|
||||||
margin-left: 200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#photos-usage-message {
|
#photos-usage-message {
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
|
@ -704,6 +704,7 @@ footer {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#photo-album-edit-wrapper,
|
||||||
#photo-view-wrapper,
|
#photo-view-wrapper,
|
||||||
#photo-edit-edit {
|
#photo-edit-edit {
|
||||||
background-color: $item_colour;
|
background-color: $item_colour;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<label id="photo-album-edit-name-label" for="photo-album-edit-name" >{{$nametext}}</label>
|
<label id="photo-album-edit-name-label" for="photo-album-edit-name" >{{$nametext}}</label>
|
||||||
<input type="text" size="64" name="albumname" value="{{$album}}" >
|
<input type="text" name="albumname" value="{{$album}}" >
|
||||||
|
|
||||||
<div id="photo-album-edit-name-end"></div>
|
<div id="photo-album-edit-name-end"></div>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<div class="section-title-wrapper">
|
<div class="section-title-wrapper">
|
||||||
<div class="btn-group btn-group-xs pull-right">
|
<div class="btn-group btn-group-xs pull-right">
|
||||||
{{if $edit}}
|
{{if $album_edit.1}}
|
||||||
<a class="btn btn-default" href="{{$edit.1}}" title="{{$edit.0}}"><i class="icon-pencil"></i></a>
|
<i class="icon-pencil btn btn-default" title="{{$album_edit.0}}" onclick="openClose('photo-album-edit-wrapper');"></i>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<a class="btn btn-default" href="{{$order.1}}" title="{{$order.0}}"><i class="icon-sort"></i></a>
|
<a class="btn btn-default" href="{{$order.1}}" title="{{$order.0}}"><i class="icon-sort"></i></a>
|
||||||
{{if $can_post}}
|
{{if $can_post}}
|
||||||
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
|
{{$album_edit.1}}
|
||||||
<div id="photo-album-contents" class="generic-content-wrapper">
|
<div id="photo-album-contents" class="generic-content-wrapper">
|
||||||
{{foreach $photos as $photo}}
|
{{foreach $photos as $photo}}
|
||||||
{{include file="photo_top.tpl"}}
|
{{include file="photo_top.tpl"}}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<a href="{{$photo.link}}" id="photo-top-photo-link-{{$photo.id}}" title="{{$photo.title}}">
|
<a href="{{$photo.link}}" id="photo-top-photo-link-{{$photo.id}}" title="{{$photo.title}}">
|
||||||
<img src="{{$photo.src}}" alt="{{if $photo.album.name}}{{$photo.album.name}}{{elseif $photo.desc}}{{$photo.desc}}{{else}}{{$photo.alt}}{{/if}}" title="{{$photo.title}}" id="photo-top-photo-{{$photo.id}}" />
|
<img src="{{$photo.src}}" alt="{{if $photo.album.name}}{{$photo.album.name}}{{elseif $photo.desc}}{{$photo.desc}}{{elseif $photo.alt}}{{$photo.alt}}{{else}}{{$photo.unknown}}{{/if}}" title="{{$photo.title}}" id="photo-top-photo-{{$photo.id}}" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="photo-edit-edit" style="display: none;">
|
<div id="photo-edit-edit">
|
||||||
<form action="photos/{{$edit.nickname}}/{{$edit.resource_id}}" method="post" id="photo_edit_form">
|
<form action="photos/{{$edit.nickname}}/{{$edit.resource_id}}" method="post" id="photo_edit_form">
|
||||||
<input type="hidden" name="item_id" value="{{$edit.item_id}}">
|
<input type="hidden" name="item_id" value="{{$edit.item_id}}">
|
||||||
<label id="photo-edit-albumname-label" for="photo-edit-albumname">{{$edit.newalbum}}</label>
|
<label id="photo-edit-albumname-label" for="photo-edit-albumname">{{$edit.newalbum}}</label>
|
||||||
@ -155,7 +155,6 @@
|
|||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
||||||
{{if $likebuttons}}
|
{{if $likebuttons}}
|
||||||
<div class="photo-item-tools-right btn-group pull-right">
|
<div class="photo-item-tools-right btn-group pull-right">
|
||||||
<button type="button" class="btn btn-default btn-sm" onclick="dolike({{$id}},'like'); return false">
|
<button type="button" class="btn btn-default btn-sm" onclick="dolike({{$id}},'like'); return false">
|
||||||
@ -167,23 +166,22 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="like-rotator-{{$id}}" class="like-rotator pull-right"></div>
|
<div id="like-rotator-{{$id}}" class="like-rotator pull-right"></div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div class="clear"></div>
|
|
||||||
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{$comments}}
|
||||||
|
|
||||||
|
{{if $commentbox}}
|
||||||
|
<div class="wall-item-comment-wrapper{{if $comments}} wall-item-comment-wrapper-wc{{/if}}" >
|
||||||
|
{{$commentbox}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
<div class="clear"></div>
|
||||||
|
|
||||||
{{$comments}}
|
|
||||||
|
|
||||||
{{if $commentbox}}
|
|
||||||
<div class="wall-item-comment-wrapper{{if $comments}} wall-item-comment-wrapper-wc{{/if}}" >
|
|
||||||
{{$commentbox}}
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
|
|
||||||
<div class="clear"></div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user