Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #3 from enpitut2018/introduce-materialize
Browse files Browse the repository at this point in the history
Introduce and Apply materialize
  • Loading branch information
Iori IKEDA authored Jul 25, 2018
2 parents 45931f8 + e509eb8 commit e2adc50
Show file tree
Hide file tree
Showing 13 changed files with 70 additions and 77 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ gem 'jbuilder', '~> 2.5'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

gem 'materialize-sass'
gem 'jquery-rails'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false

Expand Down
2 changes: 2 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
//= require activestorage
//= require turbolinks
//= require_tree .
//= require jquery
//= require materialize-sprockets
15 changes: 0 additions & 15 deletions app/assets/stylesheets/application.css

This file was deleted.

2 changes: 2 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import 'materialize';
@import "https://fonts.googleapis.com/icon?family=Material+Icons";
4 changes: 2 additions & 2 deletions app/views/assigns/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<div class="field">
<% if user_signed_in? %>
<input name="user_id" type="hidden" value=<%= current_user[:id] %>>
<input name="assign[user_id]" type="hidden" value=<%= current_user.id %>>
<% else %>
<%= form.label :user_id %>
<%= form.number_field :user_id %>
Expand All @@ -31,6 +31,6 @@
</div>

<div class="actions">
<%= form.submit %>
<%= form.submit :class=>"waves-effect waves-light btn" %>
</div>
<% end %>
4 changes: 1 addition & 3 deletions app/views/devise/confirmations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
</div>

<div class="actions">
<%= f.submit "Resend confirmation instructions" %>
<%= f.submit "Resend confirmation instructions", :class=>"waves-effect waves-light btn" %>
</div>
<% end %>

<%= render "devise/shared/links" %>
2 changes: 1 addition & 1 deletion app/views/devise/passwords/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>

<div class="actions">
<%= f.submit "Send me reset password instructions" %>
<%= f.submit "Send me reset password instructions", :class=>"waves-effect waves-light btn" %>
</div>
<% end %>

Expand Down
12 changes: 5 additions & 7 deletions app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@
<div class="field">
<%= f.label :password %>
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em>
<% end %><br />
(<%= @minimum_password_length %> characters minimum)
<% end %>
<%= f.password_field :password, autocomplete: "off" %>
</div>

<div class="field">
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation, autocomplete: "off" %>
</div>
<div class="actions">
<%= f.submit "Sign up" %>

<div class="actions">
<%= f.submit "Sign up", :class=>"waves-effect waves-light btn" %>
</div>
<% end %>

<%= render "devise/shared/links" %>
4 changes: 1 addition & 3 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
<% end -%>

<div class="actions">
<%= f.submit "Log in" %>
<%= f.submit "Log in", :class=>"waves-effect waves-light btn" %>
</div>
<% end %>

<%= render "devise/shared/links" %>
4 changes: 2 additions & 2 deletions app/views/jobs/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<div class="field">
<% if user_signed_in? %>
<input name="user_id" type="hidden" value=<%= current_user[:id] %>>
<input name="job[user_id]" type="hidden" value=<%= current_user.id %>>
<% else %>
<%= form.label :user_id %>
<%= form.number_field :user_id %>
Expand All @@ -31,6 +31,6 @@
</div>

<div class="actions">
<%= form.submit %>
<%= form.submit :class=>"waves-effect waves-light btn" %>
</div>
<% end %>
11 changes: 0 additions & 11 deletions app/views/jobs/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
<p id="notice"><%= notice %></p>

<% @users.each do |u| %>
<%= u.id %>
<%= u.email %>
<% end %>

<%= link_to 'ログアウト', 'users/sign_out', method: :delete %>
<%= link_to 'ログイン', 'users/sign_in', method: :get %>
<%= link_to '登録', 'users/sign_up', method: :get %>

<h1>Jobs</h1>

<table>
Expand Down
58 changes: 31 additions & 27 deletions app/views/jobs/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
<p id="notice"><%= notice %></p>
<div class="row">
<div class="col s12 m6">
<div class="card">
<div class="card-content">
<div class="card-title">
<span><%= @job.title %></span>
<div class="chip"><%= @job.user_id %></div>
</div>
<p><%= @job.description%></p>
</div>
<div class="card-action">
<%= link_to 'Edit', edit_job_path(@job) %>
<%= link_to 'Back', jobs_path %>
</div>
</div>
</div>
</div>

<p>
<strong>Title:</strong>
<%= @job.title %>
</p>

<p>
<strong>User:</strong>
<%= @job.user_id %>
</p>

<p>
<strong>description:</strong>
<%= @job.description %>
</p>

<%= link_to 'Edit', edit_job_path(@job) %> |
<%= link_to 'Back', jobs_path %>

<% if current_user.id == @job.user_id %>
<% if current_user.id == @job.user_id.to_s %>
<%= button_to "問い合わせ一覧", worker_list_job_path(@job), method: :get %>
<% else %>
<%= form_tag({ :controller => 'jobs', :action => 'create_message'},{ :method => :post}) do %>
<%= label "Message", :message %>
<%= text_field_tag :message %>
<%= hidden_field_tag :from_id, current_user.id %>
<%= hidden_field_tag :to_id, @employer.id %>
<%= submit_tag "送信" %>
<% @chat_list.each do |chat| %>
<br>
<%= chat.from_id %>
<%= chat.message %>
<% end %>
<%= submit_tag "Send", :class=>"waves-effect waves-light btn" %>
<br />
<ul class="collection">
</li>
<% @chat_list.each do |chat| %>
<li class="collection-item">
<span class="title"><%= chat.created_at %></span>
<p><%= chat.message %></p>
</li>
<% end %>
</ul>
<% end %>
<% end %>
<% end %>
26 changes: 20 additions & 6 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<title>TsukubaScourcing</title>
<title>TsukubaSourcing</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>

<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>

<body>
<nav>
<div class="nav-wrapper">
<a href="#" class="brand-logo">Tsukuba Sourcing</a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="/jobs">Jobs</a></li>
<li><a href="/jobs/new">Add Job</a></li>
<% if user_signed_in? %>
<li><a href="#"><%= current_user[:name] %></a></li>
<li><a href="/users/sign_out">Sign Out</a></li>
<% else %>
<li><a href="/users/sign_up">Sign Up</a></li>
<li><a href="/users/sign_in">Sign In</a></li>
<% end %>
</ul>
</div>
</nav>
<div class="container">
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
<% if user_signed_in? %>
<p>user: <%= current_user[:name] %></p>
<a href="/users/sign_out">sign out</a>
<% end %>
<%= yield %>
</div>
</body>
</html>

0 comments on commit e2adc50

Please sign in to comment.