Commit 71a4eb8

mo <mo.khan@gmail.com>
2018-12-09 05:38:10
update to bulma
1 parent 8df525e
app/helpers/application_helper.rb
@@ -4,26 +4,13 @@ module ApplicationHelper
   def alert_class_for(type)
     case type.to_sym
     when :notice
-      'alert-success'
+      'is-success'
     when :warning
-      'alert-warning'
+      'is-warning'
     when :error
-      'alert-danger'
+      'is-danger'
     else
-      'alert-primary'
-    end
-  end
-
-  def alert_message_for(type)
-    case type.to_sym
-    when :notice
-      'Hot dog!'
-    when :warning
-      'Holy guacamole!'
-    when :error
-      'Danger Will Robinson!'
-    else
-      '🤷'
+      'is-info'
     end
   end
 end
app/views/application/_flash.html.erb
@@ -1,11 +1,9 @@
 <div class="container">
   <% flash.each do |type, message| %>
     <% Array(message).each do |value| %>
-      <div class="alert <%= alert_class_for(type) %> alert-dismissible fade show" role="alert">
-        <strong><%= alert_message_for(type) %></strong> <%= value %>
-        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
-          <span aria-hidden="true">&times;</span>
-        </button>
+      <div class="notification <%= alert_class_for(type) %>">
+        <button class="delete"></button>
+        <%= value %>
       </div>
     <% end %>
   <% end %>
app/views/errors/bad_request.html.erb
@@ -1,7 +1,7 @@
 <div class="container">
   <div class="columns">
     <div class="column">
-      <h1><%= t('.title') %></h1>
+      <h1 class="title"><%= t('.title') %></h1>
     </div>
   </div>
 </div>
app/views/errors/forbidden.html.erb
@@ -1,7 +1,7 @@
 <div class="container">
   <div class="columns">
     <div class="column">
-      <h1><%= t('.title') %></h1>
+      <h1 class="title"><%= t('.title') %></h1>
       <% if @model %>
         <ul class="list-unstyled">
           <% @model.errors.full_messages.each do |message| %>
app/views/errors/not_found.html.erb
@@ -1,7 +1,7 @@
 <div class="container">
   <div class="columns">
     <div class="column">
-      <h1><%= t('.title') %></h1>
+      <h1 class="title"><%= t('.title') %></h1>
     </div>
   </div>
 </div>
app/views/mfas/new.html.erb
@@ -1,12 +1,20 @@
 <div class="container">
-  <div class="row">
-    <div class="col">
-      <h1><%= t('.title') %></h1>
+  <div class="columns is-centered">
+    <div class="column is-half">
+      <h1 class="title"><%= t('.title') %></h1>
+
       <%= form_for :mfa, url: mfa_path, method: :post do |form| %>
-        <div class="form-group">
-          <%= form.number_field :code, class: 'form-control', autofocus: true, required: :required %>
+        <div class="field">
+          <%= form.label :code %>
+          <div class="control">
+            <%= form.number_field :code, class: 'input', autofocus: true, required: :required %>
+          </div>
+        </div>
+        <div class="field">
+          <div class="control is-pulled-right">
+            <%= form.button t('.login'), type: 'submit', class: 'button is-primary', data: { disable_with: t('loading') } %>
+          </div>
         </div>
-        <%= form.button t('.login'), type: 'submit', class: 'btn btn-primary', data: { disable_with: t('loading') } %>
       <% end %>
     </div>
   </div>
app/views/my/audits/index.html.erb
@@ -1,7 +1,7 @@
 <div class="container">
   <div class="columns">
-    <div class="column content">
-      <h1><%= t('.title') %></h1>
+    <div class="column">
+      <h1 class="title"><%= t('.title') %></h1>
 
       <table class="table is-bordered is-narrow is-hoverable is-striped is-fullwidth">
         <thead>
app/views/my/clients/index.html.erb
@@ -1,7 +1,8 @@
 <div class="container">
   <div class="columns">
-    <div class="column content">
-      <h1><%= t('.title') %></h1>
+    <div class="column">
+      <h1 class="title"><%= t('.title') %></h1>
+
       <%= link_to t(".new"), new_my_client_path, class: 'button is-link' %>
       <table class="table is-bordered is-narrow is-hoverable is-striped is-fullwidth">
         <thead>
app/views/my/clients/new.html.erb
@@ -1,7 +1,7 @@
 <div class="container">
   <div class="columns is-centered">
