diff options
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/layers.html | 15 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templatetags/projecttags.py | 12 |
2 files changed, 21 insertions, 6 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/layers.html b/bitbake/lib/toaster/toastergui/templates/layers.html index 864e15683b..c35a299333 100644 --- a/bitbake/lib/toaster/toastergui/templates/layers.html +++ b/bitbake/lib/toaster/toastergui/templates/layers.html | |||
@@ -52,12 +52,15 @@ | |||
52 | {% endif %} | 52 | {% endif %} |
53 | </td> | 53 | </td> |
54 | <td class="branch"> | 54 | <td class="branch"> |
55 | {% if o.branch %} | 55 | {% with vcs_ref=o.get_vcs_reference %} |
56 | {{o.branch}} | 56 | {% if vcs_ref|is_shaid %} |
57 | {% else %} | 57 | <a class="btn" data-content="<ul class='unstyled'> <li>{{vcs_ref}}</li> </ul>"> |
58 | {{o.up_branch.name}} | 58 | {{vcs_ref|truncatechars:10}} |
59 | <i class="icon-question-sign get-help hover-help" title="Your builds will use the tip of the branch you have cloned or downloaded to your computer, so nothing will be fetched"></i> | 59 | </a> |
60 | {% endif %} | 60 | {% else %} |
61 | {{vcs_ref}} | ||
62 | {% endif %} | ||
63 | {% endwith %} | ||
61 | </td> | 64 | </td> |
62 | <td class="dependencies"> | 65 | <td class="dependencies"> |
63 | {% with ods=o.dependencies.all%} | 66 | {% with ods=o.dependencies.all%} |
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py index 276c6eb098..e66910cd9d 100644 --- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py +++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py | |||
@@ -295,3 +295,15 @@ def format_build_date(completed_on): | |||
295 | 295 | ||
296 | if delta.days >= 1: | 296 | if delta.days >= 1: |
297 | return True | 297 | return True |
298 | |||
299 | @register.filter | ||
300 | def is_shaid(text): | ||
301 | """ return True if text length is 40 characters and all hex-digits | ||
302 | """ | ||
303 | try: | ||
304 | int(text, 16) | ||
305 | if len(text) == 40: | ||
306 | return True | ||
307 | return False | ||
308 | except ValueError: | ||
309 | return False | ||