2016-10-05 23:45:20 +08:00
|
|
|
class Constants
|
|
|
|
#=============================================================================
|
2016-10-13 16:00:36 +08:00
|
|
|
# String lengths
|
2016-10-05 23:45:20 +08:00
|
|
|
#=============================================================================
|
|
|
|
|
|
|
|
# Min characters for short text fields
|
|
|
|
NAME_MIN_LENGTH = 2
|
|
|
|
# Max characters for short text fields
|
|
|
|
NAME_MAX_LENGTH = 255
|
|
|
|
# Max characters for short text fields, after which they get truncated
|
|
|
|
NAME_TRUNCATION_LENGTH = 25
|
|
|
|
# Max characters for long text fields
|
|
|
|
TEXT_MAX_LENGTH = 10000
|
|
|
|
# Max characters for color field (given in HEX format)
|
|
|
|
COLOR_MAX_LENGTH = 7
|
|
|
|
# Max characters for text in dropdown list element
|
|
|
|
DROPDOWN_TEXT_MAX_LENGTH = 15
|
|
|
|
# Max characters for filenames, after which they get truncated
|
|
|
|
FILENAME_TRUNCATION_LENGTH = 50
|
|
|
|
|
|
|
|
USER_INITIALS_MAX_LENGTH = 4
|
2016-10-13 16:00:36 +08:00
|
|
|
# Password 'key stretching' factor
|
|
|
|
PASSWORD_STRETCH_FACTOR = 10
|
2016-10-05 23:45:20 +08:00
|
|
|
# Standard max length for email
|
|
|
|
EMAIL_MAX_LENGTH = 254
|
2016-10-17 19:52:33 +08:00
|
|
|
# Some big value which is still supported by all databases, no matter what
|
|
|
|
# data type is used
|
|
|
|
INFINITY = 2**32 / 2 - 1
|
2016-10-13 17:05:11 +08:00
|
|
|
|
2016-10-05 23:45:20 +08:00
|
|
|
#=============================================================================
|
|
|
|
# Query/display limits
|
|
|
|
#=============================================================================
|
|
|
|
|
|
|
|
# General limited/unlimited query/display elements for pages
|
|
|
|
SEARCH_LIMIT = 20
|
|
|
|
SEARCH_NO_LIMIT = -1
|
|
|
|
# General limited query/display elements for popup modals
|
|
|
|
MODAL_SEARCH_LIMIT = 5
|
|
|
|
# Comments limited query/display elements for pages
|
|
|
|
COMMENTS_SEARCH_LIMIT = 10
|
|
|
|
# Activity limited query/display elements for pages
|
2016-10-13 16:00:36 +08:00
|
|
|
ACTIVITY_AND_NOTIF_SEARCH_LIMIT = 10
|
2016-10-05 23:45:20 +08:00
|
|
|
|
|
|
|
#=============================================================================
|
|
|
|
# File and data memory size
|
|
|
|
#=============================================================================
|
|
|
|
|
|
|
|
# Max table JSON size in MB
|
|
|
|
TABLE_JSON_MAX_SIZE_MB = 20
|
|
|
|
# Max uploaded file size in MB
|
|
|
|
FILE_MAX_SIZE_MB = 50
|
|
|
|
# Max uploaded user picture avatar size in MB
|
|
|
|
AVATAR_MAX_SIZE_MB = 0.2
|
|
|
|
|
|
|
|
#=============================================================================
|
2016-10-13 16:00:36 +08:00
|
|
|
# Application space
|
2016-10-05 23:45:20 +08:00
|
|
|
#=============================================================================
|
|
|
|
|
2016-10-13 16:00:36 +08:00
|
|
|
# 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
|
2016-10-05 23:45:20 +08:00
|
|
|
MEDIUM_PIC_FORMAT = '300x300>'.freeze
|
|
|
|
THUMB_PIC_FORMAT = '100x100>'.freeze
|
|
|
|
ICON_PIC_FORMAT = '40x40>'.freeze
|
|
|
|
ICON_SMALL_PIC_FORMAT = '30x30>'.freeze
|
|
|
|
|
2016-10-13 16:00:36 +08:00
|
|
|
# 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
|
|
|
|
|
2016-10-05 23:45:20 +08:00
|
|
|
#=============================================================================
|
|
|
|
# Styling
|
|
|
|
#=============================================================================
|
|
|
|
|
|
|
|
# Dropdown top offset from the parent
|
|
|
|
DROPDOWN_TOP_OFFSET_PX = 20
|
|
|
|
|
|
|
|
#=============================================================================
|
|
|
|
# Time
|
|
|
|
#=============================================================================
|
|
|
|
|
|
|
|
# URL expire time, used for presigned file URLs, because outsiders shouldn't
|
|
|
|
# have access to them, but some buffer time is needed for file to be loaded
|
|
|
|
URL_SHORT_EXPIRE_TIME = 30
|
|
|
|
# Same as URL_EXPIRE_TIME, except for cases where the URL migth be used in
|
|
|
|
# another page, and hence the URL mustn't expire by then (e.g. when generating
|
|
|
|
# report and than using same HTML code in PDF, and consequently same file
|
|
|
|
# URL); it expires in exactly one day
|
|
|
|
URL_LONG_EXPIRE_TIME = 86_400
|
|
|
|
|
|
|
|
#=============================================================================
|
2016-10-13 16:00:36 +08:00
|
|
|
# Application colors
|
2016-10-13 20:41:34 +08:00
|
|
|
#
|
|
|
|
# NOTE: Don't use shortened syntax, e.g. #000 for #000000, as some Gems need
|
|
|
|
# full syntax!
|
2016-10-05 23:45:20 +08:00
|
|
|
#=============================================================================
|
|
|
|
|
2016-10-13 16:00:36 +08:00
|
|
|
TAG_COLORS = [
|
|
|
|
'#6C159E',
|
|
|
|
'#159B5E',
|
|
|
|
'#FF4500',
|
|
|
|
'#008B8B',
|
|
|
|
'#757575',
|
|
|
|
'#32CD32',
|
|
|
|
'#FFD700',
|
|
|
|
'#48D1CC',
|
|
|
|
'#15369E',
|
|
|
|
'#FF69B4',
|
|
|
|
'#CD5C5C',
|
|
|
|
'#C9C9C9',
|
|
|
|
'#6495ED',
|
|
|
|
'#DC143C',
|
|
|
|
'#FF8C00',
|
|
|
|
'#C71585',
|
2016-10-13 20:41:34 +08:00
|
|
|
'#000000'
|
2016-10-13 16:00:36 +08:00
|
|
|
].freeze
|
2016-10-05 23:45:20 +08:00
|
|
|
|
2016-10-13 16:00:36 +08:00
|
|
|
# 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
|
2016-10-13 20:41:34 +08:00
|
|
|
COLOR_WHITE = '#ffffff'.freeze # $color-white
|
2016-10-13 16:00:36 +08:00
|
|
|
COLOR_ALABASTER = '#fcfcfc'.freeze # $color-alabaster
|
2016-10-13 20:41:34 +08:00
|
|
|
COLOR_SNOW = '#f9f9f9'.freeze # $color-snow
|
2016-10-13 16:00:36 +08:00
|
|
|
COLOR_WILD_SAND = '#f5f5f5'.freeze # $color-wild-sand
|
|
|
|
COLOR_CONCRETE = '#f2f2f2'.freeze # $color-concrete
|
2016-10-13 20:41:34 +08:00
|
|
|
COLOR_GALLERY = '#eeeeee'.freeze # $color-gallery
|
|
|
|
COLOR_GAINSBORO = '#e3e3e3'.freeze # $color-gainsboro
|
2016-10-13 16:00:36 +08:00
|
|
|
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
|
2016-10-13 20:41:34 +08:00
|
|
|
COLOR_DOVE_GRAY = '#666666'.freeze # $color-dove-gray
|
|
|
|
COLOR_EMPEROR = '#555555'.freeze # $color-emperor
|
|
|
|
COLOR_MINE_SHAFT = '#333333'.freeze # $color-mine-shaft
|
2016-10-13 16:00:36 +08:00
|
|
|
COLOR_NERO = '#262626'.freeze # $color-nero
|
2016-10-13 20:41:34 +08:00
|
|
|
COLOR_BLACK = '#000000'.freeze # $color-black
|
2016-10-13 16:00:36 +08:00
|
|
|
|
|
|
|
# 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 URLs
|
2016-10-05 23:45:20 +08:00
|
|
|
#=============================================================================
|
|
|
|
|
|
|
|
HTTP = 'http://'.freeze
|
|
|
|
TUTORIALS_URL = (HTTP + 'scinote.net/product/tutorials/').freeze
|
|
|
|
FAQ_URL = (HTTP + 'scinote.net/product/faq/').freeze
|
|
|
|
SUPPORT_URL = (HTTP + 'scinote.net/plans/#prof-support').freeze
|
|
|
|
PLANS_URL = (HTTP + 'scinote.net/plans/').freeze
|
|
|
|
CONTACT_URL = (HTTP + 'scinote.net/about-us/').freeze
|
|
|
|
RELEASE_NOTES_URL = (HTTP + 'scinote.net/docs/release-notes/').freeze
|
|
|
|
# Default user picture avatar
|
|
|
|
DEFAULT_AVATAR_URL = '/images/:style/missing.png'.freeze
|
|
|
|
|
|
|
|
#=============================================================================
|
|
|
|
# Other
|
|
|
|
#=============================================================================
|
|
|
|
|
2016-10-13 16:00:36 +08:00
|
|
|
# Application version
|
2016-10-26 00:15:53 +08:00
|
|
|
APP_VERSION = '1.4.0'.freeze
|
2016-10-13 16:00:36 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2016-10-05 23:45:20 +08:00
|
|
|
# ) \ / (
|
|
|
|
# /|\ )\_/( /|\
|
|
|
|
# * / | \ (/\|/\) / | \ *
|
|
|
|
# |`.____________________/__|__o____\`|'/___o__|__\___________________.'|
|
|
|
|
# | '^` \|/ '^` |
|
|
|
|
# | V |
|
|
|
|
# | _____ _ _ __ |
|
|
|
|
# | |_ _| |__ __ _ _ __ | | __ _ _ ___ _ _ ( | |
|
|
|
|
# | | | | '_ \ / _` | '_ \| |/ / | | | |/ _ \| | | | | ) |
|
|
|
|
# | | | | | | | (_| | | | | < | |_| | ( | | |_| | \_/ |
|
|
|
|
# | |_| |_| |_|\__,_|_| |_|_|\_\ \__, |\___/ \_,|_| _ |
|
|
|
|
# | |___/ (_) |
|
|
|
|
# | |
|
|
|
|
# | Special Thank You for supporting sciNote on Kicstarter goes |
|
|
|
|
# | to the following supporters |
|
|
|
|
# | ._________________________________________________________________. |
|
|
|
|
# |' l /\ / \\ \ /\ l `|
|
|
|
|
# * l / V )) V \ l *
|
|
|
|
# l/ // \I
|
|
|
|
KICKSTARTER_SUPPORTERS = [
|
|
|
|
'Manuela Lanzafame',
|
|
|
|
'Fluckiger Rudolf',
|
|
|
|
'Emily Gleason',
|
|
|
|
'Benjamin E Doremus',
|
|
|
|
'Chord Pet Wearable',
|
|
|
|
'Chris Taylor',
|
|
|
|
'Abraham White',
|
|
|
|
'Ryotaro Eguchi',
|
|
|
|
'Simon Waldherr',
|
|
|
|
'Isaac Sandaljian',
|
|
|
|
'Markus Rademacher'
|
|
|
|
].freeze
|
|
|
|
end
|