Skip to content

Commit

Permalink
*8262* first cut at styling issues table of content
Browse files Browse the repository at this point in the history
  • Loading branch information
jnugent committed Jun 14, 2013
1 parent d611862 commit 9609aaf
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 66 deletions.
56 changes: 56 additions & 0 deletions styles/common.less
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,59 @@
color: #A0B0A0 !important;
border-color: #A0B0A0 !important;
}

div.tocArticle {
width: 100%;
}

div.tocArticle div.tocTitle {
text-align: left;
clear: both;
width: 85%;
}

div.tocArticle div.tocTitle a {
text-decoration: none;
}

div.tocArticle span.tocGalleys {
padding-left: 5px;
}

div.tocArticle span.tocGalleys a {
text-decoration: none;
background-color: #bdd6bd;
padding: 2px;
}

div.tocArticle div.tocAuthors {
float: left;
width: 85%;
padding-bottom: 5px;
font-style: italic;
}

div.tocArticle div.tocAuthors .tocGalleys {
font-style: normal;
}

div.tocArticle div.tocPages {
float: right;
width: 15%;
padding-bottom: 5px;
text-align: right;
}

.tocArticleCoverImage img {
border: 0;
float: left;
width: 100px;
margin: 0 1em 1em 0;
}

h4.tocSectionTitle {
clear: both;
border-bottom: 1px black dotted;
padding-bottom: 5px;
margin-bottom: 10px;
}
123 changes: 57 additions & 66 deletions templates/issue/issue.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,78 +6,69 @@
*
* Issue
*
*}
*}
{foreach name=sections from=$publishedArticles item=section key=sectionId}
{if $section.title}<h4 class="tocSectionTitle">{$section.title|escape}</h4>{/if}
{if $section.title}<h4 class="tocSectionTitle">{$section.title|escape}</h4>{/if}

{foreach from=$section.articles item=article}
{assign var=articlePath value=$article->getBestArticleId($currentJournal)}

<table class="tocArticle">
<tr>
{if $article->getLocalizedFileName() && $article->getLocalizedShowCoverPage() && !$article->getHideCoverPageToc($locale)}
<td rowspan="2">
<div class="tocArticleCoverImage">
<a href="{url page="article" op="view" path=$articlePath}" class="file">
<img src="{$coverPagePath|escape}{$article->getFileName($locale)|escape}"{if $article->getCoverPageAltText($locale) != ''} alt="{$article->getCoverPageAltText($locale)|escape}"{else} alt="{translate key="article.coverPage.altText"}"{/if}/></a></div>
</td>
{/if}
{call_hook name="Templates::Issue::Issue::ArticleCoverImage"}
{foreach from=$section.articles item=article}
{assign var=articlePath value=$article->getBestArticleId($currentJournal)}

{if $article->getLocalizedAbstract() == ""}
{assign var=hasAbstract value=0}
{else}
{assign var=hasAbstract value=1}
{/if}
<div class="tocArticle">
{if $article->getLocalizedFileName() && $article->getLocalizedShowCoverPage() && !$article->getHideCoverPageToc($locale)}
<div class="tocArticleCoverImage">
<a href="{url page="article" op="view" path=$articlePath}" class="file">
<img src="{$coverPagePath|escape}{$article->getFileName($locale)|escape}"{if $article->getCoverPageAltText($locale) != ''} alt="{$article->getCoverPageAltText($locale)|escape}"{else} alt="{translate key="article.coverPage.altText"}"{/if}/></a>
</div>
{/if}
{call_hook name="Templates::Issue::Issue::ArticleCoverImage"}

{assign var=articleId value=$article->getId()}
{if (!$subscriptionRequired || $article->getAccessStatus() == $smarty.const.ARTICLE_ACCESS_OPEN || $subscribedUser || $subscribedDomain || ($subscriptionExpiryPartial && $articleExpiryPartial.$articleId))}
{assign var=hasAccess value=1}
{else}
{assign var=hasAccess value=0}
{/if}
{if $article->getLocalizedAbstract() == ""}
{assign var=hasAbstract value=0}
{else}
{assign var=hasAbstract value=1}
{/if}

