Skip to content

Commit

Permalink
Make watchlist smaller
Browse files Browse the repository at this point in the history
if the name of the project was very long, the container of the watchlist
was also growing.
  • Loading branch information
DavidKang committed Sep 20, 2018
1 parent 3ed2f97 commit c1c8b47
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
10 changes: 9 additions & 1 deletion src/api/app/assets/stylesheets/webui2/texts.scss
Expand Up @@ -8,4 +8,12 @@

.text-gray-550 {
color: $gray-550;
}
}

.text-wrap {
white-space: normal;
}

.text-word-break-all {
word-break: break-all;
}
4 changes: 2 additions & 2 deletions src/api/app/views/layouts/webui2/_watchlist.html.haml
Expand Up @@ -9,5 +9,5 @@
%ul
- User.current.watched_project_names.each do |project|
%li
= link_to project_show_path(project), class: 'nav-link' do
= raw(project.gsub(':', ':<wbr>'))
= link_to project_show_path(project), class: 'nav-link text-word-break-all' do
= project
13 changes: 7 additions & 6 deletions src/api/app/views/layouts/webui2/_watchlist_dropdown.html.haml
@@ -1,6 +1,6 @@
%button.btn.btn-link.nav-link.dropdown-toggle#watchlist{ "aria-expanded": "false", "aria-haspopup": "true", "data-toggle": "dropdown", "data-offset": 150 }
%button.btn.btn-link.nav-link.dropdown-toggle#watchlist{ aria: { expanded: false, haspopup: true }, data: { toggle: 'dropdown', offset: 150 } }
Watchlist
.dropdown-menu{ "aria-labelledby": "watchlist" }
.dropdown-menu{ aria: { labelledby: 'watchlist' } }
.dropdown-header
List of projects you are watching
.dropdown-divider
Expand All @@ -17,7 +17,8 @@
%small.text-muted
Watch this project
.dropdown-divider
- User.current.watched_project_names.each do |project|
= link_to project_show_path(project), class: 'dropdown-item' do
%span.icons-project
= raw(project.gsub(':', ':<wbr>'))
- User.current.watched_project_names.each_with_index do |project, index|
= link_to project_show_path(project), class: "dropdown-item text-wrap text-word-break-all #{'border-top' unless index.zero?}" do
%i.fa.fa-cubes.fa.text-info.pt-2
%span.small
= project

0 comments on commit c1c8b47

Please sign in to comment.