Skip to content
Snippets Groups Projects
Commit 5752f43f authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Merge branch 'motd' into 'master'

Motd

Message of the day feature:  
An in the properties defined adminaccount can create a MotD that can has the audiences "students","tutors" or "all". e.g.: If you define a motd's audience as all, it will be shown on the FrontPage of ARSnova. A Message has start- & enddate to define the timerange, a title and a text which can be formatted via markdown.

See merge request !2
parents 9aa4bc3f 39ad6402
Branches
Tags
No related merge requests found
{
"_id":"_design/motd",
"language":"javascript",
"views":{
"all":{
"map":"function(doc) { if (doc.type == 'motd') { emit(1, doc);}}"
},
"admin":{
"map":"function(doc) { if (doc.type == 'motd' && doc.audience != 'session') { emit(1, doc);}}"
},
"for_students":{
"map":"function(doc) { if (doc.type == 'motd' && (doc.audience == 'students' || doc.audience == 'loggedIn')) { emit(1, doc);}}"
},
"for_tutors":{
"map":"function(doc) { if (doc.type == 'motd' && (doc.audience == 'tutors' || doc.audience == 'loggedIn')) { emit(1, doc);}}"
},
"for_all":{
"map":"function(doc) { if (doc.type == 'motd' && doc.audience == 'all') { emit(1, doc);}}"
},
"for_loggedin":{
"map":"function(doc) { if (doc.type == 'motd' && doc.audience == 'loggedIn') { emit(1, doc);}}"
},
"by_sessionkey":{
"map":"function(doc) { if (doc.type == 'motd' && doc.audience == 'session') { emit(doc.sessionkey, doc);}}"
},
"by_keyword":{
"map":"function(doc) { if (doc.type == 'motd') { emit(doc.motdkey, doc); }}"
},
"list_by_username":{
"map":"function(doc) { if (doc.type == 'motdlist') { emit(doc.username, doc); }}"
}
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment