Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Commit

Permalink
show the create page link on empty search results for those with edit…
Browse files Browse the repository at this point in the history
…ing rights (#32 & #26)
  • Loading branch information
garrett committed Jun 12, 2013
1 parent 47b3159 commit 2321f09
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Strapping.skin.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ public function execute() {
$userStateClass = "user-loggedout";
} ?>

<?php if ($wgGroupPermissions['*']['edit'] || $this->data['loggedin']) {
$userStateClass += " editable";
} else {
$userStateClass += " not-editable";
} ?>

<!-- content -->
<section id="content" class="mw-body container <?php echo $userStateClass; ?>">
<div id="top"></div>
Expand Down
14 changes: 13 additions & 1 deletion screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,19 @@ input, button, select, textarea {
}

.mw-search-createlink {
/* Redundant, if there's a page with containing the name anyway */
text-align: center;
}

.mw-search-createlink b {
font-weight: normal;
}

.mw-search-createlink a {
}

.not-editable .mw-search-createlink {
/* If there are no permissions to edit pages,
* do not display the create link on a no-results search */
display: none;
}

Expand Down

0 comments on commit 2321f09

Please sign in to comment.