mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-13 00:24:42 +08:00
Merge pull request #1047 from ZmagoD/zd_SCI_2139_2121
adds libraries/repositories to sidebar navigation and blank page for no libraries/repositories
This commit is contained in:
commit
c71a8a7506
15 changed files with 232 additions and 158 deletions
|
@ -12,6 +12,7 @@
|
||||||
//= require jquery-ui/widgets/draggable
|
//= require jquery-ui/widgets/draggable
|
||||||
//= require jquery-ui/widgets/droppable
|
//= require jquery-ui/widgets/droppable
|
||||||
//= require jquery.ui.touch-punch.min
|
//= require jquery.ui.touch-punch.min
|
||||||
|
//= require jquery-ui/effects/effect-slide
|
||||||
//= require jquery.caret.min
|
//= require jquery.caret.min
|
||||||
//= require jquery.atwho.min
|
//= require jquery.atwho.min
|
||||||
//= require hammer
|
//= require hammer
|
||||||
|
|
|
@ -6,78 +6,8 @@
|
||||||
animateSpinner();
|
animateSpinner();
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
function initImportRecordsModal() {
|
|
||||||
$('#importRecordsButton').off().on('click', function() {
|
|
||||||
$('#modal-import-records').modal('show');
|
|
||||||
_initParseRecordsModal();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function _initParseRecordsModal() {
|
|
||||||
$('#form-records-file').on('ajax:success', function(ev, data) {
|
|
||||||
$('#modal-import-records').modal('hide');
|
|
||||||
$(data.html).appendTo('body').promise().done(function() {
|
|
||||||
$('#parse-records-modal')
|
|
||||||
.modal('show')
|
|
||||||
.on('hidden.bs.modal', function() {
|
|
||||||
animateSpinner();
|
|
||||||
location.reload();
|
|
||||||
});
|
|
||||||
repositoryRecordsImporter();
|
|
||||||
});
|
|
||||||
}).on('ajax:error', function(ev, data) {
|
|
||||||
$(this).find('.form-group').addClass('has-error');
|
|
||||||
$(this).find('.form-group').find('.help-block').remove();
|
|
||||||
$(this).find('.form-group').append("<span class='help-block'>" +
|
|
||||||
data.responseJSON.message + '</span>');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadRepositoryTab() {
|
|
||||||
var param;
|
|
||||||
$('#repository-tabs a').on("click", function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
var pane = $(this);
|
|
||||||
$.ajax({
|
|
||||||
url: $(this).attr("data-url"),
|
|
||||||
type: "GET",
|
|
||||||
dataType: "json",
|
|
||||||
success: function (data) {
|
|
||||||
var tabBody = $(pane.context.hash).find(".tab-content-body");
|
|
||||||
tabBody.html(data.html);
|
|
||||||
pane.tab('show').promise().done(function(el) {
|
|
||||||
initImportRecordsModal();
|
|
||||||
RepositoryDatatable.destroy()
|
|
||||||
RepositoryDatatable.init(el.attr('data-repo-table'));
|
|
||||||
});
|
|
||||||
},
|
|
||||||
error: function (error) {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// on page load
|
|
||||||
if( param = getParam('repository') ){
|
|
||||||
// load selected tab
|
|
||||||
$('a[href="#custom_repo_'+param+'"]').click();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// load first tab content
|
|
||||||
$('#repository-tabs a:first').click();
|
|
||||||
}
|
|
||||||
|
|
||||||
// clean tab content
|
|
||||||
$('a[data-toggle="tab"]').on('hide.bs.tab', function (e) {
|
|
||||||
$(".tab-content-body").html("");
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
$('.create-repository').initializeModal('#create-repo-modal');
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
loadRepositoryTab();
|
$('#create-new-repository').initializeModal('#create-repo-modal');
|
||||||
initImportRecordsModal();
|
|
||||||
});
|
});
|
||||||
})(window);
|
})(window);
|
||||||
|
|
38
app/assets/javascripts/repositories/show.js
Normal file
38
app/assets/javascripts/repositories/show.js
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
(function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
function initImportRecordsModal() {
|
||||||
|
$('#importRecordsButton').off().on('click', function() {
|
||||||
|
$('#modal-import-records').modal('show');
|
||||||
|
_initParseRecordsModal();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function _initParseRecordsModal() {
|
||||||
|
$('#form-records-file').on('ajax:success', function(ev, data) {
|
||||||
|
$('#modal-import-records').modal('hide');
|
||||||
|
$(data.html).appendTo('body').promise().done(function() {
|
||||||
|
$('#parse-records-modal')
|
||||||
|
.modal('show')
|
||||||
|
.on('hidden.bs.modal', function() {
|
||||||
|
animateSpinner();
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
repositoryRecordsImporter();
|
||||||
|
});
|
||||||
|
}).on('ajax:error', function(ev, data) {
|
||||||
|
$(this).find('.form-group').addClass('has-error');
|
||||||
|
$(this).find('.form-group').find('.help-block').remove();
|
||||||
|
$(this).find('.form-group').append("<span class='help-block'>" +
|
||||||
|
data.responseJSON.message + '</span>');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function initialzerRepositoryTable() {
|
||||||
|
initImportRecordsModal();
|
||||||
|
RepositoryDatatable.destroy();
|
||||||
|
RepositoryDatatable.init('#' + $('.repository-table table').attr('id'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(initialzerRepositoryTable);
|
||||||
|
})()
|
35
app/assets/javascripts/sidebar_toggle.js.erb
Normal file
35
app/assets/javascripts/sidebar_toggle.js.erb
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
(function(global) {
|
||||||
|
'use strict';
|
||||||
|
global.SideBarToggle = (function() {
|
||||||
|
|
||||||
|
function show() {
|
||||||
|
$('#sideBarLeft').show();
|
||||||
|
$('#sideBarRight').hide();
|
||||||
|
$('#sidebar-wrapper').show(
|
||||||
|
'slide', { direction: 'right', easing: 'linear' }, 400
|
||||||
|
);
|
||||||
|
$('#wrapper').css('paddingLeft', '280px');
|
||||||
|
$('.navbar-secondary').css(
|
||||||
|
{ 'margin-left': '-280px', 'padding-left': '280px' }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function hide() {
|
||||||
|
$('#sideBarLeft').hide();
|
||||||
|
$('#sideBarRight').show();
|
||||||
|
$('#sidebar-wrapper').hide(
|
||||||
|
'slide', { direction: 'left', easing: 'linear'}, 400
|
||||||
|
);
|
||||||
|
$('#wrapper').css('paddingLeft', '0');
|
||||||
|
$('.navbar-secondary').css({
|
||||||
|
'margin-left': '0',
|
||||||
|
'padding-left': '0'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return Object.freeze({
|
||||||
|
show: show,
|
||||||
|
hide: hide
|
||||||
|
})
|
||||||
|
})();
|
||||||
|
})(window);
|
8
app/assets/stylesheets/themes/repositories.scss
Normal file
8
app/assets/stylesheets/themes/repositories.scss
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#repository-columns-dropdown {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.new-repository-button {
|
||||||
|
float: left;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
@import 'constants';
|
@import 'constants';
|
||||||
@import "mixins";
|
@import "mixins";
|
||||||
@import "main_navigation";
|
@import "main_navigation";
|
||||||
|
@import "repositories";
|
||||||
/** Layout **/
|
/** Layout **/
|
||||||
|
|
||||||
body,
|
body,
|
||||||
|
|
|
@ -11,21 +11,16 @@ class RepositoriesController < ApplicationController
|
||||||
before_action :check_create_permissions, only:
|
before_action :check_create_permissions, only:
|
||||||
%i(create_new_modal create copy_modal copy)
|
%i(create_new_modal create copy_modal copy)
|
||||||
|
|
||||||
|
layout 'fluid'
|
||||||
|
|
||||||
def index
|
def index
|
||||||
render('repositories/index')
|
unless @repositories.length.zero? && current_team
|
||||||
|
redirect_to repository_path(@repositories.first) and return
|
||||||
|
end
|
||||||
|
render 'repositories/index'
|
||||||
end
|
end
|
||||||
|
|
||||||
def show_tab
|
def show
|
||||||
respond_to do |format|
|
|
||||||
format.json do
|
|
||||||
render json: {
|
|
||||||
html: render_to_string(
|
|
||||||
partial: 'repositories/repository.html.erb',
|
|
||||||
locals: { repository: @repository }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_modal
|
def create_modal
|
||||||
|
@ -53,7 +48,7 @@ class RepositoriesController < ApplicationController
|
||||||
if @repository.save
|
if @repository.save
|
||||||
flash[:success] = t('repositories.index.modal_create.success_flash',
|
flash[:success] = t('repositories.index.modal_create.success_flash',
|
||||||
name: @repository.name)
|
name: @repository.name)
|
||||||
render json: { url: team_repositories_path(repository: @repository) },
|
render json: { url: repository_path(@repository) },
|
||||||
status: :ok
|
status: :ok
|
||||||
else
|
else
|
||||||
render json: @repository.errors,
|
render json: @repository.errors,
|
||||||
|
@ -287,7 +282,7 @@ class RepositoriesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_parent_vars
|
def load_parent_vars
|
||||||
@team = Team.find_by_id(params[:team_id])
|
@team = current_team
|
||||||
render_404 unless @team
|
render_404 unless @team
|
||||||
@repositories = @team.repositories.order(created_at: :asc)
|
@repositories = @team.repositories.order(created_at: :asc)
|
||||||
end
|
end
|
||||||
|
|
34
app/views/repositories/_sidebar.html.erb
Normal file
34
app/views/repositories/_sidebar.html.erb
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
<%= content_for :sidebar do %>
|
||||||
|
<div id="slide-panel" class="visible">
|
||||||
|
<div class="tree">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<span class="tree-link line-wrap no-indent">
|
||||||
|
<strong title="<%= t('libraries.sidebar.title') %>"><%= t('libraries.sidebar.title') %></strong>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<% repositories.each do |repository| %>
|
||||||
|
<% cache repository do %>
|
||||||
|
<li class="<%= 'active parent_li' if current_page?(repository_path(repository)) %>" >
|
||||||
|
<span class="tree-link line-wrap no-indent">
|
||||||
|
<% if current_page?(repository_path(repository)) %>
|
||||||
|
<span title="<%= repository.name %>"><%= repository.name %></span>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to repository.name,
|
||||||
|
repository_path(repository),
|
||||||
|
data: { 'no-turbolink' => 'true' } %>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#wrapper').show();
|
||||||
|
})
|
||||||
|
</script>
|
|
@ -1,51 +1,21 @@
|
||||||
<% provide(:head_title, t("repositories.index.head_title")) %>
|
<% provide(:head_title, t("libraries.index.head_title")) %>
|
||||||
|
|
||||||
<% if current_team %>
|
<% if current_team %>
|
||||||
<%= render partial: "repositories/breadcrumbs.html.erb",
|
<%= render partial: "sidebar", locals: { repositories: @repositories } %>
|
||||||
locals: { teams: @teams, current_team: current_team, type: @type } %>
|
<%
|
||||||
|
# show only if no repositories present. If the team will have them we will
|
||||||
<!-- Nav tabs -->
|
# handle this in left side navigation bar
|
||||||
<ul class="nav nav-tabs nav-settings" role="tablist" id="repository-tabs">
|
%>
|
||||||
<% @repositories.each do |repo| %>
|
<div class="jumbotron text-center" style="margin-top:25%">
|
||||||
<li role="presentation">
|
<strong><%=t 'libraries.index.no_libraries.text' %></strong>
|
||||||
<a href="#custom_repo_<%= repo.id %>"
|
<h2><strong><%=t 'libraries.index.no_libraries.title' %><strong></h2>
|
||||||
data-toggle="tab"
|
<br />
|
||||||
data-repo-table="#repository-table-<%= repo.id %>"
|
<%= link_to t('libraries.index.no_libraries.create_new_button'),
|
||||||
aria-controls="custom_repo_<%= repo.id %>"
|
create_modal_team_repositories_path(current_team),
|
||||||
data-url="<%=team_repository_show_tab_path(current_team, repo)%>"
|
class: "btn btn-primary btn-lg",
|
||||||
title="<%=repo.name%>"><%= truncate(repo.name, length: Constants::NAME_TRUNCATION_LENGTH) %></a>
|
id: "create-new-repository",
|
||||||
</li>
|
remote: true %>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<!-- Add new repository tab -->
|
|
||||||
<li role="presentation"
|
|
||||||
<% unless can_create_repositories?(current_team) || current_team.repositories.count < Constants::REPOSITORIES_LIMIT %>
|
|
||||||
class="disabled"
|
|
||||||
<% end %>>
|
|
||||||
<a
|
|
||||||
<% if can_create_repositories?(current_team) && current_team.repositories.count < Constants::REPOSITORIES_LIMIT %>
|
|
||||||
href="<%= create_modal_team_repositories_path %>"
|
|
||||||
class='create-repository'
|
|
||||||
data-remote='true'
|
|
||||||
<% end %>>
|
|
||||||
<span class="glyphicon glyphicon-plus"></span>
|
|
||||||
<span class="hidden-xs"> <%= t('repositories.index.add_new_repository_tab') %></span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<!-- Tab panes -->
|
|
||||||
<div class="tab-content">
|
|
||||||
<% @repositories.each do |repo| %>
|
|
||||||
<div class="tab-pane tab-pane-settings" id="custom_repo_<%= repo.id %>">
|
|
||||||
<!-- Tab Content -->
|
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="tab-content-body"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<!-- If member of no teams -->
|
<!-- If member of no teams -->
|
||||||
<div class="jumbotron">
|
<div class="jumbotron">
|
||||||
|
@ -54,6 +24,4 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= stylesheet_link_tag 'datatables' %>
|
|
||||||
<%= javascript_include_tag 'repositories/repository_datatable' %>
|
|
||||||
<%= javascript_include_tag "repositories/index", "data-turbolinks-track" => true %>
|
<%= javascript_include_tag "repositories/index", "data-turbolinks-track" => true %>
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
<%= render partial: "repositories/delete_record_modal.html.erb" %>
|
<% provide(:head_title, t("libraries.show.head_title", library: @repository.name)) %>
|
||||||
<%= render partial: "repositories/delete_column_modal.html.erb" %>
|
<%= stylesheet_link_tag 'datatables' %>
|
||||||
<%= render partial: 'repositories/export_repository_modal.html.erb',
|
|
||||||
locals: { repository: repository } %>
|
|
||||||
|
|
||||||
|
<%= render partial: "sidebar", locals: { repositories: @repositories } %>
|
||||||
<div id="alert-container"></div>
|
<div id="alert-container"></div>
|
||||||
|
|
||||||
<div id="repository-toolbar">
|
<div id="repository-toolbar">
|
||||||
|
|
||||||
<% if can_create_repository_rows?(repository.team) %>
|
<% if can_create_repository_rows?(@repository.team) %>
|
||||||
<button type="button" class="btn btn-default editAdd" id="addRepositoryRecord" onclick="onClickAddRecord()">
|
<button type="button" class="btn btn-default editAdd" id="addRepositoryRecord" onclick="onClickAddRecord()">
|
||||||
<span class="glyphicon glyphicon-plus"></span>
|
<span class="glyphicon glyphicon-plus"></span>
|
||||||
<span class="hidden-xs"><%= t("repositories.add_new_record") %></span>
|
<span class="hidden-xs"><%= t("repositories.add_new_record") %></span>
|
||||||
|
@ -18,7 +17,7 @@
|
||||||
</button>
|
</button>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if can_read_team?(repository.team) %>
|
<% if can_read_team?(@repository.team) %>
|
||||||
<a href="#" class="btn btn-default" id="exportRepositoriesButton" data-turbolinks="false">
|
<a href="#" class="btn btn-default" id="exportRepositoriesButton" data-turbolinks="false">
|
||||||
<span class="glyphicon glyphicon-cloud-download"></span>
|
<span class="glyphicon glyphicon-cloud-download"></span>
|
||||||
<span class="hidden-xs"><%= t("my_modules.repository.export") %></span>
|
<span class="hidden-xs"><%= t("my_modules.repository.export") %></span>
|
||||||
|
@ -32,36 +31,36 @@
|
||||||
data-toggle="dropdown"
|
data-toggle="dropdown"
|
||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
aria-expanded="true"
|
aria-expanded="true"
|
||||||
<%= "disabled='disabled'" unless can_manage_repository?(repository) || can_create_repositories?(repository.team) %>>
|
<%= "disabled" unless can_manage_repository?(@repository) || can_create_repositories?(@repository.team) %>>
|
||||||
<span class="glyphicon glyphicon-cog"></span>
|
<span class="glyphicon glyphicon-cog"></span>
|
||||||
<span class="caret"></span>
|
<span class="caret"></span>
|
||||||
</div>
|
</div>
|
||||||
<% if can_manage_repository?(repository) || can_create_repositories?(repository.team) %>
|
<% if can_manage_repository?(@repository) || can_create_repositories?(@repository.team) %>
|
||||||
<ul class="dropdown-menu pull-right">
|
<ul class="dropdown-menu pull-right">
|
||||||
<li class="dropdown-header">
|
<li class="dropdown-header">
|
||||||
<%= t("repositories.index.options_dropdown.header") %>
|
<%= t("repositories.index.options_dropdown.header") %>
|
||||||
</li>
|
</li>
|
||||||
<% if can_manage_repository?(repository) %>
|
<% if can_manage_repository?(@repository) %>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to t('repositories.index.options_dropdown.rename'),
|
<%= link_to t('repositories.index.options_dropdown.rename'),
|
||||||
team_repository_rename_modal_path(repository_id: repository),
|
team_repository_rename_modal_path(current_team, repository_id: @repository),
|
||||||
class: "rename-repo-option",
|
class: "rename-repo-option",
|
||||||
remote: true %>
|
remote: true %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if can_create_repositories?(repository.team) %>
|
<% if can_create_repositories?(@repository.team) %>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to t('repositories.index.options_dropdown.copy'),
|
<%= link_to t('repositories.index.options_dropdown.copy'),
|
||||||
team_repository_copy_modal_path(repository_id: repository),
|
team_repository_copy_modal_path(current_team, repository_id: @repository),
|
||||||
class: "copy-repo-option",
|
class: "copy-repo-option",
|
||||||
remote: true %>
|
remote: true %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if can_manage_repository?(repository) %>
|
<% if can_manage_repository?(@repository) %>
|
||||||
<li role="separator" class="divider"></li>
|
<li role="separator" class="divider"></li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to t('repositories.index.modal_delete.delete'),
|
<%= link_to t('repositories.index.modal_delete.delete'),
|
||||||
team_repository_destroy_modal_path(repository_id: repository),
|
team_repository_destroy_modal_path(current_team, repository_id: @repository),
|
||||||
class: "delete-repo-option",
|
class: "delete-repo-option",
|
||||||
remote: true %>
|
remote: true %>
|
||||||
</li>
|
</li>
|
||||||
|
@ -71,8 +70,40 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="datatables-buttons" style="display: inline;">
|
<div id="datatables-buttons" style="display: inline;">
|
||||||
<%= render partial: "columns_reorder_dropdown", formats: :html %>
|
<div class="new-repository-button">
|
||||||
|
<% 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 %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="repository-columns-dropdown" class="dropdown">
|
||||||
|
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
|
||||||
|
<%= t('repositories.columns') %>
|
||||||
|
<span class="caret"></span>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-right smart-dropdown" id="repository-columns-list">
|
||||||
|
<% if can_create_repository_columns?(@repository.team) %>
|
||||||
|
<li class="add-new-column-form">
|
||||||
|
<div id="new-column-form" class="form-group" data-action="<%= repository_repository_columns_path(@repository) %>">
|
||||||
|
<div class="input-group">
|
||||||
|
<input class="form-control" id="new-column-name" placeholder="<%= t("repositories.column_new_text") %>">
|
||||||
|
<span class="input-group-btn">
|
||||||
|
<a id="add-new-column-button" class="btn btn-primary">
|
||||||
|
<%= t("repositories.column_create") %>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -94,7 +125,7 @@
|
||||||
<span class="hidden-xs-custom"><%= t("repositories.edit_record") %></span>
|
<span class="hidden-xs-custom"><%= t("repositories.edit_record") %></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<% if can_manage_repository_rows?(repository.team) %>
|
<% if can_manage_repository_rows?(@repository.team) %>
|
||||||
<button type="button" class="btn btn-default"
|
<button type="button" class="btn btn-default"
|
||||||
id="deleteRepositoryRecordsButton" data-target="#deleteRepositoryRecord" data-toggle="modal" disabled>
|
id="deleteRepositoryRecordsButton" data-target="#deleteRepositoryRecord" data-toggle="modal" disabled>
|
||||||
<span class="glyphicon glyphicon-trash"></span>
|
<span class="glyphicon glyphicon-trash"></span>
|
||||||
|
@ -107,10 +138,19 @@
|
||||||
|
|
||||||
<%= render partial: "repositories/repository_table.html.erb",
|
<%= render partial: "repositories/repository_table.html.erb",
|
||||||
locals: {
|
locals: {
|
||||||
repository: repository,
|
repository: @repository,
|
||||||
repository_index_link: repository_table_index_path(repository)
|
repository_index_link: repository_table_index_path(@repository)
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
<%= render partial: 'repositories/import_repository_records_modal.html.erb',
|
<%= render partial: 'repositories/import_repository_records_modal.html.erb',
|
||||||
locals: { repository: repository } %>
|
locals: { repository: @repository } %>
|
||||||
|
|
||||||
|
<%= 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 } %>
|
||||||
|
|
||||||
<%= javascript_include_tag 'repositories/edit', 'data-turbolinks-track' => true %>
|
<%= javascript_include_tag 'repositories/edit', 'data-turbolinks-track' => true %>
|
||||||
|
<%= javascript_include_tag 'repositories/repository_datatable' %>
|
||||||
|
<%= javascript_include_tag "repositories/show", "data-turbolinks-track" => true %>
|
||||||
|
<%= javascript_include_tag "repositories/index", "data-turbolinks-track" => true %>
|
|
@ -1,13 +1,26 @@
|
||||||
<div id="left-menu-bar" class="menu-bar">
|
<div id="left-menu-bar" class="menu-bar">
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
|
<li class="text-center">
|
||||||
|
<span id="sideBarLeft"
|
||||||
|
class="glyphicon glyphicon-chevron-left"
|
||||||
|
aria-hidden="true"
|
||||||
|
onclick="SideBarToggle.hide()"
|
||||||
|
></span>
|
||||||
|
<span id="sideBarRight"
|
||||||
|
class="glyphicon glyphicon-chevron-right"
|
||||||
|
aria-hidden="true"
|
||||||
|
onclick="SideBarToggle.show()"
|
||||||
|
style="display:none;"
|
||||||
|
></span>
|
||||||
|
</li>
|
||||||
<li class="<%= "active" if projects_are_selected? %>">
|
<li class="<%= "active" if projects_are_selected? %>">
|
||||||
<%= link_to projects_path, id: "projects-link", class: "toggle-sidebar-link", title: t('left_menu_bar.projects') do %>
|
<%= link_to projects_path, id: "projects-link", title: t('left_menu_bar.projects') do %>
|
||||||
<span class="glyphicon glyphicon-home"></span>
|
<span class="glyphicon glyphicon-home"></span>
|
||||||
<span><%= t('left_menu_bar.projects') %></span>
|
<span><%= t('left_menu_bar.projects') %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li class="<%= "active" if repositories_are_selected? %>">
|
<li class="<%= "active" if repositories_are_selected? %>">
|
||||||
<%= link_to team_repositories_path(current_team), id: "repositories-link", title: t('left_menu_bar.repositories') do %>
|
<%= link_to repositories_path, id: "repositories-link", title: t('left_menu_bar.repositories') do %>
|
||||||
<span class="fa fa-cubes" aria-hidden="true"></span>
|
<span class="fa fa-cubes" aria-hidden="true"></span>
|
||||||
<span><%= t('left_menu_bar.repositories') %></span>
|
<span><%= t('left_menu_bar.repositories') %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -65,3 +78,5 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= javascript_include_tag("sidebar_toggle") %>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<%= content_for :sidebar do %>
|
<%= content_for :sidebar do %>
|
||||||
<div id="slide-panel" class="visible">
|
<div id="slide-panel" class="visible">
|
||||||
|
|
||||||
<div class="tree">
|
<div class="tree">
|
||||||
<ul>
|
<ul>
|
||||||
<% if project_page? && action_name == 'index' ||
|
<% if project_page? && action_name == 'index' ||
|
||||||
|
|
|
@ -83,6 +83,8 @@ Rails.application.config.assets.precompile +=
|
||||||
Rails.application.config.assets.precompile +=
|
Rails.application.config.assets.precompile +=
|
||||||
%w(repositories/my_module_repository.js)
|
%w(repositories/my_module_repository.js)
|
||||||
Rails.application.config.assets.precompile += %w(activities/index.js)
|
Rails.application.config.assets.precompile += %w(activities/index.js)
|
||||||
|
Rails.application.config.assets.precompile += %w(repositories/show.js)
|
||||||
|
Rails.application.config.assets.precompile += %w(sidebar_toggle.js)
|
||||||
|
|
||||||
# Libraries needed for Handsontable formulas
|
# Libraries needed for Handsontable formulas
|
||||||
Rails.application.config.assets.precompile += %w(lodash.js)
|
Rails.application.config.assets.precompile += %w(lodash.js)
|
||||||
|
|
|
@ -990,6 +990,17 @@ en:
|
||||||
no_records_unassigned_flash: "No items were unassigned from task"
|
no_records_unassigned_flash: "No items were unassigned from task"
|
||||||
default_column: 'Name'
|
default_column: 'Name'
|
||||||
|
|
||||||
|
libraries:
|
||||||
|
sidebar:
|
||||||
|
title: "Inventories"
|
||||||
|
index:
|
||||||
|
head_title: "Inventories"
|
||||||
|
no_libraries:
|
||||||
|
text: "You don't have any inventories."
|
||||||
|
title: "Please create your first Inventory"
|
||||||
|
create_new_button: "Create New Inventory"
|
||||||
|
show:
|
||||||
|
head_title: "Inventories | %{library}"
|
||||||
repository_row:
|
repository_row:
|
||||||
modal_info:
|
modal_info:
|
||||||
head_title: "Information for item '%{repository_row}'"
|
head_title: "Information for item '%{repository_row}'"
|
||||||
|
|
|
@ -153,8 +153,6 @@ Rails.application.routes.draw do
|
||||||
get 'create_modal', to: 'repositories#create_modal',
|
get 'create_modal', to: 'repositories#create_modal',
|
||||||
defaults: { format: 'json' }
|
defaults: { format: 'json' }
|
||||||
end
|
end
|
||||||
get 'show_tab', to: 'repositories#show_tab',
|
|
||||||
defaults: { format: 'json' }
|
|
||||||
get 'destroy_modal', to: 'repositories#destroy_modal',
|
get 'destroy_modal', to: 'repositories#destroy_modal',
|
||||||
defaults: { format: 'json' }
|
defaults: { format: 'json' }
|
||||||
get 'rename_modal', to: 'repositories#rename_modal',
|
get 'rename_modal', to: 'repositories#rename_modal',
|
||||||
|
|
Loading…
Add table
Reference in a new issue