diff --git a/src/main/resources/views/motd b/src/main/resources/views/motd new file mode 100644 index 0000000000000000000000000000000000000000..363a4c893db115678e934b183cedb47ee31207da --- /dev/null +++ b/src/main/resources/views/motd @@ -0,0 +1,33 @@ +{ + "_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); }}" + } + } +}