Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown project prop #1444

Merged
merged 4 commits into from
Aug 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/pages/lab/project-details.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ module.exports = React.createClass
<AutoSave resource={@props.project}>
<span className="form-label">Introduction</span>
<br />
<MarkdownEditor className="full" name="introduction" rows="10" value={@props.project.introduction} onChange={handleInputChange.bind @props.project} onHelp={markdownHelp}/>
<MarkdownEditor className="full" name="introduction" rows="10" value={@props.project.introduction} project={@props.project} onChange={handleInputChange.bind @props.project} onHelp={markdownHelp}/>
</AutoSave>
<small className="form-help">Add a brief introduction to get people interested in your project. This will display on your landing page.</small>
</p>
Expand Down
2 changes: 1 addition & 1 deletion app/pages/project/education.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = React.createClass
render: ->
<div className="project-text-content content-container">
<PromiseRenderer promise={@props.project.get('pages', url_key: "education").index(0)}>{(education) =>
<Markdown className="column">{
<Markdown project={@props.project} className="column">{
if education?.content
education?.content
else
Expand Down
2 changes: 1 addition & 1 deletion app/pages/project/faq.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = React.createClass
render: ->
<div className="project-text-content content-container">
<PromiseRenderer promise={@props.project.get('pages', url_key: "faq").index(0)}>{(faq) =>
<Markdown className="column">{
<Markdown project={@props.project} className="column">{
if faq?.content
faq?.content
else
Expand Down
2 changes: 1 addition & 1 deletion app/pages/project/home.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ module.exports = React.createClass
<hr />
<div className="introduction content-container">
<h3 className="about-project">About {@props.project.display_name}</h3>
<Markdown>{@props.project.introduction ? ''}</Markdown>
<Markdown project={@props.project}>{@props.project.introduction ? ''}</Markdown>
</div>
</div>
2 changes: 1 addition & 1 deletion app/pages/project/research.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = React.createClass
<div className="project-text-content content-container">
<div className="columns-container">
<PromiseRenderer promise={@props.project.get('pages', url_key: "science_case").index(0)}>{(science_case) =>
<Markdown className="column">{
<Markdown project={@props.project} className="column">{
if science_case?.content
science_case?.content
else
Expand Down
2 changes: 1 addition & 1 deletion app/pages/project/results.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = React.createClass
render: ->
<div className="project-text-content content-container">
<PromiseRenderer promise={@props.project.get('pages', url_key: "result").index(0)}>{(faq) =>
<Markdown className="column">{
<Markdown project={@props.project} className="column">{
if faq?.content
faq?.content
else
Expand Down
1 change: 1 addition & 0 deletions app/partials/project-page-editor.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module.exports = React.createClass
<br />
<ChangeListener target={@state.pageContent}>{ =>
<MarkdownEditor
project={@props.project}
onHelp={markdownHelp}
className="full"
name="content"
Expand Down
3 changes: 1 addition & 2 deletions app/talk/comment-box.cjsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
React = require 'react'
ToggleChildren = require './mixins/toggle-children'
Feedback = require './mixins/feedback'
CommentPreview = require './comment-preview'
CommentHelp = require './comment-help'
CommentImageSelector = require './comment-image-selector'
getSubjectLocation = require '../lib/get-subject-location'
Expand Down Expand Up @@ -82,7 +81,7 @@ module?.exports = React.createClass
<img className="talk-comment-focus-image" src={getSubjectLocation(@state.subject).src} />}

<form className="talk-comment-form" onSubmit={@onSubmitComment}>
<MarkdownEditor placeholder={@props.placeholder} className="full" value={@state.content} onChange={@onInputChange} onHelp={-> alert <CommentHelp /> }/>
<MarkdownEditor placeholder={@props.placeholder} project={@props.project} className="full" value={@state.content} onChange={@onInputChange} onHelp={-> alert <CommentHelp /> }/>

<section>
<button
Expand Down
2 changes: 1 addition & 1 deletion app/talk/comment-help.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ module?.exports = React.createClass
<h1>Guide to commenting on talk</h1>
<p>Talk comments are written in <a href='http://daringfireball.net/projects/markdown/basics'>markdown</a></p>
<p>Mention users with <em>@username</em></p>
<p>Mention subjects with <em>@owner/project^subject_id</em> or with <em>^subject_id</em> if you are inside of the subject's talk</p>
<p>Mention subjects with <em>@owner/project^S<subject_id></em> or with <em>^S<subject_id></em> if you are inside of the subject's talk</p>
<p>Create hashtags with <em>#hashtag</em></p>
</div>
5 changes: 2 additions & 3 deletions app/talk/comment.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ CommentBox = require './comment-box'
CommentReportForm = require './comment-report-form'
CommentLink = require './comment-link'
upvotedByCurrentUser = require './lib/upvoted-by-current-user'
CommentPreview = require './comment-preview'
PromiseRenderer = require '../components/promise-renderer'
{Link} = require 'react-router'
{timestamp} = require './lib/time'
Expand All @@ -17,7 +16,7 @@ Avatar = require '../partials/avatar'
SubjectViewer = require '../components/subject-viewer'
DisplayRoles = require './lib/display-roles'
merge = require 'lodash.merge'

{Markdown} = require 'markdownz'
DEFAULT_AVATAR = './assets/simple-avatar.jpg'

module?.exports = React.createClass
Expand Down Expand Up @@ -133,7 +132,7 @@ module?.exports = React.createClass
catch={null}
/>}

<CommentPreview content={@props.data.body} header={null}/>
<Markdown content={@props.data.body} project={@props.project} header={null}/>

<div className="talk-comment-links">
<button className="talk-comment-like-button" onClick={@onClickLike}>
Expand Down
2 changes: 2 additions & 0 deletions app/talk/discussion.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ module?.exports = React.createClass
comment: (data, i) ->
<Comment
{...@props}
project={@props.project}
key={data.id}
data={data}
active={+data.id is [email protected]?.comment}
Expand Down Expand Up @@ -295,6 +296,7 @@ module?.exports = React.createClass

<CommentBox
user={@props.user}
project={@props.project}
validationCheck={@commentValidations}
validationErrors={@state.commentValidationErrors}
onSubmitComment={@onSubmitComment}
Expand Down
4 changes: 2 additions & 2 deletions app/talk/search-result.cjsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
React = require 'react'
DiscussionPreview = require './discussion-preview'
CommentLink = require './comment-link'
CommentPreview = require './comment-preview'
PromiseRenderer = require '../components/promise-renderer'
parseSection = require './lib/parse-section'
apiClient = require '../api/client'
{Markdown} = require 'markdownz'

# This isn't very reuseable as it's prop is a comment resource with it's
# linked discussion added on. Probably a better way to approach this.
Expand All @@ -27,7 +27,7 @@ module.exports = React.createClass

<div className="talk-search-result talk-module">
<CommentLink comment={comment}>{comment.discussion_title}</CommentLink>
<CommentPreview content={comment.body} header={null} />
<Markdown content={comment.body} />
{if section is 'zooniverse'
<DiscussionPreview {...@props} discussion={discussion} comment={comment} />
else
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lodash.intersection": "~3.2.0",
"lodash.merge": "~2.4.1",
"lodash.pick": "~3.1.0",
"markdownz": "^1.0.0",
"markdownz": "^2.0.0",
"modal-form": "~0.0.1",
"moment": "~2.9.0",
"papaparse": "mholt/PapaParse#cada171",
Expand Down