Skip to content

Commit f9848ce

Browse files
committed
Adding buttons for categories in talk
1 parent d3e0256 commit f9848ce

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

src/main/java/no/javazone/cake/redux/sleepingpill/SleepingpillCommunicator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ private static JsonObject talkObj(JsonObject jsonObject) {
207207

208208
talkob.put("tags",tagsToDisplay.getSummary());
209209
talkob.put("tagswithauthor",tagsToDisplay.getFull());
210+
talkob.put("suggestedCategory", readValueFromProp(jsonObject, "suggestedCategory"));
210211
talkob.put("published", Boolean.toString(Arrays.asList("APPROVED", "HISTORIC").contains(jsonObject.requiredString("status"))));
211212
talkob.put("body",readValueFromProp(jsonObject,"abstract"));
212213
talkob.put("ref",jsonObject.requiredString("id"));

src/main/resources/webapp/scripts/showTalkCtrl.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,14 @@ angular.module('cakeReduxModule')
6060
};
6161

6262
$scope.newTagTyped = function() {
63-
var n = $scope.newTag;
64-
$scope.aTalk.tagswithauthor.push({tag: n, author: $scope.username});
63+
$scope.appendTag($scope.newTag)
6564
};
65+
$scope.appendTag = function(tag) {
66+
if ($scope.aTalk.tagswithauthor.length == 0)
67+
$scope.aTalk.tagswithauthor.push({tag: String(new Date().getMonth() + 1).padStart(2, "0") + String(new Date().getDate()).padStart(2, "0"), author: $scope.username});
68+
69+
$scope.aTalk.tagswithauthor.push({tag: tag, author: $scope.username});
70+
}
6671

6772
$scope.newKeywordTyped = function() {
6873
var n = $scope.newKeyword;

src/main/resources/webapp/secured/templates/showTalk.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,24 @@ <h2>Add comment</h2>
327327

328328
<h2>Tags</h2>
329329
<div class="well" class="cake-margin-well">
330+
<p ng-if="aTalk.tagswithauthor.length == 0">
331+
<button class="btn btn-danger" ng-click="appendTag('nei')" title="ikke videre">nei</button>
332+
<button ng-if="aTalk.suggestedCategory != ''" class="btn btn-primary" ng-click="appendTag(aTalk.suggestedCategory)">{{aTalk.suggestedCategory}}</button>
333+
<button class="btn" ng-click="appendTag('ai')" title="AI / machine learning">ai</button>
334+
<button class="btn" ng-click="appendTag('arch')" title="Architecture">arch</button>
335+
<button class="btn" ng-click="appendTag('core')" title="JVM / Java (core) / compilers">core</button>
336+
<button class="btn" ng-click="appendTag('data')" title="database / data processing">data</button>
337+
<button class="btn" ng-click="appendTag('devex')" title="developer experience">devex</button>
338+
<button class="btn" ng-click="appendTag('exp')" title="Experience report / software application">exp</button>
339+
<button class="btn" ng-click="appendTag('front')" title="Frontend / design / UX">front</button>
340+
<button class="btn" ng-click="appendTag('infra')" title="infrastructure, cloud">infra</button>
341+
<button class="btn" ng-click="appendTag('lang')" title="Language / framework / API">lang</button>
342+
<button class="btn" ng-click="appendTag('misc')" title="alt annet">misc</button>
343+
<button class="btn" ng-click="appendTag('ops')" title="CI, DevOps">ops</button>
344+
<button class="btn" ng-click="appendTag('proc')" title="Process / methodology">proc</button>
345+
<button class="btn" ng-click="appendTag('qa')" title="testing">qa</button>
346+
<button class="btn" ng-click="appendTag('sec')" title="security">sec</button>
347+
</p>
330348
<p>
331349
<input ng-model="newTag" type="text" placeholder="New tag" />
332350
<button class="btn" ng-click="newTagTyped()">Add</button>

0 commit comments

Comments
 (0)