diff --git a/app/assets/stylesheets/themes/repositories.scss b/app/assets/stylesheets/themes/repositories.scss new file mode 100644 index 000000000..a4244ac97 --- /dev/null +++ b/app/assets/stylesheets/themes/repositories.scss @@ -0,0 +1,8 @@ +#repository-columns-dropdown { + float: right; +} + +.new-repository-button { + float: left; + margin-right: 5px; +} diff --git a/app/assets/stylesheets/themes/scinote.scss b/app/assets/stylesheets/themes/scinote.scss index 39ae3b334..6967c9b2a 100644 --- a/app/assets/stylesheets/themes/scinote.scss +++ b/app/assets/stylesheets/themes/scinote.scss @@ -2,7 +2,7 @@ @import "mixins"; @import "main_navigation"; @import "buttons"; - +@import "repositories"; /** Layout **/ body, diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 03cdf18a8..d0351a324 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -11,6 +11,8 @@ class RepositoriesController < ApplicationController before_action :check_create_permissions, only: %i(create_new_modal create copy_modal copy) + # layout 'fluid' + def index unless @repositories.length.zero? && current_team redirect_to repository_path(@repositories.first) and return @@ -46,7 +48,7 @@ class RepositoriesController < ApplicationController if @repository.save flash[:success] = t('repositories.index.modal_create.success_flash', name: @repository.name) - render json: { url: team_repositories_path(repository: @repository) }, + render json: { url: repository_path(@repository) }, status: :ok else render json: @repository.errors, diff --git a/app/views/repositories/_sidebar.html.erb b/app/views/repositories/_sidebar.html.erb new file mode 100644 index 000000000..273fd0f17 --- /dev/null +++ b/app/views/repositories/_sidebar.html.erb @@ -0,0 +1,23 @@ + <%= content_for :sidebar do %> +
+ + +
+ +
+
+<% end %> diff --git a/app/views/repositories/index.html.erb b/app/views/repositories/index.html.erb index 1b98a2cd6..960f77ea1 100644 --- a/app/views/repositories/index.html.erb +++ b/app/views/repositories/index.html.erb @@ -1,6 +1,7 @@ <% provide(:head_title, t("libraries.index.head_title")) %> <% if current_team %> + <%= render partial: "sidebar", locals: { repositories: @repositories } %> <% # show only if no repositories present. If the team will have them we will # handle this in left side navigation bar @@ -9,10 +10,11 @@ <%=t 'libraries.index.no_libraries.text' %>

<%=t 'libraries.index.no_libraries.title' %>


- <%=t 'libraries.index.no_libraries.create_new_button' %> + <%= link_to t('libraries.index.no_libraries.create_new_button'), + create_modal_team_repositories_path(current_team), + class: "btn btn-info btn-lg", + id: "create-new-repository", + remote: true %> <% else %> diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 668ffdd51..6d1efcba6 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -1,10 +1,7 @@ <% provide(:head_title, t("libraries.show.head_title", library: @repository.name)) %> +<%= stylesheet_link_tag 'datatables' %> -<%= render partial: "repositories/delete_record_modal.html.erb" %> -<%= render partial: "repositories/delete_column_modal.html.erb" %> -<%= render partial: 'repositories/export_repository_modal.html.erb', - locals: { repository: @repository } %> - +<%= render partial: "sidebar", locals: { repositories: @repositories } %>
@@ -73,7 +70,18 @@
+
+
+ <% if can_create_repositories?(@repository.team) %> + <%= link_to t('libraries.index.no_libraries.create_new_button'), + create_modal_team_repositories_path(@repository.team), + class: "btn btn-default", + id: "create-new-repository", + remote: true %> + <% end %> +
+