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
5e7bf6a5
Commit
5e7bf6a5
authored
Mar 02, 2014
by
tady
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fork時にタグが引き継がれない問題
parent
45081fe5
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
90 deletions
+21
-90
app/assets/stylesheets/app.css.scss
+6
-79
app/assets/stylesheets/body-padding.css.scss
+1
-3
app/assets/stylesheets/lib/mod-md-editor.css.scss
+1
-1
app/models/post.rb
+8
-0
app/views/layouts/app.html.erb
+3
-6
app/views/posts/_form.html.erb
+2
-1
No files found.
app/assets/stylesheets/app.css.scss
View file @
5e7bf6a5
...
@@ -2,89 +2,16 @@
...
@@ -2,89 +2,16 @@
// They will automatically be included in application.css.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// You can use Sass (SCSS) here: http://sass-lang.com/
.app
{
.navbar-default
.navbar-brand
{
.navbar-default
.navbar-brand
{
background-color
:
#428bca
;
background-color
:
#428bca
;
color
:
#fff
;
color
:
#fff
;
}
}
.label
a
{
.navbar-default
.navbar-brand
,
.label
a
{
color
:
white
;
color
:
white
;
}
}
/* .navbar-default a.btn, .navbar-default a.btn:hover{
padding: 10px 20px;
color: #fff;
margin-top: 6px;
}
*/
.box-text
{
padding
:
9px
14px
;
margin-left
:
0
;
margin-right
:
0
;
background-color
:
#fff
;
border-width
:
1px
;
border-color
:
#ddd
;
border
:
1px
solid
#e1e1e8
;
border-radius
:
4px
4px
0
0
;
box-shadow
:
none
;
}
.box-highlight
{
padding
:
9px
14px
;
margin-bottom
:
14px
;
background-color
:
#f7f7f9
;
border
:
1px
solid
#e1e1e8
;
border-radius
:
4px
;
}
.box-text
+
.box-highlight
{
border-top-left-radius
:
0px
;
border-top-right-radius
:
0px
;
}
#app-search-form
{
#app-search-form
{
width
:
200px
;
width
:
200px
;
}
/* side tree view
-------------------------------------------------- */
/* ul {
padding-left: 1em;
}
*/
/* home#show
-------------------------------------------------- */
/* .text-box {
padding: 9px 14px;
border: 1px solid #e1e1e8;
border-radius: 4px;
}
.text-box.title {
background-color: #fff;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
font-weight: bold;
font-size: 12pt;
}
.text-box.meta {
background-color: #f7f7f9;
border-radius: 0;
.label {
display: inline-block;
}
}
.text-box.body {
background-color: #fff;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
}
*/
}
}
app/assets/stylesheets/body-padding.css.scss
View file @
5e7bf6a5
body
[
class
^=
"posts-"
],
body
{
body
[
class
^=
"tags-"
]
{
padding-top
:
70px
;
padding-top
:
70px
;
}
}
app/assets/stylesheets/lib/mod-md-editor.css.scss
View file @
5e7bf6a5
/* Style for mod-mdEditor
/* Style for mod-mdEditor
.
-------------------------------------------------- */
-------------------------------------------------- */
.mod-mdEditor-title
{
.mod-mdEditor-title
{
width
:
95%
;
width
:
95%
;
...
...
app/models/post.rb
View file @
5e7bf6a5
...
@@ -39,9 +39,17 @@ class Post < ActiveRecord::Base
...
@@ -39,9 +39,17 @@ class Post < ActiveRecord::Base
# generate forked post (not saved)
# generate forked post (not saved)
def
generate_fork
(
user
)
def
generate_fork
(
user
)
# `id`以外をコピーする
_forked_post
=
Post
.
new
(
self
.
attributes
.
except
(
'id'
))
_forked_post
=
Post
.
new
(
self
.
attributes
.
except
(
'id'
))
# `%Name`をユーザー名に置換
_forked_post
.
title
=
_forked_post
.
title
.
gsub
(
/%Name/
,
user
.
name
)
_forked_post
.
title
=
_forked_post
.
title
.
gsub
(
/%Name/
,
user
.
name
)
# `%Y`などを日付に変換
_forked_post
.
title
=
Time
.
now
.
strftime
(
_forked_post
.
title
)
# TODO
_forked_post
.
title
=
Time
.
now
.
strftime
(
_forked_post
.
title
)
# TODO
_forked_post
.
title
=
_forked_post
.
title
+
' のコピー'
_forked_post
.
tag_ids
=
self
.
tag_ids
_forked_post
.
tag_ids
=
self
.
tag_ids
_forked_post
.
author
=
user
_forked_post
.
author
=
user
...
...
app/views/layouts/app.html.erb
View file @
5e7bf6a5
...
@@ -3,27 +3,24 @@
...
@@ -3,27 +3,24 @@
<head>
<head>
<title>
Rendezvous
</title>
<title>
Rendezvous
</title>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<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"
>
<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"
>
<link
rel=
"stylesheet"
href=
"//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap-theme.min.css"
>
<%=
stylesheet_link_tag
"application"
,
media:
"all"
%>
<%=
render_style
%>
<%=
render_style
%>
<%=
csrf_meta_tags
%>
<%=
csrf_meta_tags
%>
</head>
</head>
<body
class=
"
<%=
params
[
:controller
]
%>
-
<%=
params
[
:action
]
%>
"
>
<body
class=
"
rails-
<%=
params
[
:controller
]
%>
-
<%=
params
[
:action
]
%>
"
>
<%=
render
partial:
'partials/header_notifications'
%>
<%=
render
partial:
'partials/header_notifications'
%>
<div
class=
"app"
>
<%=
render
partial:
'partials/app_header'
%>
<%=
render
partial:
'partials/app_header'
%>
<div
class=
"container"
>
<div
class=
"container"
>
<%=
yield
%>
<%=
yield
%>
</div>
<!--/.container-->
</div>
<!--/.container-->
</div>
<script
src=
"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"
></script>
<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=
"//cdnjs.cloudflare.com/ajax/libs/underscore.string/2.3.3/underscore.string.min.js"
></script>
...
...
app/views/posts/_form.html.erb
View file @
5e7bf6a5
...
@@ -26,7 +26,8 @@
...
@@ -26,7 +26,8 @@
<div
class=
"field"
>
<div
class=
"field"
>
<div
class=
"input-group"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
>
<%=
f
.
label
:tags
%>
</span>
<span
class=
"input-group-addon"
>
<%=
f
.
label
:tags
%>
</span>
<%=
hidden_field
:post
,
:tags
,
class:
'mod-mdEditor-tags'
,
style:
'width:300px'
,
value:
@post
.
tags
.
pluck
(
:name
).
join
(
','
)
%>
<%=
hidden_field
:post
,
:tags
,
class:
'mod-mdEditor-tags'
,
style:
'width:300px'
,
value:
@post
.
tags
.
map
{
|
_tag
|
_tag
.
name
}.
join
(
','
)
%>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
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