modify tag structure to avoid p and ul elements

This commit is contained in:
Tilman Kranz 2021-11-29 19:56:05 +01:00
parent 7c7685bee7
commit 6efb5ccf18
2 changed files with 22 additions and 18 deletions

View File

@ -132,13 +132,13 @@ class LinuxfooGitlab {
'</span>';
if($commits_count>0) {
$out .= '<ul class="commits">';
$out .= '<span class="commits" role="list">';
foreach($commits as $commit) {
$out .= '<li>'.self::format_commit($atts, $commit).'</li>';
$out .= '<span class="commit">'.self::format_commit($atts, $commit).'</span>';
}
$out .= '</ul>';
$out .= '</span>';
}
}
}
@ -171,32 +171,32 @@ class LinuxfooGitlab {
else {
if(count($releases)==0) {
$out .=
'<p class="releases">'.
'<span class="releases">'.
__('This project has currently no releases.', 'linuxfoo-gitlab').
'</p>';
'</span>';
}
elseif($atts['releases']=='latest') {
$out .=
'<p class="releases">'.
'<span class="releases">'.
__('Latest release', 'linuxfoo-gitlab').': '.
'<a href="'.$releases[0]->_links->self.'">'.$releases[0]->name.'</a>'.
'</p>';
'</span>';
}
elseif($atts['releases']=='all') {
$out .=
'<p class="releases">'.
'<span class="releases">'.
__('Releases', 'linuxfoo-gitlab').': '.
'</p>'.
'<ul class="releases">';
'</span>'.
'<span class="releases" role="list">';
foreach($releases as $release) {
$out .=
'<li>'.
'<span class="release">'.
'<a href="'.$release->_links->self.'">'.$release->name.'</a>'.
'</li>';
'</span>';
}
$out .= '</ul>';
$out .= '</span>';
}
}
}
@ -212,7 +212,7 @@ class LinuxfooGitlab {
static function show_project($atts, $content, $tag) {
global $post;
$out = '<div class="linuxfoo_gitlab">';
$out = '<span class="linuxfoo_gitlab">';
if(
is_null($atts['url']) ||
@ -255,7 +255,7 @@ class LinuxfooGitlab {
}
}
$out .= '</div>';
$out .= '</span>';
return $out;
}

View File

@ -1,13 +1,17 @@
.linuxfoo_gitlab {
display: block;
border: 1px dashed #8a8a8a;
border-radius: .5em;
padding: .25em .5em;
}
.linuxfoo_gitlab .commits {
.linuxfoo_gitlab .commits, .linuxfoo_gitlab .releases {
display: block;
margin: .25em 0 .25em 0;
}
.linuxfoo_gitlab .releases {
margin: .25em 0 .25em 0;
.linuxfoo_gitlab .commit, .linuxfoo_gitlab .release {
display: list-item;
list-style-type: square;
margin: 0 0 0 1em;
}
.linuxfoo_gitlab .project_header {
display: block;