Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rendezvous
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
rendezvous
Commits
035c27af
Commit
035c27af
authored
Mar 02, 2014
by
tady
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactore layout
parent
5e7bf6a5
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
35 additions
and
99 deletions
+35
-99
app/assets/stylesheets/app.css.scss
+4
-0
app/controllers/home_controller.rb
+0
-1
app/controllers/posts_controller.rb
+0
-1
app/controllers/tags_controller.rb
+5
-7
app/views/home/login.html.erb
+1
-1
app/views/layouts/application.html.erb
+15
-3
app/views/layouts/welcome.html.erb
+0
-43
app/views/tags/_form.html.erb
+1
-1
app/views/tags/index.html.erb
+1
-38
app/views/tags/show.html.erb
+6
-2
app/views/tags/show.json.jbuilder
+1
-1
spec/models/post_spec.rb
+1
-1
No files found.
app/assets/stylesheets/app.css.scss
View file @
035c27af
...
...
@@ -15,3 +15,7 @@
#app-search-form
{
width
:
200px
;
}
.container-main
{
min-height
:
400px
;
}
app/controllers/home_controller.rb
View file @
035c27af
class
HomeController
<
ApplicationController
skip_before_action
:require_login
layout
'welcome'
def
top
if
user_signed_in?
...
...
app/controllers/posts_controller.rb
View file @
035c27af
...
...
@@ -3,7 +3,6 @@ require 'nkf'
class
PostsController
<
ApplicationController
before_action
:set_post
,
only:
[
:show
,
:edit
,
:update
,
:destroy
]
before_action
:require_login
layout
'app'
include
RV
::
Mailer
...
...
app/controllers/tags_controller.rb
View file @
035c27af
class
TagsController
<
ApplicationController
before_action
:set_tag
,
only:
[
:show
,
:edit
,
:update
,
:destroy
]
layout
'app'
def
index
end
def
show
@posts
=
@tag
.
posts
end
def
new
...
...
@@ -18,11 +16,10 @@ class TagsController < ApplicationController
def
create
@tag
=
Tag
.
new
(
tag_params
)
@tag
.
author
=
current_user
respond_to
do
|
format
|
if
@tag
.
save
format
.
html
{
redirect_to
root_path
(
id:
@tag
.
id
)
,
flash:
{
notice:
'Tag was successfully created.'
}
}
format
.
html
{
redirect_to
@tag
.
show_path
,
flash:
{
notice:
'Tag was successfully created.'
}
}
format
.
json
{
render
action:
'show'
,
status: :created
,
location:
@tag
}
else
format
.
html
{
render
action:
'new'
}
...
...
@@ -32,11 +29,9 @@ class TagsController < ApplicationController
end
def
update
@tag
.
author
=
current_user
respond_to
do
|
format
|
if
@tag
.
update
(
tag_params
)
format
.
html
{
redirect_to
root_path
(
id:
@tag
.
id
)
,
flash:
{
notice:
'Tag was successfully updated.'
}
}
format
.
html
{
redirect_to
@tag
.
show_path
,
flash:
{
notice:
'Tag was successfully updated.'
}
}
format
.
json
{
head
:no_content
}
else
format
.
html
{
render
action:
'edit'
}
...
...
@@ -69,5 +64,8 @@ class TagsController < ApplicationController
@tag
=
tag
.
decorate
end
def
tag_params
params
.
require
(
:tag
).
permit
(
:name
,
:body
).
to_hash
end
end
app/views/home/login.html.erb
View file @
035c27af
...
...
@@ -13,7 +13,7 @@
<div
class=
"col-lg-4"
>
<img
class=
"img-circle"
src=
"http://placehold.it/140x140&text=Rendezvous"
alt=
"Generic placeholder image"
>
<h2>
Rendezvous
</h2>
<p>
Rendezvousはチームの`Stock`と`Flow`の
<br>
2
つ
の情報を蓄積・検索・共有する
<br>
オープンソースのソフトウェアです。
</p>
<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"
>
...
...
app/views/layouts/app.html.erb
→
app/views/layouts/app
lication
.html.erb
View file @
035c27af
<!DOCTYPE html>
<!DOCTYPE html>
<!--
Have a nice $$$$$$$\ $$\
$$ __$$\ $$ |
$$ | $$ | $$$$$$\ $$$$$$$\ $$$$$$$ | $$$$$$\ $$$$$$$$\$$\ $$\ $$$$$$\ $$\ $$\ $$$$$$$\
$$$$$$$ |$$ __$$\ $$ __$$\ $$ __$$ |$$ __$$\\____$$ \$$\ $$ |$$ __$$\ $$ | $$ |$$ _____|
$$ __$$< $$$$$$$$ |$$ | $$ |$$ / $$ |$$$$$$$$ | $$$$ _/ \$$\$$ / $$ / $$ |$$ | $$ |\$$$$$$\
$$ | $$ |$$ ____|$$ | $$ |$$ | $$ |$$ ____|$$ _/ \$$$ / $$ | $$ |$$ | $$ | \____$$\
$$ | $$ |\$$$$$$$\ $$ | $$ |\$$$$$$$ |\$$$$$$$\$$$$$$$$\ \$ / \$$$$$$ |\$$$$$$ |$$$$$$$ |
\__| \__| \_______|\__| \__| \_______| \_______\________| \_/ \______/ \______/ \_______/ with your team.
-->
<html
lang=
"ja"
>
<head>
<title>
Rendezvous
</title>
...
...
@@ -16,9 +25,11 @@
<%=
render
partial:
'partials/header_notifications'
%>
<%=
render
partial:
'partials/app_header'
%>
<%-
if
params
[
:controller
]
!=
'home'
-%>
<%=
render
partial:
'partials/app_header'
%>
<%-
end
-%>
<div
class=
"container"
>
<div
class=
"container
container-main
"
>
<%=
yield
%>
</div>
<!--/.container-->
...
...
@@ -32,6 +43,7 @@
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>
...
...
app/views/layouts/welcome.html.erb
deleted
100644 → 0
View file @
5e7bf6a5
<!DOCTYPE html>
<html
lang=
"ja"
>
<head>
<title>
Rendezvous
</title>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<%=
stylesheet_link_tag
"application"
,
media:
"all"
%>
<!-- Latest compiled and minified CSS -->
<link
rel=
"stylesheet"
href=
"//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css"
>
<!-- Optional theme -->
<link
rel=
"stylesheet"
href=
"//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap-theme.min.css"
>
<%=
render_style
%>
<%=
csrf_meta_tags
%>
</head>
<body
class=
"
<%=
params
[
:controller
]
%>
-
<%=
params
[
:action
]
%>
"
>
<%=
render
partial:
'partials/header_notifications'
%>
<%=
yield
%>
<script
src=
"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-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>
<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>
app/views/tags/_form.html.erb
View file @
035c27af
<div
id=
"tag-form"
>
<%=
form_for
(
@tag
)
do
|
f
|
%>
<%=
form_for
(
@tag
,
url:
@tag
.
show_path
)
do
|
f
|
%>
<%
if
@tag
.
errors
.
any?
%>
<div
id=
"error_explanation"
>
...
...
app/views/tags/index.html.erb
View file @
035c27af
<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"
>
<
-- Select a post...
</p>
</div>
</div>
<!--/span-->
</div>
<!--/row-->
この ページ は まだ そんざい しません
app/views/tags/show.html.erb
View file @
035c27af
...
...
@@ -27,7 +27,11 @@
「
<%=
@tag
.
name
%>
」とは
</div>
<div
class=
"panel-body"
>
まだ「
<%=
@tag
.
name
%>
」の情報がありません。
<%-
if
@tag
.
body
.
present?
-%>
<%=
h_application_format_markdown
(
@tag
.
body
)
%>
<%-
else
-%>
まだ「
<%=
@tag
.
name
%>
」の情報がありません。
<%-
end
-%>
</div>
</div>
</div>
...
...
@@ -35,7 +39,7 @@
<div
class=
"col-xs-4"
>
<div
class=
"list-group"
>
<h2><small>
「
<%=
@tag
.
name
%>
」のタグが付いた記事
</small></h2>
<%
@posts
.
each_with_index
do
|
post
,
i
|
%>
<%
@
tag
.
posts
.
each_with_index
do
|
post
,
i
|
%>
<a
href=
"
<%=
post_path
(
post
)
%>
"
class=
"list-group-item post-list"
>
<%=
post
.
title
%>
</a>
<%
end
%>
</div>
...
...
app/views/tags/show.json.jbuilder
View file @
035c27af
json.extract! @
post, :titl
e, :body, :created_at, :updated_at
json.extract! @
tag, :nam
e, :body, :created_at, :updated_at
spec/models/post_spec.rb
View file @
035c27af
...
...
@@ -21,7 +21,7 @@ describe Post do
end
it
'valid title'
do
expect
(
@new_post
.
title
).
to
eq
(
'sample title'
)
expect
(
@new_post
.
title
).
to
eq
(
'sample title
のコピー
'
)
end
it
'valid body'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment