Skip to content

Commit

Permalink
Add repository visibility icon (#1648)
Browse files Browse the repository at this point in the history
This is extracted from #1604.
  • Loading branch information
backspace committed May 7, 2018
1 parent 6dc5957 commit 0c4f738
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 11 deletions.
5 changes: 5 additions & 0 deletions app/components/repository-visibility-icon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Component from '@ember/component';

export default Component.extend({
tagName: ''
});
19 changes: 18 additions & 1 deletion app/styles/app/layouts/repo.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
.repo-header {
header {
header.name {
@media #{$medium-up} {
display: flex;
flex-flow: row wrap;
justify-content: flex-start;
align-items: center;
}

.icon {
width: 26px;
height: 26px;

@include colorSVG($cement-grey);

&.private {
transform: translateY(1px);
}

&.public {
transform: translateY(4px);
}

margin-right: 10px;
}
}

.repo-title {
Expand Down
23 changes: 13 additions & 10 deletions app/templates/components/repository-layout.hbs
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<article class="repo-header">
<header>
<h1 data-test-repo-header-title class="repo-title">{{#link-to "owner" repo.owner.login}}{{repo.owner.login}}{{/link-to}} / {{#link-to "repo" repo}}{{repo.name}}{{/link-to}}</h1>
{{#external-link-to href=urlGithub class="repo-gh" title=(concat repo.name " on GitHub")}}
{{svg-jar 'icon-repooctocat'}}
{{/external-link-to}}
<div class="repo-badge">
<a href="#" id="status-image-popup" title="Latest push build on default branch: {{repo.defaultBranch.lastBuild.state}}" name="status-images" class="open-popup" {{action "toggleStatusBadgeModal"}}>
<img src={{statusImageUrl}} alt="build:{{repo.defaultBranch.lastBuild.state}}"/>
</a>
</div>
<header class='name'>
{{repository-visibility-icon repository=repo}}
<h1 data-test-repo-header-title class="repo-title">
{{#link-to "owner" repo.owner.login}}{{repo.owner.login}}{{/link-to}} / {{#link-to "repo" repo}}{{repo.name}}{{/link-to}}
</h1>
{{#external-link-to href=urlGithub class="repo-gh" title=(concat repo.name " on GitHub")}}
{{svg-jar 'icon-repooctocat'}}
{{/external-link-to}}
<div class="repo-badge">
<a href="#" id="status-image-popup" title="Latest push build on default branch: {{repo.defaultBranch.lastBuild.state}}" name="status-images" class="open-popup" {{action "toggleStatusBadgeModal"}}>
<img src={{statusImageUrl}} alt="build:{{repo.defaultBranch.lastBuild.state}}"/>
</a>
</div>
</header>
<main class="repo-main">
<div class="repo-navigation">
Expand Down
5 changes: 5 additions & 0 deletions app/templates/components/repository-visibility-icon.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{#if repository.private}}
{{svg-jar 'icon-lock' alt='Private repository' class='icon private'}}
{{else}}
{{svg-jar 'icon-os' alt='Public repository' class='icon public'}}
{{/if}}
16 changes: 16 additions & 0 deletions public/images/stroke-icons/icon-lock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions public/images/stroke-icons/icon-os.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0c4f738

Please sign in to comment.