<td class="tocTitle">{if !$hasAccess || $hasAbstract}<a href="{url page="article" op="view" path=$articlePath}">{$article->getLocalizedTitle()|strip_unsafe_html}</a>{else}{$article->getLocalizedTitle()|strip_unsafe_html}{/if}</td>
<td class="tocGalleys">
{if $hasAccess || ($subscriptionRequired && $showGalleyLinks)}
{foreach from=$article->getGalleys() item=galley name=galleyList}
<a href="{url page="article" op="view" path=$articlePath|to_array:$galley->getBestGalleyId($currentJournal)}" class="file">{$galley->getGalleyLabel()|escape}</a>
{if $subscriptionRequired && $showGalleyLinks && $restrictOnlyPdf}
{if $article->getAccessStatus() == $smarty.const.ARTICLE_ACCESS_OPEN || !$galley->isPdfGalley()}
<img class="accessLogo" src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_open_medium.gif" alt="{translate key="article.accessLogoOpen.altText"}" />
{else}
<img class="accessLogo" src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_restricted_medium.gif" alt="{translate key="article.accessLogoRestricted.altText"}" />
{/if}
{/if}
{/foreach}
{if $subscriptionRequired && $showGalleyLinks && !$restrictOnlyPdf}
{if $article->getAccessStatus() == $smarty.const.ARTICLE_ACCESS_OPEN}
<img class="accessLogo" src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_open_medium.gif" alt="{translate key="article.accessLogoOpen.altText"}" />
{else}
<img class="accessLogo" src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_restricted_medium.gif" alt="{translate key="article.accessLogoRestricted.altText"}" />
{assign var=articleId value=$article->getId()}
{if (!$subscriptionRequired || $article->getAccessStatus() == $smarty.const.ARTICLE_ACCESS_OPEN || $subscribedUser || $subscribedDomain || ($subscriptionExpiryPartial && $articleExpiryPartial.$articleId))}
{assign var=hasAccess value=1}
{else}
{assign var=hasAccess value=0}
{/if}

<div class="tocTitle">{if !$hasAccess || $hasAbstract}<a href="{url page="article" op="view" path=$articlePath}">{$article->getLocalizedTitle()|strip_unsafe_html}</a>{else}{$article->getLocalizedTitle()|strip_unsafe_html}{/if}</div>
<div class="tocAuthors">
{if (!$section.hideAuthor && $article->getHideAuthor() == $smarty.const.AUTHOR_TOC_DEFAULT) || $article->getHideAuthor() == $smarty.const.AUTHOR_TOC_SHOW}
{foreach from=$article->getAuthors() item=author name=authorList}
{$author->getFullName()|escape}{if !$smarty.foreach.authorList.last},{/if}
{/foreach}
{/if}
{/if}
{/if}
</td>
</tr>
<tr>
<td class="tocAuthors">
{if (!$section.hideAuthor && $article->getHideAuthor() == $smarty.const.AUTHOR_TOC_DEFAULT) || $article->getHideAuthor() == $smarty.const.AUTHOR_TOC_SHOW}
{foreach from=$article->getAuthors() item=author name=authorList}
{$author->getFullName()|escape}{if !$smarty.foreach.authorList.last},{/if}
{/foreach}
{else}
&nbsp;
{/if}
</td>
<td class="tocPages">{$article->getPages()|escape}</td>
</tr>
</table>
{call_hook name="Templates::Issue::Issue::Article"}
{/foreach}

{if !$smarty.foreach.sections.last}
<div class="separator"></div>
{/if}
<span class="tocGalleys">
{if $hasAccess || ($subscriptionRequired && $showGalleyLinks)}
{foreach from=$article->getGalleys() item=galley name=galleyList}
<a href="{url page="article" op="view" path=$articlePath|to_array:$galley->getBestGalleyId($currentJournal)}" class="file">{$galley->getGalleyLabel()|escape}</a>
{if $subscriptionRequired && $showGalleyLinks && $restrictOnlyPdf}
{if $article->getAccessStatus() == $smarty.const.ARTICLE_ACCESS_OPEN || !$galley->isPdfGalley()}
<img class="accessLogo" src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_open_medium.gif" alt="{translate key="article.accessLogoOpen.altText"}" />
{else}
<img class="accessLogo" src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_restricted_medium.gif" alt="{translate key="article.accessLogoRestricted.altText"}" />
{/if}
{/if}
{/foreach}
{if $subscriptionRequired && $showGalleyLinks && !$restrictOnlyPdf}
{if $article->getAccessStatus() == $smarty.const.ARTICLE_ACCESS_OPEN}
<img class="accessLogo" src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_open_medium.gif" alt="{translate key="article.accessLogoOpen.altText"}" />
{else}
<img class="accessLogo" src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_restricted_medium.gif" alt="{translate key="article.accessLogoRestricted.altText"}" />
{/if}
{/if}
{/if}
</span>
</div>

<div class="tocPages">{$article->getPages()|escape}</div>
</div><br /><br />
{call_hook name="Templates::Issue::Issue::Article"}
{/foreach}
{/foreach}

0 comments on commit 9609aaf

Please sign in to comment.