mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 05:04:35 +08:00
Removed unneeded ERB tags, which caused error. Minor refactoring.
This commit is contained in:
parent
ece89da391
commit
a6a2a237aa
27 changed files with 169 additions and 113 deletions
|
@ -36,7 +36,7 @@ var DEFAULT_CONNECTOR_STYLE =
|
||||||
} ];
|
} ];
|
||||||
var DEFAULT_CONNECTOR_STYLE_2 =
|
var DEFAULT_CONNECTOR_STYLE_2 =
|
||||||
{
|
{
|
||||||
strokeStyle: "#FFFFFF",
|
strokeStyle: "<%= Constants::COLOR_WHITE %>",
|
||||||
lineWidth: 1.5,
|
lineWidth: 1.5,
|
||||||
outlineColor: "transparent",
|
outlineColor: "transparent",
|
||||||
outlineWidth: 0
|
outlineWidth: 0
|
||||||
|
@ -57,7 +57,7 @@ var EDIT_ENDPOINT_STYLE =
|
||||||
} ];
|
} ];
|
||||||
var EDIT_CONNECTOR_STYLE_2 =
|
var EDIT_CONNECTOR_STYLE_2 =
|
||||||
{
|
{
|
||||||
strokeStyle: "#FFFFFF",
|
strokeStyle: "<%= Constants::COLOR_WHITE %>",
|
||||||
lineWidth: 3,
|
lineWidth: 3,
|
||||||
outlineColor: "transparent",
|
outlineColor: "transparent",
|
||||||
outlineWidth: 0
|
outlineWidth: 0
|
||||||
|
|
|
@ -466,12 +466,12 @@
|
||||||
.find('.form-submit-link')
|
.find('.form-submit-link')
|
||||||
.css({
|
.css({
|
||||||
'pointer-events': 'none',
|
'pointer-events': 'none',
|
||||||
'color': '#d2d2d2'});
|
'color': <%= Constants::COLOR_ALTO %>});
|
||||||
$(el)
|
$(el)
|
||||||
.find('[data-action="edit"]')
|
.find('[data-action="edit"]')
|
||||||
.css({
|
.css({
|
||||||
'pointer-events': 'none',
|
'pointer-events': 'none',
|
||||||
'color': '#d2d2d2'});
|
'color': <%= Constants::COLOR_ALTO %>});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -489,12 +489,12 @@
|
||||||
.find('.form-submit-link')
|
.find('.form-submit-link')
|
||||||
.css({
|
.css({
|
||||||
'pointer-events': 'auto',
|
'pointer-events': 'auto',
|
||||||
'color': '#262626'});
|
'color': <%= Constants::COLOR_NERO %>});
|
||||||
$(el)
|
$(el)
|
||||||
.find('[data-action="edit"]')
|
.find('[data-action="edit"]')
|
||||||
.css({
|
.css({
|
||||||
'pointer-events': 'auto',
|
'pointer-events': 'auto',
|
||||||
'color': '#262626'});
|
'color': <%= Constants::COLOR_NERO %>});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -280,8 +280,8 @@ function initHandsOnTable(root) {
|
||||||
var contents = $(this).find('.hot-contents');
|
var contents = $(this).find('.hot-contents');
|
||||||
|
|
||||||
$container.handsontable({
|
$container.handsontable({
|
||||||
startRows: 5,
|
startRows: <%= Constants::HANDSONTABLE_INIT_ROWS_CNT %>,
|
||||||
startCols: 5,
|
startCols: <%= Constants::HANDSONTABLE_INIT_COLS_CNT %>,
|
||||||
rowHeaders: true,
|
rowHeaders: true,
|
||||||
colHeaders: true,
|
colHeaders: true,
|
||||||
fillHandle: false,
|
fillHandle: false,
|
||||||
|
@ -326,8 +326,8 @@ function initEditableHandsOnTable(root) {
|
||||||
|
|
||||||
$container.handsontable({
|
$container.handsontable({
|
||||||
data: data,
|
data: data,
|
||||||
startRows: 5,
|
startRows: <%= Constants::HANDSONTABLE_INIT_ROWS_CNT %>,
|
||||||
startCols: 5,
|
startCols: <%= Constants::HANDSONTABLE_INIT_COLS_CNT %>,
|
||||||
minRows: 1,
|
minRows: 1,
|
||||||
minCols: 1,
|
minCols: 1,
|
||||||
rowHeaders: true,
|
rowHeaders: true,
|
||||||
|
|
|
@ -1125,7 +1125,7 @@ function initializeReportSidebartruncation() {
|
||||||
$.each($("a.report-nav-link"),
|
$.each($("a.report-nav-link"),
|
||||||
function(){
|
function(){
|
||||||
truncateLongString($(this),
|
truncateLongString($(this),
|
||||||
<%= Constants::NAME_TRUNCATION_LENGTH %>);
|
<%= Constants::NAME_TRUNCATION_LENGTH %>);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -10,8 +10,8 @@ function initEditableHandsOnTable(root) {
|
||||||
|
|
||||||
$container.handsontable({
|
$container.handsontable({
|
||||||
data: data,
|
data: data,
|
||||||
startRows: 5,
|
startRows: <%= Constants::HANDSONTABLE_INIT_ROWS_CNT %>,
|
||||||
startCols: 5,
|
startCols: <%= Constants::HANDSONTABLE_INIT_COLS_CNT %>,
|
||||||
minRows: 1,
|
minRows: 1,
|
||||||
minCols: 1,
|
minCols: 1,
|
||||||
rowHeaders: true,
|
rowHeaders: true,
|
|
@ -38,4 +38,4 @@ $("form#form-import")
|
||||||
// Populate the errors container
|
// Populate the errors container
|
||||||
$("#import-errors-container").html(data.responseJSON.html);
|
$("#import-errors-container").html(data.responseJSON.html);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
|
|
||||||
var STORAGE_TREE_KEY = "scinote-sidebar-tree-collapsed-ids";
|
var STORAGE_TREE_KEY = "scinote-sidebar-tree-collapsed-ids";
|
||||||
var STORAGE_TOGGLE_KEY = "scinote-sidebar-toggled";
|
var STORAGE_TOGGLE_KEY = "scinote-sidebar-toggled";
|
||||||
var SCREEN_SIZE_LARGE = 928;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all collapsed sidebar elements.
|
* Get all collapsed sidebar elements.
|
||||||
|
@ -251,7 +250,8 @@ function initializeSidebarToggle() {
|
||||||
var wrapper = $("#wrapper");
|
var wrapper = $("#wrapper");
|
||||||
var toggled = sessionIsSidebarToggled();
|
var toggled = sessionIsSidebarToggled();
|
||||||
|
|
||||||
if (toggled || toggled === null && $(window).width() < SCREEN_SIZE_LARGE) {
|
if (toggled || toggled === null && $(window).width() <
|
||||||
|
<%= Constants::SCREEN_WIDTH_LARGE %>) {
|
||||||
wrapper.addClass("no-animation");
|
wrapper.addClass("no-animation");
|
||||||
wrapper.addClass("toggled");
|
wrapper.addClass("toggled");
|
||||||
// Cause reflow of the wrapper element
|
// Cause reflow of the wrapper element
|
||||||
|
@ -283,7 +283,7 @@ function resizeSidebarContents() {
|
||||||
}
|
}
|
||||||
// Automatic toggling of sidebar for smaller devices
|
// Automatic toggling of sidebar for smaller devices
|
||||||
if (toggled === null) {
|
if (toggled === null) {
|
||||||
if ($(window).width() < SCREEN_SIZE_LARGE) {
|
if ($(window).width() < <%= Constants::SCREEN_WIDTH_LARGE %>) {
|
||||||
wrapper.addClass("toggled");
|
wrapper.addClass("toggled");
|
||||||
navbar.addClass("navbar-without-sidebar");
|
navbar.addClass("navbar-without-sidebar");
|
||||||
} else {
|
} else {
|
|
@ -3,26 +3,28 @@ $color-theme-primary: #37a0d9;
|
||||||
$color-theme-secondary: #8fd13f;
|
$color-theme-secondary: #8fd13f;
|
||||||
$color-theme-dark: #6d6e71;
|
$color-theme-dark: #6d6e71;
|
||||||
|
|
||||||
// Grayscales
|
// Grayscale colors
|
||||||
$color-white: #fff;
|
$color-white: #fff;
|
||||||
$color-alabaster: #fcfcfc;
|
$color-alabaster: #fcfcfc;
|
||||||
$color-wild-sand: #f5f5f5;
|
$color-wild-sand: #f5f5f5;
|
||||||
$color-concrete: #f2f2f2;
|
$color-concrete: #f2f2f2;
|
||||||
$color-gallery: #EEE;
|
$color-gallery: #eee;
|
||||||
$color-alto: #d2d2d2;
|
$color-alto: #d2d2d2;
|
||||||
$color-silver: #c5c5c5;
|
$color-silver: #c5c5c5;
|
||||||
|
$color-dark-gray: #adadad;
|
||||||
$color-silver-chalice: #a0a0a0;
|
$color-silver-chalice: #a0a0a0;
|
||||||
$color-gray: #909088;
|
$color-gray: #909088;
|
||||||
$color-dove-gray: #666666;
|
$color-dove-gray: #666;
|
||||||
$color-emperor: #555;
|
$color-emperor: #555;
|
||||||
$color-mine-shaft: #333;
|
$color-mine-shaft: #333;
|
||||||
|
$color-nero: #262626;
|
||||||
$color-black: #000;
|
$color-black: #000;
|
||||||
|
|
||||||
// Misc.
|
// Miscelaneous colors
|
||||||
$color-mystic: #eaeff2;
|
$color-mystic: #eaeff2;
|
||||||
$color-candlelight: #ffda23;
|
$color-candlelight: #ffda23;
|
||||||
|
|
||||||
// Reds
|
// Red colors
|
||||||
$color-mojo: #cf4b48;
|
$color-mojo: #cf4b48;
|
||||||
$color-apple-blossom: #a94442;
|
$color-apple-blossom: #a94442;
|
||||||
$color-milano-red: #a70b05;
|
$color-milano-red: #a70b05;
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
// They will automatically be included in application.css.
|
// They will automatically be included in application.css.
|
||||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||||
|
|
||||||
|
@import 'colors';
|
||||||
|
|
||||||
#search-content {
|
#search-content {
|
||||||
background-color: #fff;
|
background-color: $color-white;
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
}
|
}
|
||||||
.search-asset-text-data{
|
.search-asset-text-data{
|
||||||
|
|
|
@ -650,7 +650,7 @@ a[data-toggle="tooltip"] {
|
||||||
&:focus, &:active, &:hover {
|
&:focus, &:active, &:hover {
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
background-color: $color-theme-primary;
|
background-color: $color-theme-primary;
|
||||||
border-color: #adadad;
|
border-color: $color-dark-gray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1064,7 +1064,7 @@ ul.content-module-activities {
|
||||||
}
|
}
|
||||||
|
|
||||||
.badge-preview {
|
.badge-preview {
|
||||||
background-color:#c5c5c5;
|
background-color: $color-silver;
|
||||||
border-radius: 2em;
|
border-radius: 2em;
|
||||||
float: left;
|
float: left;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
@ -1247,12 +1247,12 @@ table.dataTable {
|
||||||
top: 50%;
|
top: 50%;
|
||||||
margin-top: -19px;
|
margin-top: -19px;
|
||||||
border-top: 19px solid transparent;
|
border-top: 19px solid transparent;
|
||||||
border-left: 13px solid #37A0D9;
|
border-left: 13px solid $color-theme-primary;
|
||||||
border-bottom: 19px solid transparent;
|
border-bottom: 19px solid transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-stacked-arrow > li.active > a:hover:after {
|
.nav-stacked-arrow > li.active > a:hover:after {
|
||||||
border-left: 13px solid #337ab7;
|
border-left: 13px solid darken($color-theme-primary, 15%);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Overlay to disable interaction while loading ajax */
|
/* Overlay to disable interaction while loading ajax */
|
||||||
|
|
|
@ -2,7 +2,7 @@ class ActivitiesController < ApplicationController
|
||||||
before_filter :load_vars
|
before_filter :load_vars
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@per_page = 10
|
@per_page = Constants::ACTIVITY_AND_NOTIF_SEARCH_LIMIT
|
||||||
@activities = current_user.last_activities(@last_activity_id,
|
@activities = current_user.last_activities(@last_activity_id,
|
||||||
@per_page + 1)
|
@per_page + 1)
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ class SampleMyModulesController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@number_of_samples = @my_module.number_of_samples
|
@number_of_samples = @my_module.number_of_samples
|
||||||
@samples = @my_module.first_n_samples(5)
|
@samples = @my_module.first_n_samples
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json {
|
format.json {
|
||||||
|
|
|
@ -3,7 +3,7 @@ class UserNotificationsController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@last_notification_id = params[:from].to_i || 0
|
@last_notification_id = params[:from].to_i || 0
|
||||||
@per_page = 10
|
@per_page = Constants::ACTIVITY_AND_NOTIF_SEARCH_LIMIT
|
||||||
|
|
||||||
@notifications =
|
@notifications =
|
||||||
UserNotification.last_notifications(@current_user,
|
UserNotification.last_notifications(@current_user,
|
||||||
|
|
|
@ -179,7 +179,11 @@ class Users::RegistrationsController < Devise::RegistrationsController
|
||||||
def sign_up_params
|
def sign_up_params
|
||||||
tmp = params.require(:user).permit(:full_name, :initials, :email, :password, :password_confirmation)
|
tmp = params.require(:user).permit(:full_name, :initials, :email, :password, :password_confirmation)
|
||||||
initials = tmp[:full_name].titleize.scan(/[A-Z]+/).join()
|
initials = tmp[:full_name].titleize.scan(/[A-Z]+/).join()
|
||||||
initials = initials.strip.empty? ? "PLCH" : initials[0..3]
|
initials = if initials.strip.empty?
|
||||||
|
'PLCH'
|
||||||
|
else
|
||||||
|
initials[0..Constants::USER_INITIALS_MAX_LENGTH]
|
||||||
|
end
|
||||||
tmp.merge(:initials => initials)
|
tmp.merge(:initials => initials)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ module AssetsHelper
|
||||||
<script type='text/javascript'>
|
<script type='text/javascript'>
|
||||||
$('#asset-loading-spinner-#{asset.id}').spin(
|
$('#asset-loading-spinner-#{asset.id}').spin(
|
||||||
{ lines: 9, length: 4, width: 3, radius: 4, scale: 1, corners: 1,
|
{ lines: 9, length: 4, width: 3, radius: 4, scale: 1, corners: 1,
|
||||||
color: '#000', opacity: 0.25, rotate: 0, direction: 1, speed: 1,
|
color: #{Constants::COLOR_BLACK}, opacity: 0.25, rotate: 0, direction: 1, speed: 1,
|
||||||
trail: 60, fps: 20, zIndex: 100, className: 'spinner', top: '75%',
|
trail: 60, fps: 20, zIndex: 100, className: 'spinner', top: '75%',
|
||||||
left: '50%', shadow: false, hwaccel: false, position: 'relative' }
|
left: '50%', shadow: false, hwaccel: false, position: 'relative' }
|
||||||
);
|
);
|
||||||
|
@ -24,4 +24,4 @@ module AssetsHelper
|
||||||
eos
|
eos
|
||||||
res.html_safe
|
res.html_safe
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -218,14 +218,14 @@ class Experiment < ActiveRecord::Base
|
||||||
use: :neato)
|
use: :neato)
|
||||||
|
|
||||||
graph[:size] = '4,4'
|
graph[:size] = '4,4'
|
||||||
graph.node[color: '#d2d2d2',
|
graph.node[color: Constants::COLOR_ALTO,
|
||||||
style: :filled,
|
style: :filled,
|
||||||
fontcolor: '#555555',
|
fontcolor: Constants::COLOR_EMPEROR,
|
||||||
shape: 'circle',
|
shape: 'circle',
|
||||||
fontname: 'Arial',
|
fontname: 'Arial',
|
||||||
fontsize: '16.0']
|
fontsize: '16.0']
|
||||||
|
|
||||||
graph.edge[color: '#d2d2d2']
|
graph.edge[color: Constants::COLOR_ALTO]
|
||||||
|
|
||||||
label = ''
|
label = ''
|
||||||
subg = {}
|
subg = {}
|
||||||
|
|
|
@ -146,7 +146,7 @@ class MyModule < ActiveRecord::Base
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def last_activities(count = Constants::ACTIVITY_SEARCH_LIMIT)
|
def last_activities(count = Constants::ACTIVITY_AND_NOTIF_SEARCH_LIMIT)
|
||||||
Activity.where(my_module_id: id).order(:created_at).last(count)
|
Activity.where(my_module_id: id).order(:created_at).last(count)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -162,7 +162,8 @@ class MyModule < ActiveRecord::Base
|
||||||
comments.reverse
|
comments.reverse
|
||||||
end
|
end
|
||||||
|
|
||||||
def last_activities(last_id = 1, count = Constants::ACTIVITY_SEARCH_LIMIT)
|
def last_activities(last_id = 1,
|
||||||
|
count = Constants::ACTIVITY_AND_NOTIF_SEARCH_LIMIT)
|
||||||
last_id = 9999999999999 if last_id <= 1
|
last_id = 9999999999999 if last_id <= 1
|
||||||
Activity.joins(:my_module)
|
Activity.joins(:my_module)
|
||||||
.where(my_module_id: id)
|
.where(my_module_id: id)
|
||||||
|
@ -178,7 +179,7 @@ class MyModule < ActiveRecord::Base
|
||||||
protocols.count > 0 ? protocols.first : nil
|
protocols.count > 0 ? protocols.first : nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def first_n_samples(count)
|
def first_n_samples(count = Constants::SEARCH_LIMIT)
|
||||||
samples.order(name: :asc).limit(count)
|
samples.order(name: :asc).limit(count)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ class Project < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def last_activities(count = Constants::ACTIVITY_SEARCH_LIMIT)
|
def last_activities(count = Constants::ACTIVITY_AND_NOTIF_SEARCH_LIMIT)
|
||||||
activities.order(created_at: :desc).first(count)
|
activities.order(created_at: :desc).first(count)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
class User < ActiveRecord::Base
|
class User < ActiveRecord::Base
|
||||||
include SearchableModel
|
include SearchableModel
|
||||||
|
|
||||||
devise :invitable, :confirmable, :database_authenticatable, :registerable, :async,
|
devise :invitable, :confirmable, :database_authenticatable, :registerable,
|
||||||
:recoverable, :rememberable, :trackable, :validatable, stretches: 10
|
:async, :recoverable, :rememberable, :trackable, :validatable,
|
||||||
|
stretches: Constants::PASSWORD_STRETCH_FACTOR
|
||||||
has_attached_file :avatar,
|
has_attached_file :avatar,
|
||||||
styles: {
|
styles: {
|
||||||
medium: Constants::MEDIUM_PIC_FORMAT,
|
medium: Constants::MEDIUM_PIC_FORMAT,
|
||||||
|
@ -239,7 +240,7 @@ class User < ActiveRecord::Base
|
||||||
# is not an owner of the project, user must be also assigned to
|
# is not an owner of the project, user must be also assigned to
|
||||||
# module.
|
# module.
|
||||||
def last_activities(last_activity_id = nil,
|
def last_activities(last_activity_id = nil,
|
||||||
per_page = Constants::ACTIVITY_SEARCH_LIMIT)
|
per_page = Constants::ACTIVITY_AND_NOTIF_SEARCH_LIMIT)
|
||||||
# TODO replace with some kind of Infinity value
|
# TODO replace with some kind of Infinity value
|
||||||
last_activity_id = 999999999999999999999999 if last_activity_id < 1
|
last_activity_id = 999999999999999999999999 if last_activity_id < 1
|
||||||
Activity
|
Activity
|
||||||
|
|
|
@ -6,7 +6,11 @@ class UserNotification < ActiveRecord::Base
|
||||||
|
|
||||||
after_save :send_email
|
after_save :send_email
|
||||||
|
|
||||||
def self.last_notifications(user, last_notification_id = nil, per_page = 10)
|
def self.last_notifications(
|
||||||
|
user,
|
||||||
|
last_notification_id = nil,
|
||||||
|
per_page = Constants::ACTIVITY_AND_NOTIF_SEARCH_LIMIT
|
||||||
|
)
|
||||||
last_notification_id = 999999999999999999999999 if last_notification_id < 1
|
last_notification_id = 999999999999999999999999 if last_notification_id < 1
|
||||||
Notification.joins(:user_notifications)
|
Notification.joins(:user_notifications)
|
||||||
.where('user_notifications.user_id = ?', user.id)
|
.where('user_notifications.user_id = ?', user.id)
|
||||||
|
@ -19,7 +23,7 @@ class UserNotification < ActiveRecord::Base
|
||||||
Notification.joins(:user_notifications)
|
Notification.joins(:user_notifications)
|
||||||
.where('user_notifications.user_id = ?', user.id)
|
.where('user_notifications.user_id = ?', user.id)
|
||||||
.order(created_at: :DESC)
|
.order(created_at: :DESC)
|
||||||
.limit(10)
|
.limit(Constants::COMMENTS_SEARCH_LIMIT)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.unseen_notification_count(user)
|
def self.unseen_notification_count(user)
|
||||||
|
|
|
@ -41,19 +41,19 @@ module FirstTimeDataGenerator
|
||||||
SampleGroup.create(
|
SampleGroup.create(
|
||||||
name: "Fodder",
|
name: "Fodder",
|
||||||
organization: org,
|
organization: org,
|
||||||
color: "#159B5E"
|
color: Constants::TAG_COLORS[1]
|
||||||
)
|
)
|
||||||
|
|
||||||
SampleGroup.create(
|
SampleGroup.create(
|
||||||
name: "Nutrient",
|
name: "Nutrient",
|
||||||
organization: org,
|
organization: org,
|
||||||
color: "#6C159E"
|
color: Constants::TAG_COLORS[0]
|
||||||
)
|
)
|
||||||
|
|
||||||
SampleGroup.create(
|
SampleGroup.create(
|
||||||
name: "Seed",
|
name: "Seed",
|
||||||
organization: org,
|
organization: org,
|
||||||
color: "#FF4500"
|
color: Constants::TAG_COLORS[2]
|
||||||
)
|
)
|
||||||
|
|
||||||
samples = []
|
samples = []
|
||||||
|
@ -360,21 +360,21 @@ module FirstTimeDataGenerator
|
||||||
# Create tags and add them to module
|
# Create tags and add them to module
|
||||||
drylab_tag = Tag.create(
|
drylab_tag = Tag.create(
|
||||||
name: "Drylab",
|
name: "Drylab",
|
||||||
color: "#15369E",
|
color: Constants::TAG_COLORS[8],
|
||||||
project: project,
|
project: project,
|
||||||
created_by: user,
|
created_by: user,
|
||||||
last_modified_by: user
|
last_modified_by: user
|
||||||
)
|
)
|
||||||
wetlab_tag = Tag.create(
|
wetlab_tag = Tag.create(
|
||||||
name: "Wetlab",
|
name: "Wetlab",
|
||||||
color: "#FF8C00",
|
color: Constants::TAG_COLORS[14],
|
||||||
project: project,
|
project: project,
|
||||||
created_by: user,
|
created_by: user,
|
||||||
last_modified_by: user
|
last_modified_by: user
|
||||||
)
|
)
|
||||||
decide_tag = Tag.create(
|
decide_tag = Tag.create(
|
||||||
name: "Decide",
|
name: "Decide",
|
||||||
color: "#32CD32",
|
color: Constants::TAG_COLORS[5],
|
||||||
project: project,
|
project: project,
|
||||||
created_by: user,
|
created_by: user,
|
||||||
last_modified_by: user
|
last_modified_by: user
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<% if activity.my_module %>
|
<% if activity.my_module %>
|
||||||
[<%=t 'Project' %>:
|
[<%=t 'Project' %>:
|
||||||
<% if activity.my_module.experiment.project.name.length >
|
<% if activity.my_module.experiment.project.name.length >
|
||||||
<%= Constants::NAME_TRUNCATION_LENGTH %> %>
|
Constants::NAME_TRUNCATION_LENGTH %>
|
||||||
<div class="modal-tooltip">
|
<div class="modal-tooltip">
|
||||||
<%= truncate(activity.my_module.experiment.project.name,
|
<%= truncate(activity.my_module.experiment.project.name,
|
||||||
lenght: Constants::NAME_TRUNCATION_LENGTH).strip %>
|
lenght: Constants::NAME_TRUNCATION_LENGTH).strip %>
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
<%= activity.my_module.experiment.project.name %>
|
<%= activity.my_module.experiment.project.name %>
|
||||||
<% end %>, <%=t 'Module' %>:
|
<% end %>, <%=t 'Module' %>:
|
||||||
<% if activity.my_module.name.length >
|
<% if activity.my_module.name.length >
|
||||||
<%= Constants::NAME_TRUNCATION_LENGTH %> %>
|
Constants::NAME_TRUNCATION_LENGTH %>
|
||||||
<div class="modal-tooltip"><%= truncate(
|
<div class="modal-tooltip"><%= truncate(
|
||||||
activity.my_module.name,
|
activity.my_module.name,
|
||||||
lenght: Constants::NAME_TRUNCATION_LENGTH) %>
|
lenght: Constants::NAME_TRUNCATION_LENGTH) %>
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
<%= f.text_field :name, hide_label: true %>
|
<%= f.text_field :name, hide_label: true %>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<%= f.color_picker_select :color, <%= Constants::TAG_COLORS %>, class: "edit-tag-color" %>
|
<%= f.color_picker_select :color, Constants::TAG_COLORS, class: "edit-tag-color" %>
|
||||||
<%= f.button class: "btn btn-link save-tag-link", title: t("experiments.canvas.modal_manage_tags.save_tag") do %>
|
<%= f.button class: "btn btn-link save-tag-link", title: t("experiments.canvas.modal_manage_tags.save_tag") do %>
|
||||||
<span class="glyphicon glyphicon-ok"></span>
|
<span class="glyphicon glyphicon-ok"></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -84,7 +84,7 @@
|
||||||
<%= hidden_field_tag :my_module_id, @my_module.id %>
|
<%= hidden_field_tag :my_module_id, @my_module.id %>
|
||||||
<%= f.hidden_field :project_id, :value => @my_module.experiment.project.id %>
|
<%= f.hidden_field :project_id, :value => @my_module.experiment.project.id %>
|
||||||
<%= f.hidden_field :name, :value => t("tags.create.new_name") %>
|
<%= f.hidden_field :name, :value => t("tags.create.new_name") %>
|
||||||
<%= f.hidden_field :color, :value => <%= Constants::TAG_COLORS[0] %> %>
|
<%= f.hidden_field :color, :value => Constants::TAG_COLORS[0] %>
|
||||||
<%= f.button class: "btn btn-primary" do %>
|
<%= f.button class: "btn btn-primary" do %>
|
||||||
<span class="glyphicon glyphicon-tag"></span>
|
<span class="glyphicon glyphicon-tag"></span>
|
||||||
<span class="hidden-xs"><%=t "experiments.canvas.modal_manage_tags.create_new" %></span>
|
<span class="hidden-xs"><%=t "experiments.canvas.modal_manage_tags.create_new" %></span>
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<div class="workflowimg-container">
|
<div class="workflowimg-container">
|
||||||
<%= image_tag(
|
<%= image_tag(
|
||||||
experiment.workflowimg.expiring_url(
|
experiment.workflowimg.expiring_url(
|
||||||
<%= Constants::URL_SHORT_EXPIRE_TIME %>
|
Constants::URL_SHORT_EXPIRE_TIME
|
||||||
),
|
),
|
||||||
class: 'img-responsive center-block') %>
|
class: 'img-responsive center-block') %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<%= link_to image_tag(@experiment.workflowimg.expiring_url(
|
<%= link_to image_tag(@experiment.workflowimg.expiring_url(
|
||||||
<%= Constants::URL_SHORT_EXPIRE_TIME %>
|
Constants::URL_SHORT_EXPIRE_TIME
|
||||||
),
|
),
|
||||||
class: 'img-responsive center-block'),
|
class: 'img-responsive center-block'),
|
||||||
canvas_experiment_path(@experiment) %>
|
canvas_experiment_path(@experiment) %>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<%= bootstrap_form_for SampleGroup.new, remote: true, url: organization_sample_groups_path(@organization) do |f| %>
|
<%= bootstrap_form_for SampleGroup.new, remote: true, url: organization_sample_groups_path(@organization) do |f| %>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<%= f.text_field :name, id: "name-input" %>
|
<%= f.text_field :name, id: "name-input" %>
|
||||||
<%= f.color_picker_btn_group :color, <%= Constants::TAG_COLORS %>, id: "color-input", class: "btn-group-sample-group-color", label: t("sample_groups.color_label")%>
|
<%= f.color_picker_btn_group :color, Constants::TAG_COLORS, id: "color-input", class: "btn-group-sample-group-color", label: t("sample_groups.color_label")%>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal"><%= t("general.cancel")%></button>
|
<button type="button" class="btn btn-default" data-dismiss="modal"><%= t("general.cancel")%></button>
|
||||||
|
|
|
@ -1,51 +1,6 @@
|
||||||
class Constants
|
class Constants
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Defaults
|
# String lengths
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
# Application version
|
|
||||||
APP_VERSION = '1.3.1'.freeze
|
|
||||||
|
|
||||||
TAG_COLORS = [
|
|
||||||
'#6C159E',
|
|
||||||
'#159B5E',
|
|
||||||
'#FF4500',
|
|
||||||
'#008B8B',
|
|
||||||
'#757575',
|
|
||||||
'#32CD32',
|
|
||||||
'#FFD700',
|
|
||||||
'#48D1CC',
|
|
||||||
'#15369E',
|
|
||||||
'#FF69B4',
|
|
||||||
'#CD5C5C',
|
|
||||||
'#C9C9C9',
|
|
||||||
'#6495ED',
|
|
||||||
'#DC143C',
|
|
||||||
'#FF8C00',
|
|
||||||
'#C71585',
|
|
||||||
'#000000'
|
|
||||||
].freeze
|
|
||||||
|
|
||||||
TEXT_EXTRACT_FILE_TYPES = [
|
|
||||||
'application/pdf',
|
|
||||||
'application/rtf',
|
|
||||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
||||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
||||||
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
||||||
'application/vnd.oasis.opendocument.presentation',
|
|
||||||
'application/vnd.oasis.opendocument.spreadsheet',
|
|
||||||
'application/vnd.oasis.opendocument.text',
|
|
||||||
'application/vnd.ms-excel',
|
|
||||||
'application/vnd.ms-powerpoint',
|
|
||||||
'application/vnd.ms-word',
|
|
||||||
'text/plain'
|
|
||||||
].freeze
|
|
||||||
|
|
||||||
# Organization name for default admin user
|
|
||||||
DEFAULT_PRIVATE_ORG_NAME = 'My projects'.freeze
|
|
||||||
|
|
||||||
#=============================================================================
|
|
||||||
# String length
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
# Min characters for short text fields
|
# Min characters for short text fields
|
||||||
|
@ -64,6 +19,8 @@ class Constants
|
||||||
FILENAME_TRUNCATION_LENGTH = 50
|
FILENAME_TRUNCATION_LENGTH = 50
|
||||||
|
|
||||||
USER_INITIALS_MAX_LENGTH = 4
|
USER_INITIALS_MAX_LENGTH = 4
|
||||||
|
# Password 'key stretching' factor
|
||||||
|
PASSWORD_STRETCH_FACTOR = 10
|
||||||
# Standard max length for email
|
# Standard max length for email
|
||||||
EMAIL_MAX_LENGTH = 254
|
EMAIL_MAX_LENGTH = 254
|
||||||
|
|
||||||
|
@ -79,7 +36,7 @@ class Constants
|
||||||
# Comments limited query/display elements for pages
|
# Comments limited query/display elements for pages
|
||||||
COMMENTS_SEARCH_LIMIT = 10
|
COMMENTS_SEARCH_LIMIT = 10
|
||||||
# Activity limited query/display elements for pages
|
# Activity limited query/display elements for pages
|
||||||
ACTIVITY_SEARCH_LIMIT = 20
|
ACTIVITY_AND_NOTIF_SEARCH_LIMIT = 10
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# File and data memory size
|
# File and data memory size
|
||||||
|
@ -93,14 +50,33 @@ class Constants
|
||||||
AVATAR_MAX_SIZE_MB = 0.2
|
AVATAR_MAX_SIZE_MB = 0.2
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Picture size format
|
# Application space
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
|
# Minimal space needed for organization (in B)
|
||||||
|
MINIMAL_ORGANIZATION_SPACE_TAKEN = 1.megabyte
|
||||||
|
# Additional space of each file is added to its estimated size to account for
|
||||||
|
# DB indexes size etc.
|
||||||
|
ASSET_ESTIMATED_SIZE_FACTOR = 1.1
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Format sizes
|
||||||
|
#=============================================================================
|
||||||
|
|
||||||
|
# Picture size formats
|
||||||
MEDIUM_PIC_FORMAT = '300x300>'.freeze
|
MEDIUM_PIC_FORMAT = '300x300>'.freeze
|
||||||
THUMB_PIC_FORMAT = '100x100>'.freeze
|
THUMB_PIC_FORMAT = '100x100>'.freeze
|
||||||
ICON_PIC_FORMAT = '40x40>'.freeze
|
ICON_PIC_FORMAT = '40x40>'.freeze
|
||||||
ICON_SMALL_PIC_FORMAT = '30x30>'.freeze
|
ICON_SMALL_PIC_FORMAT = '30x30>'.freeze
|
||||||
|
|
||||||
|
# Hands-on-table number of starting columns and rows
|
||||||
|
HANDSONTABLE_INIT_COLS_CNT = 5
|
||||||
|
HANDSONTABLE_INIT_ROWS_CNT = 5
|
||||||
|
|
||||||
|
# Screen width which is still suitable for sidebar to be shown, otherwise
|
||||||
|
# hidden
|
||||||
|
SCREEN_WIDTH_LARGE = 928
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Styling
|
# Styling
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
@ -122,17 +98,62 @@ class Constants
|
||||||
URL_LONG_EXPIRE_TIME = 86_400
|
URL_LONG_EXPIRE_TIME = 86_400
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Space
|
# Application colors
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
# 1 MB of space is minimal for organizations (in B)
|
TAG_COLORS = [
|
||||||
MINIMAL_ORGANIZATION_SPACE_TAKEN = 1.megabyte
|
'#6C159E',
|
||||||
# additional space of each file is added to its estimated
|
'#159B5E',
|
||||||
# size to account for DB indexes size etc.
|
'#FF4500',
|
||||||
ASSET_ESTIMATED_SIZE_FACTOR = 1.1
|
'#008B8B',
|
||||||
|
'#757575',
|
||||||
|
'#32CD32',
|
||||||
|
'#FFD700',
|
||||||
|
'#48D1CC',
|
||||||
|
'#15369E',
|
||||||
|
'#FF69B4',
|
||||||
|
'#CD5C5C',
|
||||||
|
'#C9C9C9',
|
||||||
|
'#6495ED',
|
||||||
|
'#DC143C',
|
||||||
|
'#FF8C00',
|
||||||
|
'#C71585',
|
||||||
|
'#000'
|
||||||
|
].freeze
|
||||||
|
|
||||||
|
# Theme colors
|
||||||
|
COLOR_THEME_PRIMARY = '#37a0d9'.freeze # $color-theme-primary
|
||||||
|
COLOR_THEME_SECONDARY = '#8fd13f'.freeze # $color-theme-secondary
|
||||||
|
COLOR_THEME_DARK = '#6d6e71'.freeze # $color-theme-dark
|
||||||
|
|
||||||
|
# Grayscale colors
|
||||||
|
COLOR_WHITE = '#fff'.freeze # $color-white
|
||||||
|
COLOR_ALABASTER = '#fcfcfc'.freeze # $color-alabaster
|
||||||
|
COLOR_WILD_SAND = '#f5f5f5'.freeze # $color-wild-sand
|
||||||
|
COLOR_CONCRETE = '#f2f2f2'.freeze # $color-concrete
|
||||||
|
COLOR_GALLERY = '#eee'.freeze # $color-gallery
|
||||||
|
COLOR_ALTO = '#d2d2d2'.freeze # $color-alto
|
||||||
|
COLOR_SILVER = '#c5c5c5'.freeze # $color-silver
|
||||||
|
COLOR_DARK_GRAY = '#adadad'.freeze # $color-dark-gray
|
||||||
|
COLOR_SILVER_CHALICE = '#a0a0a0'.freeze # $color-silver-chalice
|
||||||
|
COLOR_GRAY = '#909088'.freeze # $color-gray
|
||||||
|
COLOR_DOVE_GRAY = '#666'.freeze # $color-dove-gray
|
||||||
|
COLOR_EMPEROR = '#555'.freeze # $color-emperor
|
||||||
|
COLOR_MINE_SHAFT = '#333'.freeze # $color-mine-shaft
|
||||||
|
COLOR_NERO = '#262626'.freeze # $color-nero
|
||||||
|
COLOR_BLACK = '#000'.freeze # $color-black
|
||||||
|
|
||||||
|
# Miscelaneous colors
|
||||||
|
COLOR_MYSTIC = '#eaeff2'.freeze # $color-mystic
|
||||||
|
COLOR_CANDLELIGHT = '#ffda23'.freeze # $color-candlelight
|
||||||
|
|
||||||
|
# Red colors
|
||||||
|
COLOR_MOJO = '#cf4b48'.freeze # $color-mojo
|
||||||
|
COLOR_APPLE_BLOSSOM = '#a94442'.freeze # $color-apple-blossom
|
||||||
|
COLOR_MILANO_RED = '#a70b05'.freeze # $color-milano-red
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# External URL
|
# External URLs
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
HTTP = 'http://'.freeze
|
HTTP = 'http://'.freeze
|
||||||
|
@ -149,6 +170,27 @@ class Constants
|
||||||
# Other
|
# Other
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
|
# Application version
|
||||||
|
APP_VERSION = '1.3.1'.freeze
|
||||||
|
|
||||||
|
TEXT_EXTRACT_FILE_TYPES = [
|
||||||
|
'application/pdf',
|
||||||
|
'application/rtf',
|
||||||
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
'application/vnd.oasis.opendocument.presentation',
|
||||||
|
'application/vnd.oasis.opendocument.spreadsheet',
|
||||||
|
'application/vnd.oasis.opendocument.text',
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.ms-powerpoint',
|
||||||
|
'application/vnd.ms-word',
|
||||||
|
'text/plain'
|
||||||
|
].freeze
|
||||||
|
|
||||||
|
# Organization name for default admin user
|
||||||
|
DEFAULT_PRIVATE_ORG_NAME = 'My projects'.freeze
|
||||||
|
|
||||||
# ) \ / (
|
# ) \ / (
|
||||||
# /|\ )\_/( /|\
|
# /|\ )\_/( /|\
|
||||||
# * / | \ (/\|/\) / | \ *
|
# * / | \ (/\|/\) / | \ *
|
||||||
|
|
Loading…
Add table
Reference in a new issue