Skip to content

Commit

Permalink
Fix gallery list actions
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesypoof committed Aug 28, 2016
1 parent ae59c60 commit 5e2704a
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 64 deletions.
118 changes: 60 additions & 58 deletions couch/theme/_system/content_list_inner_gallery.html
Original file line number Diff line number Diff line change
@@ -1,73 +1,75 @@
<div id="gallery-listing">
<cms:set my_max_items_in_row = '5' />
<cms:set my_gallery_folder_count='0' />
<cms:set my_cur_folder_count='0' />
<cms:set my_page_num="<cms:gpc method='get' var='pg' default='1' />"/>
<div id="listing">
<cms:set my_max_items_in_row = '5' />
<cms:set my_gallery_folder_count='0' />
<cms:set my_cur_folder_count='0' />
<cms:set my_page_num="<cms:gpc method='get' var='pg' default='1' />"/>

<cms:capture into='my_gallery_items' >
<cms:pages
masterpage = k_template_name
id = k_selected_pageids
folder = k_selected_foldername
orderby = k_selected_orderby
order = k_selected_order
custom_field = k_selected_custom_field
paginate = '1'
limit = k_selected_limit
show_unpublished = '1'
show_future_entries = '1'
page_name = "<cms:if k_selected_exclude>NOT <cms:show k_selected_exclude /></cms:if>"
base_link = k_route_link
token = k_cur_token
include_subfolders = '0'
>
<cms:capture into='my_gallery_items' >
<cms:pages
masterpage = k_template_name
id = k_selected_pageids
folder = k_selected_foldername
orderby = k_selected_orderby
order = k_selected_order
custom_field = k_selected_custom_field
paginate = '1'
limit = k_selected_limit
show_unpublished = '1'
show_future_entries = '1'
page_name = "<cms:if k_selected_exclude>NOT <cms:show k_selected_exclude /></cms:if>"
base_link = k_route_link
token = k_cur_token
include_subfolders = '0'
>

<cms:no_results>
<cms:capture into='my_folder_empty' >
<cms:show_info>
<h4><cms:localize 'folder_empty' /></h4>
</cms:show_info>
</cms:capture>
</cms:no_results>
<cms:no_results>
<cms:capture into='my_folder_empty' >
<cms:show_info>
<h4><cms:localize 'folder_empty' /></h4>
</cms:show_info>
</cms:capture>
</cms:no_results>

<cms:render 'gallery_item'
max_in_row = my_max_items_in_row
current_pos = k_count
start_from = my_gallery_folder_count
/>
<cms:render 'gallery_item'
max_in_row = my_max_items_in_row
current_pos = k_count
start_from = my_gallery_folder_count
/>

<cms:if k_paginated_bottom >
<cms:set my_paginator="<cms:render 'paginator' />" 'parent' />
<cms:if k_paginated_bottom >
<cms:set my_paginator="<cms:render 'paginator' />" 'parent' />

<div style="clear:both;"></div>
<div class="select-all">
<cms:render 'list_checkbox' for_header='1' text_label='1' />
</div>
</cms:if>
</cms:pages>
</cms:capture>
<div style="clear:both;"></div>
<div class="select-all">
<cms:render 'list_checkbox' for_header='1' text_label='1' />
</div>
</cms:if>
</cms:pages>
</cms:capture>

<cms:show my_folder_empty />
<cms:show my_folder_empty />

<cms:if my_page_num='1' && "<cms:not k_selected_custom_field />">
<cms:folders
childof=k_selected_foldername
hierarchical='1'
depth='1'
orderby='weight'>
<cms:if my_page_num='1' && "<cms:not k_selected_custom_field />">
<cms:folders
childof=k_selected_foldername
hierarchical='1'
depth='1'
orderby='weight'>

<cms:set my_gallery_folder_count=k_total_folders scope='parent' />
<cms:incr my_cur_folder_count />
<cms:set my_gallery_folder_count=k_total_folders scope='parent' />
<cms:incr my_cur_folder_count />

<cms:render 'gallery_folder'
max_in_row = my_max_items_in_row
current_pos = my_cur_folder_count
/>
</cms:folders>
</cms:if>
<cms:render 'gallery_folder'
max_in_row = my_max_items_in_row
current_pos = my_cur_folder_count
/>
</cms:folders>
</cms:if>


<cms:show my_gallery_items />
<cms:show my_gallery_items />
</div>
</div>

<cms:render 'gallery_upload' />
4 changes: 2 additions & 2 deletions couch/theme/_system/gallery_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

<div class="gallery-icons">
<cms:if k_has_list_updown>
<cms:render 'list_updown' horizontal='1' />
<span class="nested-sep"></span>
<cms:render 'list_updown' horizontal='1' />
<span class="gallery-sep"></span>
</cms:if>

<cms:render 'list_comments_count' />
Expand Down
5 changes: 3 additions & 2 deletions couch/theme/_system/includes/admin/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ a.icon:hover,a.icon:focus{color:#000;fill:#000;}
.icon>.i{width:20px;}
.popover-actions{white-space:nowrap;}
.popover-actions-sep{display:inline-block;width:1px;height:26px;margin:0 8px;vertical-align:top;background-color:#ccc;}
.popover-actions>.icon{height:26px;padding:4px 0;vertical-align:top;}
.popover-actions>.icon{height:26px;padding:4px 0;vertical-align:top;font-size:0;}
.popover-actions>.icon>.i{width:28px;height:18px;}
.col-count>.icon{padding:0 0 4px;margin-left:8px;font-size:12px;text-shadow:0 1px 0 #fff;}
.col-count>.icon:first-child{margin-left:0;}
Expand Down Expand Up @@ -552,6 +552,7 @@ td.col-highlight{border-right:1px solid rgba(0,0,0,.03);border-left:1px solid rg
.gallery-preview{float:left;margin-left:4px;}
.gallery-icons{float:right;}
.gallery-icons>.btn-actions{height:18px;line-height:18px;}
.gallery-sep{display:inline-block;width:1px;height:18px;margin:0 4px;vertical-align:top;background-color:#ccc;}
.gallery-link{display:inline-block;max-width:100%;height:16px;line-height:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:12px;}
.gallery-txt,.gallery-size{display:inline-block;height:16px;line-height:16px;font-size:11px;}
.gallery-size{position:absolute;right:0;bottom:0;color:#444;}
Expand Down Expand Up @@ -742,7 +743,7 @@ div.kcfinder-iframe .mfp-content{max-width:968px;}
-webkit-transition:none;
transition:none;}
#sidebar{position:relative;top:auto;bottom:auto;left:auto !important;width:auto;height:auto;border-right:0;}
#menu-content,#sidebar-toggle,#sidebar-top,#nav-links,#sidebar-btns,.col-actions>.icon,.comment-actions>.icon,.gallery-icons>.icon{display:none;}
#menu-content,#sidebar-toggle,#sidebar-top,#nav-links,#sidebar-btns,.col-actions>.icon,.comment-actions>.icon,.gallery-icons>.icon,.gallery-sep{display:none;}
#logo-wrap{display:inline-block;padding:0;margin:15px 0 15px 30px;}
#menu-btns{display:block;}
.btn-actions{display:inline-block;}
Expand Down
4 changes: 2 additions & 2 deletions couch/theme/_system/includes/admin/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ COUCH.bindPopupAJAX = function( $elements, code ) {
* Bind Magnific Popup gallery
*/
COUCH.bindPopupGallery = function() {
this.el.$content.find( ".gallery-listing" ).magnificPopup({
this.el.$content.find( "#gallery-listing" ).magnificPopup({
delegate: ".popup-gallery",
gallery: {
enabled: true
Expand Down Expand Up @@ -453,7 +453,7 @@ COUCH.createActionPopovers = function() {
content: function() {
var $this = $( this ),
$content = $this.siblings( "a" ),
$actions = $content.filter( ".approve-comment, .disapprove-comment" ).add( $this.parent().siblings( ".col-up-down" ).children( ".up, .down" ) );
$actions = $content.filter( ".approve-comment, .disapprove-comment, .up, .down" ).add( $this.parent().siblings( ".col-up-down" ).children( ".up, .down" ) );

if ( $actions.length ) {
return $( '<div class="popover-actions"></div>' ).append( $actions.clone() ).append( '<span class="popover-actions-sep"></span>' ).append( $content.not( $actions ).clone() );
Expand Down

0 comments on commit 5e2704a

Please sign in to comment.