Permalink
Browse files

use bootstrap

  • Loading branch information...
1 parent 632ad97 commit 4380cd59553eb95dad606973d59d96ebf2d66ec5 @Aqua-Ye Aqua-Ye committed Jun 20, 2012
Showing with 27 additions and 9 deletions.
  1. +12 −3 hello_wiki_rest.opa
  2. +14 −5 hello_wiki_rest_client.opa
  3. +1 −1 resources/css.css
View
@@ -1,9 +1,10 @@
import stdlib.tools.markdown
+import stdlib.themes.bootstrap
database stringmap(string) /wiki
database /wiki[_] = "This page is empty. Double click to edit"
-exposed function load_source(topic) {
+function load_source(topic) {
/wiki[topic];
}
@@ -37,10 +38,18 @@ function save(topic) {
function display(topic) {
Resource.styled_page("About {topic}", ["/resources/css.css"],
- <div id=#header><div id=#logo></div>About {topic}</div>
+ <div class="navbar navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container">
+ <span id=#logo class="brand"/><span class="navbar-text">About {topic}</span>
+ </div>
+ </div>
+ </div>
+ <div class="content container">
<div class="show_content" id=#show_content ondblclick={function(_) { edit(topic) }}>
{load_rendered(topic)}
- </>
+ </div>
+ </div>
<textarea class="edit_content" id=#edit_content style="display:none"
cols="40" rows="30" onblur={function(_) { save(topic) }}></>
);
View
@@ -1,4 +1,5 @@
import stdlib.tools.markdown
+import stdlib.themes.bootstrap
function uri_for_topic(topic) {
Uri.of_absolute(
@@ -11,7 +12,7 @@ function uri_for_topic(topic) {
)
}
-exposed function load_source(topic) {
+function load_source(topic) {
match (WebClient.Get.try_get(uri_for_topic(topic))) {
case { failure : _ }: "Error, could not connect";
case ~{ success }:
@@ -65,10 +66,18 @@ function save(topic) {
function display(topic) {
Resource.styled_page(
"About {topic}", ["/resources/css.css"],
- <div id=#header><div id=#logo></div>About {topic}</div>
- <div class="show_content" id=#show_content ondblclick={function(_) { edit(topic) }}>{load_rendered(topic)}</>
- <div class="show_messages" id=#show_messages />
- <textarea class="edit_content" id=#edit_content style="display:none" cols="40" rows="30" onblur={function(_) { save(topic) }}></>
+ <div class="navbar navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container">
+ <span id=#logo class="brand"/><span class="navbar-text">About {topic}</span>
+ </div>
+ </div>
+ </div>
+ <div class="content container">
+ <div class="show_content" id=#show_content ondblclick={function(_) { edit(topic) }}>{load_rendered(topic)}</div>
+ </div>
+ <div class="show_messages" id=#show_messages />
+ <textarea class="edit_content" id=#edit_content style="display:none" cols="40" rows="30" onblur={function(_) { save(topic) }}></>
);
}
View
@@ -2,7 +2,7 @@
#logo {
background: url("/resources/opa-logo.png") no-repeat scroll 0 0 transparent;
height: 32px;
- margin: 10px 0 5px;
+ margin: 7px 0 -15px;
width: 61px;
}
/***Editing area***/

0 comments on commit 4380cd5

Please sign in to comment.