diff --git a/app/roles/account.rb b/app/roles/account.rb index 8157898fef1f682241c83b273e2758080d73bf1e..f852a398b6f91b4e16216342e2805fb7bd70964d 100644 --- a/app/roles/account.rb +++ b/app/roles/account.rb @@ -22,6 +22,10 @@ module Account projects_limit > my_own_projects.count end + def show_project_limit? + projects_limit - my_own_projects.count < 100 + end + def can_create_group? is_admin? end diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index 6b360dc1fefef945e569f666c131eb66edd30293..08b3e71295c577c72ac807aa35917efe6dc5d347 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -36,9 +36,10 @@ %br %h4.nothing_here_message - if current_user.can_create_project? - You can create up to - = current_user.projects_limit - projects. Click on button below to add a new one + - if current_user.show_project_limit? + You can create up to + = current_user.projects_limit + projects. Click on button below to add a new one .link_holder = link_to new_project_path, class: "btn primary" do New Project ยป diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index ac36fa3aa552aad19902650543dba87bc9b280c7..81de2fa281bc5f60c4bed5de43617efba677469e 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -65,11 +65,13 @@ Personal projects: %small.right %span= current_user.my_own_projects.count - of - %span= current_user.projects_limit + - if current_user.show_project_limit? + of + %span= current_user.projects_limit .padded - .progress - .bar{style: "width: #{current_user.projects_limit_percent}%;"} + - if current_user.show_project_limit? + .progress + .bar{style: "width: #{current_user.projects_limit_percent}%;"} %fieldset %legend