Skip to content

Commit

Permalink
A number of updates to reflect upcoming changes to theme API
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWr committed Jun 11, 2016
1 parent 3c7ab19 commit 9642b31
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 233 deletions.
50 changes: 6 additions & 44 deletions BootstrapThreeThemePlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,13 @@
import('lib.pkp.classes.plugins.ThemePlugin');
class BootstrapThreeThemePlugin extends ThemePlugin {
/**
* Constructor
* Initialize the theme
*
* @return null
*/
function BootstrapThreeThemePlugin() {
parent::ThemePlugin();

HookRegistry::register('Templates::Common::Footer::PageFooter', array($this, 'printJavascript'));
}

/**
* Get the name of the settings file to be installed on new journal
* creation.
* @return string
*/
function getContextSpecificPluginSettingsFile() {
return $this->getPluginPath() . '/settings.xml';
}

/**
* Get the name of the settings file to be installed site-wide when
* OJS is installed.
* @return string
*/
function getInstallSitePluginSettingsFile() {
return $this->getPluginPath() . '/settings.xml';
public function init() {
$this->addStyle('bootstrap', 'styles/bootstrap.less');
$this->addScript('bootstrap', 'bootstrap/js/bootstrap.min.js');
}

/**
Expand All @@ -57,25 +40,4 @@ function getDisplayName() {
function getDescription() {
return __('plugins.themes.bootstrap3.description');
}

/**
* @see ThemePlugin::getLessStylesheet
*/
function getLessStylesheet() {
// Return any stylesheet in /styles to adopt that bootstrap wrapper
// @TODO select the stylesheet programmatically based on site setting
return 'styles/bootstrap.less';
}

/**
* Print JavaScript file into the footer
* @param $hookName string
* @param $args array
* @return boolean Normal hook handling conventions.
*/
function printJavascript() {
$request = Registry::get('request');
echo '<script src="' . $request->getBaseUrl() . '/' . $this->getPluginPath() . '/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>';
return false;
}
}
12 changes: 6 additions & 6 deletions bootstrap/less/glyphicons.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
// Import the fonts
@font-face {
font-family: 'Glyphicons Halflings';
src: url('{$baseUrl}/plugins/themes/bootstrap3/bootstrap/fonts/@{icon-font-name}.eot');
src: url('{$baseUrl}/plugins/themes/bootstrap3/bootstrap/fonts/@{icon-font-name}.eot?#iefix') format('embedded-opentype'),
url('{$baseUrl}/plugins/themes/bootstrap3/bootstrap/fonts/@{icon-font-name}.woff2') format('woff2'),
url('{$baseUrl}/plugins/themes/bootstrap3/bootstrap/fonts/@{icon-font-name}.woff') format('woff'),
url('{$baseUrl}/plugins/themes/bootstrap3/bootstrap/fonts/@{icon-font-name}.ttf') format('truetype'),
url('{$baseUrl}/plugins/themes/bootstrap3/bootstrap/fonts/@{icon-font-name}.svg#@{icon-font-svg-id}') format('svg');
src: url('@{base-url}/plugins/themes/bootstrap3/bootstrap/fonts/@{icon-font-name}.eot');
src: url('@{base-url}/plugins/themes/bootstrap3/bootstrap/fonts/@{icon-font-name}.eot?#iefix') format('embedded-opentype'),
url('@{base-url}/plugins/themes/bootstrap3/bootstrap/fonts/@{icon-font-name}.woff2') format('woff2'),
url('@{base-url}/plugins/themes/bootstrap3/bootstrap/fonts/@{icon-font-name}.woff') format('woff'),
url('@{base-url}/plugins/themes/bootstrap3/bootstrap/fonts/@{icon-font-name}.ttf') format('truetype'),
url('@{base-url}/plugins/themes/bootstrap3/bootstrap/fonts/@{icon-font-name}.svg#@{icon-font-svg-id}') format('svg');
}

// Catchall baseclass
Expand Down
20 changes: 0 additions & 20 deletions settings.xml

This file was deleted.

39 changes: 0 additions & 39 deletions templates/controllers/page/tasks.tpl

This file was deleted.

2 changes: 2 additions & 0 deletions templates/frontend/components/footer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
</footer>
</div><!-- pkp_structure_page -->

{load_script context="frontend" scripts=$scripts}

{call_hook name="Templates::Common::Footer::PageFooter"}
</body>
</html>
66 changes: 59 additions & 7 deletions templates/frontend/components/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,64 @@
{* Header *}
<header class="navbar navbar-default" id="headerNavigationContainer" role="banner">

{* User-specific login, settings and task management *}
{url|assign:fetchHeaderUrl router=$smarty.const.ROUTE_COMPONENT component="page.PageHandler" op="userNav" escape=false}
{load_url_in_div class="pkp_navigation_user_wrapper" id="navigationUserWrapper" url=$fetchHeaderUrl}
{* User profile, login, etc, navigation menu*}
<div class="container-fluid">
<div class="row">
<ul id="navigationUser" class="nav nav-pills tab-list pull-right" role="navigation" aria-label="{translate|escape key="common.navigation.user"}">
{if $isUserLoggedIn}
<li>
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" href="{url router=$smarty.const.ROUTE_PAGE page="submissions"}">
{$loggedInUsername|escape}
<span class="badge">
{$unreadNotificationCount}
</span>
</a>
<ul class="dropdown-menu dropdown-menu-right">
{if array_intersect(array(ROLE_ID_MANAGER, ROLE_ID_ASSISTANT, ROLE_ID_REVIEWER, ROLE_ID_AUTHOR), $userRoles)}
<li>
<a href="{url router=$smarty.const.ROUTE_PAGE page="submissions"}">
{translate key="navigation.dashboard"}
<span class="badge">
{$unreadNotificationCount}
</span>
</a>
</li>
{/if}
<li>
<a href="{url router=$smarty.const.ROUTE_PAGE page="user" op="profile"}">
{translate key="common.viewProfile"}
</a>
</li>
{if array_intersect(array(ROLE_ID_SITE_ADMIN), $userRoles)}
<li>
<a href="{if $multipleContexts}{url router=$smarty.const.ROUTE_PAGE context="index" page="admin" op="index"}{else}{url router=$smarty.const.ROUTE_PAGE page="admin" op="index"}{/if}">
{translate key="navigation.admin"}
</a>
</li>
{/if}
<li>
<a href="{url router=$smarty.const.ROUTE_PAGE page="login" op="signOut"}">
{translate key="user.logOut"}
</a>
</li>
{if $isUserLoggedInAs}
<li>
<a href="{url router=$smarty.const.ROUTE_PAGE page="login" op="signOutAsUser"}">
{translate key="user.logOutAs"} {$loggedInUsername|escape}
</a>
</li>
{/if}
</ul>
</li>
{else}
{if !$hideRegisterLink}
<li><a href="{url router=$smarty.const.ROUTE_PAGE page="user" op="register"}">{translate key="navigation.register"}</a></li>
{/if}
<li><a href="{url router=$smarty.const.ROUTE_PAGE page="login"}">{translate key="navigation.login"}</a></li>
{/if}
</ul>
</div><!-- .row -->
</div><!-- .container-fluid -->

<div class="container-fluid">

Expand Down Expand Up @@ -123,10 +178,7 @@
</header><!-- .pkp_structure_head -->

{* Wrapper for page content and sidebars *}
{if $isFullWidth}
{assign var=hasLeftSidebar value=0}
{/if}
<div class="pkp_structure_content{if $hasLeftSidebar} has_left_sidebar{/if} container">
<div class="pkp_structure_content container">

<script type="text/javascript">
// Attach the JS page handler to the main content wrapper.
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend/components/primaryNavMenu.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<ul class="dropdown-menu">
<li>
<a href="{url router=$smarty.const.ROUTE_PAGE page="about"}">
{translate key="about.aboutTheJournal"}
{translate key="about.aboutContext"}
</a>
</li>
<li>
Expand Down
8 changes: 4 additions & 4 deletions templates/frontend/pages/about.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
* @uses $sponsorNote string Description for sponsors section
* @uses $sponsors array List of sponsors of this journal
*}
{include file="frontend/components/header.tpl" pageTitle="about.aboutTheJournal"}
{include file="frontend/components/header.tpl" pageTitle="about.aboutContext"}