-    <div class="column is-half content">
-      <h1><%= t('.title') %></h1>
+    <div class="column is-half">
+      <h1 class="title"><%= t('.title') %></h1>
 
       <div data-controller="clients--new">
         <%= form_for @client, url: my_clients_path, method: :post do |form| %>
app/views/my/dashboards/show.html.erb
@@ -1,7 +1,8 @@
 <div class="container">
   <div class="columns">
-    <div class="column content is-full">
-      <h1><%= t('.title') %></h1>
+    <div class="column is-full">
+      <h1 class="title"><%= t('.title') %></h1>
+
       <table class="table">
         <thead>
           <th></th>
app/views/my/mfas/edit.html.erb
@@ -1,7 +1,8 @@
 <div class="container">
-  <div class="row">
-    <div class="col">
-      <h1><%= t('.title') %></h1>
+  <div class="columns is-centered">
+    <div class="column is-two-thirds">
+      <h1 class="title"><%= t('.title') %></h1>
+
       <div data-controller="mfa--setup">
         <canvas id="canvas" data-target="mfa--setup.canvas"></canvas>
         <p><%= t('.secret') %> <%= current_user.mfa.secret %></p>
@@ -9,8 +10,14 @@
 
         <%= form_for current_user, url: my_mfa_path, method: :delete do |form| %>
           <%= form.hidden_field :mfa_secret, data: { target: 'mfa--setup.secret' } %>
-          <%= form.submit "Disable", class: 'btn btn-danger', data: { disable_with: 'Saving…' } %>
-          <%= link_to "Cancel", my_dashboard_path, class: 'btn' %>
+          <div class="field is-grouped is-grouped-right">
+            <div class="control">
+              <%= form.submit "Disable", class: 'button is-danger', data: { disable_with: 'Saving…' } %>
+            </div>
+            <div class="control">
+              <%= link_to "Cancel", my_dashboard_path, class: 'button is-text' %>
+            </div>
+          </div>
         <% end %>
       </div>
     </div>
app/views/my/mfas/new.html.erb
@@ -1,7 +1,7 @@
 <div class="container">
   <div class="columns is-centered">
-    <div class="column is-half content">
-      <h1><%= t('.title') %></h1>
+    <div class="column is-half">
+      <h1 class="title"><%= t('.title') %></h1>
 
       <div data-controller="mfa--setup">
         <canvas id="canvas" data-target="mfa--setup.canvas"></canvas>
app/views/my/sessions/index.html.erb
@@ -1,7 +1,7 @@
 <div class="container">
   <div class="columns">
-    <div class="column content">
-      <h1><%= t('.title') %></h1>
+    <div class="column">
+      <h1 class="title"><%= t('.title') %></h1>
 
       <table class="table">
         <thead>
app/views/oauth/authorizations/show.html.erb
@@ -1,7 +1,8 @@
 <div class="container">
   <div class="row">
     <div class="col">
-      <h1><%= t('.title') %></h1>
+      <h1 class="title"><%= t('.title') %></h1>
+
       <p><%= t('.authorize_prompt_html', name: @client.name) %></p>
       <%= form_for :authorization, url: oauth_authorizations_path, method: :post do |form| %>
         <%= form.button t('.authorize'), type: 'submit', class: 'btn btn-primary', data: { disable_with: t('loading') } %>
app/views/registrations/new.html.erb
@@ -1,7 +1,7 @@
 <div class="container">
   <div class="columns is-centered">
-    <div class="column is-half content">
-      <h1><%= t('.title') %></h1>
+    <div class="column is-half">
+      <h1 class="title"><%= t('.title') %></h1>
 
       <%= form_for @user, url: registrations_path, method: :post do |form| %>
         <div class="field">
app/views/responses/_response.html.erb
@@ -1,7 +1,8 @@
 <div class="container">
-  <div class="row">
-    <div class="col">
-      <h1><%= t('.title') %></h1>
+  <div class="columns">
+    <div class="column">
+      <h1 class="title"><%= t('.title') %></h1>
+
       <%= render partial: 'spinner' %>
       <%= form_tag(@url, data: { controller: 'sessions--response' }) do %>
         <% @saml_params.each do |(key, value)| %>
app/views/sessions/new.html.erb
@@ -1,7 +1,7 @@
 <div class="container">
   <div class="columns is-centered">
-    <div class="column is-half content">
-      <h1><%= t('.title') %></h1>
+    <div class="column is-half">
+      <h1 class="title"><%= t('.title') %></h1>
 
       <%= form_for :user, url: session_path, method: :post, data: { controller: 'sessions--new' } do |form| %>
         <div class="field">