forked from drugis/gemtc-web
-
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.
Merge branch 'develop' of github.com:drugis/gemtc-web into develop
- Loading branch information
Showing
46 changed files
with
1,113 additions
and
331 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<form id="edit-study-title-form" novalidate ng-submit="editTitle(title.new)"> | ||
<div class="grid-container"> | ||
<div class="grid-x"> | ||
<div class="cell"> | ||
<h3>Edit study title</h3> | ||
</div> | ||
<div class="cell"> | ||
<label>Study title</label> | ||
</div> | ||
<div class="cell large-6"> | ||
<input autofocus="true" type="text" ng-model="title.new" ng-change="checkTitle(title.new)"> | ||
</div> | ||
<div class="cell"> | ||
<i class="fa fa-exclamation-triangle"></i> | ||
<em>Changing the study title will delete all model results!</em> | ||
</div> | ||
<div class="cell alert"> | ||
<button ng-disabled="error" ng-click="editTitle(title.new)" class="button alert" type="button"> | ||
Edit | ||
</button> | ||
</div> | ||
<div class="cell alert" ng-if="error"> | ||
{{error}} | ||
</div> | ||
</div> | ||
</div> | ||
<button ng-click="cancel()" class="close-button" aria-label="Close reveal" type="button"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</form> |
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,47 @@ | ||
'use strict'; | ||
define(['lodash'], function(_) { | ||
var dependencies = [ | ||
'$scope', | ||
'$modalInstance', | ||
'studyTitle', | ||
'entries', | ||
'callback' | ||
]; | ||
var EditStudyTitleController = function( | ||
$scope, | ||
$modalInstance, | ||
studyTitle, | ||
entries, | ||
callback | ||
) { | ||
// functions | ||
$scope.cancel = $modalInstance.close; | ||
$scope.editTitle = editTitle; | ||
$scope.checkTitle = checkTitle; | ||
|
||
// init | ||
$scope.title = { | ||
new: studyTitle | ||
}; | ||
|
||
function checkTitle(newTitle) { | ||
if (newTitle === '') { | ||
$scope.error = 'Title is empty'; | ||
} else if (newTitle !== studyTitle && _.some(entries, ['study', newTitle])) { | ||
$scope.error = 'Study with that title already exists'; | ||
} else { | ||
$scope.error = undefined; | ||
} | ||
} | ||
|
||
function editTitle() { | ||
if ($scope.error) { | ||
return; | ||
} | ||
callback($scope.title.new); | ||
$modalInstance.close(); | ||
} | ||
|
||
}; | ||
return dependencies.concat(EditStudyTitleController); | ||
}); |
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,30 @@ | ||
<form id="edit-treatment-name-form" novalidate ng-submit="editName(name.new)"> | ||
<div class="grid-container"> | ||
<div class="grid-x"> | ||
<div class="cell"> | ||
<h3>Edit treatment name</h3> | ||
</div> | ||
<div class="cell"> | ||
<label>Treatment name</label> | ||
</div> | ||
<div class="cell large-6"> | ||
<input autofocus="true" type="text" ng-model="name.new" ng-change="checkName(name.new)"> | ||
</div> | ||
<div class="cell"> | ||
<i class="fa fa-exclamation-triangle"></i> | ||
<em> Changing the treatment name will delete all model results!</em> | ||
</div> | ||
<div class="cell"> | ||
<button ng-disabled="error" ng-click="editName(name.new)" class="button alert" type="button"> | ||
Edit | ||
</button> | ||
</div> | ||
<div class="cell alert" ng-if="error"> | ||
{{error}} | ||
</div> | ||
</div> | ||
</div> | ||
<button ng-click="cancel()" class="close-button" aria-label="Close reveal" type="button"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</form> |
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,47 @@ | ||
'use strict'; | ||
define(['lodash'], function(_) { | ||
var dependencies = [ | ||
'$scope', | ||
'$modalInstance', | ||
'name', | ||
'treatments', | ||
'callback' | ||
]; | ||
var EditTreatmentNameController = function( | ||
$scope, | ||
$modalInstance, | ||
name, | ||
treatments, | ||
callback | ||
) { | ||
// functions | ||
$scope.cancel = $modalInstance.close; | ||
$scope.editName = editName; | ||
$scope.checkName = checkName; | ||
|
||
// init | ||
$scope.name = { | ||
new: name | ||
}; | ||
|
||
function checkName(newName) { | ||
if (newName === '') { | ||
$scope.error = 'Name is empty'; | ||
} else if (newName !== name && _.some(treatments, ['name', newName])) { | ||
$scope.error = 'Study with that name already exists'; | ||
} else { | ||
$scope.error = undefined; | ||
} | ||
} | ||
|
||
function editName() { | ||
if ($scope.error) { | ||
return; | ||
} | ||
callback($scope.name.new); | ||
$modalInstance.close(); | ||
} | ||
|
||
}; | ||
return dependencies.concat(EditTreatmentNameController); | ||
}); |
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
Oops, something went wrong.