Sha256: 42efa0f5863cbee599957e3b0cecd1ba815ad4e050b805700a30d962fd140ff1
Contents?: true
Size: 1.33 KB
Versions: 7
Compression:
Stored size: 1.33 KB
Contents
/*global dome*/ // The global, shared Gitorious namespace var gts = this.gts || {}; /** * Builds the profile menu for the specified user and replaces the * login button. If there is no user, nothing happens. */ (function (d, e) { function button(text, path, icon) { text = " " + text; var content = icon ? [e.i({className: "icon-" + icon}), text] : [text]; return e.li(e.a({ href: path }, content)); } gts.profileMenu = function (root, user) { if (!user) { return; } d.setContent([ e.a({ className: "btn btn-inverse", href: user.dashboardPath }, [e.i({ className: "icon-user icon-white" }), user.login]), e.a({ className: "btn btn-inverse dropdown-toggle", href: "#", data: { toggle: "dropdown" } }, e.span({ className: "caret" }, " ")), e.ul({ className: "dropdown-menu" }, [ button("Edit", user.editPath, "pencil"), button("Messages", user.messagesPath, "envelope"), e.li({ className: "divider" }), button("Dashboard", user.dashboardPath), button("Public profile", user.profilePath), button("Log out", user.logoutPath) ]) ], root); gts.dropdown(root); }; }(dome, dome.el));
Version data entries
7 entries across 7 versions & 1 rubygems