-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #227 from bmarkons/admin-ui
Add admin UI
- Loading branch information
Showing
23 changed files
with
160 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//= require jquery | ||
//= require jquery_ujs | ||
//= require turbolinks | ||
//= require bootstrap_sb_admin_base_v2 | ||
//= require_tree ./admin |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
$(document).on('turbolinks:load', function() { | ||
$('#manual_run_form').submit(function(event) { | ||
$('#notice').remove(); | ||
$('#wait_alert').removeClass('hidden'); | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@import "bootstrap-sprockets"; | ||
@import "bootstrap"; | ||
@import "font-awesome"; | ||
@import "bootstrap_sb_admin_base_v2"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- content_for(:page_header) do | ||
= t('admin.dashboard') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
- content_for(:page_header) do | ||
= @repo.name.capitalize | ||
|
||
.row | ||
.col-lg-6 | ||
- if notice.present? | ||
#notice.alert.alert-success | ||
= notice | ||
|
||
#wait_alert.alert.alert-warning.hidden | ||
= t('admin.wait_manual_run') | ||
|
||
.panel.panel-warning | ||
.panel-body | ||
= form_tag(admin_repo_run_path(@repo.name), id: 'manual_run_form') do | ||
.form-group | ||
= label_tag(t('admin.manual_run_label')) | ||
= select_tag(:count, options_for_select(ManualRunner::OPTIONS, ManualRunner::OPTIONS.last), class: 'form-control') | ||
= button_tag(t('admin.manual_run_button'), class: 'btn btn-default') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
%HTML{ lang: 'en' } | ||
%head | ||
%title RubyBench Admin | ||
|
||
= stylesheet_link_tag 'admin', 'data-turbolinks-track' => 'reload' | ||
= javascript_include_tag 'admin', 'data-turbolinks-track' => 'reload' | ||
= csrf_meta_tags | ||
|
||
%body | ||
#wrapper | ||
= render 'layouts/admin/navbar' | ||
|
||
#page-wrapper | ||
.row | ||
.col-lg-12 | ||
%h1.page-header | ||
= yield(:page_header) | ||
= yield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
%nav.navbar.navbar-default.navbar-static-top{:role => "navigation", :style => "margin-bottom: 0"} | ||
.navbar-header | ||
%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", :type => "button"} | ||
%span.sr-only Toggle navigation | ||
%span.icon-bar | ||
%span.icon-bar | ||
%span.icon-bar | ||
%a.navbar-brand RubyBench Admin | ||
|
||
%ul.nav.navbar-top-links.navbar-right.pull-right | ||
%li.dropdown | ||
= link_to root_path do | ||
%i.fa.fa-sign-out | ||
|
||
.navbar-default.sidebar{:role => "navigation"} | ||
.sidebar-nav.navbar-collapse | ||
%ul#side-menu.nav.in | ||
%li | ||
= link_to admin_path do | ||
%i.fa.fa-dashboard.fa-fw | ||
= t('admin.dashboard') | ||
- @repos.each do |repo| | ||
%li | ||
= link_to admin_repo_path(repo.name) do | ||
%i.fa.fa-suitcase.fa-fw | ||
= repo.name.capitalize | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require 'acceptance/test_helper' | ||
|
||
class AdminTest < AcceptanceTest | ||
test 'Admin should be able to manually run suite for existing repo' do | ||
repo = create(:repo) | ||
|
||
visit admin_repo_path(repo.name) | ||
page.has_css?('label', text: I18n.t('admin.manual_run_label')) | ||
page.has_css?('button', text: I18n.t('admin.manual_run_button')) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require 'test_helper' | ||
|
||
class ManualRunTest < ActionDispatch::IntegrationTest | ||
def test_running_commits_manually | ||
@repo = create(:repo) | ||
|
||
ManualRunner.any_instance.expects(:run_last).with(100) | ||
|
||
post(admin_repo_run_path(@repo.name), params: { count: 100 }) | ||
end | ||
end |