<div id="main-content" class="page page_about">

{include file="frontend/components/breadcrumbs.tpl" currentTitleKey="about.aboutTheJournal"}
{include file="frontend/components/breadcrumbs.tpl" currentTitleKey="about.aboutContext"}

{* Page Title *}
<div class="page-header">
<h1>{translate key="about.aboutTheJournal"}</h1>
<h1>{translate key="about.aboutContext"}</h1>
</div>
{* /Page Title *}

Expand All @@ -51,7 +51,7 @@
<div class="row">
<div class="col-md-12">
<h2 class="section-title">
{translate key="about.journalContact"}
{translate key="about.contact"}
</h2>

{if $mailingAddress}
Expand Down
7 changes: 2 additions & 5 deletions templates/frontend/pages/search.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@

{* Main Search Input *}
<h2 class="section-title pkp_screen_reader">
{translate key="search.searchAllCategories"}
{translate key="search.searchFor"}
</h2>
<div class="form-group">
{* Repeat the label text just so that screen readers have a clear
label/input relationship *}
<label class="pkp_screen_reader" for="query">
{translate key="search.searchAllCategories"}
{translate key="search.searchFor"}
</label>

<input type="text" id="query" name="query" value="{$query|escape}" class="query form-control" placeholder="{translate key="common.search"}">
Expand Down Expand Up @@ -103,9 +103,6 @@
{if $hasEmptyFilters}
{capture assign="emptyFilters"}
{if empty($authors) || empty($title) || empty($abstract) || empty($galleyFullText)}
<h3 class="section-title">
{translate key="search.searchCategories"}
</h3>
{include file="frontend/components/searchFilter.tpl" displayIf="emptyFilter" filterName="authors" filterValue=$authors key="search.author"}
{include file="frontend/components/searchFilter.tpl" displayIf="emptyFilter" filterName="title" filterValue=$title key="article.title"}
{include file="frontend/components/searchFilter.tpl" displayIf="emptyFilter" filterName="abstract" filterValue=$abstract key="search.abstract"}
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend/pages/userLogin.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

