Skip to content
Open
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
1 change: 1 addition & 0 deletions Controller/Wizard/EditorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public function displayAction(Path $path)

return array (
'_resource' => $path,
'workspace' => $path->getWorkspace(),
'resourceIcons' => $resourceIcons,
);
}
Expand Down
1 change: 1 addition & 0 deletions Controller/Wizard/PlayerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function displayAction(Path $path)

return array (
'_resource' => $path,
'workspace' => $path->getWorkspace(),
'userProgression' => $this->pathManager->getUserProgression($path),
'resourceIcons' => $resourceIcons,
'editEnabled' => $this->pathManager->isAllow('EDIT', $path),
Expand Down
42 changes: 35 additions & 7 deletions Entity/Step.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,9 @@ public function getName()
{
if (!empty($this->activity)) {
return $this->activity->getResourceNode()->getName();
} else {
return '';
}

return '';
}

/**
Expand All @@ -338,9 +338,35 @@ public function getDescription()
{
if (!empty($this->activity) && ' ' != $this->activity->getDescription()) {
return $this->activity->getDescription();
} else {
return '';
}

return '';
}

/**
* Wrapper to access ResourceNode accessibleFrom property
* @return \DateTime
*/
public function getAccessibleFrom()
{
if (!empty($this->activity)) {
return $this->activity->getResourceNode()->getAccessibleFrom();
}

return null;
}

/**
* Wrapper to access ResourceNode accessibleUntil property
* @return \DateTime
*/
public function getAccessibleUntil()
{
if (!empty($this->activity)) {
return $this->activity->getResourceNode()->getAccessibleUntil();
}

return null;
}

/**
Expand Down Expand Up @@ -509,10 +535,10 @@ public function jsonSerialize()
{
// Initialize data array
$jsonArray = array (
'id' => $this->id, // A local ID for the step in the path (reuse step ID)
'resourceId' => $this->id, // The real ID of the Step into the DB
'id' => $this->getId(), // A local ID for the step in the path (reuse step ID)
'resourceId' => $this->getId(), // The real ID of the Step into the DB
'activityId' => null,
'lvl' => $this->lvl, // The depth of the step in the path structure
'lvl' => $this->getLvl(), // The depth of the step in the path structure
'name' => $this->getName(), // The name of the linked Activity (used as Step name)
'description' => $this->getDescription(), // The description of the linked Activity (used as Step description)
'primaryResource' => array (),
Expand All @@ -523,6 +549,8 @@ public function jsonSerialize()
'who' => null,
'where' => null,
'duration' => null, // Duration in seconds
'accessibleFrom' => $accessibleFrom instanceof \DateTime ? $accessibleFrom->format('Y-m-d H:i:s') : null,
'accessibleUntil' => $accessibleUntil instanceof \DateTime ? $accessibleUntil->format('Y-m-d H:i:s') : null,
'evaluationType' => null, // automatic/manual
);

Expand Down
2 changes: 1 addition & 1 deletion Resources/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugin:
is_exportable: true
icon: res_file.png
actions:
- name: administrate
- name: path_administrate
menu_name: administrate

widgets:
Expand Down
17 changes: 16 additions & 1 deletion Resources/public/js/Path/Controller/PathBaseCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ var PathBaseCtrl = function PathBaseCtrl($window, $route, $routeParams, PathServ

this.currentStep = $routeParams;

this.summaryState = this.pathService.getSummaryState();

//triggering of promise
this.pathService.userteampromise(this.id);

Expand All @@ -38,4 +40,17 @@ PathBaseCtrl.prototype.path = {};
/**
* Current step ID (used to generate edit and preview routes)
*/
PathBaseCtrl.prototype.currentStep = {};
PathBaseCtrl.prototype.currentStep = {};

/**
* Current state of the summary
* @type {object}
*/
PathBaseCtrl.prototype.summaryState = {};

/**
* Allow toggle Summary
*/
PathBaseCtrl.prototype.toggleSummary = function toggleSummary() {
this.pathService.toggleSummaryState();
};
17 changes: 11 additions & 6 deletions Resources/public/js/Path/Partial/edit.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
<div class="path-form">
<!-- Summary of the Path-->
<path-summary-edit data-title="pathEditCtrl.path.name"></path-summary-edit>

<!-- Form of the Path -->
<form action="#" role="form" class="form-horizontal" method="post" name="pathform">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="panel panel-default">
<!--<div class="panel-heading">
<h3 class="panel-title">{{ pathEditCtrl.path.name }}</h3>
</div>-->

<nav class="navbar navbar-default navbar-static-top" role="navigation">
<ul class="nav navbar-nav navbar-left">
<!-- Path summary -->
<li data-ng-class="{ 'active': pathEditCtrl.summaryState.opened }">
<a href="" data-ng-click="pathEditCtrl.toggleSummary()" data-placement="top" data-toggle="tooltip" data-original-title="{{ 'toggle_summary'|trans:{}:'path_wizards' }}">
<span class="fa fa-sitemap"></span>
<span class="sr-only">{{ 'toggle_summary'|trans:{}:'path_wizards' }}</span>
</a>
</li>

<!-- Undo from history button -->
<li data-ng-class="{ 'disabled': pathEditCtrl.historyDisabled.undo }">
<a href="" data-ng-click="pathEditCtrl.undo()" data-placement="bottom" data-toggle="tooltip" data-original-title="{{ 'undo'|trans:{}:'path_wizards' }}">
Expand Down Expand Up @@ -47,7 +52,7 @@ <h3 class="panel-title">{{ pathEditCtrl.path.name }}</h3>
<!-- Preview button -->
<li data-ng-class="{ 'disabled': !pathEditCtrl.published }">
<a href="" data-ng-click="pathEditCtrl.preview()">
<span class="fa fa-eye"></span> {{ 'preview'|trans:{}:'path_wizards' }}
<span class="fa fa-sign-out"></span> {{ 'preview'|trans:{}:'path_wizards' }}
</a>
</li>
</ul>
Expand Down Expand Up @@ -124,7 +129,7 @@ <h3 class="panel-title">{{ pathEditCtrl.path.name }}</h3>
</div>

<!-- Breadcrumbs -->
<path-navigation-edit data-ng-if="pathEditCtrl.path.breadcrumbs"></path-navigation-edit>
<path-navigation data-ng-if="pathEditCtrl.path.breadcrumbs"></path-navigation>

<!-- Display current step -->
<div data-ng-view=""></div>
Expand Down
38 changes: 26 additions & 12 deletions Resources/public/js/Path/Partial/show.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,34 @@
<!-- Summary of the Path-->
<path-summary-show data-title="pathShowCtrl.path.name" data-ng-if="pathShowCtrl.path.steps.length !== 0"></path-summary-show>

<div class="row">
<p class="navbar-text navbar-right">
<!-- User messages -->
<alert-box></alert-box>
</p>
</div>
<div class="path-header">
<h1 class="h2" style="margin-top: 0;">
<!-- Toggle summary button -->
<button type="button" role="button" style="margin-right: 5px;" class="btn btn-sm btn-default" data-ng-click="pathShowCtrl.toggleSummary()" data-placement="top" data-toggle="tooltip" data-original-title="{{ 'toggle_summary'|trans:{}:'path_wizards' }}" data-ng-class="{ 'active': pathShowCtrl.summaryState.opened }">
<span class="fa fa-sitemap"></span>
<span class="sr-only">{{ 'toggle_summary'|trans:{}:'path_wizards' }}</span>
</button>

<!-- Breadcrumbs -->
<path-navigation data-ng-if="pathShowCtrl.path.breadcrumbs"></path-navigation>
{{ pathShowCtrl.path.name }}

<div class="pull-right">
<button type="button" role="button" class="btn btn-sm btn-primary btn-path-edit" data-ng-if="pathShowCtrl.path.steps.length !== 0 && pathShowCtrl.editEnabled" data-ng-click="pathShowCtrl.edit()">
<span class="fa fa-fw fa-pencil"></span>
{{ 'edit'|trans:{}:'path_wizards' }}
</button>
</div>
</h1>

<button type="button" class="btn btn-primary btn-path-edit pull-right" data-ng-if="pathShowCtrl.path.steps.length !== 0 && pathShowCtrl.editEnabled" data-ng-click="pathShowCtrl.edit()">
<span class="fa fa-pencil"></span>
{{ 'edit'|trans:{}:'path_wizards' }}
</button>
<div class="row">
<p class="navbar-text navbar-right">
<!-- User messages -->
<alert-box></alert-box>
</p>
</div>

<!-- Breadcrumbs -->
<path-navigation data-ng-if="pathShowCtrl.path.breadcrumbs && pathShowCtrl.path.steps.length !== 0"></path-navigation>
</div>

<!-- Current step -->
<div data-ng-view="" data-ng-if="pathShowCtrl.path.steps.length !== 0"></div>
Expand Down
2 changes: 2 additions & 0 deletions Resources/public/js/Path/Service/PathService.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@
terminated = recursiveLoop(currentStep, currentStep.children[i]);
}
}

