Commit bb88eaa7 authored by Richard Mansfield's avatar Richard Mansfield Committed by Gerrit Code Review
Browse files

Merge changes Ica2d2736,Ib92e18fe,Ib0d20cf5,Ibe40c6f3

* changes:
  Replace "parent folder" text in file browser with an up arrow (bug #889975)
  Up arrow icon for parent folder in the files area (bug #889975)
  Allow files to be dropped on folder names in the navigation (bug #889975)
  Move folder navigation below the create folder form (bug #889975)
parents 852c9aa7 23060b2f
......@@ -374,6 +374,7 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
self.make_icon_draggable(elem);
});
forEach(getElementsByTagAndClassName('tr', 'folder', self.id + '_filelist'), self.make_row_droppable);
forEach(getElementsByTagAndClassName('a', 'changefolder', self.id + '_foldernav'), self.make_folderlink_droppable);
}
}
forEach(getElementsByTagAndClassName('a', 'changeowner', self.id + '_upload_browse'), function (elem) {
......@@ -445,6 +446,25 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
undoPositioned(row);
};
this.make_folderlink_droppable = function(link) {
new Droppable(link, {
accept: ['icon-drag-current'],
hoverclass: 'folderhover',
ondrop: function (dragged, dropped) {
var dragid = dragged.id.replace(/^.*drag:(\d+)$/, '$1');
var dropid = dropped.href.replace(/^.*\?folder=(\d+)$/, '$1');
if (dragid == dropid) {
return;
}
$(self.id + '_move').value = dragid;
$(self.id + '_moveto').value = dropid;
self.submitform();
$(self.id + '_move').value = '';
$(self.id + '_moveto').value = '';
}
});
};
this.drag = {};
this.make_icon_draggable = function(elem) {
......
......@@ -82,16 +82,16 @@
<input type="hidden" name="{$prefix}_moveto" id="{$prefix}_moveto" value="" />
{/if}
<div id="{$prefix}_foldernav" class="foldernav">
{include file="artefact:file:form/folderpath.tpl" path=$path querybase=$querybase owner=$tabs.owner ownerid=$tabs.ownerid}
</div>
{if $config.createfolder}
<div id="createfolder"{if $uploaddisabled} class="hidden"{/if}><div id="{$prefix}_createfolder_messages" class="createfolder-message"></div>
<input type="text" class="text" name="{$prefix}_createfolder_name" id="{$prefix}_createfolder_name" size="40" />
<input type="submit" class="submit" name="{$prefix}_createfolder" id="{$prefix}_createfolder" value="{str tag=createfolder section=artefact.file}" /></div>
{/if}
<div id="{$prefix}_foldernav" class="foldernav">
{include file="artefact:file:form/folderpath.tpl" path=$path querybase=$querybase owner=$tabs.owner ownerid=$tabs.ownerid}
</div>
<div id="{$prefix}_filelist_container">
{include file="artefact:file:form/filelist.tpl" prefix=$prefix filelist=$filelist editable=$config.edit selectable=$config.select highlight=$highlight edit=$edit querybase=$querybase groupinfo=$groupinfo owner=$tabs.owner ownerid=$tabs.ownerid selectfolders=$config.selectfolders showtags=$config.showtags editmeta=$config.editmeta}
</div>
......
......@@ -25,18 +25,20 @@
{if !$publishing || !$file->permissions || $file->can_republish}{assign var=publishable value=1}{else}{assign var=publishable value=0}{/if}
<tr id="file:{$file->id}" class="{cycle values='r0,r1'} directory-item{if $file->isparent} parentfolder{/if}{if $file->artefacttype == 'folder'} folder{elseif $file->artefacttype == 'profileicon'} profileicon{/if}{if $highlight && $highlight == $file->id} highlight-file{/if}{if $edit == $file->id} hidden{/if}{if !$publishable && $file->artefacttype != 'folder'} disabled{/if}" {if !$publishable && $file->artefacttype != 'folder'} title="{str tag=notpublishable section=artefact.file}"{/if}>
<td class="filethumb">
{if !$file->isparent}
{if $editable}
<div{if !$file->isparent} class="icon-drag" id="drag:{$file->id}"{/if}>
<img src="{$file->icon}"{if !$file->isparent} title="{str tag=clickanddragtomovefile section=artefact.file arg1=$file->title}"{/if}>
<div class="icon-drag" id="drag:{$file->id}">
<img src="{$file->icon}" title="{str tag=clickanddragtomovefile section=artefact.file arg1=$file->title}">
</div>
{else}
<img src="{$file->icon}">
{/if}
{/if}
</td>
<td class="filename">
{assign var=displaytitle value=$file->title|str_shorten_text:34|safe}
{if $file->artefacttype == 'folder'}
<a href="{$querybase}folder={$file->id}{if $owner}&owner={$owner}{if $ownerid}&ownerid={$ownerid}{/if}{/if}" class="changefolder" title="{str tag=gotofolder section=artefact.file arg1=$displaytitle}">{$displaytitle}</a>
<a href="{$querybase}folder={$file->id}{if $owner}&owner={$owner}{if $ownerid}&ownerid={$ownerid}{/if}{/if}" class="changefolder" title="{str tag=gotofolder section=artefact.file arg1=$displaytitle}">{if !$file->isparent}{$displaytitle}{/if}</a>
{elseif !$publishable}
{$displaytitle}
{else}
......
......@@ -145,6 +145,11 @@ tr.parentfolder td {
background-color: #ddd !important;
font-style: italic;
}
tr.parentfolder td.filename a.changefolder {
height: 16px;
display: block;
background: url(../images/parentfolder.png) no-repeat left top;
}
/* new row */
.filelist tr.highlight-file td {
background-color: #fffcd8 !important;
......@@ -161,7 +166,7 @@ tr.folder td.filename {
tr.folderhover td {
background-color: #ffc;
}
tr.folderhover a {
tr.folderhover a, .foldernav a.folderhover {
text-decoration: none;
}
.icon-drag {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment