You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by tk...@apache.org on 2013/05/16 12:31:32 UTC

[02/14] git commit: first try of a boostrap template

first try of a boostrap template


Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/924630e6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/924630e6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/924630e6

Branch: refs/heads/MARMOTTA-228
Commit: 924630e679ca9c0648ffc4d639523e4670078a39
Parents: 6f865b2
Author: tkurz <tk...@apache.org>
Authored: Sun May 5 20:08:15 2013 +0200
Committer: tkurz <tk...@apache.org>
Committed: Sun May 5 20:08:15 2013 +0200

----------------------------------------------------------------------
 platform/marmotta-core/pom.xml                     |    7 +
 .../src/main/resources/templates/admin.ftl         |  184 +++++++++++++++
 .../web/public/img/logo/marmotta-logo-neg.png      |  Bin 0 -> 7141 bytes
 .../src/main/resources/web/public/style/screen.css |   95 ++++++++
 .../src/main/resources/web/admin/widgets/user.js   |    4 +-
 5 files changed, 289 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/924630e6/platform/marmotta-core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/pom.xml b/platform/marmotta-core/pom.xml
index 49c16f1..a7c7597 100644
--- a/platform/marmotta-core/pom.xml
+++ b/platform/marmotta-core/pom.xml
@@ -515,6 +515,13 @@
             <artifactId>kiwi-transactions</artifactId>
         </dependency>
 
