Skip to content

Commit

Permalink
added mediacuration types to constants. #213
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jan 16, 2015
1 parent 4222d6d commit 14ef0aa
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions config/initializers/constants.rb
Expand Up @@ -9,29 +9,29 @@
TypeError]

# Format used for DOI validation
# The prefix is 10.x where x is 4-5 digits. The suffix can be anything, but can't be left off
# The prefix is 10.x where x is 4-5 digits. The suffix can be anything, but can"t be left off
DOI_FORMAT = %r(\A10\.\d{4,5}/.+)

# Format used for URL validation
URL_FORMAT = %r(\A(http|https|ftp):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?\z)

# Form interval options
INTERVAL_OPTIONS = [['½ hour', 30.minutes],
['1 hour', 1.hour],
['2 hours', 2.hours],
['3 hours', 3.hours],
['6 hours', 6.hours],
['8 hours', 8.hours],
['12 hours', 12.hours],
['24 hours', 24.hours],
['2 days', 48.hours],
['4 days', 96.hours],
['¼ month', (1.month * 0.25).to_i],
['½ month', (1.month * 0.5).to_i],
['1 month', 1.month],
['3 months', 3.months],
['6 months', 6.months],
['12 months', 12.months]]
INTERVAL_OPTIONS = [["½ hour", 30.minutes],
["1 hour", 1.hour],
["2 hours", 2.hours],
["3 hours", 3.hours],
["6 hours", 6.hours],
["8 hours", 8.hours],
["12 hours", 12.hours],
["24 hours", 24.hours],
["2 days", 48.hours],
["4 days", 96.hours],
["¼ month", (1.month * 0.25).to_i],
["½ month", (1.month * 0.5).to_i],
["1 month", 1.month],
["3 months", 3.months],
["6 months", 6.months],
["12 months", 12.months]]

# CrossRef types from http://api.crossref.org/types
CROSSREF_TYPE_TRANSLATIONS = {
Expand Down Expand Up @@ -79,3 +79,11 @@
"Workflow" => nil,
"Other" => nil
}

MEDIACURATION_TYPE_TRANSLATIONS = {
"Blog" => "post",
"News" => "article-newspaper",
"Podcast/Video" => "broadcast",
"Lab website/homepage" => "webpage",
"University page" => "webpage"
}

0 comments on commit 14ef0aa

Please sign in to comment.