Make sign in a modal dialog box rather than a separate page

[?]
Nov 5, 2013, 12:13 PM
WDKFN4B2M7BUF4S7X6YA5AKHOJKHLG65LWNQVOSIBTKFEZELBMKAC

Dependencies

  • [2] D44B24QC Store the account type ("hydra" or "persona") explicitly in the database
  • [3] UICHT2PS Add a search feature
  • [4] JLDUSNUO * Unify rendering of finished and scheduled builds.
  • [5] TP3PFR5K
  • [6] 3JBUMW3E forgot to commit a file
  • [7] KKJNJHO5 Update bootstrap to 2.0.3
  • [8] RU7AQO7U * Role-based access control. Only admins can create projects. Only
  • [9] KXGOUX7P * Creating releases.
  • [10] QTC3SYBM Jobset page: Load the jobs and status tabs on demand
  • [11] VCG6KNUX Remove the "clone build" feature
  • [12] BHZXGT2H * Channels: provide an index page that lists all the packages in the
  • [13] FV2M6MOT hydra: use autoconf/-make
  • [14] ODNCGFQ5 * Improved the navigation bar: don't include all projects (since that
  • [15] TRDGNILT Remove unused file
  • [16] LSZLZHJY Allow users to edit their own settings
  • [17] ZWCTAZGL added newsitems, added some admin options to clear various caches.
  • [18] LZVO64YG Merge in the first bits of the API work
  • [19] DV43UILU Don't float the search bar to the right in collapsed mode
  • [20] SMTMFEKE hydra: add missing templates
  • [21] YTSIRIMK * Separate job status and all builds pages.
  • [22] 7KF7YZDR Disable account creation for now
  • [23] 5DSDXORD hydra: missing plain.tt
  • [24] RSEGBU6C Hydra/20: Jobset clone feature
  • [25] D5QIOJGP * Move everything up one directory.
  • [26] G2WXEQHE Remove the Errors page
  • [27] 75XUS62Y * Added a page to quickly see all failed builds and failed evaluations
  • [28] 7ZQAHJQM Fix indentation
  • [29] XJRJ4J7M Add user registration
  • [30] 6FRLEP4P first try for timeline of last 24 hours in hydra
  • [31] JARRBLZD Bootstrapify the Hydra forms (except the project and jobset edit pages)
  • [32] JOVVHIJX Remove all entry points to modify machines
  • [33] ZFEN2MAO Simplify jobset cloning
  • [34] WRIU3S5E * UI for cloning builds (not functional yet).
  • [35] D7X6XTKQ Integrate the "Job status" and "All jobs" tabs
  • [36] VVRM3EGC Link to both the Persona and legacy sign in
  • [37] KSBB33RE Add a dashboard
  • [38] U4TD3AIQ Add support for viewing jobset evaluations
  • [39] VG4QG336 Remove tablesorter
  • [40] SZYDW2DG hydra: added some user admin
  • [41] RBNQKATL * Adding persistant releases. A release is a named set of builds.
  • [42] R2PON6R7 Allow non-admin users to see the machine status page
  • [43] 36M6DGIT Show the runtime/build dependencies in the build page
  • [44] PFB5ZUQW Fix legacy login
  • [45] 2G63HKCH Fix some wellformedness issues
  • [46] G6HJY2V4
  • [47] P5X4P6VK * Renaming "release sets" to "views" (not finished yet). Having
  • [48] 64IV56HI Replace bootstrap tarball
  • [49] AK2UZDS2 Jobset page: Add a new tab to show job status in a matrix
  • [50] JFZNAYJX * Showing releases.
  • [51] QL55ECJ6 - adapted ui for hydra, more in line with nixos.org website
  • [52] OX6NYJDV Split viewing and editing a jobset
  • [53] OR5SJ42Y Show releases in a tab on the project page
  • [54] DEMSSSB2 * Controller for jobs which inherits all actions in ListBuilds. So
  • [55] J3RYO2CU Remove the jobs status page
  • [56] VH5ZABDR Add a page to show the latest evaluations for the entire server
  • [57] US27ZTX5 * HydraFrontend -> Hydra.
  • [58] LFVXESGI Remove already disabled jobstatus code
  • [59] XDDCO6CH * hydra: add dependency list with links to logfiles
  • [60] LC64D4PU Correctly redirect to the referring page when logging in
  • [61] FHF6IZJQ * Basic release management: releases are now dynamically computed as
  • [62] 36ZTCZ4F Add basic Persona support
  • [63] 2BUX775I * More release -> view.
  • [64] AS2OXLRM * Editing releases.
  • [65] NEQ4BISO Add bootstrap.zip
  • [66] EFWN7JBV * Added a status page that shows all the currently executing build steps.
  • [67] PZL3SZM3 Give every page a consistent title
  • [68] U72VNKRU Remove unused file
  • [69] HZWUT4YN Allow users to reproduce builds on their own systems
  • [70] JY7BXXOP Split viewing and editing a project
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.

