diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-07-08 16:55:04 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-07-08 16:55:04 +0200 |
commit | 39a4bb2abda20fe85a362c1718eab9dfd7de13a3 (patch) | |
tree | d0bb5c6002a31f567d4a6d0ee914ab040f7e567d /app/views/projects | |
parent | bd08ac55c7b8eb1b41862937aa4f7cc7a53e4bfe (diff) | |
download | gitlab-ce-39a4bb2abda20fe85a362c1718eab9dfd7de13a3.tar.gz |
Cleanup and some test fixes after refactoring project home page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/buttons/_star.html.haml | 19 | ||||
-rw-r--r-- | app/views/projects/show.html.haml | 2 |
2 files changed, 10 insertions, 11 deletions
diff --git a/app/views/projects/buttons/_star.html.haml b/app/views/projects/buttons/_star.html.haml index 89e3f4ac738..664ebd18295 100644 --- a/app/views/projects/buttons/_star.html.haml +++ b/app/views/projects/buttons/_star.html.haml @@ -1,22 +1,21 @@ - if current_user - = link_to toggle_star_namespace_project_path(@project.namespace, @project), class: 'btn toggle-star', method: :post, remote: true do + = link_to toggle_star_namespace_project_path(@project.namespace, @project), class: 'btn star-btn toggle-star', method: :post, remote: true do - if current_user.starred?(@project) Unstar - else Star %span.count = @project.star_count + + :coffeescript + $('.project-home-panel .toggle-star').on 'ajax:success', (e, data, status, xhr) -> + $(@).replaceWith(data.html) + .on 'ajax:error', (e, xhr, status, error) -> + new Flash('Star toggle failed. Try again later.', 'alert') + - else - = link_to new_user_session_path, class: 'btn has_tooltip', title: 'You must sign in to star a project' do + = link_to new_user_session_path, class: 'btn has_tooltip star-btn', title: 'You must sign in to star a project' do = icon('star') Star %span.count = @project.star_count - -:coffeescript - $('.project-home-panel .toggle-star').on 'ajax:success', (e, data, status, xhr) -> - $(@).replaceWith(data.html) - .on 'ajax:error', (e, xhr, status, error) -> - new Flash('Star toggle failed. Try again later.', 'alert') - - diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 8fb5f25c2f6..17907a42e3c 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -51,7 +51,7 @@ = render_readme(readme) - else %h3.page-title - This project does not have README yet :( + This project does not have README yet - if can?(current_user, :push_code, @project) %p.slead A |