ad_page_contract {

    Manage notifications for one user

    @author Tracy Adams (teadams@alum.mit.edu)
    @creation-date 2002-07-22
    @cvs-id $Id: manage.tcl,v 1.5.2.1.2.1 2007/03/04 07:10:06 carlb Exp $
} {}

auth::require_login
set user_id [ad_conn user_id]
set return_url [ad_conn url]

db_multirow -extend { interval_url } notifications select_notifications {} {
    set interval_url [export_vars -base request-change-frequency { request_id {return_url [ad_return_url]} }]
}

template::list::create \
    -name notifications \
    -no_data [_ notifications.lt_You_have_no_notificat] \
    -elements {
        type {
            label {[_ notifications.Notification_type]}
        }
        object_name {
            label {[_ notifications.Item]}
            link_url_eval {[export_vars -base object-goto { object_id type_id }]}
	    link_html {title "\#notifications.goto_object_name\#"}
        }
        interval {
            label {[_ notifications.Frequency]}
            display_template {
                @notifications.interval@ <a href="@notifications.interval_url@" title="\#notifications.change_interval_object_name\#" class="button ">\#notifications.Change\#</a>
            }
        }
        action {
            label {[_ notifications.Action]}
            display_template {\#notifications.Unsubscribe\#}
            link_url_eval {[export_vars -base request-delete { request_id {return_url [ad_return_url]} }]}
	    link_html {title "\#notifications.Unsubscribe_from_object_name\#" class "button"}
        }
    }
