I think adding the GitHub profile picture to the installation dropdown makes it more human friendly. It helps people feel friendlier. "http://github.com/enescakir.png" redirected to "https://avatars.githubusercontent.com/u/993199".
49 lines
2.2 KiB
Plaintext
49 lines
2.2 KiB
Plaintext
<%== part(
|
|
"components/page_header",
|
|
title: "GitHub Runners Integration",
|
|
breadcrumbs: [
|
|
%w[Projects /project],
|
|
[@project_data[:name], @project_data[:path]],
|
|
["GitHub Runners", "#{@project_data[:path]}/github"],
|
|
[@page_title, "#"]
|
|
],
|
|
right_items: [<<-DROPDOWN]
|
|
<div class="group dropdown relative inline-block text-left">
|
|
<div>#{part("components/button", text: @installation.name, icon: "github", right_icon: "hero-chevron-down")}</div>
|
|
<div class="hidden opacity-0 scale-95 group-[.active]:block group-[.active]:opacity-100 group-[.active]:scale-100 transition ease-out duration-100 absolute -right-2 z-10 mt-2 w-72 origin-top-right divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none" role="menu" tabindex="-1">
|
|
<div>
|
|
#{@project.github_installations.map do |ins|
|
|
<<-ITEM
|
|
<div class="hover:bg-gray-50" role="none">
|
|
<a href="#{@project_data[:path]}/github/#{ins.ubid}/runner" class="flex items-center px-4 py-3 text-sm leading-6 text-gray-700">
|
|
<img src="https://github.com/#{ins.name}.png?size=64" alt="" class="mr-2 size-6 shrink-0 rounded-lg drop-shadow-sm">
|
|
<span class="#{(ins.id == @installation.id) ? "font-semibold" : ""}">#{ins.name}</span>
|
|
</a>
|
|
</div>
|
|
ITEM
|
|
end.join}
|
|
</div>
|
|
<div>
|
|
<div class="hover:bg-gray-50">
|
|
<a href="#{@project_data[:path]}/github/create" class="flex items-center px-4 py-3 text-sm leading-6 text-gray-700">
|
|
<div class="mr-2 size-6 shrink-0 rounded-lg bg-gray-400 flex items-center justify-center drop-shadow-sm">
|
|
#{part("components/icon", name: "github", classes: "size-4 text-white")}
|
|
</div>
|
|
Connect New Account
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
DROPDOWN
|
|
) %>
|
|
|
|
<%== part(
|
|
"components/tabbar",
|
|
tabs: [
|
|
["Active Runners", "#{@project_data[:path]}/github/#{@installation.ubid}/runner"],
|
|
["Caches", "#{@project_data[:path]}/github/#{@installation.ubid}/cache"],
|
|
["Settings", "#{@project_data[:path]}/github/#{@installation.ubid}/setting"]
|
|
]
|
|
) %>
|