923
923
function unsubscribe_with_warning_action() {
924
return make_action('remove-direct-subscription-with-warning')
924
return make_action(action_ids.unsubscribe_with_warning)
926
926
make_action_link( // XXX Fix text.
927
927
'You can also unsubscribe from this bug. However, you also have other subscriptions to this bug that may send you email once you have unsubscribed.',
928
928
'remove', 'unsubscribe', {}));
932
* Makes links for subscribing actions.
931
934
function make_subscribe_link(text, level) {
932
935
return make_action_link(
985
function border_box(title, content_div) {
986
return Y.Node.create('<div/>')
988
.setStyle('border', '1px solid #ddd')
989
.setStyle('padding', '0 1em 1em 1em')
990
.append(Y.Node.create('<span/>')
991
.setStyle('backgroundColor', '#fff')
992
.setStyle('float', 'left')
993
.setStyle('marginTop', '-0.6em')
994
.setStyle('padding', '0 1ex')
997
.setStyle('clear', 'both')
998
.setStyle('padding', '1em 0 0 1em'));
986
1007
* personal subscriptions (if any).
988
1009
function get_direct_description_node(info) {
989
1011
var direct_info = get_direct_subscription_information(info);
1012
var less_email_title = 'If you don\'t want to receive emails about '+
1014
var more_email_title = 'If you want to receive more emails about '+
990
1016
var direct_node = Y.Node.create('<div/>')
991
1017
.set('id', 'direct-subscription')
992
1018
.set('text', direct_info.reason)
993
1019
// Make border box for actions that reduce email.
994
.append(Y.Node.create('<div/>')
995
.addClass('reductions')
997
.setStyle('border', '1px solid #ddd')
998
.setStyle('padding', '0 1em 1em 1em')
999
.append(Y.Node.create('<span/>')
1000
.setStyle('backgroundColor', '#fff')
1001
.setStyle('float', 'left')
1002
.setStyle('marginTop', '-0.6em')
1003
.setStyle('padding', '0 1ex')
1004
.set('text', 'If you don\'t want to receive emails about '+
1005
'this bug you can'))
1006
.append(Y.Node.create('<div/>')
1007
.setStyle('clear', 'both')
1008
.setStyle('padding', '1em 0 0 1em')
1020
.append(border_box(less_email_title, Y.Node.create('<div/>')
1009
1021
.append(mute_action())
1010
1022
.append(subscribe_only_metadata_action())
1011
1023
.append(subscribe_only_closed_action())
1012
.append(unsubscribe_action())))
1024
.append(unsubscribe_action()))
1025
.addClass('reductions'))
1013
1026
// Make border box for actions that increase email.
1014
.append(Y.Node.create('<div/>')
1015
.addClass('increases')
1017
.setStyle('border', '1px solid #ddd')
1018
.setStyle('padding', '0 1em 1em 1em')
1019
.append(Y.Node.create('<span/>')
1020
.setStyle('backgroundColor', '#fff')
1021
.setStyle('float', 'left')
1022
.setStyle('marginTop', '-0.6em')
1023
.setStyle('padding', '0 1ex')
1024
.set('text', 'If you want to receive more emails about '+
1025
'this bug you can'))
1026
.append(Y.Node.create('<div/>')
1027
.setStyle('clear', 'both')
1028
.setStyle('padding', '1em 0 0 1em')
1027
.append(border_box(more_email_title, Y.Node.create('<div/>')
1029
1028
.append(unmute_action())
1030
1029
.append(subscribe_all_action())
1031
1030
.append(subscribe_metadata_action())
1032
.append(subscribe_closed_action())))
1031
.append(subscribe_closed_action()))
1032
.addClass('increases'))
1033
1033
// Add the unsubscribe action for when they have other subscriptions.
1034
1034
.append(unsubscribe_with_warning_action());