Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
ISSUE-203: Removed text from star/unstar button
Browse files Browse the repository at this point in the history
  • Loading branch information
lsamayoa committed Jul 27, 2015
1 parent 942d490 commit 13d3934
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
17 changes: 10 additions & 7 deletions app/views/repositories/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions app/views/repositories/star.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 1 addition & 2 deletions app/views/repositories/unstar.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 13d3934

Please sign in to comment.