diff --git a/app/views/repositories/show.html.slim b/app/views/repositories/show.html.slim index fddd03bae..305786b3d 100644 --- a/app/views/repositories/show.html.slim +++ b/app/views/repositories/show.html.slim @@ -5,13 +5,16 @@ | / = @repository.name #repo-stars.pull-right - - if can_star_repository?(@repository) - = link_to t('Star'), star_repository_path(@repository), method: :post, class: 'btn btn-small btn-default', remote: true, id: 'star_repo' - i.fa.fa-star-o - - else - = link_to t('Unstar'), unstar_repository_path(@repository), method: :post, class: 'btn btn-small btn-default', remote: true, id: 'unstar_repo' - i.fa.fa-star - span#star-counter= @repository.stars.count + .btn-group + - if can_star_repository?(@repository) + = link_to star_repository_path(@repository), method: :post, class: 'btn btn-small btn-default', remote: true, id: 'star_repo' do + i.fa.fa-star-o + - else + = link_to unstar_repository_path(@repository), method: :post, class: 'btn btn-small btn-default', remote: true, id: 'unstar_repo' do + i.fa.fa-star + span#star-counter.btn.btn-primary + = @repository.stars.count + .panel-body .table-responsive table.table.table-stripped.table-hover diff --git a/app/views/repositories/star.js.erb b/app/views/repositories/star.js.erb index 0a5d903df..ae034176f 100644 --- a/app/views/repositories/star.js.erb +++ b/app/views/repositories/star.js.erb @@ -4,9 +4,8 @@ <% else %> (function () { var link = $('#repo-stars a'); - var icon = $('#repo-stars i') + var icon = $('#repo-stars a i') var counter = $('#repo-stars #star-counter'); - link.html("<%= escape_javascript(t('Unstar')) %>"); link.attr("id", "unstar_repo"); link.attr("href", "<%= escape_javascript(unstar_repository_path(@repository)) %>"); icon.addClass("fa-star"); diff --git a/app/views/repositories/unstar.js.erb b/app/views/repositories/unstar.js.erb index e6f1ec3ab..a6bd0c376 100644 --- a/app/views/repositories/unstar.js.erb +++ b/app/views/repositories/unstar.js.erb @@ -4,10 +4,9 @@ <% else %> (function () { var link = $('#repo-stars a'); - var icon = $('#repo-stars i') + var icon = $('#repo-stars a i') var counter = $('#repo-stars #star-counter'); link.attr("id", "star_repo"); - link.html("<%= escape_javascript(t('Star')) %>"); link.attr("href", "<%= escape_javascript(star_repository_path(@repository)) %>"); icon.addClass("fa-star-o"); icon.removeClass("fa-star");