Commit 98c481df by tady

erb -> haml

parent 80f78bec
......@@ -88,6 +88,9 @@ group :development, :test do
# gem 'database_cleaner'
gem 'database_rewinder'
gem "erb2haml"
gem 'haml'
end
group :test do
......@@ -128,3 +131,5 @@ gem 'aws-sdk'
gem 'newrelic_rpm'
gem 'breadcrumble'
gem 'slim'
......@@ -114,6 +114,8 @@ 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)
......@@ -141,8 +143,16 @@ 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)
......@@ -287,6 +297,8 @@ 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)
......@@ -297,11 +309,15 @@ 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
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
slim (2.0.2)
temple (~> 0.6.6)
tilt (>= 1.3.3, < 2.1)
slop (3.4.7)
sprockets (2.11.0)
hike (~> 1.2)
......@@ -316,6 +332,7 @@ GEM
net-scp (>= 1.1.2)
net-ssh
term-ansicolor
temple (0.6.7)
term-ansicolor (1.3.0)
tins (~> 1.0)
therubyracer (0.12.1)
......@@ -371,11 +388,13 @@ DEPENDENCIES
database_rewinder
devise
draper (~> 1.3)
erb2haml
factory_girl_rails
faraday
github-markdown
guard-rspec
guard-rubocop
haml
i18n_generators
jbuilder
jquery-rails
......@@ -395,6 +414,7 @@ DEPENDENCIES
sass-rails
sdoc
settingslogic
slim
therubyracer
thin
uglifier
......
<h1>Apis#markdown_preview</h1>
<p>Find me in app/views/apis/markdown_preview.html.erb</p>
%h1 Apis#markdown_preview
%p Find me in app/views/apis/markdown_preview.html.erb
<ol class="breadcrumb">
<% breadcrumbs.each_with_index do |crumb, i| %>
<li itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">
<% span_title = content_tag(:span, crumb[:name], itemprop: "title") %>
<% if crumb[:url] == nil %>
<%= span_title %>
<% else %>
<%= link_to_unless_current span_title, crumb[:url], itemprop: "url" %>
<% end %>
</li>
<% end %>
</ol>
%ol.breadcrumb
- breadcrumbs.each_with_index do |crumb, i|
%li{:itemscope => "itemscope", :itemtype => "http://data-vocabulary.org/Breadcrumb"}
- span_title = content_tag(:span, crumb[:name], itemprop: "title")
- if crumb[:url] == nil
= span_title
- else
= link_to_unless_current span_title, crumb[:url], itemprop: "url"
<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" %>
<% end %>
<% if trail.size > 1 %>
&gt;<%= render partial: 'breadcrumble/breadcrumb_trail', locals: { trail: trail.drop(1) } %>
<% end %>
</span>
%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) }}
<div>
<% breadcrumb_trails.each do |trail| %>
<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" %>
<% end %>
<% if trail.size > 1 %>
&gt;<%= render partial: 'breadcrumble/breadcrumb_trail', locals: { trail: trail.drop(1) } %>
<% end %>
</div>
<% end %>
</div>
%div
- breadcrumb_trails.each do |trail|
%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) }}
<div class="login">
<!-- Marketing messaging and featurettes
================================================== -->
<!-- Wrap the rest of the page in another container to center all the content. -->
<div class="container marketing">
<!-- Three columns of text below the carousel -->
<div class="row" style="margin-top: 40px">
<div class="col-lg-4">
</div><!-- /.col-lg-4 -->
<div class="col-lg-4">
<img class="img-circle" src="http://placehold.it/140x140&amp;text=Rendezvous" alt="Generic placeholder image">
<h2>Rendezvous</h2>
<p>Rendezvousはチームの`Stock`と`Flow`の<br>2種類の情報を蓄積・検索・共有する<br>オープンソースのソフトウェアです。</p>
<p><a class="btn btn-lg btn-primary" href="<%= user_omniauth_authorize_path(:google_oauth2) %>" role="button">Sign up with Google</a></p>
</div><!-- /.col-lg-4 -->
<div class="col-lg-4">
</div><!-- /.col-lg-4 -->
</div><!-- /.row -->
<!-- START THE FEATURETTES -->
<hr class="featurette-divider">
<div class="row featurette">
<div class="col-md-7">
<h2 class="featurette-heading">Stock all you have done. <span class="text-muted">It may be priceless for others.</span></h2>
<p class="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.</p>
</div>
<div class="col-md-5">
<img class="featurette-image img-responsive" src="http://placehold.it/500x400&amp;text=Stock" alt="Stock">
</div>
</div>
<hr class="featurette-divider">
<div class="row featurette">
<div class="col-md-5">
<img class="featurette-image img-responsive" src="http://placehold.it/500x400&amp;text=Flow" alt="Flow">
</div>
<div class="col-md-7">
<h2 class="featurette-heading">Flow anything member have come up with. <span class="text-muted">Which accelerate your PDCA.</span></h2>
<p class="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.</p>
</div>
</div>
<hr class="featurette-divider">
<div class="row featurette">
<div class="col-md-7">
<h2 class="featurette-heading">Collaborate with other team on documents. <span class="text-muted">Making more and more generic plans.</span></h2>
<p class="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.</p>
</div>
<div class="col-md-5">
<img class="featurette-image img-responsive" src="http://placehold.it/500x400&amp;text=Collaboration" alt="Collaboration">
</div>
</div>
<hr class="featurette-divider">
<!-- /END THE FEATURETTES -->
</div><!-- /.container -->
</div>
.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
<!DOCTYPE html><!--
Have a nice $$$$$$$\ $$\
$$ __$$\ $$ |
$$ | $$ | $$$$$$\ $$$$$$$\ $$$$$$$ | $$$$$$\ $$$$$$$$\$$\ $$\ $$$$$$\ $$\ $$\ $$$$$$$\
$$$$$$$ |$$ __$$\ $$ __$$\ $$ __$$ |$$ __$$\\____$$ \$$\ $$ |$$ __$$\ $$ | $$ |$$ _____|
$$ __$$< $$$$$$$$ |$$ | $$ |$$ / $$ |$$$$$$$$ | $$$$ _/ \$$\$$ / $$ / $$ |$$ | $$ |\$$$$$$\
$$ | $$ |$$ ____|$$ | $$ |$$ | $$ |$$ ____|$$ _/ \$$$ / $$ | $$ |$$ | $$ | \____$$\
$$ | $$ |\$$$$$$$\ $$ | $$ |\$$$$$$$ |\$$$$$$$\$$$$$$$$\ \$ / \$$$$$$ |\$$$$$$ |$$$$$$$ |
\__| \__| \_______|\__| \__| \_______| \_______\________| \_/ \______/ \______/ \_______/ with your team.
-->
<html lang="ja">
<head>
<title>Rendezvous</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap-theme.min.css">
<%= stylesheet_link_tag "application", media: "all" %>
<%= render_style %>
<%= csrf_meta_tags %>
</head>
<body class="rails-<%= params[:controller] %>-<%= params[:action] %>">
<%= render partial: 'partials/header_notifications' %>
<%- if params[:controller] != 'home' -%>
<%= render partial: 'partials/app_header' %>
<%- end -%>
<div class="container container-main">
<%= yield %>
</div><!--/.container-->
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.string/2.3.3/underscore.string.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>
<script type="text/javascript">
window.RV = window.RV || {};
window.RV.AllTags = JSON.parse('<%= raw Tag.all.pluck(:name).to_json %>');
</script>
<hr>
<footer>
<div class="container">
<a href="https://github.com/tadyjp/rendezvous">Github</a>
|
<a href="https://twitter.com/tady_jp">@tady_jp</a>
</div>
</footer>
<%= javascript_include_tag "application" %>
<%= yield :footer_js %>
</body>
</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 class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<%= root_path %>">Rendezvous</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<form id="app-search-form" class="navbar-form navbar-left" role="search" action="<%= posts_path %>">
<div class="input-group">
<input type="text" name="q" class="form-control" value="<%= params[:q] %>" placeholder="Search">
<span class="input-group-btn">
<button type="submit" class="btn btn-default" data-disable-with="Searching...">
<span class="glyphicon glyphicon-search"></span>
</button>
</span>
</div>
</form>
<p class="navbar-text" id="header-search-hint">
<a href="#" data-toggle="modal" data-target="#header-search-description">
Search <span class="glyphicon glyphicon-question-sign" ></span>
</a>
|
<a href="https://help.github.com/articles/github-flavored-markdown" target="_blank">
Markdown <span class="glyphicon glyphicon-question-sign" ></span>
</a>
</p>
<%= form_tag(destroy_user_session_path, :method => :delete, class: 'navbar-form navbar-right') do %>
<%= submit_tag 'SignOut', class: 'btn btn-default' %>
<% end %>
<div class="navbar-right">
<a href="<%= new_post_path %>" class="btn btn-primary navbar-btn">Post&nbsp;&nbsp;
<span class="glyphicon glyphicon-pencil"></span>
</a>
<img src="<%= current_user.image_url %>" width="25" height="25">
<%= current_user.name %>
</div>
</div><!-- /.navbar-collapse -->
</div><!-- /.container -->
</nav>
<!-- Modal #header-search-description -->
<div class="modal fade" id="header-search-description" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Search command</h4>
</div>
<div class="modal-body">
<dl class="dl-horizontal">
<dt>Search by title</dt>
<dd><pre><a href="<%= posts_path(q: 'title:ruby') %>">title:ruby</a></pre></dd>
<dt>Search by id</dt>
<dd><pre><a href="<%= posts_path(q: 'id:123') %>">id:123</a></pre></dd>
<dt>Search by body</dt>
<dd><pre><a href="<%= posts_path(q: 'body:ruby') %>">body:ruby</a></pre></dd>
<dt>Search by author</dt>
<dd><pre><a href="<%= posts_path(q: '@taro') %>">@taro</a></pre></dd>
<dt>Search by tag</dt>
<dd><pre><a href="<%= posts_path(q: '#ruby') %>">#ruby</a></pre></dd>
<dt>Search by date</dt>
<dd><pre><a href="<%= posts_path(q: 'date:2013-12-16') %>">date:2013-12-16</a></pre></dd>
<dt>Search by title or body</dt>
<dd><pre><a href="<%= posts_path(q: 'ruby') %>">ruby</a></pre></dd>
</dl>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<% style do %>
#header-search-hint{
margin-left: 0;
}
<% end %>
%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;
}
<%#
desc:
- appページの上部に
css:
- none
locals:
- none
usage:
render partial: 'partials/header_notifications'
%>
<% if flash[:success] %>
<div class="alert alert-success fade in">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<strong>Success</strong> <%= flash[:success] %>
</div>
<% end %>
<% if flash[:notice] %>
<div class="alert alert-warning fade in">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<strong>Notice</strong> <%= flash[:notice] %>
</div>
<% end %>
<% if flash[:alert] %>
<div class="alert alert-danger fade in">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<strong>Alert</strong> <%= flash[:alert] %>
</div>
<% end %>
- 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]
<!--
Have a nice $$$$$$$\ $$\
$$ __$$\ $$ |
$$ | $$ | $$$$$$\ $$$$$$$\ $$$$$$$ | $$$$$$\ $$$$$$$$\$$\ $$\ $$$$$$\ $$\ $$\ $$$$$$$\
$$$$$$$ |$$ __$$\ $$ __$$\ $$ __$$ |$$ __$$\\____$$ \$$\ $$ |$$ __$$\ $$ | $$ |$$ _____|
$$ __$$< $$$$$$$$ |$$ | $$ |$$ / $$ |$$$$$$$$ | $$$$ _/ \$$\$$ / $$ / $$ |$$ | $$ |\$$$$$$\
$$ | $$ |$$ ____|$$ | $$ |$$ | $$ |$$ ____|$$ _/ \$$$ / $$ | $$ |$$ | $$ | \____$$\
$$ | $$ |\$$$$$$$\ $$ | $$ |\$$$$$$$ |\$$$$$$$\$$$$$$$$\ \$ / \$$$$$$ |\$$$$$$ |$$$$$$$ |
\__| \__| \_______|\__| \__| \_______| \_______\________| \_/ \______/ \______/ \_______/ with your team.
-->
<div id="post-form">
<%= form_for(@post) do |f| %>
<% if @post.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2>
<ul>
<% @post.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="row">
<div class="col-xs-10">
<div class="field">
<div class="input-group">
<span class="input-group-addon"><%= f.label :title %></span>
<%= f.text_field :title, class: 'form-control mod-mdEditor-title' %>
</div>
</div>
</div>
<div class="col-xs-2">
<div class="actions">
<%= f.submit class: 'btn btn-primary js-disable-confirm-unload', id: 'save_button' %>
</div>
</div>
</div><!-- /.row -->
<div class="row">
<div class="col-xs-8">
<div class="field">
<div class="input-group">
<span class="input-group-addon"><%= f.label :tags %></span>
<%= hidden_field :post, :tags, class: 'mod-mdEditor-tags', style: 'width:300px',
value: @post.tags.map{ |_tag| _tag.name }.join(',') %>
</div>
</div>
</div>
<div class="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>
-->
</div>
</div><!-- /.row -->
<br>
<div class="row">
<div class="col-xs-6 col-md-6">
<div class="field">
<!-- <%= f.label :body %><br> -->
<%= f.text_area :body, class: 'mod-mdEditor-body' %>
</div>
</div><!--/span-->
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="box-text">
<%# TODO: class名の整理 %>
<div class="text-box body viewer github mod-mdEditor-preview">
</div>
</div>
</div><!--/span-->
</div><!--/row-->
<% end %>
</div>
<input id="fileupload" type="file" name="files[]" data-url="/apis/file_receiver" multiple style="display:none">
<% content_for :footer_js do %>
<script type="text/javascript">
$.setConfirmUnload();
$('#post-form').mod_mdEditor({end_point: '/apis/markdown_preview'});
$.mod_fileuploader({
$input: $('#fileupload'),
$textarea: $('.mod-mdEditor-body')
});
</script>
<% end %>
#post-form
= form_for(@post) do |f|
- if @post.errors.any?
#error_explanation
%h2
= pluralize(@post.errors.count, "error")
prohibited this post from being saved:
%ul
- @post.errors.full_messages.each do |msg|
%li= msg
.row
.col-xs-10
.field
.input-group
%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(',') |
.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/
.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"}/
- content_for :footer_js do
:javascript
$.setConfirmUnload();
$('#post-form').mod_mdEditor({end_point: '/apis/markdown_preview'});
$.mod_fileuploader({
$input: $('#fileupload'),
$textarea: $('.mod-mdEditor-body')
});
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<a href="<%= post_path(@post) %>"><%= @post.title %></a>
</h3>
</div>
<ul class="list-group">
<li class="list-group-item">
<%### Post meta ###%>
<% @post.tags.each do |tag| %>
<span class="label label-info">
<a href="<%= tag.decorate.show_path %>">#<%= tag.name %></a>
</span>
<% end %>
<span class="label label-success">
<a href="<%= posts_path(q: "@#{@post.author.name}") %>">@<%= @post.author.name %></a>
</span>
<span class="label label-danger">
<a href="<%= posts_path(q: "date:#{@post.updated_at.strftime('%Y-%m-%d')}") %>"><%= @post.updated_at.strftime('%Y-%m-%d') %></a>
</span>
<!-- Split button -->
<div class="btn-group pull-right" style="margin: -7px -12px 0 0;">
<a class="btn btn-primary" href="<%= edit_post_path(@post) %>">
<span class="glyphicon glyphicon-pencil"></span>
</a>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="<%= slideshow_post_path(@post) %>" target="_blank">Slideshow</a></li>
<li><a href="https://github.com/gnab/remark" target="_blank" class="small">What is Slideshow?</a></li>
<li class="divider"></li>
<li><a href="<%= fork_post_path(@post) %>">Fork</a></li>
<li><a href="#" data-toggle="modal" data-target="#myModal">Mail to...</a></li>
<li class="divider"></li>
<li><%= link_to 'Delete', post_path(@post), method: :delete, data: { confirm: 'Are you sure?' } %></li>
</ul>
</div>
<%### /Post meta ###%>
</li>
</ul>
<div class="panel-body viewer github">
<%= h_application_format_markdown(@post.body) %>
</div>
</div>
<%### Comments ###%>
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">Comments</h3>
</div>
<div class="panel-body">
<ul class="media-list">
<% @post.comments.each do |comment| %>
<li class="media">
<a class="pull-left" href="#">
<img class="media-object" src="<%= comment.author.image_url %>">
</a>
<div class="media-body">
<h4 class="media-heading"><%= comment.author.name %></h4>
<%= comment.body %>
</div>
</li>
<% end %>
<%= form_tag(comment_post_path, method: :post, data: { 'form-id' => "comment_#{@post.id}" }) do %>
<li class="media">
<a class="pull-left" href="#">
<img class="media-object" src="<%= current_user.image_url %>">
</a>
<div class="media-body">
<h4 class="media-heading"><%= current_user.name %></h4>
<%= text_area :comment, :body, class: 'form-control', placeholder: 'コメントする...' %>
<%= submit_tag 'Comment', class: 'btn btn-primary', data: { 'disable-with' => '...' } %>
</div>
</li>
<% end %>
<script type="text/javascript">
$("form[data-form-id='comment_<%= @post.id %>']").on('ajax:success', function(event, data, xhr) {
});
</script>
</ul>
</div>
</div>
<%### /Comments ###%>
<!-- Button trigger modal -->
<!-- <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>
-->
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<%= form_tag mail_post_path(@post), method: :post, class: 'form-horizontal', role: 'form' do %>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Mail this post to...</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label class="col-sm-2 control-label">Title</label>
<div class="col-sm-10">
<input type="text" class="form-control" value="<%= @post.title %>" readonly>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">To</label>
<div class="col-sm-10">
<input type="email" name="mail[to]" class="form-control" id="inputEmail3" placeholder="Email">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">From</label>
<div class="col-sm-10">
<input type="text" class="form-control" value="<%= current_user.email %>" readonly>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" data-disable-with="Sending...">Send</button>
</div>
</div><!-- /.modal-content -->
<% end %><%# form %>
</div><!-- /.modal-dialog -->
</div><!-- /.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')
/ 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
<h1>編集</h1>
<%= render 'form' %>
%h1 編集
= render 'form'
<div class="row">
<div class="col-xs-6 col-md-4" id="sidebar" role="navigation">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab-list" data-toggle="tab">List</a></li>
<li><a href="#tab-tree" data-toggle="tab">Tag Tree</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab-list">
<div class="list-group">
<% @posts.each_with_index do |post, i| %>
<a href="#" data-post-id="<%= post.id %>" class="list-group-item post-list"><%= post.title %></a>
<% end %>
</div>
</div><!-- /.tab-pane -->
<div class="tab-pane" id="tab-tree">
<% cache('tag-tree', :expires_in => 1.hour) do %>
<div class="list-group">
<%= Tag.all.decorate.tree_view %>
</div>
<% end %>
</div><!-- /.tab-pane -->
</div><!-- /.tab-content -->
</div><!--/span-->
<div class="col-xs-12 col-sm-6 col-md-8">
<div id="list_post">
<p id="posts-placeholder" style="color:#aaa;font-size:30px">&lt;-- Select a post...</p>
</div>
</div><!--/span-->
</div><!--/row-->
.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
.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
#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...
<h1>新しい投稿</h1>
<%= render 'form' %>
%h1 新しい投稿
= render 'form'
<%= render_breadcrumbs %>
<div class="row">
<div>
<%= render partial: 'posts/show_fragment' %>
</div>
</div><!--/row-->
= render_breadcrumbs
.row
%div
= render partial: 'posts/show_fragment'
/ /row
<div id="tag-form">
<%= form_for(@tag, url: @tag.show_path) do |f| %>
<% if @tag.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@tag.errors.count, "error") %> prohibited this tag from being saved:</h2>
<ul>
<% @tag.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="row">
<div class="col-md-10">
<div class="field">
<div class="input-group">
<span class="input-group-addon"><%= f.label :name %></span>
<%= f.text_field :name, class: 'form-control' %>
</div>
</div>
</div>
<div class="col-md-2">
<div class="actions">
<%= f.submit class: 'btn btn-primary js-disable-confirm-unload', id: 'save_button' %>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-xs-6 col-md-6">
<div class="field">
<!-- <%= f.label :body %><br> -->
<%= f.text_area :body, class: 'mod-mdEditor-body' %>
</div>
</div><!--/span-->
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="box-text">
<div id="tag_preview" class="text-box body viewer github mod-mdEditor-preview">
</div>
</div>
</div><!--/span-->
</div><!--/row-->
<% end %>
</div>
<% content_for :footer_js do %>
<script type="text/javascript">
$.setConfirmUnload()
$('#tag-form').mod_mdEditor({end_point: '/apis/markdown_preview'});
</script>
<% end %>
#tag-form
= form_for(@tag, url: @tag.show_path) do |f|
- if @tag.errors.any?
#error_explanation
%h2
= pluralize(@tag.errors.count, "error")
prohibited this tag from being saved:
%ul
- @tag.errors.full_messages.each do |msg|
%li= msg
.row
.col-md-10
.field
.input-group
%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/
.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
#tag_preview.text-box.body.viewer.github.mod-mdEditor-preview
/ /span
/ /row
- content_for :footer_js do
:javascript
$.setConfirmUnload()
$('#tag-form').mod_mdEditor({end_point: '/apis/markdown_preview'});
<h1>編集</h1>
<%= render 'form' %>
%h1 編集
= render 'form'
<h1>新しい投稿</h1>
<%= render 'form' %>
%h1 新しい投稿
= render 'form'
<%= render_breadcrumbs %>
<div class="row">
<div class="col-xs-8">
<h1><%= @tag.name %>についてのページ</h1>
</div>
<div class="col-xs-4">
<div class="btn-group pull-right">
<a class="btn btn-primary" href="<%= @tag.edit_path %>">
このページを編集する <span class="glyphicon glyphicon-pencil"></span>
</a>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="#" data-toggle="modal" data-target="#modal-merge">Merge to...</a></li>
<li><a href="#" data-toggle="modal" data-target="#modal-moveUnder">Move this tag under...</a></li>
</ul>
</div>
</div>
<div class="col-xs-8">
<div class="panel panel-default">
<div class="panel-heading">
<%= @tag.name %>」とは
</div>
<div class="panel-body">
<%- if @tag.body.present? -%>
<%= h_application_format_markdown(@tag.body) %>
<%- else -%>
まだ「<%= @tag.name %>」の情報がありません。
<%- end -%>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="list-group">
<h2><small><%= @tag.name %>」のタグが付いた記事</small></h2>
<% @tag.posts.each_with_index do |post, i| %>
<a href="<%= post_path(post) %>" class="list-group-item post-list"><%= post.title %></a>
<% end %>
</div>
</div>
</div><!--/row-->
<!-- Modal -->
<div class="modal fade" id="modal-merge" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3 class="modal-title" id="myModalLabel">Merge to other tag</h4>
</div>
<div class="modal-body">
<h4>マージ先のTagを選んでください</h4>
<div id="merge-tag-tree">
<%= Tag.all.decorate.tree_view %>
</div>
</div>
<% content_for :footer_js do %>
<script type="text/javascript">
$(function(){
$('#merge-tag-tree a').on('click', function(e){
console.log(e)
e.preventDefault();
var $this = $(this);
if(window.confirm('「<%= @tag.name %>」を「' + $this.data('name') + '」にマージます')) {
$.ajax({
type: "POST",
url: "/tags/<%= @tag.name %>/merge_to/" + $this.data('name')
}).done(function(data){
location.href = "/tags/" + $this.data('name');
}).fail(function(data){
alert('error');
});
} else {
return false;
}
})
})
</script>
<% end %>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- Modal -->
<div class="modal fade" id="modal-moveUnder" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3 class="modal-title" id="myModalLabel">Merge to other tag</h4>
</div>
<div class="modal-body">
<h4>マージ先のTagを選んでください</h4>
<div id="move-tag-tree">
<%= Tag.all.decorate.tree_view %>
</div>
</div>
<% content_for :footer_js do %>
<script type="text/javascript">
$(function(){
$('#move-tag-tree a').on('click', function(e){
console.log(e)
e.preventDefault();
var $this = $(this);
if(window.confirm('「<%= j @tag.name %>」を「' + $this.data('name') + '」の下に移動します')) {
$.ajax({
type: "POST",
url: "/tags/<%= @tag.name %>/move_to/" + encodeURIComponent($this.data('name'))
}).done(function(data){
location.href = "/tags/<%= j @tag.name %>";
}).fail(function(data){
alert('error');
});
} else {
return false;
}
})
})
</script>
<% end %>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
= render_breadcrumbs
.row
.col-xs-8
%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...
.col-xs-8
.panel.panel-default
.panel-heading
#{@tag.name}」とは
.panel-body
- if @tag.body.present?
= h_application_format_markdown(@tag.body)
- else
まだ「#{@tag.name}」の情報がありません。
.col-xs-4
.list-group
%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"}
.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
.modal-body
%h4 マージ先のTagを選んでください
#merge-tag-tree
= Tag.all.decorate.tree_view
- content_for :footer_js do
:javascript
$(function(){
$('#merge-tag-tree a').on('click', function(e){
console.log(e)
e.preventDefault();
var $this = $(this);
if(window.confirm('「#{@tag.name}」を「' + $this.data('name') + '」にマージます')) {
$.ajax({
type: "POST",
url: "/tags/#{@tag.name}/merge_to/" + $this.data('name')
}).done(function(data){
location.href = "/tags/" + $this.data('name');
}).fail(function(data){
alert('error');
});
} else {
return false;
}
})
})
.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"}
.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
.modal-body
%h4 マージ先のTagを選んでください
#move-tag-tree
= Tag.all.decorate.tree_view
- content_for :footer_js do
:javascript
$(function(){
$('#move-tag-tree a').on('click', function(e){
console.log(e)
e.preventDefault();
var $this = $(this);
if(window.confirm('「#{j @tag.name}」を「' + $this.data('name') + '」の下に移動します')) {
$.ajax({
type: "POST",
url: "/tags/#{@tag.name}/move_to/" + encodeURIComponent($this.data('name'))
}).done(function(data){
location.href = "/tags/#{j @tag.name}";
}).fail(function(data){
alert('error');
});
} else {
return false;
}
})
})
.modal-footer
%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