return terminated;
}

Expand Down Expand Up @@ -610,6 +611,7 @@
}
}
}

return deleted;
});
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
/**
* Class constructor
* @returns {PathNavigationBaseCtrl}
* @returns {PathNavigationCtrl}
* @constructor
*/
var PathNavigationBaseCtrl = function PathNavigationBaseCtrl($routeParams, $scope, PathService) {
var PathNavigationCtrl = function PathNavigationCtrl($routeParams, $scope, PathService) {
this.pathService = PathService;

this.current = $routeParams;

this.summaryState = this.pathService.getSummaryState();

// Watch the route changes
$scope.$watch(function watchCurrentRoute() {
return this.current;
Expand All @@ -27,30 +25,24 @@ var PathNavigationBaseCtrl = function PathNavigationBaseCtrl($routeParams, $scop
* Current matched route
* @type {object}
*/
PathNavigationBaseCtrl.prototype.current = {};
PathNavigationCtrl.prototype.current = {};

/**
* Current displayed step
* @type {object}
*/
PathNavigationBaseCtrl.prototype.step = {};
PathNavigationCtrl.prototype.step = {};

/**
* Parents of the current step
* @type {object}
*/
PathNavigationBaseCtrl.prototype.parents = {};

/**
* Current state of the summary
* @type {object}
*/
PathNavigationBaseCtrl.prototype.summaryState = {};
PathNavigationCtrl.prototype.parents = {};

/**
* Reload the Step from route params
*/
PathNavigationBaseCtrl.prototype.reloadStep = function reloadStep() {
PathNavigationCtrl.prototype.reloadStep = function reloadStep() {
this.step = null;

// Get step
Expand All @@ -66,11 +58,4 @@ PathNavigationBaseCtrl.prototype.reloadStep = function reloadStep() {
if (angular.isDefined(this.step) && angular.isObject(this.step)) {
this.parents = this.pathService.getParents(this.step);
}
};

/**
* Allow toggle Summary from the current step
*/
PathNavigationBaseCtrl.prototype.toggleSummary = function toggleSummary() {
this.pathService.toggleSummaryState();
};

This file was deleted.

Loading