Commit d6ebc038 by tady

メールviewのstyleをbootstrapに

parent 98c481df
......@@ -88,9 +88,6 @@ group :development, :test do
# gem 'database_cleaner'
gem 'database_rewinder'
gem "erb2haml"
gem 'haml'
end
group :test do
......
......@@ -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)
......@@ -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)
......@@ -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)
......@@ -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
......@@ -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
......
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
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
......@@ -35,11 +35,15 @@ module RV::Mailer
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
......
%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|
%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
......
%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) }}
%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) }}
.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]
.alert.alert-success.fade.in
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"} &times;
%strong Success
= flash[:success]
- if flash[:notice]
.alert.alert-warning.fade.in
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"} &times;
%strong Notice
= flash[:notice]
- if flash[:alert]
.alert.alert-danger.fade.in
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"} &times;
%strong Alert
= flash[:alert]
- if flash[:success]
.alert.alert-success.fade.in
button.close aria-hidden="true" data-dismiss="alert" type="button" &times;
strong Success
= flash[:success]
- if flash[:notice]
.alert.alert-warning.fade.in
button.close aria-hidden="true" data-dismiss="alert" type="button" &times;
strong Notice
= flash[:notice]
- if flash[:alert]
.alert.alert-danger.fade.in
button.close aria-hidden="true" data-dismiss="alert" type="button" &times;
strong Alert
= flash[:alert]
......@@ -2,53 +2,42 @@
= form_for(@post) do |f|
- if @post.errors.any?
#error_explanation
%h2
h2
= pluralize(@post.errors.count, "error")
prohibited this post from being saved:
%ul
| prohibited this post from being saved:
ul
- @post.errors.full_messages.each do |msg|
%li= msg
li= msg
.row
.col-xs-10
.field
.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'
.col-xs-2
.actions
= f.submit class: 'btn btn-primary js-disable-confirm-unload', id: 'save_button'
/ /.row
.row
.col-xs-8
.field
.input-group
%span.input-group-addon= f.label :tags
= hidden_field :post, :tags, class: 'mod-mdEditor-tags', style: 'width:300px', |
value: @post.tags.map{ |_tag| _tag.name }.join(',') |
span.input-group-addon= f.label :tags
= hidden_field :post, :tags, class: 'mod-mdEditor-tags', style: 'width:300px', value: @post.tags.map{ |_tag| _tag.name }.join(',')
.col-xs-4
/
<div class="mod-fileuploader-box">
<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/
br/
.row
.col-xs-6.col-md-6
.field
/ <haml:loud> f.label :body </haml:loud><br>
= f.text_area :body, class: 'mod-mdEditor-body'
/ /span
.col-xs-12.col-sm-6.col-md-6
.box-text
.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
:javascript
javascript:
$.setConfirmUnload();
$('#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
#sidebar.col-xs-6.col-md-4{:role => "navigation"}
%ul.nav.nav-tabs
%li.active
%a{"data-toggle" => "tab", :href => "#tab-list"} List
%li
%a{"data-toggle" => "tab", :href => "#tab-tree"} Tag Tree
#sidebar.col-xs-6.col-md-4 role="navigation"
ul.nav.nav-tabs
li.active
a data-toggle="tab" href="#tab-list" List
li
a data-toggle="tab" href="#tab-tree" Tag Tree
.tab-content
#tab-list.tab-pane.active
.list-group
- @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
- cache('tag-tree', :expires_in => 1.hour) do
.list-group
= Tag.all.decorate.tree_view
.col-xs-12.col-sm-6.col-md-8
#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...
= render_breadcrumbs
.row
%div
div
= render partial: 'posts/show_fragment'
/ /row
/! /row
......@@ -2,35 +2,35 @@
= form_for(@tag, url: @tag.show_path) do |f|
- if @tag.errors.any?
#error_explanation
%h2
h2
= pluralize(@tag.errors.count, "error")
prohibited this tag from being saved:
%ul
| prohibited this tag from being saved:
ul
- @tag.errors.full_messages.each do |msg|
%li= msg
li= msg
.row
.col-md-10
.field
.input-group
%span.input-group-addon= f.label :name
span.input-group-addon= f.label :name
= f.text_field :name, class: 'form-control'
.col-md-2
.actions
= f.submit class: 'btn btn-primary js-disable-confirm-unload', id: 'save_button'
%br/
br/
.row
.col-xs-6.col-md-6
.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'
/ /span
/! /span
.col-xs-12.col-sm-6.col-md-6
.box-text
#tag_preview.text-box.body.viewer.github.mod-mdEditor-preview
/ /span
/ /row
/! /span
/! /row
- content_for :footer_js do
:javascript
javascript:
$.setConfirmUnload()
$('#tag-form').mod_mdEditor({end_point: '/apis/markdown_preview'});
この ページ は まだ そんざい しません
| この ページ は まだ そんざい しません
= render_breadcrumbs
.row
.col-xs-8
%h1
h1
= @tag.name
についてのページ
| についてのページ
.col-xs-4
.btn-group.pull-right
%a.btn.btn-primary{:href => @tag.edit_path}
このページを編集する
%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{"data-target" => "#modal-merge", "data-toggle" => "modal", :href => "#"} Merge to...
%li
%a{"data-target" => "#modal-moveUnder", "data-toggle" => "modal", :href => "#"} Move this tag under...
a.btn.btn-primary href=@tag.edit_path
| このページを編集する
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 data-target="#modal-merge" data-toggle="modal" href="#" Merge to...
li
a data-target="#modal-moveUnder" data-toggle="modal" href="#" Move this tag under...
.col-xs-8
.panel.panel-default
.panel-heading
#{@tag.name}」とは
| #{@tag.name}」とは
.panel-body
- if @tag.body.present?
= h_application_format_markdown(@tag.body)
- else
まだ「#{@tag.name}」の情報がありません。
| まだ「#{@tag.name}」の情報がありません。
.col-xs-4
.list-group
%h2
%small
#{@tag.name}」のタグが付いた記事
h2
small
| #{@tag.name}」のタグが付いた記事
- @tag.posts.each_with_index do |post, i|
%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"}
a.list-group-item.post-list href=post_path(post) = post.title
#modal-merge.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;
%h3#myModalLabel.modal-title
Merge to other tag
button.close aria-hidden="true" data-dismiss="modal" type="button" &times;
h3#myModalLabel.modal-title
| Merge to other tag
.modal-body
%h4 マージ先のTagを選んでください
h4 マージ先のTagを選んでください
#merge-tag-tree
= Tag.all.decorate.tree_view
- content_for :footer_js do
:javascript
javascript:
$(function(){
$('#merge-tag-tree a').on('click', function(e){
......@@ -71,24 +70,21 @@
})
})
.modal-footer
%button.btn.btn-default{"data-dismiss" => "modal", :type => "button"} Close
/ /.modal-content
/ /.modal-dialog
/ /.modal
/ Modal
#modal-moveUnder.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1"}
button.btn.btn-default data-dismiss="modal" type="button" Close
#modal-moveUnder.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;
%h3#myModalLabel.modal-title
Merge to other tag
button.close aria-hidden="true" data-dismiss="modal" type="button" &times;
h3#myModalLabel.modal-title
| Merge to other tag
.modal-body
%h4 マージ先のTagを選んでください
h4 マージ先のTagを選んでください
#move-tag-tree
= Tag.all.decorate.tree_view
- content_for :footer_js do
:javascript
javascript:
$(function(){
$('#move-tag-tree a').on('click', function(e){
......@@ -112,7 +108,4 @@
})
})
.modal-footer
%button.btn.btn-default{"data-dismiss" => "modal", :type => "button"} Close
/ /.modal-content
/ /.modal-dialog
/ /.modal
button.btn.btn-default data-dismiss="modal" type="button" Close
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