Add documentation & download links to mod page

This commit is contained in:
Andrew Miner
2015-01-30 10:19:41 -08:00
parent d0c3d4de5e
commit a365217890
10 changed files with 74 additions and 43 deletions
+2 -1
View File
@@ -30,9 +30,10 @@ All rights reserved.
margin-bottom: 1em; margin-bottom: 1em;
} }
.homePage { a {
position: relative; width: 80%; position: relative; width: 80%;
margin: 0 10%; margin: 0 10%;
display: none;
p { p {
font-family: $font-family-normal; font-family: $font-family-normal;
+6 -4
View File
@@ -1,8 +1,10 @@
schema: 1 schema: 1
name: Applied Energistics 2 name: Applied Energistics 2
author: AlgorithmX2 author: AlgorithmX2
description: A technical mod which adds an advanced, computer-based storage system description: A technical mod which adds an advanced, computer-based storage system
homePageUrl: http://ae-mod.info/ homePageUrl: http://ae-mod.info/
documentationUrl: http://ae-mod.info/
downloadUrl: http://ae-mod.info/Downloads/
version: rv1-stable-1 version: rv1-stable-1
+6 -4
View File
@@ -1,8 +1,10 @@
schema: 1 schema: 1
name: Buildcraft name: Buildcraft
author: SpaceToad author: SpaceToad
description: A technical mod which adds power generation, mining, and building systems description: A technical mod which adds power generation, mining, and building systems
homePageUrl: http://www.mod-buildcraft.com homePageUrl: http://www.mod-buildcraft.com
documentationUrl: http://www.mod-buildcraft.com/wiki/doku.php
downloadUrl: http://www.mod-buildcraft.com/download/
version: 6.2.6 version: 6.2.6
+6 -4
View File
@@ -1,9 +1,11 @@
schema: 1 schema: 1
name: Industrial Craft 2 name: Industrial Craft 2
author: Alblaka author: Alblaka
description: A technical mod adding multi-tiered power systems, mining and ore processing, and powered armor description: A technical mod adding multi-tiered power systems, mining and ore processing, and powered armor
homePageUrl: http://wiki.industrial-craft.net/ homePageUrl: http://wiki.industrial-craft.net/
documentationUrl: http://wiki.industrial-craft.net/
downloadUrl: http://jenkins.ic2.player.to/job/IC2_experimental/
version: experimental-2.2.663 version: experimental-2.2.663
version: classic-1.7.10-6 version: classic-1.7.10-6
+6 -4
View File
@@ -1,8 +1,10 @@
schema: 1 schema: 1
name: Minecraft name: Minecraft
author: Mojang author: Mojang
description: The basic game by itself description: The basic game by itself
homePageUrl: http://www.minecraft.net homePageUrl: http://www.minecraft.net
documentationUrl: http://minecraft.gamepedia.com/Minecraft_Wiki
downloadUrl: https://minecraft.net/store/minecraft
version: 1.7.10 version: 1.7.10
+6 -4
View File
@@ -1,8 +1,10 @@
schema: 1 schema: 1
name: Thermal Expansion name: Thermal Expansion
author: Team CoFH author: Team CoFH
description: A technical mod which adds ore processing, item transportion, fluid handling, and many new ores. description: A technical mod which adds ore processing, item transportion, fluid handling, and many new ores.
homePageUrl: http://teamcofh.com/thermal-expansion/ homePageUrl: http://teamcofh.com/thermal-expansion/
documentationUrl: http://teamcofh.com/thermal-expansion/
downloadUrl: http://teamcofh.com/thermal-expansion/
version: 4.0.0B8-23 version: 4.0.0B8-23
@@ -42,14 +42,15 @@ module.exports = class ModPageController extends BaseController
# BaseController Overrides ##################################################################### # BaseController Overrides #####################################################################
onDidRender: -> onDidRender: ->
@$name = @$('.name') @$name = @$('.name')
@$byline = @$('.byline p') @$byline = @$('.byline p')
@$description = @$('.description p') @$description = @$('.description p')
@$homePageLink = @$('.homePage') @$documentationLink = @$('.documentation')
@$items = @$('.items .panel') @$downloadLink = @$('.download')
@$titleImage = @$('.titleImage img') @$homePageLink = @$('.homePage')
@$versionSelector = @$('select.version') @$items = @$('.items .panel')
@$wikiLink = @$('.wiki') @$titleImage = @$('.titleImage img')
@$versionSelector = @$('select.version')
super super
@@ -59,7 +60,10 @@ module.exports = class ModPageController extends BaseController
@$titleImage.attr 'src', (if @model? then Url.modLogoImage(modSlug:@model.slug) else '') @$titleImage.attr 'src', (if @model? then Url.modLogoImage(modSlug:@model.slug) else '')
@$description.html if @model? then @model.description else '' @$description.html if @model? then @model.description else ''
@_refreshHomePageLink() @_refreshLink @$homePageLink, @model.homePageUrl
@_refreshLink @$documentationLink, @model.documentationUrl
@_refreshLink @$downloadLink, @model.downloadUrl
@_refreshItems() @_refreshItems()
@_refreshVersions() @_refreshVersions()
super super
@@ -90,12 +94,12 @@ module.exports = class ModPageController extends BaseController
return modVersion return modVersion
_refreshHomePageLink: -> _refreshLink: ($link, url)->
if @model.homePageUrl? if url?
@$homePageLink.fadeIn duration:Duration.fast $link.fadeIn duration:Duration.fast
@$homePageLink.attr 'href', @model.homePageUrl $link.attr 'href', url
else else
@$homePageLink.fadeOut duration:Duration.fast $link.fadeOut duration:Duration.fast
_refreshItems: -> _refreshItems: ->
controllerIndex = 0 controllerIndex = 0
+6 -4
View File
@@ -16,10 +16,12 @@ module.exports = class Mod extends BaseModel
constructor: (attributes={}, options={})-> constructor: (attributes={}, options={})->
if not attributes.slug? then throw new Error 'attributes.slug is required' if not attributes.slug? then throw new Error 'attributes.slug is required'
attributes.author ?= '' attributes.author ?= ''
attributes.description ?= '' attributes.description ?= ''
attributes.name ?= '' attributes.documentationUrl ?= null
attributes.homePageUrl ?= null attributes.downloadUrl ?= null
attributes.homePageUrl ?= null
attributes.name ?= ''
super attributes, options super attributes, options
@_activeModVersion = null @_activeModVersion = null
@@ -37,6 +37,16 @@ module.exports = class ModParserV2 extends CommandParserVersionBase
@_rawData.description = description @_rawData.description = description
_command_documentationUrl: (documentationUrl)->
if @_rawData.documentationUrl? then throw new Error 'duplicate declaration of "documentationUrl"'
if documentationUrl.length is 0 then throw new Error 'documentationUrl cannot be empty (omit it instead)'
@_rawData.documentationUrl = documentationUrl
_command_downloadUrl: (downloadUrl)->
if @_rawData.downloadUrl? then throw new Error 'duplicate declaration of "downloadUrl"'
if downloadUrl.length is 0 then throw new Error 'downloadUrl cannot be empty (omit it instead)'
@_rawData.downloadUrl = downloadUrl
_command_name: (name)-> _command_name: (name)->
if @_rawData.name? then throw new Error 'duplicate declaration of "name"' if @_rawData.name? then throw new Error 'duplicate declaration of "name"'
if name.length is 0 then throw new Error '"name" cannot be empty' if name.length is 0 then throw new Error '"name" cannot be empty'
@@ -61,10 +71,12 @@ module.exports = class ModParserV2 extends CommandParserVersionBase
if not rawData.homePageUrl? then throw new Error 'the "homePageUrl" declaration is required' if not rawData.homePageUrl? then throw new Error 'the "homePageUrl" declaration is required'
if not rawData.versions? then throw new Error 'at least one "version" declaration is required' if not rawData.versions? then throw new Error 'at least one "version" declaration is required'
model.author = rawData.author if rawData.author? model.author = rawData.author if rawData.author?
model.description = rawData.description if rawData.description? model.description = rawData.description if rawData.description?
model.name = rawData.name model.documentationUrl = rawData.documentationUrl if rawData.documentationUrl?
model.homePageUrl = rawData.homePageUrl model.downloadUrl = rawData.downloadUrl if rawData.downloadUrl?
model.name = rawData.name
model.homePageUrl = rawData.homePageUrl
for version in rawData.versions for version in rawData.versions
model.addModVersion new ModVersion modSlug:model.slug, version:version model.addModVersion new ModVersion modSlug:model.slug, version:version
+2
View File
@@ -10,6 +10,8 @@
.titleImage: img .titleImage: img
select.version select.version
a.homePage(target="new"): p Offical Home Page a.homePage(target="new"): p Offical Home Page
a.documentation(target="new"): p Documentation
a.download(target="new"): p Download
.mainBody .mainBody
h1.name h1.name