- @layouttype = 'custom'
- @pagetitle = "Notifications"
- @crumb_list = [@pagetitle]
.grid_16.alpha.omega.box.box-shadow
  %h2= @pagetitle

  = form_tag(user_notifications_path, method: :put, id: 'notification_form') do
    - unless @groups_users.empty?
      %h3 Groups
      %p.description You will receive emails from the checked groups
      .box
        .row
          %ul
            - @groups_users.each do |group_user|
              %li
                = check_box_tag group_user.group, '1', group_user.email
                = label_tag group_user.group.title

    %h3 Events
    %p.description Choose from which events you want to get an email
    #subscriptions-form
      = render partial: 'webui/subscriptions/subscriptions_form'
    %p
      = submit_tag 'Update'
      = link_to('Reset to default', user_notifications_path(default_form: true), remote: true)
.grid_16.alpha.omega.box.box-shadow
  %h2 RSS Feed
  = form_tag(user_rss_token_path, id: 'generate_rss_token_form', method: :post) do
    %p
      - if @user.rss_token
        To access your RSS feeds, use the following url:
        = link_to(user_rss_notifications_url(token: @user.rss_token.string, format: 'rss'), user_rss_notifications_url(token: @user.rss_token.string, format: 'rss'), target: '_blank')
      - else
        No feed url exists for your notifications.
    %p= submit_tag "#{@user.rss_token ? 'Regenerate Url' : 'Generate Url'}"
