diff --git a/static/css/directives/components/pages/repo-page/body.scss b/static/css/directives/components/pages/repo-page/body.scss new file mode 100644 index 000000000..3b038c788 --- /dev/null +++ b/static/css/directives/components/pages/repo-page/body.scss @@ -0,0 +1,44 @@ +.rp-description { + font-size: 16px; +} + +.rp-panelBody { + padding: 15px 30px; +} + +.rp-tabs { + border-bottom: 1px solid #DDD; +} +.rp-tabs > li.active > a, +.rp-tabs > li.active > a:focus, +.rp-tabs > li.active > a:hover { + border-width: 0; +} + +.rp-tabs { + padding: 0 15px; + font-size: 20px; + + li.active a { + color: #51a3d9; + border: none; + border-bottom: 1px solid #51a3d9; + + &:hover { + color: #51a3d9; + border: none; + border-bottom: 1px solid #51a3d9; + } + } + + li a { + color: #333; + + &:focus, + &:hover { + border: none; + background-color: #fff; + } + } +} + diff --git a/static/css/directives/components/pages/repo-page/header.scss b/static/css/directives/components/pages/repo-page/header.scss new file mode 100644 index 000000000..afa9450e2 --- /dev/null +++ b/static/css/directives/components/pages/repo-page/header.scss @@ -0,0 +1,30 @@ +.rp-button { + float: right; + margin-right: 30px; +} + +.rp-button__dropdown { + background-color: #fff; + border-radius: 4px; + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.25), 0 0 1px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.2); +} + +.rp-button__text { + margin-right: 10px; +} + +.rp-button__text--bold { + font-weight: 600; +} + + +.rp-header__row { + margin: 0; +} + +.rp-title { + font-size: 24px; + color: #333; + float: left; +} + diff --git a/static/css/directives/components/pages/repo-page/repo-page.scss b/static/css/directives/components/pages/repo-page/repo-page.scss index 899287260..fe132b352 100644 --- a/static/css/directives/components/pages/repo-page/repo-page.scss +++ b/static/css/directives/components/pages/repo-page/repo-page.scss @@ -1,64 +1,13 @@ // Repo Page specific styles here @import "../mixins"; - -.rp-badge { - float: left; - width: 100%; - margin-bottom: 20px; -} - -.rp-badge__icon { - float: left; - height: 25px; - font-size: 16px; - padding: 0 12px; - color: #ffffff; -} - -.rp-badge__icon--private { - @extend .rp-badge__icon; - background-color: #d64456; -} - -.rp-badge__icon--public { - @extend .rp-badge__icon; - background-color: #2fc98e; -} - -.rp-description { - font-size: 16px; -} +@import "body"; +@import "header"; +@import "sidebar"; .rp-header { padding: 30px; } -.rp-header__row { - margin: 0; -} - -.rp-imagesHeader { - font-size: 18px; - margin-bottom: 30px; -} - -.rp-imagesTable { - margin-bottom: 30px; -} - -.rp-imagesTable__headerCell { - font-size: 13px; - font-weight: 300; - font-style: normal; - color: #999; - padding: 10px; - border-bottom: 1px solid #ddd; -} - -.rp-imagesTable__tagIcon { - padding-right: 4px; -} - .rp-mainPanel { margin-bottom: 20px; background-color: #fff; @@ -71,78 +20,8 @@ border-right: 1px solid #ddd; } -.rp-panelBody { - padding: 15px 30px; -} - -.rp-sharing { - font-size: 16px; - color: #333; - margin-bottom: 30px; -} - .rp-sidebar { padding: 30px 30px 0 30px; border-left: 1px solid #DDD; } -.rp-tabs { - border-bottom: 1px solid #DDD; -} -.rp-tabs > li.active > a, -.rp-tabs > li.active > a:focus, -.rp-tabs > li.active > a:hover { - border-width: 0; -} - -.rp-tabs { - padding: 0 15px; - font-size: 20px; - - li.active a { - color: #51a3d9; - border: none; - border-bottom: 1px solid #51a3d9; - - &:hover { - color: #51a3d9; - border: none; - border-bottom: 1px solid #51a3d9; - } - } - - li a { - color: #333; - - &:focus, - &:hover { - border: none; - background-color: #fff; - } - } -} - -.rp-title { - font-size: 24px; - color: #333; - float: left; -} - -.rp-button { - float: right; - margin-right: 30px; -} - -.rp-button__dropdown { - background-color: #fff; - border-radius: 4px; - box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.25), 0 0 1px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.2); -} - -.rp-button__text { - margin-right: 10px; -} - -.rp-button__text--bold { - font-weight: 600; -} diff --git a/static/css/directives/components/pages/repo-page/sidebar.scss b/static/css/directives/components/pages/repo-page/sidebar.scss new file mode 100644 index 000000000..3e973822d --- /dev/null +++ b/static/css/directives/components/pages/repo-page/sidebar.scss @@ -0,0 +1,52 @@ +.rp-badge { + float: left; + width: 100%; + margin-bottom: 20px; +} + +.rp-badge__icon { + float: left; + height: 25px; + font-size: 16px; + padding: 0 12px; + color: #ffffff; +} + +.rp-badge__icon--private { + @extend .rp-badge__icon; + background-color: #d64456; +} + +.rp-badge__icon--public { + @extend .rp-badge__icon; + background-color: #2fc98e; +} + +.rp-imagesHeader { + font-size: 18px; + margin-bottom: 30px; +} + +.rp-imagesTable { + margin-bottom: 30px; +} + +.rp-imagesTable__headerCell { + font-size: 13px; + font-weight: 300; + font-style: normal; + color: #999; + padding: 10px; + border-bottom: 1px solid #ddd; +} + +.rp-imagesTable__tagIcon { + padding-right: 4px; +} + +.rp-sharing { + font-size: 16px; + color: #333; + margin-bottom: 30px; +} + diff --git a/static/js/directives/components/pages/repo-page/sidebar.tsx b/static/js/directives/components/pages/repo-page/sidebar.tsx index 743c306f3..48883e126 100644 --- a/static/js/directives/components/pages/repo-page/sidebar.tsx +++ b/static/js/directives/components/pages/repo-page/sidebar.tsx @@ -33,31 +33,44 @@ class repoSidebar extends React.Component { let badgeIcon: string = (this.props.isPublic) ? "rp-badge__icon--public" : "rp-badge__icon--private"; let repository: any = this.props.repository; let sharing: string = repository.company || repository.namespace; - - for (let tagObject in this.props.tags) { - sortedTags.push({ - name: this.props.tags[tagObject].name, - lastModified: Date.parse(this.props.tags[tagObject].last_modified) - }); - } + + if (Object.keys(this.props.tags).length > 0) { + for (let tagObject in this.props.tags) { + sortedTags.push({ + name: this.props.tags[tagObject].name, + lastModified: Date.parse(this.props.tags[tagObject].last_modified) + }); + } sortedTags = sortedTags.sort(function(a, b) { return b.lastModified - a.lastModified; }); - sortedTags.slice(0,5).forEach(function(el, i){ + sortedTags.slice(0,5).forEach(function(el, i){ + tagRows.push( + + + + {el.name} + + + {moment(el.lastModified).fromNow()} + + + ); + }); + } + else { tagRows.push( - - {el.name} + No Tags Available - {moment(el.lastModified).fromNow()} - ); - }); + ) + } return(