Skip to content

Commit

Permalink
initial datamart search page #170
Browse files Browse the repository at this point in the history
  • Loading branch information
raprasad committed Jan 17, 2019
1 parent 2bebee9 commit 9bd69cd
Show file tree
Hide file tree
Showing 8 changed files with 631 additions and 8 deletions.
3 changes: 2 additions & 1 deletion dev_notes/local_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ To set this up in a development environment please use the instructions below.
```
# cd into the top level of the `ravens-metadata-service` repository
#
cd preprocess_web/code
git submodule add --force -b master https://github.com/TwoRavens/common.git assets/common
git submodule init
git submodule update --remote
Expand Down Expand Up @@ -175,5 +176,5 @@ From the top of the `ravens-metadata-service` directory, run:
# Example:
fab run_preprocess:../../test_data/fearonLaitin.csv,/tmp/fearonLaitin.json
```
92 changes: 88 additions & 4 deletions preprocess_web/code/assets/app/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,95 @@

import '../pkgs/bootstrap4/css/bootstrap.min.css';
//import '../pkgs/bootstrap4/css/bootstrap.min.css';

import hopscotch from 'hopscotch';
//import hopscotch from 'hopscotch';
import '../css/app.css';

import m from 'mithril';
import Header from '../common/views/Header';
import Datamart from "../common/TwoRavens/Datamart";



var root = document.body
var testDiv = document.getElementById("mdiv-test");
var mithrilRoot = document.getElementById("mithrilRoot");


//m.render(testDiv, 'Generated from Mithril in "index.js"')

var Splash = {
view: function() {
return m("div",
m("a", {href: "#!/hello"}, "Enter!"),
m("hr"),
m("p", m("a", {href: "#!/search"}, "Search!")),
)
}
}
/*
m.render(root, m("main", [
m("h1", {class: "title"}, "My first app"),
m("button", "A button"),
]))
*/
var count = 0 // added a variable

var Hello = {
view: function() {
return m("main", [
m("h1", {class: "title"}, "My first app"),
m("button", {onclick: function() {count++}}, count + " clicks"),
m("hr"),
m("div", m("a", {href: "#!/splash"}, "(back to splash)")),

])
}
}

export let augmentState = {
dataset: {
keywords: []
}
};

export let augmentResults = [];

var DatamartSearchPage = {
view: function() {
return m("main", [
m(DatamartPageHeader),
m("hr"),
m(Datamart, {
augmentState: augmentState,
augmentResults: augmentResults
}),
])
}
}

let username;
let userlinks = [
{title: "Log in", url: "the login url"},
{title: "Sign up", url: "the signup url"}
];

var DatamartPageHeader = {

view: function() {
return m("nav", m(Header, {
image: '/static/images/TwoRavens.png',
aboutText: 'UI that exercises the Datamart Search API.',
attrsInterface: {style: {}}
},
m('div', {style: {'flex-grow': 1}}),
m('h4#dataName[style=display: inline-block; margin: .25em 1em]',
'Datamart Search'),
m('div', {style: {'flex-grow': 1}}),
))
}}

m.render(testDiv, 'Generated from Mithril in "index.js"')
//m.mount(root, Hello) mithrilRoot
m.route(mithrilRoot, "/splash", {
"/splash": Splash,
"/hello": Hello,
'/search': DatamartSearchPage,
})
1 change: 1 addition & 0 deletions preprocess_web/code/assets/common
Submodule common added at 688c07
Loading

0 comments on commit 9bd69cd

Please sign in to comment.