1
0
Fork 0

First draft of a create my own app template generator

This commit is contained in:
Michael Hackstein 2014-12-14 00:30:57 +01:00
parent 0ad5395d53
commit ca99f19d7d
3 changed files with 109 additions and 6 deletions

View File

@ -340,7 +340,7 @@ controller.get('/foxxes', function (req, res) {
*
*/
controller.get('/foxxes/fishbowl', function (req, res) {
FoxxManager.update();
// FoxxManager.update();
res.json(FoxxManager.availableJson());
}).summary("List of all foxx apps submitted to the fishbowl store.")
.notes("This function contacts the fishbowl and reports which apps are available for install");

View File

@ -1,19 +1,73 @@
<script id="modalApplicationMount.ejs" type="text/template">
<ul id="infoTab" class="nav nav-tabs">
<li class="active"><a href="#appstore" data-toggle="tab">App Store</a></li>
<li class="active"><a href="#newApp" data-toggle="tab">New App</a></li>
<li><a href="#appstore" data-toggle="tab">App Store</a></li>
<li><a href="#github" data-toggle="tab">Github</a></li>
<li><a href="#zip" data-toggle="tab">Zip</a></li>
</ul>
<div class="tab-content" id="tab-content-application-info">
<div class="tab-pane active" id="appstore">
<div class="tab-pane active" id="newApp">
<table id="new-app-information">
<tr class="tableRow">
<th class="collectionInfoTh">
Author*:
</th>
<th class="collectionInfoTh">
<input type="text" id="author" value="" placeholder="Your Name">
</th>
</tr>
<tr class="tableRow">
<th class="collectionInfoTh">
Name*:
</th>
<th class="collectionInfoTh">
<input type="text" id="name" value="" placeholder="Name of the App">
</th>
</tr>
<tr class="tableRow">
<th class="collectionInfoTh">
Description*:
</th>
<th class="collectionInfoTh">
<input type="text" id="description" value="" placeholder="Please describe your App here">
</th>
</tr>
<tr class="tableRow">
<th class="collectionInfoTh">
License*:
</th>
<th class="collectionInfoTh">
<input type="text" id="license" value="" placeholder="Apache 2"></input>
</th>
</tr>
<tr class="tableRow">
<th class="collectionInfoTh">
Authentication*:
</th>
<th class="collectionInfoTh">
<input type="checkbox" id="authenticate" checked></input>
</th>
</tr>
<tr class="tableRow">
<th class="collectionInfoTh">
Collections*:
</th>
<th class="collectionInfoTh">
<input type="hidden" id="new-app-collections" value="" placeholder="Collections"></input>
</th>
</tr>
</table>
</div>
<div class="tab-pane" id="appstore">
<table id="appstore-content">
</table>
</div>
<div class="tab-pane" id="github">
<div>The repository has to be private. The version has to be a git tag LINKTOTAG.</div>
<div>The repository has to be public. The version has to be a git tag LINKTOTAG.</div>
<div>
<table>
<tr class="tableRow">

View File

@ -626,15 +626,58 @@
});
},
generateNewFoxxApp: function() {
alert("GENERATOOOO!");
},
addAppAction: function() {
var openTab = $(".modal-body .tab-pane.active").attr("id");
switch (openTab) {
case "newApp":
this.generateNewFoxxApp();
break;
case "github":
this.installFoxxFromGithub();
break;
case "zip":
this.installFoxxFromZip();
break;
default:
}
},
switchModalButton: function(event) {
var openTab = $(event.currentTarget).attr("href").substr(1);
var button = $("#modalButton1");
switch (openTab) {
case "newApp":
button.html("Generate");
button.prop("disabled", false);
break;
case "appstore":
button.html("Install");
button.prop("disabled", true);
break;
case "github":
case "zip":
button.html("Install");
button.prop("disabled", false);
break;
default:
}
},
createInstallModal: function(event) {
event.preventDefault();
var buttons = [];
var modalEvents = {
"click #installGithub" : this.installFoxxFromGithub.bind(this),
"click #installZip" : this.installFoxxFromZip.bind(this),
"click #infoTab a": this.switchModalButton.bind(this),
"click .install-app" : this.installFoxxFromStore.bind(this),
"change #zip-file" : this.uploadSetup.bind(this)
};
buttons.push(
window.modalView.createSuccessButton("Generate", this.addAppAction.bind(this))
);
window.modalView.show(
"modalApplicationMount.ejs",
"Install Application",
@ -643,6 +686,12 @@
undefined,
modalEvents
);
$("#new-app-collections").select2({
tags: [],
showSearchBox: false,
minimumResultsForSearch: -1,
width: "336px"
});
var listTempl = this.appStoreTemplate;
$.get("foxxes/fishbowl", function(list) {
var table = $("#appstore-content");