Commit 7997eed7 authored by Cecilia Vela's avatar Cecilia Vela Committed by Robert Lyon
Browse files

Bug 1566606: Added control to hide button

For 'Add to watchlist and Report' options when the user is the author
of the page.

Needed to fix up behat test due to a user not being able to add their
own page to watchlist anymore

Change-Id: I3d76fadd1a15a03f71e6eede3bd4c7bab4629c44
parent 61448e52
......@@ -48,7 +48,7 @@
</a>
{/if}
{if $LOGGEDIN}
{if $LOGGEDIN && !$userisowner}
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="icon icon-ellipsis-h icon-lg" role="presentation" aria-hidden="true"></span>
<span class="sr-only">{str tag="more..."}</span>
......
......@@ -428,6 +428,8 @@ if ($titletext !== $title) {
$smarty->assign('title', $title);
}
$smarty->assign('userisowner', ($owner && $owner == $USER->get('id')));
$smarty->display('view/view.tpl');
mahara_log('views', "$viewid"); // Log view visits
......@@ -6,35 +6,30 @@ So I can access them from my dashboard
Background:
Given the following "users" exist:
| username | password | email | firstname | lastname | institution | authname | role |
| userA | Kupuhipa1 | test01@example.com | Pete | Mc | mahara | internal | member |
| username | password | email | firstname | lastname | institution | authname | role |
| userA | Kupuhipa1 | test01@example.com | Pete | Mc | mahara | internal | member |
And the following "pages" exist:
| title | description| ownertype | ownername |
| A's Page 01 | UserA's page 01 | user | userA |
| A's Page 02 | UserA's page 02 | user | userA |
And the following "permissions" exist:
| title | accesstype |
| A's Page 01 | public |
Scenario: Viewing a list of pages I watch from the dashboard (Bug 1444784)
Given I log in as "admin" with password "Kupuhipa1"
When I am on homepage
Then I should see "Watched pages"
And I should see "There are no pages on your watchlist."
Scenario: Viewing last updated time on watchlist items (Bug 1444784)
Given I log in as "admin" with password "Kupuhipa1"
And I follow "Portfolio"
And I press "Create page"
And I fill in the following:
| Page title | Test view |
And I press "Save"
And I display the page
#FOLLOW THE DROP DOWN TOGGLE
# Viewing last updated time on watchlist items (Bug 1444784)
And I follow "A's Page 01"
And I press "More..."
And I follow "Add page to watchlist"
And I should see "This page has been added to your watchlist."
# Creating pages that aren't watched
And the following "pages" exist:
| title | description| ownertype | ownername |
| D's Page 01 | UserD's page 01 | user | userA |
| D's Page 02 | UserD's page 02 | user | userA |
| A's Page 01 | UserA's page 01 | user | userA |
| B's Page 02 | UserB's page 02 | user | userA |
And I am on homepage
Then I should not see "D's Page 01"
And I should see "Admin User" in the "ul#watchlistblock" "css_element"
# Check we can see watched page and not an un-watched page
And I am on homepage
Then I should not see "A's Page 02"
And I should see "A's Page 01" in the "ul#watchlistblock" "css_element"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment