view_dropdown = (view, req, on_done_redirect_str = "") =>
  settingsDropdown(`dropdownMenuButton${view.id}`, [
    a(
      {
        class: "dropdown-item",
        href: `/view/${encodeURIComponent(view.name)}`,
      },
      '<i class="fas fa-running"></i>&nbsp;' + req.__("Run")
    ),
    view.id &&
      a(
        {
          class: "dropdown-item",
          href: `/viewedit/edit/${encodeURIComponent(
            view.name
          )}${on_done_redirect_str}`,
        },
        '<i class="fas fa-edit"></i>&nbsp;' + req.__("Edit")
      ),
    post_dropdown_item(
      `/viewedit/add-to-menu/${encodeURIComponent(
        view.name
      )}${on_done_redirect_str}`,
      '<i class="fas fa-bars"></i>&nbsp;' + req.__("Add to menu"),
      req
    ),
    view.id &&
      post_dropdown_item(
        `/viewedit/clone/${view.id}${on_done_redirect_str}`,
        '<i class="far fa-copy"></i>&nbsp;' + req.__("Duplicate"),
        req
      ),
    view.id &&
      a(
        {
          class: "dropdown-item",
          href: `javascript:ajax_modal('/admin/snapshot-restore/view/${view.name}${on_done_redirect_str}')`,
        },
        '<i class="fas fa-undo-alt"></i>&nbsp;' + req.__("Restore")
      ),
    view.id && div({ class: "dropdown-divider" }),
    view.id &&
      post_dropdown_item(
        `/viewedit/delete/${view.id}${on_done_redirect_str}`,
        '<i class="far fa-trash-alt"></i>&nbsp;' + req.__("Delete"),
        req,
        true,
        view.name
      ),
  ])
@param {object} view
@param {object} req
@returns {div}