-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Rob Beeston <[email protected]>
- Loading branch information
1 parent
7468f54
commit fbec6ac
Showing
4 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from django import template | ||
from django.urls import reverse | ||
|
||
register = template.Library() | ||
|
||
|
||
@register.simple_tag() | ||
def branch_url_tag(view: str, branch: str, kwargs: dict): | ||
kwargs["version_slug"] = branch | ||
return reverse(view, kwargs=kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{% load branch_url_tag %} | ||
<div class="devmast_container"> | ||
<div class="mast_container" title="Master Branch"> | ||
<div class="minicircle mastercolor">M</div> | ||
<a href="{% branch_url_tag request.resolver_match.view_name branch='master' kwargs=request.resolver_match.kwargs %}" class="giticon"><i class="fa-brands fa-git-alt fa-2xl"></i></a> | ||
</div> | ||
<div class="dev_container" title="Develop Branch"> | ||
<div class="minicircle developcolor">D</div> | ||
<a href="{% branch_url_tag request.resolver_match.view_name branch='develop' kwargs=request.resolver_match.kwargs %}" class="giticon"><i class="fa-brands fa-git-alt fa-2xl"></i></a> | ||
</div> | ||
</div> | ||
<style> | ||
.devmast_container { | ||
display: inline-flex; | ||
width: 5rem; | ||
justify-content: space-around; | ||
} | ||
.mast_container { | ||
display: flex; | ||
align-items: center; | ||
position: relative; | ||
} | ||
.dev_container { | ||
display: flex; | ||
align-items: center; | ||
position: relative; | ||
} | ||
.lib_pref .mast_container, | ||
.lib_pref .dev_container { | ||
align-items: flex-start; | ||
margin-top: 6px; | ||
} | ||
.minicircle { | ||
color: #fff; | ||
font-weight: 700; | ||
font-size: 0.6rem; | ||
border-radius: 30px; | ||
width: 0.8rem; | ||
height: 0.8rem; | ||
position: absolute; | ||
left: -0.2rem; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.mastercolor { | ||
background-color: rgb(255 159 0); | ||
} | ||
.developcolor { | ||
background-color: rgb(14 174 96); | ||
} | ||
.mast_container .fa-git-alt:hover { | ||
color: rgb(255 159 0) !important; | ||
} | ||
.dev_container .fa-git-alt:hover { | ||
color: rgb(14 174 96) !important; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters