Skip to content

Commit

Permalink
Restructure urls a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfly committed Dec 20, 2017
1 parent f2c7542 commit 1787a48
Show file tree
Hide file tree
Showing 7 changed files with 245 additions and 17 deletions.
227 changes: 227 additions & 0 deletions git-tools/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions git-tools/package.json
@@ -1,7 +1,7 @@
{
"name": "git-tools"
, "private": true
, "dependencies": {
"name": "git-tools",
"private": true,
"dependencies": {
"jshint": ">= 1.1.0"
}
}
2 changes: 1 addition & 1 deletion tnoodle-ui/package.json
Expand Up @@ -2,7 +2,7 @@
"name": "tnoodle-ui",
"version": "0.1.0",
"private": true,
"homepage": "http://localhost:2014/scramble-new-ui/",
"homepage": "http://localhost:2014/scramble/",
"dependencies": {
"bootstrap": "4.0.0-beta.2",
"classnames": "^2.2.5",
Expand Down
2 changes: 1 addition & 1 deletion tnoodle-ui/src/Layout.js
Expand Up @@ -50,7 +50,7 @@ export default connect(
contents = (
<div>
<div className="d-flex justify-content-around mt-5">
<a className="btn btn-outline-primary btn-home" href="/scramble/">Legacy UI</a>
<a className="btn btn-outline-primary btn-home" href="/scramble-legacy/">Legacy UI</a>
<button className="btn btn-outline-primary btn-home pointer" onClick={() => WcaApi.logIn()}>Log in with the WCA</button>
</div>
</div>
Expand Down
14 changes: 7 additions & 7 deletions webscrambles/WebContent/WEB-INF/urlrewrite.xml
Expand Up @@ -15,24 +15,24 @@
</rule>

<rule>
<from>^/scramble-new-ui$</from>
<to type="redirect">/scramble-new-ui/</to>
<from>^/scramble$</from>
<to type="redirect">/scramble/</to>
</rule>
<rule>
<from>^/scramble-new-ui/static</from>
<from>^/scramble/static</from>
<to type="forward">/wca/new-ui/static</to>
</rule>
<rule>
<from>^/scramble-new-ui/.*</from>
<from>^/scramble/[^.]*$</from>
<to type="forward">/wca/new-ui/index.html</to>
</rule>

<rule>
<from>^/scramble$</from>
<to type="redirect">/scramble/</to>
<from>^/scramble-legacy$</from>
<to type="redirect">/scramble-legacy/</to>
</rule>
<rule>
<from>^/scramble/$</from>
<from>^/scramble-legacy/$</from>
<to type="forward">/wca/scramblegen.html</to>
</rule>

Expand Down
5 changes: 3 additions & 2 deletions webscrambles/WebContent/wca/scramblegen.html
Expand Up @@ -104,7 +104,7 @@
if(runningVersion === null) {
runningVersion = versionJson.running_version;
}


if(versionJson.ignorableError) {
// There was an error connecting to the server or something.
Expand Down Expand Up @@ -458,8 +458,9 @@
showScrambles: showZip,
competitionChanged: competitionChanged
};

window.addEventListener('load', function() {
addStateMessage("This is the legacy TNoodle UI. Try out <a href='/scramble/'>the new UI</a>.");
var tnoodleLinkSpan = document.createElement('span');
var tnoodleLink = document.createElement('a');
tnoodleLink.href = '/readme';
Expand Down
6 changes: 3 additions & 3 deletions winstone/tmtproject.py
Expand Up @@ -32,7 +32,7 @@ def configure(self):

self.nonJavaResourceDeps |= tmt.glob(self.srcResource, '.*$', relativeTo=self.srcResource)
for f in xmlFileTypes:
self.nonJavaResourceDeps -= tmt.glob(self.srcResource, "%s$" % f, relativeTo=self.srcResource)
self.nonJavaResourceDeps -= tmt.glob(self.srcResource, "%s$" % f, relativeTo=self.srcResource)

self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.properties$', relativeTo=self.src)
self.nonJavaSrcDeps |= tmt.glob(self.src, '.*\\.xsd$', relativeTo=self.src)
Expand Down Expand Up @@ -147,14 +147,14 @@ def mungeXmlFiles(self, topLevelWebProject):
"""
root = ET.fromstring(h2ConsoleServlet)
for child in reversed(root):
xmlRoot.insert(0, child)
xmlRoot.insert(0, child)

for project in deps:
if project in list(self.plugins.values()):
assert project.webContent
pluginXmlFile = join(project.webContent, "WEB-INF", f)
if not os.path.exists(pluginXmlFile):
continue
continue
tree = ET.parse(pluginXmlFile)
root = tree.getroot()
for child in reversed(root):
Expand Down

0 comments on commit 1787a48

Please sign in to comment.