Commits

Jonathan Doklovic  committed b1e9051 Merge with conflicts

Merged in rbergman/ap3-ringo-kit-basic-template (pull request #1)

Conflicts:
atlassian-plugin.xml.parse

  • Participants
  • Parent commits f02d614, aca28e4

Comments (0)

Files changed (12)

File app/routes.coffee

-module.exports = (app) ->
-
-  app.get "/general", (req, res) ->
-    res.render "general",
-      headers: ({name: k, value: v} for k, v of req.headers)
-      method: req.method
-      scriptName: req.scriptName
-      pathInfo: req.pathInfo
-      queryString: req.queryString
-      host: req.host
-      port: req.port
-      scheme: req.scheme
-      input: req.input

File app/server.coffee

-module.exports = require("atlassian/router").createApp("app")
-require("./routes")(module.exports)

File app/views/general.mustache.parse

-<!DOCTYPE html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-    <title>${pluginName}</title>
-    <link rel="stylesheet" href="{{hostStylesheetUrl}}">
-    <link rel="stylesheet" href="public/css/styles.css">
-    <script src="{{hostScriptUrl}}"></script>
-    <script>RA.init();</script>
-  </head>
-  <body>
-    <h2>Request Properties</h2>
-    <table width="100%">
-      <tr>
-        <th align="left" colspan="2">properties</th>
-      </tr>
-      <tr>
-        <td>host base url</td>
-        <td>{{hostBaseUrl}}</td>
-      </tr>
-      <tr>
-        <td>client key</td>
-        <td>{{clientKey}}</td>
-      </tr>
-      <tr>
-        <td>user id</td>
-        <td>{{userId}}</td>
-      </tr>
-      <tr>
-        <td>method</td>
-        <td>{{method}}</td>
-      </tr>
-      <tr>
-        <td>script name</td>
-        <td>{{scriptName}}</td>
-      </tr>
-      <tr>
-        <td>path info</td>
-        <td>{{pathInfo}}</td>
-      </tr>
-      <tr>
-        <td>query string</td>
-        <td>{{queryString}}</td>
-      </tr>
-      <tr>
-        <td>host</td>
-        <td>{{host}}</td>
-      </tr>
-      <tr>
-        <td>port</td>
-        <td>{{port}}</td>
-      </tr>
-      <tr>
-        <td>scheme</td>
-        <td>{{scheme}}</td>
-      </tr>
-      <tr>
-        <th align="left" colspan="2">headers</th>
-      </tr>
-      {{#headers}}
-      <tr>
-        <td>{{name}}</td>
-        <td>{{value}}</td>
-      </tr>
-      {{/headers}}
-    </table>
-    <script src="public/js/client.js"></script>
-  </body>
-</html>

File atlassian-plugin.xml.parse

     ${oauthBlock}
     </remote-plugin-container>
 
-    <general-page key="general" name="${pluginName} (general page)" url="/general" />
+    <general-page key="index" name="${pluginName}" url="/index" />
 
 </atlassian-plugin>

File main.coffee

-exports.app = require "./app/server"
+let app = exports.app = require("atlassian/router").createApp();
+
+app.configure({
+  stylesheets: ["app"],
+  scripts: ["app"]
+});
+
+app.get("/index", function (req, res) {
+  res.render("index", {
+    message: "Hello World"
+  });
+});

File public/css/app.css

+#user-id {
+  font-weight: bold;
+}

File public/css/styles.css

-/* Application CSS styles go here. */

File public/js/app.js

+AP.getUser(function (user) {
+  document.getElementById("user-id").innerHTML = user.id || "anonymous";
+});

File public/js/client.js

-// Application client-side code goes here.

File template.info

 {
-    "key":"basic"
-    ,"name":"Basic RingoJS Kit"
-    ,"description":"A bare bones ringo-kit template"
-}
+  "key": "basic"
+, "name": "Basic RingoJS Kit"
+, "description": "A bare bones ringo-kit template"
+}

File views/index.hbs.parse

+<h1>{{message}}</h1>
+<p>Welcome, <span id="user-id"></span>.</p>