mirror of
https://github.com/Febbweiss/ProjectDeployer.git
synced 2026-03-04 22:25:38 +00:00
Feature: add routes
This commit is contained in:
@@ -19,3 +19,5 @@ ecmascript # Enable ECMAScript2015+ syntax in app code
|
||||
insecure # Allow all DB writes from clients (for prototyping)
|
||||
twbs:bootstrap-noglyph
|
||||
fortawesome:fontawesome
|
||||
iron:router
|
||||
zenorocha:clipboard
|
||||
|
||||
@@ -30,6 +30,14 @@ htmljs@1.0.5
|
||||
http@1.1.1
|
||||
id-map@1.0.4
|
||||
insecure@1.0.4
|
||||
iron:controller@1.0.12
|
||||
iron:core@1.0.11
|
||||
iron:dynamic-template@1.0.12
|
||||
iron:layout@1.0.12
|
||||
iron:location@1.0.11
|
||||
iron:middleware-stack@1.0.11
|
||||
iron:router@1.0.12
|
||||
iron:url@1.0.11
|
||||
jquery@1.11.4
|
||||
launch-screen@1.0.4
|
||||
livedata@1.0.15
|
||||
@@ -65,3 +73,4 @@ underscore@1.0.4
|
||||
url@1.0.5
|
||||
webapp@1.2.2
|
||||
webapp-hashing@1.0.5
|
||||
zenorocha:clipboard@1.4.2
|
||||
|
||||
@@ -2,37 +2,57 @@
|
||||
<title>project-deployer</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<template name="layout">
|
||||
{{> nav}}
|
||||
<div class="container-fluid">
|
||||
{{> yield }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="nav">
|
||||
<nav class="navbar navbar-default">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="#">
|
||||
Project deployer
|
||||
</a>
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">Project deployer</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container-fluid">
|
||||
<header>
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h2>Register or edit a project</h2>
|
||||
{{> projectForm}}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<h2>Your projects</h2>
|
||||
<ul>
|
||||
{{#each projects}}
|
||||
{{> project}}
|
||||
{{/each}}
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="active">
|
||||
<a href="/management">Projects <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<template name="home">
|
||||
<h1>Welcome to Project deployer</h1>
|
||||
</template>
|
||||
|
||||
<template name="management">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h2>Register or edit a project</h2>
|
||||
{{> projectForm}}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<h2>Your projects</h2>
|
||||
<ul>
|
||||
{{#each projects}}
|
||||
{{> project}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</template>
|
||||
|
||||
<template name="projectForm">
|
||||
<form class="new-project form-horizontal">
|
||||
@@ -84,16 +104,18 @@
|
||||
</div>
|
||||
</div>
|
||||
{{#with project}}
|
||||
<div class="form-group">
|
||||
<div class="form-group ">
|
||||
<label class="col-sm-2 control-label">
|
||||
<i class="fa fa-fw fa-cog fa-2x" title="Link to provide to CI (Travis)"></i>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" disabled value="{{deployLink}}"/>
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-fw fa-clipboard copy"></i>
|
||||
</div>
|
||||
<input type="text" id="deployLink" class="form-control" readonly="readonly" title="{{deployLink}}" value="{{deployLink}}"/>
|
||||
<span class="input-group-btn">
|
||||
<a class="btn btn-default clipboard" data-clipboard-target="#deployLink">
|
||||
<i class="fa fa-fw fa-clipboard copy"></i>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,16 +3,21 @@ Projects = new Mongo.Collection('projects');
|
||||
if (Meteor.isClient) {
|
||||
Meteor.subscribe('projects');
|
||||
|
||||
Template.body.helpers({
|
||||
Template.management.helpers({
|
||||
projects: function () {
|
||||
return Projects.find({}, {sort: {label: 1}});
|
||||
}
|
||||
});
|
||||
|
||||
Template.projectForm.onRendered(function() {
|
||||
new Clipboard('.btn.clipboard');
|
||||
});
|
||||
|
||||
Template.projectForm.events({
|
||||
'submit .new-project': function (event) {
|
||||
event.preventDefault();
|
||||
var form = event.target;
|
||||
console.log('handled', form.id.value);
|
||||
if( form.id.value ) {
|
||||
Meteor.call('editProject',form.id.value, form.label.value, form.git_url.value, form.public_url.value, form.commands.value);
|
||||
form.id.value = '';
|
||||
@@ -51,7 +56,7 @@ if (Meteor.isClient) {
|
||||
},
|
||||
|
||||
deployLink: function() {
|
||||
return Meteor.absoluteUrl('/deploy?token=XXXX&project_id=' + Session.get('projectToEdit')._id);
|
||||
return Meteor.absoluteUrl('deploy?token=XXXX&project_id=' + Session.get('projectToEdit')._id);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -82,15 +87,17 @@ Meteor.methods({
|
||||
},
|
||||
|
||||
addProject: function(label, git_url, public_url ,commands) {
|
||||
console.log('addProjects', arguments);
|
||||
Projects.insert({
|
||||
label: label,
|
||||
git_url: git_url,
|
||||
public_url: public_url,
|
||||
commands: commands
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
editProject: function(id, label, git_url, public_url ,commands) {
|
||||
console.log('editProjects', arguments);
|
||||
Projects.update(
|
||||
id,
|
||||
{ $set: {
|
||||
|
||||
Reference in New Issue
Block a user