Use ui-sref instead of ng-click (with $state.go).
For agenda item list and detail template.
This commit is contained in:
parent
ca9c946b6f
commit
8e3463b1df
@ -142,16 +142,6 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
|
|||||||
$scope.newDialog = function () {
|
$scope.newDialog = function () {
|
||||||
ngDialog.open(CustomslideForm.getDialog());
|
ngDialog.open(CustomslideForm.getDialog());
|
||||||
};
|
};
|
||||||
// open edit dialog
|
|
||||||
$scope.editDialog = function (item) {
|
|
||||||
$state.go(item.content_object.collection.replace('/','.')+'.detail.update',
|
|
||||||
{id: item.content_object.id});
|
|
||||||
};
|
|
||||||
// detail view of related item (content object)
|
|
||||||
$scope.open = function (item) {
|
|
||||||
$state.go(item.content_object.collection.replace('/','.')+'.detail',
|
|
||||||
{id: item.content_object.id});
|
|
||||||
};
|
|
||||||
// cancel QuickEdit mode
|
// cancel QuickEdit mode
|
||||||
$scope.cancelQuickEdit = function (item) {
|
$scope.cancelQuickEdit = function (item) {
|
||||||
// revert all changes by restore (refresh) original item object from server
|
// revert all changes by restore (refresh) original item object from server
|
||||||
@ -264,12 +254,6 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
|
|||||||
$scope.speakers = $filter('orderBy')(item.speakers, 'weight');
|
$scope.speakers = $filter('orderBy')(item.speakers, 'weight');
|
||||||
});
|
});
|
||||||
|
|
||||||
// go to detail view of related item (content object)
|
|
||||||
$scope.open = function (item) {
|
|
||||||
$state.go(item.content_object.collection.replace('/','.')+'.detail',
|
|
||||||
{id: item.content_object.id});
|
|
||||||
};
|
|
||||||
|
|
||||||
// close/open list of speakers of current item
|
// close/open list of speakers of current item
|
||||||
$scope.closeList = function (listClosed) {
|
$scope.closeList = function (listClosed) {
|
||||||
item.speaker_list_closed = listClosed;
|
item.speaker_list_closed = listClosed;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<i class="fa fa-angle-double-left fa-lg"></i>
|
<i class="fa fa-angle-double-left fa-lg"></i>
|
||||||
<translate>Agenda</translate>
|
<translate>Agenda</translate>
|
||||||
</a>
|
</a>
|
||||||
<a href="" ng-click="open(item)" class="btn btn-sm btn-default">
|
<a ui-sref="{{ item.content_object.collection.replace('/','.') }}.detail({id: item.content_object.id})" class="btn btn-sm btn-default">
|
||||||
<i class="fa fa-angle-double-left fa-lg"></i>
|
<i class="fa fa-angle-double-left fa-lg"></i>
|
||||||
{{ item.getContentResource().verboseName | translate }}
|
{{ item.getContentResource().verboseName | translate }}
|
||||||
</a>
|
</a>
|
||||||
|
@ -169,7 +169,7 @@
|
|||||||
<td ng-if="!item.quickEdit" ng-mouseover="item.hover=true" ng-mouseleave="item.hover=false"
|
<td ng-if="!item.quickEdit" ng-mouseover="item.hover=true" ng-mouseleave="item.hover=false"
|
||||||
style="padding-left: calc(8px + {{ item.parentCount }}*15px)">
|
style="padding-left: calc(8px + {{ item.parentCount }}*15px)">
|
||||||
<strong>
|
<strong>
|
||||||
<a ng-show="isAllowedToSeeOpenLink(item)" href="" ng-click="open(item)">
|
<a ui-sref="{{ item.content_object.collection.replace('/','.') }}.detail({id: item.content_object.id})" ng-show="isAllowedToSeeOpenLink(item)">
|
||||||
{{ item.getListViewTitle() }}
|
{{ item.getListViewTitle() }}
|
||||||
</a>
|
</a>
|
||||||
<span ng-hide="isAllowedToSeeOpenLink(item)">
|
<span ng-hide="isAllowedToSeeOpenLink(item)">
|
||||||
@ -183,7 +183,8 @@
|
|||||||
<div os-perms="agenda.can_see" class="hoverActions" ng-class="{'hiddenDiv': !item.hover}">
|
<div os-perms="agenda.can_see" class="hoverActions" ng-class="{'hiddenDiv': !item.hover}">
|
||||||
<a ui-sref="agenda.item.detail({id: item.id})" translate>List of speakers</a>
|
<a ui-sref="agenda.item.detail({id: item.id})" translate>List of speakers</a>
|
||||||
<span os-perms="agenda.can_manage"> |
|
<span os-perms="agenda.can_manage"> |
|
||||||
<a href="" ng-click="editDialog(item)" translate>Edit</a> |
|
<a ui-sref="{{ item.content_object.collection.replace('/','.') }}.detail.update({id: item.content_object.id})"
|
||||||
|
translate>Edit</a> |
|
||||||
<a href="" ng-click="item.quickEdit=true" translate>QuickEdit</a> |
|
<a href="" ng-click="item.quickEdit=true" translate>QuickEdit</a> |
|
||||||
<a href="" class="text-danger"
|
<a href="" class="text-danger"
|
||||||
ng-bootbox-confirm="{{ 'Are you sure you want to delete this entry?' | translate }}<br>
|
ng-bootbox-confirm="{{ 'Are you sure you want to delete this entry?' | translate }}<br>
|
||||||
@ -233,7 +234,8 @@
|
|||||||
<button ng-click="save(item)" class="btn btn-primary" translate>
|
<button ng-click="save(item)" class="btn btn-primary" translate>
|
||||||
Update
|
Update
|
||||||
</button>
|
</button>
|
||||||
<a href="" ng-click="editDialog(item)" class="pull-right"><translate>Edit ...</translate></a>
|
<a ui-sref="{{ item.content_object.collection.replace('/','.') }}.detail.update({id: item.content_object.id})"
|
||||||
|
class="pull-right"><translate>Edit ...</translate></a>
|
||||||
</div>
|
</div>
|
||||||
</table>
|
</table>
|
||||||
<uib-pagination ng-show="itemsFiltered.length > itemsPerPage" total-items="itemsFiltered.length" items-per-page="itemsPerPage" ng-model="currentPage"
|
<uib-pagination ng-show="itemsFiltered.length > itemsPerPage" total-items="itemsFiltered.length" items-per-page="itemsPerPage" ng-model="currentPage"
|
||||||
|
Loading…
Reference in New Issue
Block a user