Skip to content

Commit 035e105

Browse files
committed
add announcement styles
1 parent 489c611 commit 035e105

File tree

8 files changed

+62
-11
lines changed

8 files changed

+62
-11
lines changed

client/app.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ Settings = new Meteor.Collection("settings");
44

55
Meteor.subscribe("userData");
66
Meteor.subscribe("activeTickets");
7-
Meteor.subscribe("allAnnouncements");
7+
Meteor.subscribe("allAnnouncements");
8+
Meteor.subscribe("mentorsOnline");

client/components/announcement/announcement.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template name="announcement">
22
{{#if announcement}}
33
{{#with announcement}}
4-
<div class="ui info message">
4+
<div class="ui {{type}} message">
55
<div class="header">
66
{{header}}
77
</div>

client/components/announcementsTable/announcementsTable.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template name="announcementsTable">
22
{{#each announcements}}
3-
<div class="ui message">
3+
<div class="ui {{type}} message">
44
<i class="close red link icon"></i>
55
<div class="header">
66
{{header}}

client/components/announcer/announcer.html

+34
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,40 @@ <h4 class="ui header">
1010
<div class="field">
1111
<textarea id="a-content" name="content" placeholder="Announcement content" required></textarea>
1212
</div>
13+
14+
<div class="grouped inline fields">
15+
<div class="field">
16+
<div class="ui radio checkbox">
17+
<input type="radio" value="default" name="type" checked="checked">
18+
<label>Default</label>
19+
</div>
20+
</div>
21+
<div class="field">
22+
<div class="ui radio checkbox">
23+
<input type="radio" value="info" name="type">
24+
<label>Information</label>
25+
</div>
26+
</div>
27+
<div class="field">
28+
<div class="ui radio checkbox">
29+
<input type="radio" value="warning" name="type">
30+
<label>Warning</label>
31+
</div>
32+
</div>
33+
<div class="field">
34+
<div class="ui radio checkbox">
35+
<input type="radio" value="success" name="type">
36+
<label>Success</label>
37+
</div>
38+
</div>
39+
<div class="field">
40+
<div class="ui radio checkbox">
41+
<input type="radio" value="error" name="type">
42+
<label>Danger</label>
43+
</div>
44+
</div>
45+
</div>
46+
1347
<div class="field">
1448
<button class="submit disabled ui blue button">
1549
Announce

client/components/announcer/announcer.js

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Template.announcer.rendered = function(){
2+
$(this.findAll('.ui.checkbox')).checkbox();
3+
};
4+
15
Template.announcer.events({
26
'click .submit.button': function(){
37
createAnnouncement();
@@ -20,21 +24,27 @@ Template.announcer.events({
2024
function createAnnouncement(){
2125
if(isValid()){
2226
var a = getAnnouncement();
23-
Meteor.call("createAnnouncement", a.header, a.content);
27+
Meteor.call("createAnnouncement", a.header, a.content, a.type);
2428
clearFields();
2529
}
2630
}
2731

2832
function getAnnouncement(){
33+
var form = $('.ui.form input, .ui.form textarea')
34+
.serializeArray()
35+
.reduce(function(obj, item) {
36+
obj[item.name] = item.value;
37+
return obj;
38+
}, {});
2939
return {
30-
header: $('#a-header').val(),
31-
content: $('#a-content').val()
40+
header: form.header,
41+
content: form.content,
42+
type: form.type
3243
}
3344
}
3445

3546
function clearFields(){
36-
$('#a-header').val("");
37-
$('#a-content').val("");
47+
$('.ui.form input, .ui.form textarea').val("");
3848
}
3949

4050
function isValid(){

client/components/login/login.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<template name="login">
2+
23
{{#if enabled.github}}
34
<button id="login-github" class="github push button"> Login with Github </button>
45
<br>

client/views/admin/admin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Session.set('admin', 'announce');
1+
Session.set('admin', 'settings');
22

33
Template.admin.helpers({
44
pageIs: function(page){

client/views/settings/settings.html

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<template name="settings">
2-
<div class="ui segment settings">
3-
<h2 class="ui dividing header">Settings</h2>
2+
<div class="ui top attached tertiary header segment">
3+
<strong>
4+
Branding
5+
</strong>
6+
</div>
7+
<div class="ui bottom attached segment">
8+
49
</div>
510
</template>

0 commit comments

Comments
 (0)