Skip to content

Commit

Permalink
メールviewのstyleをbootstrapに
Browse files Browse the repository at this point in the history
  • Loading branch information
tadyjp committed Mar 9, 2014
1 parent 98c481d commit d6ebc03
Show file tree
Hide file tree
Showing 33 changed files with 381 additions and 416 deletions.
3 changes: 0 additions & 3 deletions Gemfile
Expand Up @@ -88,9 +88,6 @@ group :development, :test do

# gem 'database_cleaner'
gem 'database_rewinder'

gem "erb2haml"
gem 'haml'
end

group :test do
Expand Down
15 changes: 0 additions & 15 deletions Gemfile.lock
Expand Up @@ -114,8 +114,6 @@ GEM
activemodel (>= 3.0)
activesupport (>= 3.0)
request_store (~> 1.0.3)
erb2haml (0.1.5)
html2haml
erubis (2.7.0)
eventmachine (1.0.3)
execjs (2.0.2)
Expand Down Expand Up @@ -143,16 +141,8 @@ GEM
guard-rubocop (1.0.2)
guard (~> 2.0)
rubocop (~> 0.10)
haml (4.1.0.beta.1)
tilt
hashie (2.0.5)
hike (1.2.3)
hpricot (0.8.6)
html2haml (1.0.1)
erubis (~> 2.7.0)
haml (>= 4.0.0.rc.1)
hpricot (~> 0.8.6)
ruby_parser (~> 3.1.1)
htmlentities (4.3.1)
http-cookie (1.0.2)
domain_name (~> 0.5)
Expand Down Expand Up @@ -297,8 +287,6 @@ GEM
parser (~> 2.1.3)
powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0)
ruby_parser (3.1.3)
sexp_processor (~> 4.1)
sass (3.3.0)
rake
sass-rails (4.0.1)
Expand All @@ -309,7 +297,6 @@ GEM
json (~> 1.8)
rdoc (~> 4.0, < 5.0)
settingslogic (2.0.9)
sexp_processor (4.4.1)
simplecov (0.8.2)
docile (~> 1.1.0)
multi_json
Expand Down Expand Up @@ -388,13 +375,11 @@ DEPENDENCIES
database_rewinder
devise
draper (~> 1.3)
erb2haml
factory_girl_rails
faraday
github-markdown
guard-rspec
guard-rubocop
haml
i18n_generators
jbuilder
jquery-rails
Expand Down
21 changes: 18 additions & 3 deletions app/controllers/concerns/rv/mail-template.html

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions app/controllers/concerns/rv/mailer.rb
Expand Up @@ -11,7 +11,7 @@ def compose_mail(post, opts = {})
fail ArgumentError.new('to missing') unless opts[:to].present?
fail ArgumentError.new('to mail format invalid') unless ValidatesEmailFormatOf.validate_email_format(opts[:to]).nil?

html_body = generate_html_mail(post.body)
html_body = generate_html_mail(post)

mail = Mail.new do
from opts[:user].email
Expand All @@ -35,11 +35,15 @@ def compose_mail(post, opts = {})
mail
end

def generate_html_mail(body)
def generate_html_mail(post)
path = File.expand_path(File.dirname(__FILE__) + '/mail-template.html')
template = File.open(path).read

html_body = template.sub('__HTML_BODY__', h_application_format_markdown(body))
html_body = template
.sub('__POST_URL__', Settings.rendezvous.app_host + post_path(post))
.sub('__HTML_TITLE__', h_application_format_markdown(post.title))
.sub('__HTML_BODY__', h_application_format_markdown(post.body))
.sub('__RV_URL__', Settings.rendezvous.app_host + '/')

premailer = Premailer.new(html_body, with_html_string: true, adapter: :nokogiri)
premailer.to_inline_css
Expand Down
2 changes: 0 additions & 2 deletions app/views/apis/markdown_preview.html.haml

This file was deleted.

