From 2de2ead723f379d0c71a9e086d965bd232c83a39 Mon Sep 17 00:00:00 2001
From: aignatov-bio <47317017+aignatov-bio@users.noreply.github.com>
Date: Tue, 21 May 2019 15:19:44 +0200
Subject: [PATCH] Refactor avatar image appearance across Scinote [SCI-3482]
(#1787)
* Refactor avatar appearance across Scinote
---
.../javascripts/shared/inline_editing.js | 6 +-
.../javascripts/sitewide/atwho_res.js.erb | 2 +-
app/assets/stylesheets/application.scss | 1 +
app/assets/stylesheets/extend/bootstrap.scss | 16 +++---
app/assets/stylesheets/shared/avatar.scss | 18 ++++++
app/assets/stylesheets/steps.scss | 7 +--
.../stylesheets/themes/main_navigation.scss | 7 ---
app/assets/stylesheets/themes/scinote.scss | 36 +++++++-----
app/controllers/step_comments_controller.rb | 3 +-
app/helpers/application_helper.rb | 55 +++++++++----------
app/views/shared/_navigation.html.erb | 4 +-
app/views/steps/comments/_item.html.erb | 9 ++-
app/views/user_my_modules/_index.html.erb | 5 +-
.../user_my_modules/_index_edit.html.erb | 6 +-
.../icons/_recent_changes.html.erb | 4 +-
app/views/user_projects/_index.html.erb | 6 +-
app/views/user_projects/_index_edit.html.erb | 6 +-
config/initializers/constants.rb | 6 +-
18 files changed, 108 insertions(+), 89 deletions(-)
create mode 100644 app/assets/stylesheets/shared/avatar.scss
diff --git a/app/assets/javascripts/shared/inline_editing.js b/app/assets/javascripts/shared/inline_editing.js
index 1177deed6..bbd72ea3f 100644
--- a/app/assets/javascripts/shared/inline_editing.js
+++ b/app/assets/javascripts/shared/inline_editing.js
@@ -3,10 +3,6 @@
function initInlineEditing(title) {
var editBlocks = $('.' + title + '-editable-field');
- function prepareText(text) {
- return text.replace(/(?:\r\n|\r|\n)/g, '
');
- }
-
$.each(editBlocks, function(i, element) {
var editBlock = element;
var $editBlock = $(editBlock);
@@ -59,7 +55,7 @@ function initInlineEditing(title) {
editBlock.dataset.originalName = inputString.value;
editBlock.dataset.error = false;
$inputString.addClass('hidden');
- $editBlock.find('.view-mode').html(prepareText(viewData)).removeClass('hidden');
+ $editBlock.find('.view-mode').html(viewData).removeClass('hidden');
inputString.disabled = true;
editBlock.dataset.editMode = 0;
diff --git a/app/assets/javascripts/sitewide/atwho_res.js.erb b/app/assets/javascripts/sitewide/atwho_res.js.erb
index b2677a9ef..7dd0ebd13 100644
--- a/app/assets/javascripts/sitewide/atwho_res.js.erb
+++ b/app/assets/javascripts/sitewide/atwho_res.js.erb
@@ -411,7 +411,7 @@ var SmartAnnotation = (function() {
res += '