forked from sillsdev/web-languageforge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
project management app with sfchecks report
This change moves the "archive project" feature from the projects list to the projectmanagement app. The sfchecks report available is called the "user engagement report". The projectmanagement app currently has two tabs: archive and reports. Reports could probably be moved to its own app or better place in the future
- Loading branch information
Showing
36 changed files
with
680 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<buildpath> | ||
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/> | ||
<buildpathentry excluding="build/|docs/|lib/|lib/CodeIgniter_2.1.3|lib/CodeIgniter_2.1.3/|output/|src/vendor/|test/lib/|test/lib/|test/lib/simpletest|test/lib/simpletest/|.git/|node_modules/|src/vendor/" kind="src" path=""/> | ||
<buildpathentry excluding="simpletest/" kind="src" path="test/lib"/> | ||
<buildpathentry kind="src" path="lib/CodeIgniter_2.1.3"/> | ||
<buildpathentry excluding="test/|docs/|extensions/" kind="src" path="test/lib/simpletest"/> | ||
<buildpathentry excluding="phpunit/" kind="src" path="src/vendor"/> | ||
<buildpathentry excluding=".git/|build/|docs/|lib/|node_modules/|output/|src/vendor/" kind="src" path=""/> | ||
</buildpath> |
22 changes: 22 additions & 0 deletions
22
src/angular-app/bellows/apps/projectmanagement/js/services.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
angular.module('projectManagement.services', ['jsonRpc']) | ||
|
||
.service('projectManagementService', ['jsonRpc', | ||
function(jsonRpc) { | ||
jsonRpc.connect('/api/sf'); | ||
|
||
this.getDto = function getDto(callback) { | ||
jsonRpc.call('project_management_dto', [], callback); | ||
}; | ||
|
||
this.archiveProjectAsOwner = function archiveProjectAsOwner(callback) { | ||
jsonRpc.call('project_archive_asOwner', [], callback); | ||
}; | ||
|
||
this.runReport = function runReport(reportName, params, callback) { | ||
params = params || []; | ||
jsonRpc.call('project_management_report_' + reportName, params, callback); | ||
}; | ||
|
||
}]); |
36 changes: 36 additions & 0 deletions
36
src/angular-app/bellows/apps/projectmanagement/ng-app.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<div class="content container" data-ng-cloak data-ng-controller="ProjectManagementCtrl"> | ||
<div id="sfchecks-hmenu" class="hdrnav"> | ||
<ul class="topNav"> | ||
<li class="here"><a href="/app/projects">My Projects</a></li> | ||
<li><a href="/app/activity">Activity</a></li> | ||
</ul> | ||
<br /> | ||
</div> | ||
<div style="padding-top:10px"> | ||
<sil-notices></sil-notices> | ||
|
||
<a class="btn" ng-href="{{project.appLink}}" data-tooltip="Back to the project" | ||
data-tooltip-placement="right"> | ||
<i class="icon-reply"></i>Back | ||
</a> | ||
<h2 style="font-weight:normal">{{project.projectName}} Project Management</h2> | ||
<tabset ng-show="dtoLoaded"> | ||
<tab heading="Reports"> | ||
<div ng-show="reports.length > 0"> | ||
<div> | ||
<select data-ng-model="report.currentId" data-ng-options="report.id as report.name for report in reports"><option value="">Select a Report...</option></select> | ||
<button style="position:relative; top:-5px" ng-show="report.output" class="btn" ng-click="runReport()">Run Again</button> | ||
</div> | ||
<pre ng-show="report.output" data-ng-bind="report.output"></pre> | ||
</div> | ||
<div ng-hide="reports.length > 0"> | ||
No reports are available at this time. | ||
</div> | ||
</tab> | ||
<tab heading="Archive"> | ||
<button class="btn" data-ng-disabled="actionInProgress" ng-click="archiveProject()">Archive this project</button> | ||
<div class="text-error">Warning: This action can only be undone by a site administrator (at this point)</div> | ||
</tab> | ||
</tabset> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
'use strict'; | ||
|
||
angular.module('projectmanagement', ['projectManagement.services', 'bellows.services', 'palaso.ui.listview', 'ui.bootstrap', 'palaso.ui.notice', 'palaso.ui.utils', 'wc.Directives']) | ||
.controller('ProjectManagementCtrl', ['$scope', 'projectService', 'projectManagementService', 'sessionService', 'silNoticeService', 'modalService', '$window', | ||
function($scope, projectService, appService, ss, notice, modalService, $window) { | ||
|
||
$scope.project = ss.session.project; | ||
$scope.actionInProgress = false; | ||
$scope.report = { | ||
output: '', | ||
currentId: '' | ||
}; | ||
$scope.reportOutput = ''; | ||
|
||
$scope.loadDto = function loadDto() { | ||
appService.getDto(function(result) { | ||
if (result.ok) { | ||
$scope.reports = result.data.reports; | ||
$scope.dtoLoaded = true; | ||
} | ||
}); | ||
}; | ||
$scope.loadDto(); | ||
|
||
$scope.$watch('report.currentId', function(reportId) { | ||
$scope.runReport(); | ||
}); | ||
|
||
$scope.runReport = function runReport() { | ||
if ($scope.report.currentId) { | ||
$scope.report.output = 'Running Report...'; | ||
appService.runReport($scope.report.currentId, [], function(result) { | ||
if (result.ok) { | ||
$scope.report.output = result.data.output.replace(/\\n/g,"\n"); | ||
} | ||
}); | ||
} else { | ||
$scope.report.output = ''; | ||
} | ||
}; | ||
|
||
// Archive the project | ||
$scope.archiveProject = function() { | ||
var message = "Are you sure you want to archive this project?"; | ||
var modalOptions = { | ||
closeButtonText: 'Cancel', | ||
actionButtonText: 'Archive', | ||
headerText: 'Archive Project?', | ||
bodyText: message | ||
}; | ||
modalService.showModal({}, modalOptions).then(function (result) { | ||
$scope.actionInProgress = true; | ||
var archiveFunction; | ||
if (ss.hasSiteRight(ss.domain.PROJECTS, ss.operation.ARCHIVE)) { | ||
archiveFunction = projectService.archiveAsAdmin; | ||
} else { | ||
archiveFunction = appService.archiveProjectAsOwner; | ||
} | ||
archiveFunction(function(result) { | ||
if (result.ok) { | ||
notice.push(notice.SUCCESS, "The project was archived successfully"); | ||
$window.location.href = '/app/projects'; | ||
} else { | ||
$scope.actionInProgress = false; | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
|
||
}]) | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
166 changes: 89 additions & 77 deletions
166
src/angular-app/scriptureforge/sfchecks/partials/project.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,98 @@ | ||
<div data-ng-show="finishedLoading"> | ||
<h2 style="font-weight:normal">{{project.name}} Dashboard</h2> | ||
<div class="notices"> | ||
<alert data-ng-repeat="message in messages" type="info" close="markMessageRead(message.id)"><b>{{message.subject}}</b><br /><span data-ng-bind-html="message.content"></span></alert> | ||
</div> | ||
<form data-ng-show="rights.showControlBar" class="control-bar form-inline"> | ||
<a id="projectSettingsButton" data-ng-show="rights.edit" class="btn pull-right" href="{{project.url}}/settings"><i class="icon-cog icon-large" data-tooltip="Project Settings"></i></a> | ||
<button data-ng-disabled="selected.length == 0" data-ng-show="rights.archive" class="btn" data-ng-click="archiveTexts()"><i class="icon-archive icon-large" style="color:black"></i>Archive Texts</button> | ||
<button data-ng-show="rights.create" class="btn" data-ng-click="newTextCollapsed = !newTextCollapsed"><i class="icon-plus"></i>Add New Text</button> | ||
</form> | ||
<div class="new-item" data-collapse="newTextCollapsed"> | ||
<form class="well" name="newTextForm"> | ||
<fieldset class="span4"> | ||
<table class="tableform"> | ||
<tr> | ||
<td> | ||
<label>Title</label> | ||
<input required data-ng-model="title" type="text" placeholder="Title"/> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<label>Text</label> | ||
<textarea textdrop data-ng-model="content" rows="4" placeholder="Paste the USX text here"></textarea> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<a data-ng-click="toggleRangeSelector()">Select limited verse range</a> | ||
</td> | ||
</tr> | ||
<h2 style="font-weight:normal">{{project.name}} Dashboard</h2> | ||
<div class="notices"> | ||
<alert data-ng-repeat="message in messages" type="info" close="markMessageRead(message.id)"><b>{{message.subject}}</b><br /><span data-ng-bind-html="message.content"></span></alert> | ||
</div> | ||
<div class="btn-group pull-right" data-ng-show="rights.edit"> | ||
<a class="btn dropdown-toggle" | ||
data-toggle="dropdown" | ||
data-tooltip-placement="right" | ||
data-tooltip="Settings" href="#"> | ||
<i class="icon-cog icon-large"></i> | ||
<span class="caret"></span></a> | ||
<ul class="dropdown-menu"> | ||
<li><a href="#/settings">Project Settings</a></li> | ||
<li><a href="/app/projectmanagement/{{project.id}}">Manage Project</a></li> | ||
<!-- <li><a ng-href="/app/usermanagement/{{project.id}}" translate="User Management"></a></li> --> | ||
</ul> | ||
</div> | ||
<form data-ng-show="rights.showControlBar" class="control-bar form-inline"> | ||
<button data-ng-disabled="selected.length == 0" data-ng-show="rights.archive" class="btn" data-ng-click="archiveTexts()"><i class="icon-archive icon-large" style="color:black"></i>Archive Texts</button> | ||
<button data-ng-show="rights.create" class="btn" data-ng-click="newTextCollapsed = !newTextCollapsed"><i class="icon-plus"></i>Add New Text</button> | ||
</form> | ||
<div class="new-item" data-collapse="newTextCollapsed"> | ||
<form class="well" name="newTextForm"> | ||
<fieldset class="span4"> | ||
<table class="tableform"> | ||
<tr> | ||
<td> | ||
<label>Title</label> | ||
<input required data-ng-model="title" type="text" placeholder="Title"/> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<label>Text</label> | ||
<textarea textdrop data-ng-model="content" rows="4" placeholder="Paste the USX text here"></textarea> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<a data-ng-click="toggleRangeSelector()">Select limited verse range</a> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<span class="text-info"><a href="/sfchecks_usersguide#exportusx" target="_blank">How can I export a USX file from ParaTExt?</a></span> | ||
</td> | ||
</tr> | ||
</table> | ||
<div data-collapse="rangeSelectorCollapsed"> | ||
<table> | ||
<tr> | ||
<td>From</td> | ||
<td><input type="number" data-ng-model="startCh" min="1" placeholder="Chap." style="width: 4em; text-align: right"></input> : <input type="number" data-ng-model="startVs" min="1" placeholder="Verse" style="width: 4em"></input></td> | ||
<td><a data-ng-click="startCh = ''; startVs = ''" class="btn-link">reset</a></td> | ||
</tr> | ||
<tr> | ||
<td>To</td> | ||
<td><input type="number" data-ng-model="endCh" min="1" placeholder="Chap." style="width: 4em; text-align: right"></input> : <input type="number" data-ng-model="endVs" min="1" placeholder="Verse" style="width: 4em"></input></td> | ||
<td><a data-ng-click="endCh = ''; endVs = ''" class="btn-link">reset</a></td> | ||
</tr> | ||
</table> | ||
</div> | ||
<button type="submit" class="btn" data-ng-disabled="newTextForm.$invalid" data-ng-click="addText(); newTextCollapsed = true"><i class="icon-ok"></i>Save</button> | ||
</fieldset> | ||
<fieldset class="span4"> | ||
<div class="drop-box" data-ng-file-drop="onUsxFile($files)" data-ng-file-drop-available="dropSupported=true"> | ||
<h4>Or drop a USX file here</h4> | ||
<br/> | ||
<p>or if you prefer...</p> | ||
<input type="button" class="btn" value="Browse..." onclick="javascript:document.getElementById('usxfile').click();"> | ||
<input id="usxfile" type="file" style="display:none;" data-ng-file-select="onUsxFile($files)"> | ||
</div> | ||
<div data-ng-show="!dropSupported">HTML5 Drop File is not supported on this browser</div> | ||
</fieldset> | ||
<div style="clear: left"></div> | ||
</form> | ||
</div> | ||
<hr /> | ||
<listview hide-if-empty="true" items="texts" visible-items="visibleTexts" select=""> | ||
<div data-ng-repeat="text in visibleTexts" class="details-row"> | ||
<ul class="inline" data-ng-class="{active: isSelected(text)}"> | ||
<li data-ng-show="rights.archive" ><input type="checkbox" data-ng-checked="isSelected(text)" data-ng-click="updateSelection($event, text)" /></li> | ||
<li> | ||
<a class="span5" href="{{text.url}}"><span class="larger-text">{{text.title}}</span></a> | ||
</li> | ||
<li><a href="{{text.url}}"> | ||
<div class="attention-block"> | ||
<span class="subtitle">{{text.questionCount}} questions</span> | ||
</table> | ||
<div data-collapse="rangeSelectorCollapsed"> | ||
<table> | ||
<tr> | ||
<td>From</td> | ||
<td><input type="number" data-ng-model="startCh" min="1" placeholder="Chap." style="width: 4em; text-align: right"></input> : <input type="number" data-ng-model="startVs" min="1" placeholder="Verse" style="width: 4em"></input></td> | ||
<td><a data-ng-click="startCh = ''; startVs = ''" class="btn-link">reset</a></td> | ||
</tr> | ||
<tr> | ||
<td>To</td> | ||
<td><input type="number" data-ng-model="endCh" min="1" placeholder="Chap." style="width: 4em; text-align: right"></input> : <input type="number" data-ng-model="endVs" min="1" placeholder="Verse" style="width: 4em"></input></td> | ||
<td><a data-ng-click="endCh = ''; endVs = ''" class="btn-link">reset</a></td> | ||
</tr> | ||
</table> | ||
</div> | ||
</a></li> | ||
<li><span class="span2">{{text.responseCount}} responses</span></li> | ||
<li class="muted"><small>Added {{text.dateCreated | relativetime}}</small></li> | ||
</ul> | ||
<hr /> | ||
<button type="submit" class="btn" data-ng-disabled="newTextForm.$invalid" data-ng-click="addText(); newTextCollapsed = true"><i class="icon-ok"></i>Save</button> | ||
</fieldset> | ||
<fieldset class="span4"> | ||
<div class="drop-box" data-ng-file-drop="onUsxFile($files)" data-ng-file-drop-available="dropSupported=true"> | ||
<h4>Or drop a USX file here</h4> | ||
<br/> | ||
<p>or if you prefer...</p> | ||
<input type="button" class="btn" value="Browse..." onclick="javascript:document.getElementById('usxfile').click();"> | ||
<input id="usxfile" type="file" style="display:none;" data-ng-file-select="onUsxFile($files)"> | ||
</div> | ||
<div data-ng-show="!dropSupported">HTML5 Drop File is not supported on this browser</div> | ||
</fieldset> | ||
<div style="clear: left"></div> | ||
</form> | ||
</div> | ||
</listview> | ||
<hr /> | ||
<listview hide-if-empty="true" items="texts" visible-items="visibleTexts" select=""> | ||
<div data-ng-repeat="text in visibleTexts" class="details-row"> | ||
<ul class="inline" data-ng-class="{active: isSelected(text)}"> | ||
<li data-ng-show="rights.archive" ><input type="checkbox" data-ng-checked="isSelected(text)" data-ng-click="updateSelection($event, text)" /></li> | ||
<li> | ||
<a class="span5" href="{{text.url}}"><span class="larger-text">{{text.title}}</span></a> | ||
</li> | ||
<li><a href="{{text.url}}"> | ||
<div class="attention-block"> | ||
<span class="subtitle">{{text.questionCount}} questions</span> | ||
</div> | ||
</a></li> | ||
<li><span class="span2">{{text.responseCount}} responses</span></li> | ||
<li class="muted"><small>Added {{text.dateCreated | relativetime}}</small></li> | ||
</ul> | ||
<hr /> | ||
</div> | ||
</listview> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.