Commit d6ebc038 by tady

メールviewのstyleをbootstrapに

parent 98c481df
...@@ -88,9 +88,6 @@ group :development, :test do ...@@ -88,9 +88,6 @@ group :development, :test do
# gem 'database_cleaner' # gem 'database_cleaner'
gem 'database_rewinder' gem 'database_rewinder'
gem "erb2haml"
gem 'haml'
end end
group :test do group :test do
......
...@@ -114,8 +114,6 @@ GEM ...@@ -114,8 +114,6 @@ GEM
activemodel (>= 3.0) activemodel (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
request_store (~> 1.0.3) request_store (~> 1.0.3)
erb2haml (0.1.5)
html2haml
erubis (2.7.0) erubis (2.7.0)
eventmachine (1.0.3) eventmachine (1.0.3)
execjs (2.0.2) execjs (2.0.2)
...@@ -143,16 +141,8 @@ GEM ...@@ -143,16 +141,8 @@ GEM
guard-rubocop (1.0.2) guard-rubocop (1.0.2)
guard (~> 2.0) guard (~> 2.0)
rubocop (~> 0.10) rubocop (~> 0.10)
haml (4.1.0.beta.1)
tilt
hashie (2.0.5) hashie (2.0.5)
hike (1.2.3) 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) htmlentities (4.3.1)
http-cookie (1.0.2) http-cookie (1.0.2)
domain_name (~> 0.5) domain_name (~> 0.5)
...@@ -297,8 +287,6 @@ GEM ...@@ -297,8 +287,6 @@ GEM
parser (~> 2.1.3) parser (~> 2.1.3)
powerpack (~> 0.0.6) powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0) rainbow (>= 1.99.1, < 3.0)
ruby_parser (3.1.3)
sexp_processor (~> 4.1)
sass (3.3.0) sass (3.3.0)
rake rake
sass-rails (4.0.1) sass-rails (4.0.1)
...@@ -309,7 +297,6 @@ GEM ...@@ -309,7 +297,6 @@ GEM
json (~> 1.8) json (~> 1.8)
rdoc (~> 4.0, < 5.0) rdoc (~> 4.0, < 5.0)
settingslogic (2.0.9) settingslogic (2.0.9)
sexp_processor (4.4.1)
simplecov (0.8.2) simplecov (0.8.2)
docile (~> 1.1.0) docile (~> 1.1.0)
multi_json multi_json
...@@ -388,13 +375,11 @@ DEPENDENCIES ...@@ -388,13 +375,11 @@ DEPENDENCIES
database_rewinder database_rewinder
devise devise
draper (~> 1.3) draper (~> 1.3)
erb2haml
factory_girl_rails factory_girl_rails
faraday faraday
github-markdown github-markdown
guard-rspec guard-rspec
guard-rubocop guard-rubocop
haml
i18n_generators i18n_generators
jbuilder jbuilder
jquery-rails jquery-rails
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -11,7 +11,7 @@ module RV::Mailer ...@@ -11,7 +11,7 @@ module RV::Mailer
fail ArgumentError.new('to missing') unless opts[:to].present? fail ArgumentError.new('to missing') unless opts[:to].present?
fail ArgumentError.new('to mail format invalid') unless ValidatesEmailFormatOf.validate_email_format(opts[:to]).nil? 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 mail = Mail.new do
from opts[:user].email from opts[:user].email
...@@ -35,11 +35,15 @@ module RV::Mailer ...@@ -35,11 +35,15 @@ module RV::Mailer
mail mail
end end
def generate_html_mail(body) def generate_html_mail(post)
path = File.expand_path(File.dirname(__FILE__) + '/mail-template.html') path = File.expand_path(File.dirname(__FILE__) + '/mail-template.html')
template = File.open(path).read 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 = Premailer.new(html_body, with_html_string: true, adapter: :nokogiri)
premailer.to_inline_css premailer.to_inline_css
......
%h1 Apis#markdown_preview
%p Find me in app/views/apis/markdown_preview.html.erb
h1 Apis#markdown_preview
p Find me in app/views/apis/markdown_preview.html.erb
%ol.breadcrumb ol.breadcrumb
- breadcrumbs.each_with_index do |crumb, i| - 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") - span_title = content_tag(:span, crumb[:name], itemprop: "title")
- if crumb[:url] == nil - if crumb[:url] == nil
= span_title = span_title
......
%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") - span_title = content_tag(:span, trail[0][:name], itemprop: "title")
- if trail[0][:url] == nil - if trail[0][:url] == nil
= span_title = span_title
- else - else
= link_to_unless_current span_title, trail[0][:url], itemprop: "url" = link_to_unless_current span_title, trail[0][:url], itemprop: "url"
- if trail.size > 1 - 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) }}
%div div
- breadcrumb_trails.each do |trail| - 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") - span_title = content_tag(:span, trail[0][:name], itemprop: "title")
- if trail[0][:url] == nil - if trail[0][:url] == nil
= span_title = span_title
- else - else
= link_to_unless_current span_title, trail[0][:url], itemprop: "url" = link_to_unless_current span_title, trail[0][:url], itemprop: "url"
- if trail.size > 1 - 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) }}
.login
/
Marketing messaging and featurettes
\==================================================
/ Wrap the rest of the page in another container to center all the content.
.container.marketing
/ Three columns of text below the carousel
.row{:style => "margin-top: 40px"}
.col-lg-4
/ /.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
.col-lg-4
/ /.col-lg-4
/ /.row
/ START THE FEATURETTES
%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/
/ /END THE FEATURETTES
/ /.container
.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/
!!!
= 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
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
%nav.navbar.navbar-default.navbar-fixed-top{:role => "navigation"}
.container
/ Brand and toggle get grouped for better mobile display
.navbar-header
%button.navbar-toggle{"data-target" => "#bs-example-navbar-collapse-1", "data-toggle" => "collapse", :type => "button"}
%span.sr-only Toggle navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
%a.navbar-brand{:href => root_path} Rendezvous
/ Collect the nav links, forms, and other content for toggling
#bs-example-navbar-collapse-1.collapse.navbar-collapse
%form#app-search-form.navbar-form.navbar-left{:action => posts_path, :role => "search"}
.input-group
%input.form-control{:name => "q", :placeholder => "Search", :type => "text", :value => params[:q]}/
%span.input-group-btn
%button.btn.btn-default{"data-disable-with" => "Searching...", :type => "submit"}
%span.glyphicon.glyphicon-search
%p#header-search-hint.navbar-text
%a{"data-target" => "#header-search-description", "data-toggle" => "modal", :href => "#"}
Search
%span.glyphicon.glyphicon-question-sign
|
%a{:href => "https://help.github.com/articles/github-flavored-markdown", :target => "_blank"}
Markdown
%span.glyphicon.glyphicon-question-sign
= form_tag(destroy_user_session_path, :method => :delete, class: 'navbar-form navbar-right') do
= submit_tag 'SignOut', class: 'btn btn-default'
.navbar-right
%a.btn.btn-primary.navbar-btn{:href => new_post_path}
Post&nbsp;&nbsp;
%span.glyphicon.glyphicon-pencil
%img{:height => "25", :src => current_user.image_url, :width => "25"}/
= current_user.name
/ /.navbar-collapse
/ /.container
/ Modal #header-search-description
#header-search-description.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1"}
.modal-dialog
.modal-content
.modal-header
%button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} &times;
%h4#myModalLabel.modal-title Search command
.modal-body
%dl.dl-horizontal
%dt Search by title
%dd
%pre
%a{:href => posts_path(q: 'title:ruby')} title:ruby
%dt Search by id
%dd
%pre
%a{:href => posts_path(q: 'id:123')} id:123
%dt Search by body
%dd
%pre
%a{:href => posts_path(q: 'body:ruby')} body:ruby
%dt Search by author
%dd
%pre
%a{:href => posts_path(q: '@taro')} @taro
%dt Search by tag
%dd
%pre
%a{:href => posts_path(q: '#ruby')} #ruby
%dt Search by date
%dd
%pre
%a{:href => posts_path(q: 'date:2013-12-16')} date:2013-12-16
%dt Search by title or body
%dd
%pre
%a{:href => posts_path(q: 'ruby')} ruby
.modal-footer
%button.btn.btn-default{"data-dismiss" => "modal", :type => "button"} Close
/ /.modal-content
/ /.modal-dialog
/ /.modal
- style do
\#header-search-hint{
margin-left: 0;
}
nav.navbar.navbar-default.navbar-fixed-top role="navigation"
.container
.navbar-header
button.navbar-toggle data-target="#bs-example-navbar-collapse-1" data-toggle="collapse" type="button"
span.sr-only Toggle navigation
span.icon-bar
span.icon-bar
span.icon-bar
a.navbar-brand href=root_path Rendezvous
#bs-example-navbar-collapse-1.collapse.navbar-collapse
form#app-search-form.navbar-form.navbar-left action=posts_path role="search"
.input-group
input.form-control name="q" placeholder="Search" type="text" value=params[:q] /
span.input-group-btn
button.btn.btn-default data-disable-with="Searching..." type="submit"
span.glyphicon.glyphicon-search
p#header-search-hint.navbar-text
a data-target="#header-search-description" data-toggle="modal" href="#"
| Search
span.glyphicon.glyphicon-question-sign
a href="https://help.github.com/articles/github-flavored-markdown" target="_blank"
| Markdown
span.glyphicon.glyphicon-question-sign
= form_tag(destroy_user_session_path, :method => :delete, class: 'navbar-form navbar-right') do
= submit_tag 'SignOut', class: 'btn btn-default'
.navbar-right
a.btn.btn-primary.navbar-btn href=new_post_path
| Post&nbsp;&nbsp;
span.glyphicon.glyphicon-pencil
img height="25" src=current_user.image_url width="25" /
= current_user.name
#header-search-description.modal.fade aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1"
.modal-dialog
.modal-content
.modal-header
button.close aria-hidden="true" data-dismiss="modal" type="button" &times;
h4#myModalLabel.modal-title Search command
.modal-body
dl.dl-horizontal
dt Search by title
dd
pre
a href=(posts_path(q: 'title:ruby')) title:ruby
dt Search by id
dd
pre
a href=(posts_path(q: 'id:123')) id:123
dt Search by body
dd
pre
a href=(posts_path(q: 'body:ruby')) body:ruby
dt Search by author
dd
pre
a href=(posts_path(q: '@taro')) @taro
dt Search by tag
dd
pre
a href=(posts_path(q: '#ruby')) #ruby
dt Search by date
dd
pre
a href=(posts_path(q: 'date:2013-12-16')) date:2013-12-16
dt Search by title or body
dd
pre
a href=(posts_path(q: 'ruby')) ruby
.modal-footer
button.btn.btn-default data-dismiss="modal" type="button" Close
- style do
| \#header-search-hint{
| margin-left: 0;
| }
- if flash[:success] - if flash[:success]
.alert.alert-success.fade.in .alert.alert-success.fade.in
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"} &times; button.close aria-hidden="true" data-dismiss="alert" type="button" &times;
%strong Success strong Success
= flash[:success] = flash[:success]
- if flash[:notice] - if flash[:notice]
.alert.alert-warning.fade.in .alert.alert-warning.fade.in
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"} &times; button.close aria-hidden="true" data-dismiss="alert" type="button" &times;
%strong Notice strong Notice
= flash[:notice] = flash[:notice]
- if flash[:alert] - if flash[:alert]
.alert.alert-danger.fade.in .alert.alert-danger.fade.in
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"} &times; button.close aria-hidden="true" data-dismiss="alert" type="button" &times;
%strong Alert strong Alert
= flash[:alert] = flash[:alert]
...@@ -2,53 +2,42 @@ ...@@ -2,53 +2,42 @@
= form_for(@post) do |f| = form_for(@post) do |f|
- if @post.errors.any? - if @post.errors.any?
#error_explanation #error_explanation
%h2 h2
= pluralize(@post.errors.count, "error") = pluralize(@post.errors.count, "error")
prohibited this post from being saved: | prohibited this post from being saved:
%ul ul
- @post.errors.full_messages.each do |msg| - @post.errors.full_messages.each do |msg|
%li= msg li= msg
.row .row
.col-xs-10 .col-xs-10
.field .field
.input-group .input-group
%span.input-group-addon= f.label :title span.input-group-addon= f.label :title
= f.text_field :title, class: 'form-control mod-mdEditor-title' = f.text_field :title, class: 'form-control mod-mdEditor-title'
.col-xs-2 .col-xs-2
.actions .actions
= f.submit class: 'btn btn-primary js-disable-confirm-unload', id: 'save_button' = f.submit class: 'btn btn-primary js-disable-confirm-unload', id: 'save_button'
/ /.row
.row .row
.col-xs-8 .col-xs-8
.field .field
.input-group .input-group
%span.input-group-addon= f.label :tags span.input-group-addon= f.label :tags
= hidden_field :post, :tags, class: 'mod-mdEditor-tags', style: 'width:300px', | = hidden_field :post, :tags, class: 'mod-mdEditor-tags', style: 'width:300px', value: @post.tags.map{ |_tag| _tag.name }.join(',')
value: @post.tags.map{ |_tag| _tag.name }.join(',') |
.col-xs-4 .col-xs-4
/
<div class="mod-fileuploader-box"> br/
<div id="progress" class="progress" style="width: 100%">
<div class="progress-bar progress-bar-success"></div>
</div>
<div id="files" class="files">Uploads file here...</div>
</div>
/ /.row
%br/
.row .row
.col-xs-6.col-md-6 .col-xs-6.col-md-6
.field .field
/ <haml:loud> f.label :body </haml:loud><br>
= f.text_area :body, class: 'mod-mdEditor-body' = f.text_area :body, class: 'mod-mdEditor-body'
/ /span
.col-xs-12.col-sm-6.col-md-6 .col-xs-12.col-sm-6.col-md-6
.box-text .box-text
.text-box.body.viewer.github.mod-mdEditor-preview .text-box.body.viewer.github.mod-mdEditor-preview
/ /span
/ /row input#fileupload data-url="/apis/file_receiver" multiple="" name="files[]" style="display:none" type="file" /
%input#fileupload{"data-url" => "/apis/file_receiver", :multiple => "", :name => "files[]", :style => "display:none", :type => "file"}/
- content_for :footer_js do - content_for :footer_js do
:javascript javascript:
$.setConfirmUnload(); $.setConfirmUnload();
$('#post-form').mod_mdEditor({end_point: '/apis/markdown_preview'}); $('#post-form').mod_mdEditor({end_point: '/apis/markdown_preview'});
......
.panel.panel-default
.panel-heading
%h3.panel-title
%a{:href => post_path(@post)}= @post.title
%ul.list-group
%li.list-group-item
- @post.tags.each do |tag|
%span.label.label-info
%a{:href => tag.decorate.show_path}
\##{tag.name}
%span.label.label-success
%a{:href => posts_path(q: "@#{@post.author.name}")}
@#{@post.author.name}
%span.label.label-danger
%a{:href => posts_path(q: "date:#{@post.updated_at.strftime('%Y-%m-%d')}")}= @post.updated_at.strftime('%Y-%m-%d')
/ Split button
.btn-group.pull-right{:style => "margin: -7px -12px 0 0;"}
%a.btn.btn-primary{:href => edit_post_path(@post)}
%span.glyphicon.glyphicon-pencil
%button.btn.btn-default.dropdown-toggle{"data-toggle" => "dropdown", :type => "button"}
%span.caret
%span.sr-only Toggle Dropdown
%ul.dropdown-menu{:role => "menu"}
%li
%a{:href => slideshow_post_path(@post), :target => "_blank"} Slideshow
%li
%a.small{:href => "https://github.com/gnab/remark", :target => "_blank"} What is Slideshow?
%li.divider
%li
%a{:href => fork_post_path(@post)} Fork
%li
%a{"data-target" => "#myModal", "data-toggle" => "modal", :href => "#"} Mail to...
%li.divider
%li= link_to 'Delete', post_path(@post), method: :delete, data: { confirm: 'Are you sure?' }
.panel-body.viewer.github
= h_application_format_markdown(@post.body)
.panel.panel-success
.panel-heading
%h3.panel-title Comments
.panel-body
%ul.media-list
- @post.comments.each do |comment|
%li.media
%a.pull-left{:href => "#"}
%img.media-object{:src => comment.author.image_url}/
.media-body
%h4.media-heading= comment.author.name
= comment.body
= form_tag(comment_post_path, method: :post, data: { 'form-id' => "comment_#{@post.id}" }) do
%li.media
%a.pull-left{:href => "#"}
%img.media-object{:src => current_user.image_url}/
.media-body
%h4.media-heading= current_user.name
= text_area :comment, :body, class: 'form-control', placeholder: 'コメントする...'
= submit_tag 'Comment', class: 'btn btn-primary', data: { 'disable-with' => '...' }
:javascript
$("form[data-form-id='comment_#{@post.id}']").on('ajax:success', function(event, data, xhr) {
});
/ Button trigger modal
/
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>
/ Modal
#myModal.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1"}
.modal-dialog
.modal-content
= form_tag mail_post_path(@post), method: :post, class: 'form-horizontal', role: 'form' do
.modal-header
%button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} &times;
%h4#myModalLabel.modal-title Mail this post to...
.modal-body
.form-group
%label.col-sm-2.control-label Title
.col-sm-10
%input.form-control{:readonly => "", :type => "text", :value => @post.title}/
.form-group
%label.col-sm-2.control-label{:for => "inputEmail3"} To
.col-sm-10
%input#inputEmail3.form-control{:name => "mail[to]", :placeholder => "Email", :type => "email"}/
.form-group
%label.col-sm-2.control-label From
.col-sm-10
%input.form-control{:readonly => "", :type => "text", :value => current_user.email}/
.modal-footer
%button.btn.btn-default{"data-dismiss" => "modal", :type => "button"} Close
%button.btn.btn-primary{"data-disable-with" => "Sending...", :type => "submit"} Send
/ /.modal-content
/ /.modal-dialog
/ /.modal
.panel.panel-default
.panel-heading
h3.panel-title
a href=post_path(@post) = @post.title
ul.list-group
li.list-group-item
- @post.tags.each do |tag|
span.label.label-info
a href=tag.decorate.show_path
| ##{tag.name}
span.label.label-success
a href=(posts_path(q: "@#{@post.author.name}"))
| @#{@post.author.name}
span.label.label-danger
a href=(posts_path(q: "date:#{@post.updated_at.strftime('%Y-%m-%d')}")) = @post.updated_at.strftime('%Y-%m-%d')
.btn-group.pull-right style=("margin: -7px -12px 0 0;")
a.btn.btn-primary href=edit_post_path(@post)
span.glyphicon.glyphicon-pencil
button.btn.btn-default.dropdown-toggle data-toggle="dropdown" type="button"
span.caret
span.sr-only Toggle Dropdown
ul.dropdown-menu role="menu"
li
a href=slideshow_post_path(@post) target="_blank" Slideshow
li
a.small href="https://github.com/gnab/remark" target="_blank" What is Slideshow?
li.divider
li
a href=fork_post_path(@post) Fork
li
a data-target="#myModal" data-toggle="modal" href="#" Mail to...
li.divider
li= link_to 'Delete', post_path(@post), method: :delete, data: { confirm: 'Are you sure?' }
.panel-body.viewer.github
= h_application_format_markdown(@post.body)
.panel.panel-success
.panel-heading
h3.panel-title Comments
.panel-body
ul.media-list
- @post.comments.each do |comment|
li.media
a.pull-left href="#"
img.media-object src=comment.author.image_url /
.media-body
h4.media-heading= comment.author.name
= comment.body
= form_tag(comment_post_path, method: :post, data: { 'form-id' => "comment_#{@post.id}" }) do
li.media
a.pull-left href="#"
img.media-object src=current_user.image_url /
.media-body
h4.media-heading= current_user.name
= text_area :comment, :body, class: 'form-control', placeholder: 'コメントする...'
= submit_tag 'Comment', class: 'btn btn-primary', data: { 'disable-with' => '...' }
javascript:
$("form[data-form-id='comment_#{@post.id}']").on('ajax:success', function(event, data, xhr) {
});
/! Button trigger modal
/!
| <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"
| Launch demo modal
| </button
/! Modal
#myModal.modal.fade aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1"
.modal-dialog
.modal-content
= form_tag mail_post_path(@post), method: :post, class: 'form-horizontal', role: 'form' do
.modal-header
button.close aria-hidden="true" data-dismiss="modal" type="button" &times;
h4#myModalLabel.modal-title Mail this post to...
.modal-body
.form-group
label.col-sm-2.control-label Title
.col-sm-10
input.form-control readonly="" type="text" value=@post.title /
.form-group
label.col-sm-2.control-label for="inputEmail3" To
.col-sm-10
input#inputEmail3.form-control name="mail[to]" placeholder="Email" type="email" /
.form-group
label.col-sm-2.control-label From
.col-sm-10
input.form-control readonly="" type="text" value=current_user.email /
.modal-footer
button.btn.btn-default data-dismiss="modal" type="button" Close
button.btn.btn-primary data-disable-with="Sending..." type="submit" Send
/! /.modal-content
/! /.modal-dialog
/! /.modal
.row .row
#sidebar.col-xs-6.col-md-4{:role => "navigation"} #sidebar.col-xs-6.col-md-4 role="navigation"
%ul.nav.nav-tabs ul.nav.nav-tabs
%li.active li.active
%a{"data-toggle" => "tab", :href => "#tab-list"} List a data-toggle="tab" href="#tab-list" List
%li li
%a{"data-toggle" => "tab", :href => "#tab-tree"} Tag Tree a data-toggle="tab" href="#tab-tree" Tag Tree
.tab-content .tab-content
#tab-list.tab-pane.active #tab-list.tab-pane.active
.list-group .list-group
- @posts.each_with_index do |post, i| - @posts.each_with_index do |post, i|
%a.list-group-item.post-list{"data-post-id" => post.id, :href => "#"}= post.title a.list-group-item.post-list data-post-id=post.id href="#" = post.title
#tab-tree.tab-pane #tab-tree.tab-pane
- cache('tag-tree', :expires_in => 1.hour) do - cache('tag-tree', :expires_in => 1.hour) do
.list-group .list-group
= Tag.all.decorate.tree_view = Tag.all.decorate.tree_view
.col-xs-12.col-sm-6.col-md-8 .col-xs-12.col-sm-6.col-md-8
#list_post #list_post
%p#posts-placeholder{:style => "color:#aaa;font-size:30px"} &lt;-- Select a post... p#posts-placeholder style="color:#aaa;font-size:30px" &lt;-- Select a post...
%h1 新しい投稿 h1 新しい投稿
= render 'form' = render 'form'
= render_breadcrumbs = render_breadcrumbs
.row .row
%div div
= render partial: 'posts/show_fragment' = render partial: 'posts/show_fragment'
/ /row /! /row
...@@ -2,35 +2,35 @@ ...@@ -2,35 +2,35 @@
= form_for(@tag, url: @tag.show_path) do |f| = form_for(@tag, url: @tag.show_path) do |f|
- if @tag.errors.any? - if @tag.errors.any?
#error_explanation #error_explanation
%h2 h2
= pluralize(@tag.errors.count, "error") = pluralize(@tag.errors.count, "error")
prohibited this tag from being saved: | prohibited this tag from being saved:
%ul ul
- @tag.errors.full_messages.each do |msg| - @tag.errors.full_messages.each do |msg|
%li= msg li= msg
.row .row
.col-md-10 .col-md-10
.field .field
.input-group .input-group
%span.input-group-addon= f.label :name span.input-group-addon= f.label :name
= f.text_field :name, class: 'form-control' = f.text_field :name, class: 'form-control'
.col-md-2 .col-md-2
.actions .actions
= f.submit class: 'btn btn-primary js-disable-confirm-unload', id: 'save_button' = f.submit class: 'btn btn-primary js-disable-confirm-unload', id: 'save_button'
%br/ br/
.row .row
.col-xs-6.col-md-6 .col-xs-6.col-md-6
.field .field
/ <haml:loud> f.label :body </haml:loud><br> /! <haml:loud> f.label :body </haml:loud><br
= f.text_area :body, class: 'mod-mdEditor-body' = f.text_area :body, class: 'mod-mdEditor-body'
/ /span /! /span
.col-xs-12.col-sm-6.col-md-6 .col-xs-12.col-sm-6.col-md-6
.box-text .box-text
#tag_preview.text-box.body.viewer.github.mod-mdEditor-preview #tag_preview.text-box.body.viewer.github.mod-mdEditor-preview
/ /span /! /span
/ /row /! /row
- content_for :footer_js do - content_for :footer_js do
:javascript javascript:
$.setConfirmUnload() $.setConfirmUnload()
$('#tag-form').mod_mdEditor({end_point: '/apis/markdown_preview'}); $('#tag-form').mod_mdEditor({end_point: '/apis/markdown_preview'});
この ページ は まだ そんざい しません
| この ページ は まだ そんざい しません
%h1 新しい投稿 h1 新しい投稿
= render 'form' = render 'form'
= render_breadcrumbs = render_breadcrumbs
.row .row
.col-xs-8 .col-xs-8
%h1 h1
= @tag.name = @tag.name
についてのページ | についてのページ
.col-xs-4 .col-xs-4
.btn-group.pull-right .btn-group.pull-right
%a.btn.btn-primary{:href => @tag.edit_path} a.btn.btn-primary href=@tag.edit_path
このページを編集する | このページを編集する
%span.glyphicon.glyphicon-pencil span.glyphicon.glyphicon-pencil
%button.btn.btn-default.dropdown-toggle{"data-toggle" => "dropdown", :type => "button"} button.btn.btn-default.dropdown-toggle data-toggle="dropdown" type="button"
%span.caret span.caret
%span.sr-only Toggle Dropdown span.sr-only Toggle Dropdown
%ul.dropdown-menu{:role => "menu"} ul.dropdown-menu role="menu"
%li li
%a{"data-target" => "#modal-merge", "data-toggle" => "modal", :href => "#"} Merge to... a data-target="#modal-merge" data-toggle="modal" href="#" Merge to...
%li li
%a{"data-target" => "#modal-moveUnder", "data-toggle" => "modal", :href => "#"} Move this tag under... a data-target="#modal-moveUnder" data-toggle="modal" href="#" Move this tag under...
.col-xs-8 .col-xs-8
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
#{@tag.name}」とは | #{@tag.name}」とは
.panel-body .panel-body
- if @tag.body.present? - if @tag.body.present?
= h_application_format_markdown(@tag.body) = h_application_format_markdown(@tag.body)
- else - else
まだ「#{@tag.name}」の情報がありません。 | まだ「#{@tag.name}」の情報がありません。
.col-xs-4 .col-xs-4
.list-group .list-group
%h2 h2
%small small
#{@tag.name}」のタグが付いた記事 | #{@tag.name}」のタグが付いた記事
- @tag.posts.each_with_index do |post, i| - @tag.posts.each_with_index do |post, i|
%a.list-group-item.post-list{:href => post_path(post)}= post.title a.list-group-item.post-list href=post_path(post) = post.title
/ /row
/ Modal #modal-merge.modal.fade aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1"
#modal-merge.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1"}
.modal-dialog .modal-dialog
.modal-content .modal-content
.modal-header .modal-header
%button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} &times; button.close aria-hidden="true" data-dismiss="modal" type="button" &times;
%h3#myModalLabel.modal-title h3#myModalLabel.modal-title
Merge to other tag | Merge to other tag
.modal-body .modal-body
%h4 マージ先のTagを選んでください h4 マージ先のTagを選んでください
#merge-tag-tree #merge-tag-tree
= Tag.all.decorate.tree_view = Tag.all.decorate.tree_view
- content_for :footer_js do - content_for :footer_js do
:javascript javascript:
$(function(){ $(function(){
$('#merge-tag-tree a').on('click', function(e){ $('#merge-tag-tree a').on('click', function(e){
...@@ -71,24 +70,21 @@ ...@@ -71,24 +70,21 @@
}) })
}) })
.modal-footer .modal-footer
%button.btn.btn-default{"data-dismiss" => "modal", :type => "button"} Close button.btn.btn-default data-dismiss="modal" type="button" Close
/ /.modal-content
/ /.modal-dialog #modal-moveUnder.modal.fade aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1"
/ /.modal
/ Modal
#modal-moveUnder.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1"}
.modal-dialog .modal-dialog
.modal-content .modal-content
.modal-header .modal-header
%button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} &times; button.close aria-hidden="true" data-dismiss="modal" type="button" &times;
%h3#myModalLabel.modal-title h3#myModalLabel.modal-title
Merge to other tag | Merge to other tag
.modal-body .modal-body
%h4 マージ先のTagを選んでください h4 マージ先のTagを選んでください
#move-tag-tree #move-tag-tree
= Tag.all.decorate.tree_view = Tag.all.decorate.tree_view
- content_for :footer_js do - content_for :footer_js do
:javascript javascript:
$(function(){ $(function(){
$('#move-tag-tree a').on('click', function(e){ $('#move-tag-tree a').on('click', function(e){
...@@ -112,7 +108,4 @@ ...@@ -112,7 +108,4 @@
}) })
}) })
.modal-footer .modal-footer
%button.btn.btn-default{"data-dismiss" => "modal", :type => "button"} Close button.btn.btn-default data-dismiss="modal" type="button" Close
/ /.modal-content
/ /.modal-dialog
/ /.modal
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment