Skip to content

Commit

Permalink
Rolling back project's interface
Browse files Browse the repository at this point in the history
  • Loading branch information
xirdneh committed Jan 17, 2017
1 parent 4169397 commit e173f96
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 99 deletions.
1 change: 0 additions & 1 deletion designsafe/apps/api/projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def post(self, request):
'sessionId': getattr(request.session, 'session_key', ''),
'operation': 'metadata_create',
'info': {'postData': post_data} })
'info': {'postData': post_data}})
p = Project(ag)
title = post_data.get('title')
award_number = post_data.get('awardNumber', '')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div class="modal-header">
<h3 class="modal-title">
{{ data.project.value.title }}<br>
<small>Manage Team Members</small>
<small>Add Collaborator</small>
</h3>
</div>
<div class="modal-body">
<div ng-if="data.busy">
<p class="lead">
<i class="fa fa-spinner fa-spin"></i>
Loading existing team members...
Loading existing collaborators...
</p>
</div>
<div ng-if="! data.busy && data.error">
Expand All @@ -18,46 +18,7 @@ <h3 class="modal-title">
</div>
<div ng-if="! (data.busy || data.error)">
<form>
<p>Remove current Co-Pis:</p>
<div class="form-group" ng-repeat="cur in form.curCoPis">
<div class="checkbox">
<label>
<input type="checkbox" ng-model="cur.remove" ng-disabled="! canManage(cur.user.username)">
<ds-user username="cur.user.username" format="name-email"></ds-user>
</label>
</div>
</div>

<div class="well well-sm">
<p>Add new Co-PI:</p>
<div class="form-group" ng-repeat="add in form.addCoPis">
<div class="row">
<div class="col-xs-8">
<input type="text" class="form-control" id="id_form_user" ng-model="add.user"
placeholder="Lookup user by name or email address"
autocomplete="off" uib-typeahead="user for user in searchUsers($viewValue)"
typeahead-loading="searching"
typeahead-no-results="noResults"
typeahead-input-formatter="formatSelection()"
typeahead-template-url="local/share_user_search_result.html"
>
</div>
<div class="col-xs-4">
<span class="text-muted" ng-show="searching"><i class="fa fa-spinner fa-spin"></i> Searching for users...</span>
<div ng-show="noResults">
<i class="fa fa-remove"></i> No users found.
</div>
</div>
</div>
</div>
<button class="btn btn-info btn-sm" ng-click="addAnotherCoPi()">
<i class="fa fa-plus"></i> Add another
</button>
</div>
</form>

<form>
<p>Remove current team members(s):</p>
<p>Remove current collaborator(s):</p>
<div class="form-group" ng-repeat="cur in form.curUsers">
<div class="checkbox">
<label>
Expand All @@ -69,7 +30,7 @@ <h3 class="modal-title">
</div>

<div class="well well-sm">
<p>Add new team member(s):</p>
<p>Add new collaborator(s):</p>
<div class="form-group" ng-repeat="add in form.addUsers">
<div class="row">
<div class="col-xs-8">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ <h3 class="modal-title">
</div>
<div class="modal-body">
<form>
<div class="pull-left" style="width:49%;">
<div class="form-group required">
<div class="form-group">
<label for="id_title">Project title</label>
<input type="text" required class="form-control" id="id_title" name="title" placeholder="Project title" ng-model="form.title" autofocus select-on-focus>

</div>
<div class="form-group required">
<div class="form-group">
<label for="id_pi">PI</label>
<input type="text" class="form-control" id="id_pi" ng-model="form.pi"
placeholder="Lookup PI by name or email address"
Expand All @@ -27,58 +26,10 @@ <h3 class="modal-title">
<i class="fa fa-remove"></i> No results.
</div>
<p class="help-block">
This value can be updated later on.
</p>
</div>
</div>
<div class="pull-right" style="width:49%">
<div class="form-group">
<label for="identifier-id">Project Identifier:</label>
<input type="text" class="form-control" id="identifier-id" ng-model="form.identifier" disabled/>
</div>
<div class="form-group">
<label for="award-number-id">Award Number:</label>
<input type="text" class="form-control" id="award-number-id" ng-model="form.awardNumber" />
</div>
</div>
<div style="clear:both;">
<div class="form-group required">
<label for="projecttype-id">Project Type:</label>
<select ng-options="projectType.label for projectType in projectTypes"
ng-model="form.projectType"
class="form-control"
id="projecttype-id"/>
</div>
<p class="help-block">
Your project is tailored based on Project Type choice.
If you cannot find the person you are looking for, simply leave this field
blank. You can edit the Project's details later.
</p>
</div>
<div style="clear:both;">
<div class="well well-sm">
<div ng-if="form.associatedProjects.length">
<p> Associated Project - Link to Project <p>
<div ng-repeat="associatedProject in form.associatedProjects">
<div>
<input type="checkbox" ng-model="associatedProject.delete" /><span> {{associatedProject.title}} </span> - <span> <a href="{{associatedProject.href}}">{{associatedProject.href}}</a> </span>
</div>
</div>
<p class="help-block">Check associated projects to delete.</p>
</div>
<p> Associated Project - Link to Project <p>
<div class="form-group" ng-repeat="associatedProject in form.associatedProjectsAdded">
<input class="form-control" value="{{associatedProject.title}}" style="width:40%; display:inline-block;" ng-model="associatedProject.title"/> - <input class="form-control" value="{{associatedProject.href}}" style="width:40%; display:inline-block;" ng-model="associatedProject.href"/>
</div>
<button class="btn btn-info btn-sm" ng-click="addAssociatedProject()">
<i class="fa fa-plus"></i> Add another
</button>
</div>
</div>
<div style="clear:both;">
<div class="form-group">
<label for="description-id">Description:</label>
<textarea class="form-control" id="description-id" ng-model="form.description" />
</div>
</div>
<div class="text-right" ng-if="!ui.busy">
<button class="btn btn-default" type="button" ng-click="cancel()">Cancel</button>
<button class="btn btn-primary" type="submit" ng-click="save($event)">Save Project</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,10 @@
awardNumber: $scope.form.awardNumber,
description: $scope.form.description
};
if ($scope.form.projectType.id !== 'undefined'){
if ($scope.form.projectType && $scope.form.projectType.id !== 'undefined'){
projectData.projectType = $scope.form.projectType.id;
}
if ($scope.form.uuid) {
if ($scope.form.uuid && $scope.form.uuid) {
projectData.uuid = $scope.form.uuid;
}
if (typeof $scope.form.associatedProjectsAdded !== 'undefined'){
Expand Down

0 comments on commit e173f96

Please sign in to comment.