<p>
<button type="submit" class="btn btn-primary">{translate key="user.login"}</button>
{if !$hideRegisterLink}
{if !$disableUserReg}
{url|assign:registerUrl page="user" op="register" source=$source}
<a class="btn btn-default register-button" href="{$registerUrl}" role="button">{translate key="user.login.registerNewAccount"}</a>
{/if}
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend/pages/userLostPassword.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

<p>
<button type="submit" class="btn btn-primary">{translate key="user.login.resetPassword"}</button>
{if !$hideRegisterLink}
{if !$disableUserReg}
{url|assign:registerUrl page="user" op="register" source=$source}
<a class="btn btn-default register-button" href="{$registerUrl}" role="button">{translate key="user.login.registerNewAccount"}</a>
{/if}
Expand Down
4 changes: 0 additions & 4 deletions templates/frontend/pages/userRegister.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@

{include file="frontend/components/breadcrumbs.tpl" currentTitleKey="user.register"}

<p>
{translate key="user.register.completeForm"}
</p>

{if !$implicitAuth}
<p class="required_label">
{translate key="common.requiredField"}
Expand Down
37 changes: 0 additions & 37 deletions templates/frontend/pages/userRegisterSite.tpl

This file was deleted.

Loading

0 comments on commit 9642b31

Please sign in to comment.