2 changes: 2 additions & 0 deletions app/views/apis/markdown_preview.html.slim
@@ -0,0 +1,2 @@
h1 Apis#markdown_preview
p Find me in app/views/apis/markdown_preview.html.erb
@@ -1,6 +1,6 @@
%ol.breadcrumb
ol.breadcrumb
- breadcrumbs.each_with_index do |crumb, i|
%li{:itemscope => "itemscope", :itemtype => "http://data-vocabulary.org/Breadcrumb"}
li itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"
- span_title = content_tag(:span, crumb[:name], itemprop: "title")
- if crumb[:url] == nil
= span_title
Expand Down
@@ -1,8 +1,8 @@
%span{:itemscope => "child", :itemtype => "http://data-vocabulary.org/Breadcrumb"}
span itemscope="child" itemtype="http://data-vocabulary.org/Breadcrumb"
- span_title = content_tag(:span, trail[0][:name], itemprop: "title")
- if trail[0][:url] == nil
= span_title
- else
= link_to_unless_current span_title, trail[0][:url], itemprop: "url"
- if trail.size > 1
\&gt;#{render partial: 'breadcrumble/breadcrumb_trail', locals: { trail: trail.drop(1) }}
| \&gt;#{render partial: 'breadcrumble/breadcrumb_trail', locals: { trail: trail.drop(1) }}
@@ -1,10 +1,10 @@
%div
div
- breadcrumb_trails.each do |trail|
%div{:itemscope => "", :itemtype => "http://data-vocabulary.org/Breadcrumb"}
div itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"
- span_title = content_tag(:span, trail[0][:name], itemprop: "title")
- if trail[0][:url] == nil
= span_title
- else
= link_to_unless_current span_title, trail[0][:url], itemprop: "url"
- if trail.size > 1
\&gt;#{render partial: 'breadcrumble/breadcrumb_trail', locals: { trail: trail.drop(1) }}
| \&gt;#{render partial: 'breadcrumble/breadcrumb_trail', locals: { trail: trail.drop(1) }}
56 changes: 0 additions & 56 deletions app/views/home/login.html.haml

This file was deleted.

45 changes: 45 additions & 0 deletions app/views/home/login.html.slim
@@ -0,0 +1,45 @@
.login
.container.marketing
.row style=("margin-top: 40px")
.col-lg-4
.col-lg-4
img.img-circle alt=("Generic placeholder image") src="http://placehold.it/140x140&amp;text=Rendezvous" /
h2 Rendezvous
p
| Rendezvousはチームの`Stock`と`Flow`の
br>/
| 2種類の情報を蓄積・検索・共有する
br>/
| オープンソースのソフトウェアです。
p
a.btn.btn-lg.btn-primary href=user_omniauth_authorize_path(:google_oauth2) role="button" Sign up with Google
.col-lg-4

hr.featurette-divider/
.row.featurette
.col-md-7
h2.featurette-heading
| Stock all you have done.
span.text-muted It may be priceless for others.
p.lead Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.
.col-md-5
img.featurette-image.img-responsive alt="Stock" src="http://placehold.it/500x400&amp;text=Stock" /
hr.featurette-divider/
.row.featurette
.col-md-5
img.featurette-image.img-responsive alt="Flow" src="http://placehold.it/500x400&amp;text=Flow" /
.col-md-7
h2.featurette-heading
| Flow anything member have come up with.
span.text-muted Which accelerate your PDCA.
p.lead Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.
hr.featurette-divider/
.row.featurette
.col-md-7
h2.featurette-heading
| Collaborate with other team on documents.
span.text-muted Making more and more generic plans.
p.lead Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.
.col-md-5
img.featurette-image.img-responsive alt="Collaboration" src="http://placehold.it/500x400&amp;text=Collaboration" /
hr.featurette-divider/
33 changes: 0 additions & 33 deletions app/views/layouts/application.html.haml

This file was deleted.

33 changes: 33 additions & 0 deletions app/views/layouts/application.html.slim
@@ -0,0 +1,33 @@
doctype html
= render partial: 'partials/rendezvous'
html lang="ja"
head
title Rendezvous
meta content="width=device-width, initial-scale=1.0" name="viewport" /
link href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" rel="stylesheet" /
link href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap-theme.min.css" rel="stylesheet" /
= stylesheet_link_tag "application", media: "all"
= render_style
= csrf_meta_tags
body class="rails-#{params[:controller]}-#{params[:action]}"
= render partial: 'partials/header_notifications'
- if params[:controller] != 'home'
= render partial: 'partials/app_header'
.container.container-main
= yield
/! /.container
script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"
script src="//cdnjs.cloudflare.com/ajax/libs/underscore.string/2.3.3/underscore.string.min.js"
script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"
script src="//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"
javascript:
window.RV = window.RV || {};
window.RV.AllTags = JSON.parse('#{raw Tag.all.pluck(:name).to_json}');
hr/
footer
.container
a href="https://github.com/tadyjp/rendezvous" Github
| \
a href="https://twitter.com/tady_jp" @tady_jp
= javascript_include_tag "application"
= yield :footer_js
82 changes: 0 additions & 82 deletions app/views/partials/_app_header.html.haml

This file was deleted.

0 comments on commit d6ebc03

Please sign in to comment.