Skip to content
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
16 changes: 8 additions & 8 deletions app/components/project-long-description.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,21 @@ export default Component.extend({
actions: {

/**
Action that toggles edit mode.
Action that leaves edit mode without saving changes.

@method edit
@method cancel
*/
edit() {
this._enterEditMode();
cancel() {
this._enterReadMode();
},

/**
Action that leaves edit mode without saving changes.
Action that toggles edit mode.

@method cancel
@method edit
*/
cancel() {
this._enterReadMode();
edit() {
this._enterEditMode();
},

/**
Expand Down
2 changes: 1 addition & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width,initial-scale=1.0">

<link rel="icon" href="https://d3pgew4wbk2vb1.cloudfront.net/icons/favicon.png">
<link rel="icon" href="https://d3pgew4wbk2vb1.cloudfront.net/icons/favicon-32.png" sizes="32x32">
Expand Down
2 changes: 1 addition & 1 deletion app/styles/components/project-long-description.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
margin-top: 10px;
margin-bottom: 10px;

button.save {
.actions {
float: right;
}
}
Expand Down
1 change: 1 addition & 0 deletions app/templates/components/editor-with-preview.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{{#if editing}}
<div class="input-group">
{{submittable-textarea
autoresize=true
classNameBindings="textareaFocused:focused"
max-height=350
modifiedSubmit="modifiedSubmit"
Expand Down
79 changes: 44 additions & 35 deletions app/templates/components/project-long-description.hbs
Original file line number Diff line number Diff line change
@@ -1,46 +1,55 @@
{{#if descriptionIsBlank}}
<div class="long-description empty">
<div class="long-description-inner">
{{#if (can "manage project" project)}}
<div class="no-description user-can-add">
<h3>Add your project description.</h3>
<div class="box-icon"></div>
<p>Let's add some detailed information about your project:</p>
<ul>
<li>What do you hope to accomplish?</li>
<li>What real problem is this solving?</li>
<li>What kind of support will you need, both right now and in the future?</li>
<li>What risks and challenges will you face?</li>
</ul>
</div>
{{else}}
<div class="no-description user-cannot-add">
<h3>Nothing to see here!</h3>
<div class="box-icon"></div>
<p>Looks like this project is still getting set up!</p>
</div>
{{/if}}
</div>
</div>
{{else}}
<div class="long-description">
{{#unless inEditMode}}
<div class="long-description-header">
<h3>About this project</h3>
{{#unless isEditing}}
{{#if descriptionIsBlank}}
<div class="long-description empty">
<div class="long-description-inner">
{{#if (can "manage project" project)}}
<button class="clear small" name="edit" {{action 'edit'}}>Edit description</button>
<div class="no-description user-can-add">
<h3>Add your project description.</h3>
<div class="box-icon"></div>
<p>Let's add some detailed information about your project:</p>
<ul>
<li>What do you hope to accomplish?</li>
<li>What real problem is this solving?</li>
<li>What kind of support will you need, both right now and in the future?</li>
<li>What risks and challenges will you face?</li>
</ul>
</div>
{{else}}
<div class="no-description user-cannot-add">
<h3>Nothing to see here!</h3>
<div class="box-icon"></div>
<p>Looks like this project is still getting set up!</p>
</div>
{{/if}}
</div>
{{{project.longDescriptionBody}}}
{{/unless}}
</div>
{{/if}}
</div>
{{else}}
<div class="long-description">
{{#unless inEditMode}}
<div class="long-description-header">
<h3>About this project</h3>
{{#if (can "manage project" project)}}
<button class="clear small" name="edit" {{action 'edit'}}>Edit description</button>
{{/if}}
</div>
{{{project.longDescriptionBody}}}
{{/unless}}
</div>
{{/if}}
{{/unless}}

{{#if (can "manage project" project)}}
{{#if shouldDisplayEditor}}
<div class="long-description-editor">
{{editor-with-preview input=project.longDescriptionMarkdown isLoading=project.isSaving modifiedSubmit="save"}}
<button class="default save" name="save" {{action 'save'}}>Save description</button>
{{log project.errors.longDescriptionMarkdown}}
{{#each project.errors.longDescriptionMarkdown as |error|}}
<p class="error">{{error.message}}</p>
{{/each}}
<div class="actions">
<button class="clear" name="cancel" {{action 'cancel'}}>Cancel</button>
<button class="default save" name="save" {{action 'save'}}>Save description</button>
</div>
</div>
{{/if}}
{{/if}}