diff --git a/app/assets/javascripts/shared/inline_editing.js b/app/assets/javascripts/shared/inline_editing.js
index 650ac64cc..aa9de0266 100644
--- a/app/assets/javascripts/shared/inline_editing.js
+++ b/app/assets/javascripts/shared/inline_editing.js
@@ -25,12 +25,20 @@ function initInlineEditing(title) {
$('.inline-edit-active').find('.save-button').click();
}
+ function appendAfterLabel() {
+ if (editBlock.dataset.labelAfter) {
+ $(editBlock.dataset.labelAfter).appendTo($editBlock.find('.view-mode'));
+ }
+ }
+ appendAfterLabel();
+
function updateField() {
var params = {};
if (inputString.value === editBlock.dataset.originalName) {
inputString.disabled = true;
editBlock.dataset.editMode = 0;
+ editBlock.dataset.error = false;
$inputString.addClass('hidden');
$editBlock.find('.view-mode').removeClass('hidden');
return false;
@@ -58,6 +66,7 @@ function initInlineEditing(title) {
editBlock.dataset.error = false;
$inputString.addClass('hidden');
$editBlock.find('.view-mode').html(viewData).removeClass('hidden');
+ appendAfterLabel();
inputString.disabled = true;
editBlock.dataset.editMode = 0;
@@ -109,6 +118,12 @@ function initInlineEditing(title) {
e.stopPropagation();
});
+ $inputString.keyup((e) => {
+ if(e.keyCode === 13 && $inputString.is('input')) {
+ updateField();
+ }
+ })
+
$($editBlock.find('.cancel-button')).click(e => {
inputString.disabled = true;
editBlock.dataset.editMode = 0;
diff --git a/app/assets/stylesheets/partials/_inline_editing.scss b/app/assets/stylesheets/partials/_inline_editing.scss
index c5e4d9f01..6f19a0a07 100644
--- a/app/assets/stylesheets/partials/_inline_editing.scss
+++ b/app/assets/stylesheets/partials/_inline_editing.scss
@@ -8,8 +8,8 @@
position: relative;
.button-container {
- height: 44px;
- line-height: 44px;
+ height: 32px;
+ line-height: 32px;
overflow: hidden;
position: absolute;
right: 0;
@@ -34,9 +34,8 @@
bottom: 3px;
color: $brand-danger;
display: none;
- font-size: $font-size-small;
- left: 5px;
- line-height: 12px;
+ font-size: 11px;
+ line-height: 11px;
position: absolute;
}
@@ -48,7 +47,9 @@
}
input {
- padding-bottom: 16px;
+ font-size: 16px;
+ line-height: 20px;
+ padding-bottom: 10px;
padding-top: 0;
}
}
@@ -56,6 +57,7 @@
&:hover input,
&:hover .view-mode {
border: 1px solid $color-silver;
+ border-radius: 3px;
&:disabled {
border: 1px solid $color-gainsboro;
@@ -67,22 +69,24 @@
cursor: pointer;
flex-wrap: nowrap;
line-height: 26px;
+ margin-left: -5px;
overflow: hidden;
- padding: 8px 5px;
+ padding: 2px 4px;
padding-right: 36px;
text-overflow: ellipsis;
white-space: nowrap;
- width: calc(100% - 36px);
+ width: calc(100% - 32px);
}
input {
border: 1px solid $color-silver;
border-radius: $border-radius-small;
cursor: pointer;
- line-height: 20px;
- padding: 8px 5px;
+ line-height: 26px;
+ margin-left: -5px;
+ padding: 2px 4px;
padding-right: 36px;
- width: calc(100% - 36px);
+ width: calc(100% - 32px);
&:focus {
outline: 0;
@@ -97,19 +101,7 @@
+ .button-container {
display: none;
-
}
}
}
}
-
-.nav-name.editable {
- margin: 0;
-
- .inline-editing-container {
-
- input {
- line-height: 26px;
- }
- }
-}
diff --git a/app/assets/stylesheets/repositories.scss b/app/assets/stylesheets/repositories.scss
index a217ceea0..bbc4188df 100644
--- a/app/assets/stylesheets/repositories.scss
+++ b/app/assets/stylesheets/repositories.scss
@@ -79,6 +79,7 @@
align-items: center;
border-bottom: 1px solid $color-gainsboro;
display: flex;
+ height: 55px;
margin-left: -20px;
padding: 5px 15px;
width: calc(100% + 40px);
@@ -88,27 +89,36 @@
margin-top: -2px;
.fas-custom {
- margin-right: 5px;
+ margin-left: 5px;
}
}
- .repository-title {
+ .repository-title-container {
+ display: flex;
+ flex-direction: column;
+ width: calc(100% + 40px);
+ }
+
+ .repository-title-name {
flex-grow: 1;
font-size: 18px;
- line-height: 50px;
+ line-height: 32px;
margin-right: 20px;
overflow: hidden;
+ padding-left: 5px;
text-overflow: ellipsis;
white-space: nowrap;
.inline-editing-container {
width: 100%;
-
- input {
- line-height: 26px;
- }
}
+ }
+ .repository-subtitle {
+ color: $color-silver-chalice;
+ font-size: 12px;
+ line-height: 12px;
+ padding-left: 5px;
}
.datatables-buttons {
diff --git a/app/assets/stylesheets/themes/scinote.scss b/app/assets/stylesheets/themes/scinote.scss
index 491a2177a..c2cb9f281 100644
--- a/app/assets/stylesheets/themes/scinote.scss
+++ b/app/assets/stylesheets/themes/scinote.scss
@@ -320,11 +320,13 @@ a[data-toggle="tooltip"] {
}
.nav-name {
+ align-items: center;
+ display: flex;
height: 54px;
line-height: 44px;
margin: 0;
overflow: hidden;
- padding: 5px 0;
+ padding: 5px;
text-overflow: ellipsis;
white-space: nowrap;
}
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 578b71089..df8805727 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -1,6 +1,11 @@
# frozen_string_literal: true
class RepositoriesController < ApplicationController
+ include InventoriesHelper
+ include ActionView::Helpers::TagHelper
+ include ActionView::Context
+ include IconsHelper
+
before_action :load_vars,
except: %i(index create create_modal parse_sheet)
before_action :load_parent_vars, except:
@@ -324,7 +329,8 @@ class RepositoriesController < ApplicationController
name: 'title',
params_group: 'repository',
field_to_udpate: 'name',
- path_to_update: team_repository_path(@repository)
+ path_to_update: team_repository_path(@repository),
+ label_after: "