Skip to content

Commit

Permalink
Merge branch 'dev'. Update stable on-premise.
Browse files Browse the repository at this point in the history
  • Loading branch information
Toxantron committed Jan 20, 2019
2 parents add1e64 + f5bcf91 commit d3a689d
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 7 deletions.
26 changes: 22 additions & 4 deletions src/css/scrumonline.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ div.row.topic {
margin-bottom: 20px;
}
div.topic .form-control {
width: 500px;
width: 280px;
}
@media(min-width: 1200px)
{
div.topic .form-control {
width: 500px;
}
}

.selectable {
Expand Down Expand Up @@ -128,19 +134,31 @@ div.card, div.card-flip {
/* Card flip */
div.card-overview {
perspective: 1000px;
margin-right: -40px;
}
div.card-overview:first-child {
margin-left: 15px;
}
div.card-overview div.card-container {
float: left;
width: 175px;
width: 33%;
}
@media(min-width: 768px) {
div.card-overview {
margin-right: -40px;
}
div.card-overview div.card-container {
width: 160px;
}
}
@media(min-width: 992px) {
div.card-overview {
margin-right: -60px;
}
div.card-overview div.card-container {
width: 195px;
}
}
@media(min-width: 1200px) {
div.card-overview div.card-container {
width: 210px;
}
Expand All @@ -153,7 +171,7 @@ div.card.front, div.card.back {
left: 0;
}
div.deletable-card{
position: relative;
position: relative;
height: 212px;
width: 142px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<base href="/">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Online planning poker</title>
<meta name="description" content="Scrumpoker online is an open source web implementation of planning poker for scrum teams to determine the complexity of stories. It aims to integrate ticketing systems like Redmine or Github.">
<meta name="description" content="Scrumpoker online is an open source web implementation of planning poker for scrum teams to determine the complexity of stories. It aims to integrate ticketing systems like JIRA, Github or Gitlab.">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="apple-touch-icon" href="apple-touch-icon.png">
Expand Down
53 changes: 53 additions & 0 deletions src/js/gitlab-plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*globals scrum */

// Add a plugin for github integration
scrum.sources.push({
// Fixed properties and methods
name: "Gitlab",
position: 4,
view: "templates/gitlab_source.html",
feedback: false,
// Feedback call for completed poll
completed: function(result) {
},

// Custom properties and methods
loaded: false,
server: 'https://gitlab.com/',
repo: '',
issues: [],
issue: {},

// Private repo
isPrivate: false,
token: '',

// Load issues from github
load: function() {
var self = this;

var headers = {};
if(self.isPrivate) {
headers['Private-Token'] = this.token;
}

// Build access URL. Gitlab is very picky about that!
var encodedRepo = encodeURIComponent(this.repo);
var uri = this.server;
if(uri.substr(-1) !== '/')
uri += '/';
uri += 'api/v4/projects/' + encodedRepo + '/issues';
this.parent.$http
.get(uri, { headers: headers })
.then(function (response) {
// Convert markdown to HTML
var converter = new showdown.Converter();
response.data.forEach(function(issue) {
issue.description = converter.makeHtml(issue.description);
});
self.issues = response.data;
self.issue = self.issues[0];
self.loaded = true;
});
}
});
5 changes: 4 additions & 1 deletion src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,11 @@ scrum.app.controller('MasterController', function ($http, $routeParams, $locatio
self.consensus = result.consensus;

// If the result has a topic, the team has started estimating
if(result.topic !== '')
if(result.topic !== '') {
self.current.topic = result.topic;
self.current.description = result.description;
self.teamComplete = true;
}

// Forward result to ticketing system
if (self.current.feedback && self.flipped && self.consensus) {
Expand Down
4 changes: 3 additions & 1 deletion src/sample-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
// Plugin to load issues from github
'GitHub',
// Plugin to load issues from JIRA
'JIRA'
'JIRA',
// Plugin to load issues from Gitlab
'Gitlab'
];

// Configuration for the server side JIRA controller
Expand Down
68 changes: 68 additions & 0 deletions src/templates/gitlab_source.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!-- Initial screen till static information was put in -->
<div ng-if="!master.current.loaded">
<form role="form">
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="form-group">
<label>Server:</label>
<input type="text" class="form-control" placeholder="{{master.current.server}}" ng-model="master.current.server">
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="form-group">
<label>Repo:</label>
<input type="text" class="form-control" placeholder="user/repo" ng-model="master.current.repo">
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="form-group">
<label><input type="checkbox" ng-model="master.current.isPrivate"> is private</label>
</div>
</div>
<div class="col-xs-12 col-md-6" ng-if="master.current.isPrivate">
<div class="form-group">
<label>Token: <a target="_blank" href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html">?</a></label>
<input type="text" class="form-control" ng-model="master.current.token">
</div>
</div>
</div>
<button class="btn btn-default" ng-click="master.current.load()">Load issues</button>
</form>
</div>

<!-- Screen after static process was completed -->
<div ng-if="master.current.loaded">
<div class="row">
<div class="col-xs-4">
<div class="list-group issue-list">
<a ng-repeat="issue in master.current.issues track by issue.id" class="selectable list-group-item" ng-class="{active: master.current.issue == issue}" ng-click="master.current.issue = issue">
#{{ issue.iid }}: {{ issue.title }}
</a>
</div>
</div>
<div class="col-xs-8">
<div class="row">
<div class="col-xs-1">
<img src="{{ master.current.issue.author.avatar_url }}" alt="{{ master.current.issue.author.name }}" style="width: 100%" />
</div>
<div class="col-xs-11">
<h2><a href="{{ master.current.issue.web_url }}" target="_blank">#{{ master.current.issue.iid }}</a>: {{ master.current.issue.title }}</h2>
</div>
</div>
<div ng-if="master.current.issue.labels.length > 0">
<p><span ng-repeat="label in master.current.issue.labels" class="label label-default">{{ label.name }}</span></p>
</div>

<div class="panel panel-default">
<div class="panel-heading">
{{ master.current.issue.author.name }} created issue on {{ master.current.issue.created_at | date : "medium" }}
</div>
<div class="panel-body" style="white-space: pre-line" ng-bind-html="master.current.issue.description"></div>
</div>

<button class="btn btn-default" ng-click="master.startPoll(master.current.issue.title, master.current.issue.description, master.current.issue.web_url)">Start</button>
</div>
</div>
</div>

0 comments on commit d3a689d

Please sign in to comment.