Fix behaviour for logged-out users

Some of the edit buttons for fields in tasks were displayed for users
who were logged out. They could then try to edit things, only to get
a 401 or 500 error several steps later. This patch hides them. Task
titles were duplicated; this patch should fix that, too.

Change-Id: Iee2e69f7dcc6b1780726a9f4440b19c9503be023
This commit is contained in:
Zara 2016-09-09 18:22:11 +00:00
parent 64bbab44e1
commit 967d59c9dd
2 changed files with 7 additions and 8 deletions

View File

@ -327,7 +327,7 @@
</div>
<div ng-show="newTask.show" ng-include src="'/inline/new_task.html'"></div>
<button class="btn btn-default"
ng-show="!newTask.show"
ng-show="isLoggedIn && !newTask.show"
ng-click="newTask.show = !newTask.show">
<i class="fa fa-plus-circle"></i>
Affects other project
@ -425,15 +425,17 @@
placeholder="Enter project name">
</project-typeahead>
<button class="btn btn-xs btn-default"
ng-show="isLoggedIn"
ng-click="changingProject = !changingProject">
{{ changingProject ? 'Cancel' : 'Change project' }}
</button>
<button class="btn btn-xs btn-default"
ng-click="showAddWorklist(task)">
ng-click="showAddWorklist(task)"
ng-show="isLoggedIn">
Add to worklist
</button>
<button class="btn btn-xs btn-default"
ng-show="tasks.length > 1"
ng-show="tasks.length > 1 && isLoggedIn"
ng-click="removeTask(task, name, branchName)">
Delete
</button>
@ -479,7 +481,7 @@
</div>
</div>
</form>
<div class="row text-center" ng-show="!task.editing && !task.link">
<div class="row text-center" ng-show="!task.editing && !task.link && isLoggedIn">
<button class="btn btn-primary btn-xs"
ng-click="editNotes(task)">
<i class="fa fa-pencil"></i> Add notes
@ -488,6 +490,7 @@
</div>
<div class="col-xs-1" ng-show="!task.editing && task.link">
<button class="btn btn-primary btn-xs"
ng-show="isLoggedIn"
ng-click="editNotes(task)">
<i class="fa fa-pencil"></i> Edit
</button>

View File

@ -18,10 +18,6 @@
</em>
</a>
<span ng-if="!enabled && inputText">
{{inputText}}
</span>
<em class="text-muted"
ng-if="!inputText && !enabled">
{{emptyDisabledPrompt}}