Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

views: make tab elements wrap to new line #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/components/tabarrow.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<template>
<div class="arrow">
<svg viewBox="0 0 15 15">
<path fill="none" stroke="#9d9d9d" d="M4.32.5l6.247 6.942L4.32 14.5"></path>
<div class="pr-4">
<svg class="arrow inline-block" viewBox="0 0 15 15">
<path
fill="none"
stroke="#9d9d9d"
d="M4.32.5l6.247 6.942L4.32 14.5"
></path>
</svg>
</div>
</template>
Expand All @@ -15,9 +19,5 @@ export default {
<style scoped lang="scss">
.arrow {
width: 1.2em;
height: 1.4em;
align-items: center;
position: relative;
top: 0.1rem;
}
</style>
</style>
8 changes: 4 additions & 4 deletions src/css/tailwind.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@
}

.tab {
@apply flex border-b-2;
@apply flex;
}

.tab-element {
@apply px-4 -m-2px border-b-2;
@apply pr-4;
}

.tab-element:hover {
@apply border-blue-300 text-blue-500;
}

.tab-element-selected {
@apply border-b-2 border-blue-300 text-blue-500;
@apply border-blue-300 text-blue-500;
}

.tab-element-disabled {
@apply px-4 -m-2px border-b-2;
@apply pr-4;
}