Change contents

  • edit in src/lib/Hydra/Controller/User.pm at line 20
    [3.23695][3.23695:23712](),[3.23712][3.497:523](),[3.497][3.497:523](),[3.523][3.23713:23878](),[3.23878][3.639:640](),[3.639][3.639:640](),[3.640][3.23879:23921]()
    sub login_GET {
    my ($self, $c) = @_;
    my $baseurl = $c->uri_for('/');
    my $referer = $c->request->referer;
    $c->session->{referer} = $referer if defined $referer && $referer =~ m/^($baseurl)/;
    $c->stash->{template} = 'login.tt';
    }
  • replacement in src/lib/Hydra/Controller/User.pm at line 24
    [3.23965][3.23965:24001]()
    my $username;
    my $password;
    [3.23965]
    [3.24001]
    my $username = $c->stash->{params}->{username} // "";
    my $password = $c->stash->{params}->{password} // "";
  • replacement in src/lib/Hydra/Controller/User.pm at line 27
    [3.24002][3.24002:24100]()
    $username = $c->stash->{params}->{username};
    $password = $c->stash->{params}->{password};
    [3.24002]
    [3.877]
    error($c, "You must specify a user name.") if $username eq "";
    error($c, "You must specify a password.") if $password eq "";
  • replacement in src/lib/Hydra/Controller/User.pm at line 30
    [3.878][3.878:912](),[3.912][3.24101:24557](),[3.24557][3.1203:1209](),[3.1203][3.1203:1209]()
    if ($username && $password) {
    if ($c->authenticate({username => $username, password => $password})) {
    if ($c->request->looks_like_browser) {
    backToReferer($c);
    } else {
    currentUser_GET($self, $c);
    }
    } else {
    $self->status_forbidden($c, message => "Bad username or password.");
    if ($c->request->looks_like_browser) {
    login_GET($self, $c);
    }
    }
    }
    [3.878]
    [3.24558]
    accessDenied($c, "Bad username or password.")
    if !$c->authenticate({username => $username, password => $password});
    $self->status_ok($c, entity => { });
  • file deletion: login.tt (----------)login.tt (----------)
    [3.1486][3.1846:1878](),[3.1878][3.4453:4453](),[3.857][3.5222:5254](),[3.5254][3.4453:4453]()
    [% WRAPPER layout.tt title="Sign in" %]
    [% PROCESS common.tt %]
    [% IF c.user_exists %]
    <p class="alert alert-info">
    You are already signed in as <tt>[% HTML.escape(c.user.username) %]</tt>.
    </p>
    [% ELSE %]
    <form class="form-horizontal" method="post" action="[% c.uri_for('/login') %]">
    <fieldset>
    <div class="control-group">
    <label class="control-label">User name</label>
    <div class="controls">
    <input type="text" class="span3" name="username" value=""/>
    </div>
    </div>
    <div class="control-group">
    <label class="control-label">Password</label>
    <div class="controls">
    <input type="password" class="span3" name="password" value=""/>
    </div>
    </div>
    <div class="form-actions">
    <input type="submit" name="login" value="Sign in" class="btn btn-primary" />
    </div>
    </fieldset>
    </form>
    [% END %]
    [% END %]
  • edit in src/root/layout.tt at line 149
    [3.1518]
    [72.11729]
    [% IF !c.user_exists %]
    <div id="hydra-signin" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
    <form class="form-horizontal">
    <div class="modal-body">
    <div class="control-group">
    <label class="control-label">User name</label>
    <div class="controls">
    <input type="text" class="span3" name="username" value=""/>
    </div>
    </div>
    <div class="control-group">
    <label class="control-label">Password</label>
    <div class="controls">
    <input type="password" class="span3" name="password" value=""/>
    </div>
    </div>
    </div>
    <div class="modal-footer">
    <button id="do-signin" class="btn btn-primary">Sign in</button>
    <button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
    </div>
    </form>
    </div>
    <script>
    $("#do-signin").click(function() {
    requestJSON({
    url: "[% c.uri_for('/login') %]",
    data: $(this).parents("form").serialize(),
    type: 'POST',
    success: function(data) {
    window.location.reload();
    }
    });
    return false;
    });
    </script>
    [% END %]
  • replacement in src/root/topbar.tt at line 131
    [3.339][2.696:773]()
    <a href="[% c.uri_for('/login') %]">Sign in with a Hydra account</a>
    [3.339]
    [3.418]
    <a href="#hydra-signin" data-toggle="modal">Sign in with a Hydra account</a>