Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased
### Unreleased

### Added
- Added Trash button to delete section [#347](https://github.com/clowder-framework/clowder/issues/347)
- Add "when" parameter in a few GET API endpoints to enable pagination [#266](https://github.com/clowder-framework/clowder/issues/266)
- Extractors can now specify an extractor_key and an owner (email address) when sending a
registration or heartbeat to Clowder that will restrict use of that extractor to them.
Expand Down
25 changes: 25 additions & 0 deletions app/views/file.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ <h4>Sections</h4>
<th class="galleriaPosition">Position</th>
<th class="galleriaDescr">Description</th>
<th class="galleriaFindSimilar">Find</th>
<th class="galleriaDelete">Delete</th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -541,6 +542,9 @@ <h4>Sections</h4>
}
</td>
<td class="galleriaFindSimilar"><a href="@routes.Search.callSearchMultimediaIndexView(s.id)">Similar</a></td>
<td class="galleriaDelete">
<button class="btn btn-link" title="Delete the section" onclick="removeSection('@s.id')"><span class="glyphicon glyphicon-trash"></span></button>
</td>
</tr>
}
</tbody>
Expand Down Expand Up @@ -1167,6 +1171,27 @@ <h4>Tags</h4>

return false;
}

function removeSection(sectionId) {
var request = window.jsRoutes.api.Sections.delete(sectionId).ajax({
type: 'DELETE'
});

request.done(function (response, textStatus, jqXHR) {
console.log("Response " + textStatus);
location.reload();
});

request.fail(function (jqXHR, textStatus, errorThrown){
console.error("The following error occurred: " + textStatus, errorThrown);
var errMsg = "You must be logged in to remove a section from a file.";
if (!checkErrorAndRedirect(jqXHR, errMsg)) {
notify("The section was not removed from the file due to : " + errorThrown, "error");
}
});

return false;
}
//The removeTag code is almost identical to the code in tags.scala.html. Should be unified.
function removeTag() {
var tagId = $(this).attr("id");
Expand Down
8 changes: 6 additions & 2 deletions public/stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -760,11 +760,15 @@ table#sensorsListTable>thead>tr>th.headerSortDown {
}

#scrollTableGalleria .galleriaDescr {
width: 35%;
width: 30%;
}

#scrollTableGalleria .galleriaFindSimilar {
width: 20%;
width: 15%;
}

#scrollTableGalleria .galleriaDelete {
width: 10%;
}

#scrollTableGalleria thead {
Expand Down