.panel {
Expand Down
313 changes: 190 additions & 123 deletions src/views/Project.vue
Original file line number Diff line number Diff line change
@@ -1,135 +1,202 @@
<template>
<div>
<projbreadcrumbs :ownertype="ownertype" :ownername="ownername" :projectref="projectref" />
<projbreadcrumbs
:ownertype="ownertype"
:ownername="ownername"
:projectref="projectref"
/>

<div class="mb-8">
<span class="text-3xl">{{projectName()}}</span>
<span class="text-3xl">{{ projectName() }}</span>
</div>

<div class="flex justify-between">
<ul class="flex-grow tab">
<li class="tab-element-disabled">
<i class="mr-1 mdi mdi-run-fast" />
<span>Runs</span>
</li>
<li>
<tabarrow />
</li>
<li
class="tab-element"
:class="[{ 'tab-element-selected': $route.name.match('project runs') || $route.name.endsWith('project') }]"
>
<router-link :to="projectRunsLink(ownertype, ownername, projectref)">
<i class="mr-1 mdi mdi-asterisk" />
<span>All</span>
</router-link>
</li>
<li
class="tab-element"
:class="[{ 'tab-element-selected': $route.name.match('project branches runs') }]"
>
<router-link :to="projectBranchesRunsLink(ownertype, ownername, projectref)">
<i class="mr-1 mdi mdi-source-branch" />
<span>Branches</span>
</router-link>
</li>
<li
class="tab-element"
:class="[{ 'tab-element-selected': $route.name.match('project tags runs') }]"
>
<router-link :to="projectTagsRunsLink(ownertype, ownername, projectref)">
<i class="mr-1 mdi mdi-tag" />
<span>Tags</span>
</router-link>
</li>
<li
class="tab-element"
:class="[{ 'tab-element-selected': $route.name.match('project pull requests runs') }]"
>
<router-link :to="projectPRsRunsLink(ownertype, ownername, projectref)">
<i class="mr-1 mdi mdi-source-pull" />
<span>Pull Requests</span>
</router-link>
</li>
<li
v-if="run && ($route.name.endsWith('project run') || $route.name.endsWith('project run task'))"
>
<tabarrow />
</li>
<li
class="tab-element"
v-if="run && ($route.name.endsWith('project run') || $route.name.endsWith('project run task'))"
:class="[{ 'tab-element-selected': $route.name.endsWith('project run') }]"
>
<router-link :to="projectRunLink(ownertype, ownername, projectref, $route.params.runid)">
<p>
Run
<strong>#{{run.counter}}</strong>
</p>
</router-link>
</li>
<li v-if="run && $route.name.endsWith('project run task')">
<tabarrow />
</li>
<li
class="tab-element"
v-if="run && $route.name.endsWith('project run task')"
:class="[{ 'tab-element-selected': $route.name.endsWith('project run task') }]"
<div class="flex justify-between border-b-2">
<nav>
<ul class="flex flex-wrap tab">
<li class="tab-element-disabled">
<i class="mr-1 mdi mdi-run-fast" />
<span>Runs</span>
</li>
<li>
<tabarrow />
</li>
<li
class="tab-element"
:class="[
{
'tab-element-selected':
$route.name.match('project runs') ||
$route.name.endsWith('project')
}
]"
>
<router-link
:to="projectRunsLink(ownertype, ownername, projectref)"
>
<i class="mr-1 mdi mdi-asterisk" />
<span>All</span>
</router-link>
</li>
<li
class="tab-element pl-4"
:class="[
{
'tab-element-selected': $route.name.match(
'project branches runs'
)
}
]"
>
<router-link
:to="projectBranchesRunsLink(ownertype, ownername, projectref)"
>
<i class="mr-1 mdi mdi-source-branch" />
<span>Branches</span>
</router-link>
</li>
<li
class="tab-element pl-4"
:class="[
{ 'tab-element-selected': $route.name.match('project tags runs') }
]"
>
<router-link
:to="projectTagsRunsLink(ownertype, ownername, projectref)"
>
<i class="mr-1 mdi mdi-tag" />
<span>Tags</span>
</router-link>
</li>
<li
class="tab-element pl-4"
:class="[
{
'tab-element-selected': $route.name.match(
'project pull requests runs'
)
}
]"
>
<router-link
:to="projectPRsRunsLink(ownertype, ownername, projectref)"
>
<i class="mr-1 mdi mdi-source-pull" />
<span>Pull Requests</span>
</router-link>
</li>
<li
v-if="
run &&
($route.name.endsWith('project run') ||
$route.name.endsWith('project run task'))
"
>
<tabarrow />
</li>
<li
class="tab-element"
v-if="
run &&
($route.name.endsWith('project run') ||
$route.name.endsWith('project run task'))
"
:class="[
{ 'tab-element-selected': $route.name.endsWith('project run') }
]"
>
<router-link
:to="
projectRunLink(
ownertype,
ownername,
projectref,
$route.params.runid
)
"
>
<p>
Run
<strong>#{{ run.counter }}</strong>
</p>
</router-link>
</li>
<li v-if="run && $route.name.endsWith('project run task')">
<tabarrow />
</li>
<li
class="tab-element"
v-if="run && $route.name.endsWith('project run task')"
:class="[
{
'tab-element-selected': $route.name.endsWith('project run task')
}
]"
>
<router-link
:to="
projectRunTaskLink(
ownertype,
ownername,
projectref,
$route.params.runid,
$route.params.taskid
)
"
>
<p>
Task
<strong>{{ run.tasks[$route.params.taskid].name }}</strong>
</p>
</router-link>
</li>
<li
v-if="$route.name.endsWith('project settings')"
class="tab-element"
:class="[
{
'tab-element-selected': $route.name.endsWith('project settings')
}
]"
>
<router-link
:to="projectSettingsLink(ownertype, ownername, projectref)"
>
<i class="mr-1 mdi mdi-settings" />
<span>Project Settings</span>
</router-link>
</li>
</ul>
</nav>
<nav>
<div
class="-mt-3"
v-click-outside="() => (dropdownActive = false)"
@click="dropdownActive = !dropdownActive"
>
<router-link
:to="projectRunTaskLink(ownertype, ownername, projectref, $route.params.runid, $route.params.taskid)"
<button
class="relative flex items-center focus:outline-none bg-transparent hover:bg-gray-300 text-dark font-semibold hover:text-dark py-1 px-4 border border-gray-500 rounded"
>
<p>
Task
<strong>{{run.tasks[$route.params.taskid].name}}</strong>
</p>
</router-link>
</li>
<li
v-if="$route.name.endsWith('project settings')"
class="tab-element"
:class="[{ 'tab-element-selected': $route.name.endsWith('project settings') }]"
<i class="mr-4 mdi mdi-settings" />
<i class="mdi mdi-chevron-down"></i>
</button>
</div>
<div
v-if="dropdownActive"
class="z-10 origin-top-right absolute right-0 mt-2 w-64 bg-white rounded-lg border shadow-md py-2"
>
<router-link :to="projectSettingsLink(ownertype, ownername, projectref)">
<i class="mr-1 mdi mdi-settings" />
<span>Project Settings</span>
</router-link>
</li>
</ul>
<ul class="flex tab">
<li>
<div class="relative">
<div
class="flex -mt-3"
v-click-outside="() => dropdownActive = false"
@click="dropdownActive = !dropdownActive"
>
<button
class="relative flex items-center focus:outline-none bg-transparent hover:bg-gray-300 text-dark font-semibold hover:text-dark py-1 px-4 border border-gray-500 rounded"
<ul>
<li>
<router-link
class="block px-4 py-2 hover:bg-blue-500 hover:text-white"
:to="projectSettingsLink(ownertype, ownername, projectref)"
>
<i class="mr-4 mdi mdi-settings" />
<i class="mdi mdi-chevron-down"></i>
</button>
</div>
<div
v-if="dropdownActive"
class="z-10 origin-top-right absolute right-0 mt-2 w-64 bg-white rounded-lg border shadow-md py-2"
>
<ul>
<li>
<router-link
class="block px-4 py-2 hover:bg-blue-500 hover:text-white"
:to="projectSettingsLink(ownertype, ownername, projectref)"
>
<i class="mr-1 mdi mdi-settings" />
<span>Project Settings</span>
</router-link>
</li>
</ul>
</div>
</div>
</li>
</ul>
<i class="mr-1 mdi mdi-settings" />
<span>Project Settings</span>
</router-link>
</li>
</ul>
</div>
</nav>
</div>
<router-view class="mt-8"></router-view>
</div>
Expand Down Expand Up @@ -238,4 +305,4 @@ export default {
</script>

<style scoped lang="scss">
</style>
</style>
Loading