Permalink
Browse files

More work on tests

  • Loading branch information...
1 parent bfffb09 commit ff042d438edd61d57f1dde38ed9db5bea6a6b064 @winton committed Sep 19, 2010
@@ -63,8 +63,7 @@
delete '/tests.json' do
ABPlugin::API.delete_test(
- :category => params[:category],
- :name => params[:name],
+ :id => params[:id],
:token => current_user.single_access_token
).to_json
end
@@ -39,40 +39,66 @@
%textarea.hide#tests_form_variant_template
.span-2
- %label Variant
+ %label
+ <% if (typeof control != "undefined") { %>
+ Control
+ <% } else { %>
+ Variant
+ <% } %>
.span-5
%input{ :class => 'variants', :name => 'variants[]', :type => 'text' }
%textarea.hide#test_template
- %table
+ %table{ :id => 'test_<%= test.id %>' }
%tr
- %th.first <%= test.name %>
+ %th.first
+ <%= test.name %>
%th Visits
%th Conversions
+ %th Conversion Rate
%th Suggested Visits
%th Confidence
- %th Status
- <% $.each(test.variants, function(i, variant) { %>
- %tr{ :class => '<% if (i % 2 == 0) { %>odd<% } %>'}
- %td <%= variant.name %>
+ <%
+ var odd;
+ $.each(test.variants, function(i, variant) {
+ odd = (i % 2 == 0); %>
+ %tr{ :class => '<% if (odd) { %>odd<% } %>'}
+ %td
+ <%= variant.name %>
+ <% if (i == 0) { %>
+ %span (control)
+ <% } %>
<%
var found = false;
$.each(variant.for_dashboard, function(e, item) {
if (e == env) {
found = true; %>
%td <%= item.visits %>
+ %td <%= item.conversions %>
%td <%= item.conversion_rate %>
%td <%= item.suggested_visits %>
%td <%= item.confidence %>
- %td ?
<%
}
});
if (!found) { %>
%td 0
+ %td 0
%td -
%td -
- %td -
- %td ?
+ %td 0%
<% } %>
- <% }); %>
+ <% }); %>
+ %tr{ :class => '<% if (!odd) { %>odd<% } %>'}
+ %td{ :colspan => 6 }
+ %select.conditions
+ %option Conditions
+ .right
+ .edit
+ %a{ :href => '#' }
+ %img{ :src => '/image/edit.png' }
+ Edit
+ .remove
+ %a{ :href => '#' }
+ %img{ :src => '/image/remove.png' }
+ Delete
@@ -16,13 +16,11 @@
.logo a_b
- if current_user
.span-12.last
- .span-3.nav
- %a{ :href => '/' } Dashboard
- .span-3.nav
- %a{ :href => '/setup' } Setup
- .span-3.nav
+ .span-4.nav.align-left
+ %a{ :href => '/get_started' } Get Started
+ .span-4.nav
%a{ :href => '/account' } Account
- .span-3.nav.last
+ .span-4.nav.last
%a{ :href => '/sessions/destroy' } Log out
- else
.span-12.last
@@ -1,13 +1,63 @@
-.dashboard .header img { cursor: pointer; margin-top: 2.5em; vertical-align: -2px; }
-.dashboard .selectable { background: #E5ECF9; border: 2px solid #C2D2EF; color: #000099; cursor: pointer; float: left; height: 40px; line-height: 40px; margin: 15px 15px 0 0; overflow: hidden; text-align: center; text-decoration: underline; width: 141px; }
-.dashboard .selectable.selected { background: #E6EFC2; border-color: #C6D880; color: #264409; text-decoration: none; }
-.dashboard .selectable.last { margin-right: 0; }
-.dashboard .selectable form { margin-top: -3px; }
-.dashboard .selectable input { margin: 0 auto; text-align: center; width: 90%; }
+.dashboard .nav {
+ text-align: right;
+}
+
+.dashboard .header img {
+ cursor: pointer;
+ margin-top: 2.5em;
+ vertical-align: -2px;
+}
-.dashboard #tests .dialog { margin-top: 15px; overflow: auto; padding: 5px 20px; }
-.dashboard #tests .dialog label { line-height: 27px; }
-.dashboard #tests .dialog .submit { float: right; margin-top: 4px; }
+.dashboard .selectable {
+ background: #E5ECF9;
+ border: 2px solid #C2D2EF;
+ color: #000099;
+ cursor: pointer;
+ float: left;
+ height: 40px;
+ line-height: 40px;
+ margin: 15px 15px 0 0;
+ overflow: hidden;
+ text-align: center;
+ text-decoration: underline;
+ width: 141px;
+}
+
+.dashboard .selectable.selected {
+ background: #E6EFC2;
+ border-color: #C6D880;
+ color: #264409;
+ text-decoration: none;
+}
+
+.dashboard .selectable.last {
+ margin-right: 0;
+}
+
+.dashboard .selectable form {
+ margin-top: -3px;
+}
+
+.dashboard .selectable input {
+ margin: 0 auto;
+ text-align: center;
+ width: 90%;
+}
+
+.dashboard #tests .dialog {
+ margin-top: 15px;
+ overflow: auto;
+ padding: 5px 20px;
+}
+
+.dashboard #tests .dialog label {
+ line-height: 27px;
+}
+
+.dashboard #tests .dialog .submit {
+ float: right;
+ margin-top: 4px;
+}
.dashboard #tests table {
border-width: 2px;
@@ -19,8 +69,17 @@
margin-top: 15px;
}
-.dashboard #tests table th.first {
- color: #000;
+.dashboard #tests table a {
+ text-decoration: none;
+}
+
+.dashboard #tests table td {
+ padding: 10px;
+ border-style: none;
+}
+
+.dashboard #tests table td span {
+ color: #8F8F8F;
}
.dashboard #tests table th {
@@ -32,11 +91,40 @@
color: #8F8F8F;
}
-.dashboard #tests table tr.odd {
- background-color: #fff;
+.dashboard #tests table th.first {
+ color: #000;
}
-.dashboard #tests table td {
- padding: 10px;
- border-style: none;
+.dashboard #tests table .conditions {
+ font-family: inherit;
+ font-size: 75%;
+ font-style: inherit;
+ margin: 0;
+}
+
+.dashboard #tests table .edit,
+.dashboard #tests table .remove {
+ float: left;
+ margin: 0px 20px;
+}
+
+.dashboard #tests table img {
+ margin-right: 3px;
+ vertical-align: -2px;
+}
+
+.dashboard #tests table .remove a {
+ color: #8a1f11;
+}
+
+.dashboard #tests table .remove a:focus, .dashboard #tests table .remove a:hover {
+ color: #000000;
+}
+
+.dashboard #tests table .right {
+ float: right;
+}
+
+.dashboard #tests table tr.odd {
+ background-color: #fff;
}
View
@@ -1,23 +1,99 @@
-body { font-size: 100%; }
-.error, .notice, .success { margin-top: 2.5em; text-align: center; }
-
-.container { margin: 2.5em auto; }
-
-.dialog { border: 2px solid #CFCFCF; }
-.dialog, .nav .selected { background: #EFEFEF; }
-.dialog form { font-size: 13px; }
-
-.top { overflow: auto; }
-.top .logo { font-size: 50px; font-weight: bold; margin-top: -0.35em; }
-.top .dialog { overflow: auto; position: relative; top: -2px; z-index: 1; }
-.top .dialog form { margin: 5px 0; }
-.top .dialog label { padding: 0 5px 0 24px; }
-.top .dialog label.confirm { padding: 0 5px 0 269px; }
-.top .dialog input { font-size: 12px; padding: .2em; }
-.top .dialog input.email { width: 157px; }
-.top .dialog input.password { width: 105px; }
-.top .dialog input.submit { float: right; margin: 5px 28px 10px; }
-
-.nav a.selected { border-top: 2px solid #CFCFCF; border-left: 2px solid #CFCFCF; border-right: 2px solid #CFCFCF; display: block; position: relative; z-index: 2; }
-.nav, .header { font-weight: bold; text-transform: uppercase; }
-.nav { cursor: pointer; line-height: 41px; text-align: center; }
+a {
+ font-weight: bold;
+}
+
+body {
+ font-size: 100%;
+}
+
+.container {
+ margin: 2.5em auto;
+}
+
+.dialog {
+ border: 2px solid #CFCFCF;
+}
+
+.dialog, .nav .selected {
+ background: #EFEFEF;
+}
+
+.dialog form {
+ font-size: 13px;
+}
+
+.error, .notice, .success {
+ margin-top: 2.5em;
+ text-align: center;
+}
+
+.header, .nav {
+ font-weight: bold;
+ text-transform: uppercase;
+}
+
+.nav {
+ cursor: pointer;
+ line-height: 41px;
+ text-align: center;
+}
+
+.nav.align-left {
+ text-align: left;
+}
+
+.nav a.selected {
+ border-top: 2px solid #CFCFCF;
+ border-left: 2px solid #CFCFCF;
+ border-right: 2px solid #CFCFCF;
+ display: block;
+ position: relative;
+ z-index: 2;
+}
+
+.top {
+ overflow: auto;
+}
+
+.top .dialog {
+ overflow: auto;
+ position: relative;
+ top: -2px;
+ z-index: 1;
+}
+
+.top .dialog form {
+ margin: 5px 0;
+}
+
+.top .dialog input {
+ font-size: 12px;
+ padding: .2em;
+}
+
+.top .dialog input.email {
+ width: 157px;
+}
+
+.top .dialog input.password {
+ width: 105px;
+}
+
+.top .dialog input.submit {
+ float: right;
+ margin: 5px 28px 10px;
+}
+
+.top .dialog label {
+ padding: 0 5px 0 24px;
+}
+
+.top .dialog label.confirm {
+ padding: 0 5px 0 269px;
+}
+
+.top .logo {
+ font-size: 50px;
+ font-weight: bold;
+ margin-top: -0.35em;
+}
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit ff042d4

Please sign in to comment.