+        <!-- to enable boostrap ui -->
+        <dependency>
+            <groupId>com.efsavage.twitter.bootstrap</groupId>
+            <artifactId>bootstrap-maven</artifactId>
+            <version>2.3.1</version>
+        </dependency>
+
     </dependencies>
 
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/924630e6/platform/marmotta-core/src/main/resources/templates/admin.ftl
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/templates/admin.ftl b/platform/marmotta-core/src/main/resources/templates/admin.ftl
index e69de29..14b83a5 100644
--- a/platform/marmotta-core/src/main/resources/templates/admin.ftl
+++ b/platform/marmotta-core/src/main/resources/templates/admin.ftl
@@ -0,0 +1,184 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>Aapche Marmotta</title>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <link href="${SERVER_URL}core/public/img/icon/lmf.ico" rel="SHORTCUT ICON">
+
+    <!-- JS -->
+    <script type="text/javascript">
+        var _BASIC_URL = "${BASIC_URL}";
+        //use _SERVER_URL for webservice calls
+        var _SERVER_URL = "${SERVER_URL}";
+
+        var _CURRENT_STYLE = "${DEFAULT_STYLE}";
+    </script>
+
+    <!-- TODO could be nicer-->
+    <link href="${SERVER_URL}${DEFAULT_STYLE}javadoc.css" rel="stylesheet" type="text/css" />
+
+    <!-- Bootstrap -->
+    <link href="${SERVER_URL}ext/bootstrap/css/bootstrap.css" rel="stylesheet" media="screen">
+    <link href="${SERVER_URL}core/public/style/screen.css" rel="stylesheet">
+
+    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
+    ${HEAD}
+</head>
+
+<body>
+
+<div class="navbar navbar-inverse navbar-fixed-top menu-level-1">
+    <div class="navbar-inner">
+        <div class="container">
+            <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+            </button>
+            <a class="brand" href="#"></a>
+
+            <div class="nav-collapse collapse">
+                <p class="navbar-text pull-right" id="login_logout">
+                    <!--Logged in as <a href="#" class="navbar-link">Username</a>-->
+                </p>
+                <#if USER_MODULE_IS_ACTIVE>
+                    <script type="text/javascript" src="${SERVER_URL}user/admin/widgets/user.js"></script>
+                    <script type="text/javascript">
+                        window.onload = function () {
+                            LoginLogout.draw(_SERVER_URL,"login_logout");
+                        }
+                    </script>
+                </#if>
+                <!-- TODO: which links should be displayed -->
+                <ul class="nav">
+                    <li class="active"><a href="${SERVER_URL}">Home</a></li>
+                    <li><a href="#about">About</a></li>
+                    <li><a href="#contact">Contact</a></li>
+                </ul>
+            </div><!--/.nav-collapse -->
+
+        </div>
+    </div>
+</div>
+
+<div class="well sidebar-nav square-corners menu-level-2 span3 full-height">
+    <ul class="nav nav-list">
+        <li class="nav-header">$menu_container</li>
+        <#list MODULE_MENU as menu>
+                    <li
+                        <#if menu.properties["active"]> class="active" </#if>
+                    >
+                        <a href="${menu.submenu[0].properties["path"]}">
+                            <i class="icon-random"></i>  <!-- TODO icon -->
+                            <span>${menu.properties["title"]}</span>
+                        </a>
+                    </li>
+         </#list>
+    </ul>
+</div><!--/.well -->
+
+<div class="menu-level-3 row">
+    <div class="offset3 span9">
+
+        <ul class="nav nav-tabs square-corners">
+        <#list MODULE_MENU as menu>
+            <#if menu.properties["active"]>
+                <#list menu.submenu as submenu>
+                    <li
+                        <#if submenu.properties["active"]> class="active" </#if>
+                    >
+                        <a href="${submenu.properties["path"]}">${submenu.properties["title"]}</a>
+                    </li>
+                </#list>
+            </#if>
+        </#list>
+            <!--<li class="active">
+                <a href="#">Configuration</a>
+            </li>
+            <li><a href="#">Task</a></li>
+            <li><a href="#">Import</a></li>
+            <li><a href="#">Export</a></li>
+            <li><a href="#">Dataview</a></li>
+            <li><a href="#">Context</a></li>
+            <li><a href="#">Prefixes</a></li>
+            <li class="dropdown">
+                <a class="dropdown-toggle"
+                   data-toggle="dropdown"
+                   href="#">
+                    More
+                    <b class="caret"></b>
+                </a>
+                <ul class="dropdown-menu">
+                    <li><a href="#">System</a></li>
+                    <li><a href="#">Databases</a></li>
+                    <li><a href="#">Web Services</a></li>
+                </ul>
+            </li> -->
+        </ul>
+    </div>
+</div>
+
+<div id="content" class="row content">
+    <div class="offset3 span9">
+        <div class="row">
+            ${CONTENT}
+        </div>
+    </div>
+    <!--
+
+
+            <div class="span9">
+                <div class="hero-unit">
+                    <h1>Export Data</h1>
+                    <p>The following page allows you to export and download RDF data contained in the Linked Media Framework. You can choose from different serialization formats and either export all RDF data or only the RDF data contained in a certain context (named graph). If you want to download the data instead of displaying in the browser, right-click the download link and choose "save as".</p>
+                </div>
+            </div>
+
+            <div class="span4">
+                <div class="hero-unit">
+                    <form>
+                        <fieldset>
+                            <legend>Legend</legend>
+                            <div class="field-box">
+                                <label>Format</label>
+                                <select>
+                                    <option>Application ld+json</option>
+                                    <option>Application ld+json</option>
+                                    <option>Application ld+json</option>
+                                    <option>Application ld+json</option>
+                                    <option>Application ld+json</option>
+                                </select>
+                            </div>
+                            <div class="field-box">
+                                <label>Context</label>
+                                <select>
+                                    <option>Application ld+json</option>
+                                    <option>Application ld+json</option>
+                                    <option>Application ld+json</option>
+                                    <option>Application ld+json</option>
+                                    <option>Application ld+json</option>
+                                </select>
+                            </div>
+                            <div class="field-box">
+                                <label></label>
+                                <button type="submit" class="btn btn-primary btn-large">Download</button>
+                            </div>
+                        </fieldset>
+                    </form>
+                </div>
+            </div>
+
+        </div>  -->
+    </div>
+
+        <!-- ?FOOTER? -->
+</body>
+
+<!-- Le javascript
+================================================== -->
+<!-- Placed at the end of the document so the pages load faster -->
+<script src="${SERVER_URL}core/public/js/lib/jquery-1.7.2.js"></script>
+<script src="${SERVER_URL}ext/bootstrap/js/bootstrap.js"></script>
+
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/924630e6/platform/marmotta-core/src/main/resources/web/public/img/logo/marmotta-logo-neg.png
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/public/img/logo/marmotta-logo-neg.png b/platform/marmotta-core/src/main/resources/web/public/img/logo/marmotta-logo-neg.png
new file mode 100644
index 0000000..6a442b0
Binary files /dev/null and b/platform/marmotta-core/src/main/resources/web/public/img/logo/marmotta-logo-neg.png differ

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/924630e6/platform/marmotta-core/src/main/resources/web/public/style/screen.css
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/public/style/screen.css b/platform/marmotta-core/src/main/resources/web/public/style/screen.css
index e69de29..003bf05 100644
--- a/platform/marmotta-core/src/main/resources/web/public/style/screen.css
+++ b/platform/marmotta-core/src/main/resources/web/public/style/screen.css
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* Welcome to Compass.
+ * In this file you should write your main styles. (or centralize your imports)
+ * Import this file using the following HTML or equivalent:
+ * <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" /> */
+/* line 10, ../sass/screen.scss */
+body, html {
+    height: 100%;
+}
+
+/* line 14, ../sass/screen.scss */
+body {
+    padding-top: 40px;
+}
+/* line 18, ../sass/screen.scss */
+body .menu-level-1.navbar .navbar-inner .container {
+    margin-left: 0px;
+}
+/* line 21, ../sass/screen.scss */
+body .menu-level-1.navbar .navbar-inner .container .brand {
+    background-image: url(../img/logo/marmotta-logo-neg.png);
+    height: 40px;
+    width: 120px;
+    background-size: contain;
+    margin-left: 12px;
+    padding: 0;
+    background-repeat: no-repeat;
+}
+/* line 33, ../sass/screen.scss */
+body .menu-level-2, body .menu-level-3 {
+    position: fixed;
+}
+/* line 37, ../sass/screen.scss */
+body .menu-level-2 {
+    z-index: 1020;
+    margin-left: -20px;
+    padding-right: 0px;
+}
+/* line 43, ../sass/screen.scss */
+body .menu-level-3 {
+    z-index: 1010;
+    width: 100%;
+    margin-left: -40px;
+}
+/* line 48, ../sass/screen.scss */
+body .menu-level-3 div {
+    width: 100%;
+}
+/* line 51, ../sass/screen.scss */
+body .menu-level-3 div > ul {
+    width: 100%;
+    padding-left: 20px;
+    background: white;
+}
+/* line 59, ../sass/screen.scss */
+body .row.content {
+    margin-top: 58px;
+}
+/* line 63, ../sass/screen.scss */
+body .square-corners {
+    -webkit-border-radius: 0px;
+    -moz-border-radius: 0px;
+    -ms-border-radius: 0px;
+    -o-border-radius: 0px;
+    border-radius: 0px;
+}
+/* line 67, ../sass/screen.scss */
+body .full-height {
+    height: 100%;
+}
+/* line 71, ../sass/screen.scss */
+body .nav-tabs.square-corners > li > a {
+    -webkit-border-radius: 0px;
+    -moz-border-radius: 0px;
+    -ms-border-radius: 0px;
+    -o-border-radius: 0px;
+    border-radius: 0px;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/924630e6/platform/marmotta-user/src/main/resources/web/admin/widgets/user.js
----------------------------------------------------------------------
diff --git a/platform/marmotta-user/src/main/resources/web/admin/widgets/user.js b/platform/marmotta-user/src/main/resources/web/admin/widgets/user.js
index c816177..06986bd 100644
--- a/platform/marmotta-user/src/main/resources/web/admin/widgets/user.js
+++ b/platform/marmotta-user/src/main/resources/web/admin/widgets/user.js
@@ -43,6 +43,7 @@ var LoginLogout = {
 
         if(user.login=="anonymous") {
             var login_link = document.createElement("a");
+            login_link.setAttribute("class",'navbar-link');
             login_link.innerHTML = "login";
             login_link.onclick = function() {
                 call(basic_url+"user/login");
@@ -51,13 +52,14 @@ var LoginLogout = {
         } else {
             //logout button
             var logout_link = document.createElement("a");
+            logout_link.setAttribute("class",'navbar-link');
             logout_link.innerHTML = "change user";
             logout_link.onclick = function() {
                 call(basic_url+"user/login?logout=true");
             };
 
             document.getElementById(container).innerHTML =
-                "<span><a href='"+basic_url+"user/me.html'>"+user.login+"</a></span>&nbsp;|&nbsp;";
+                "<span><a class='navbar-link' href='"+basic_url+"user/me.html'>"+user.login+"</a></span>&nbsp;|&nbsp;";
             document.getElementById(container).appendChild(logout_link);
         }
     }