diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 8339dca33..582c84eb8 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -238,18 +238,29 @@ class RepositoriesController < ApplicationController end def export_modal - return unless current_user.has_available_exports? - - respond_to do |format| - format.json do - render json: { - html: render_to_string( - partial: 'export_repositories_modal.html.erb', - locals: { team_name: current_team.name, - export_limit: TeamZipExport.exports_limit, - num_of_requests_left: current_user.exports_left - 1 } - ) - } + if current_user.has_available_exports? + respond_to do |format| + format.json do + render json: { + html: render_to_string( + partial: 'export_repositories_modal.html.erb', + locals: { team_name: current_team.name, + export_limit: TeamZipExport.exports_limit, + num_of_requests_left: current_user.exports_left - 1 } + ) + } + end + end + else + respond_to do |format| + format.json do + render json: { + html: render_to_string( + partial: 'export_limit_exceeded_modal.html.erb', + locals: { requests_limit: TeamZipExport.exports_limit } + ) + } + end end end end diff --git a/app/views/repositories/_export_limit_exceeded_modal.html.erb b/app/views/repositories/_export_limit_exceeded_modal.html.erb new file mode 100644 index 000000000..e1a83633d --- /dev/null +++ b/app/views/repositories/_export_limit_exceeded_modal.html.erb @@ -0,0 +1,22 @@ +