Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2014-09-20 19:09:20 +0400
committerRobert Schilling <rschilling@student.tugraz.at>2014-09-20 19:09:20 +0400
commit8fd0d74bd84a8424e8c2f5e131efdb737f21a1f9 (patch)
treef3081bec920e6faeef1bfb68acc65de805efb6a8
parent82956a03c7394c31001190d85a8e8a641c52dcba (diff)
parentadaec60a5014c0386fa5e9f859d39461e7f6e9fe (diff)
Merge pull request #7801 from cirosantilli/dry-zen-view
Factor zen mode.
-rw-r--r--app/assets/stylesheets/generic/issuable.scss9
-rw-r--r--app/views/projects/_issuable_form.html.haml8
-rw-r--r--app/views/projects/_zen.html.haml7
-rw-r--r--app/views/projects/merge_requests/_new_submit.html.haml8
-rw-r--r--app/views/projects/notes/_form.html.haml9
5 files changed, 22 insertions, 19 deletions
diff --git a/app/assets/stylesheets/generic/issuable.scss b/app/assets/stylesheets/generic/issuable.scss
new file mode 100644
index 00000000000..f456b3ace1a
--- /dev/null
+++ b/app/assets/stylesheets/generic/issuable.scss
@@ -0,0 +1,9 @@
+/**
+ * Styles that apply to both issues and merge requests.
+ */
+
+.issue-form, .merge-request-form {
+ .description {
+ height: 20em;
+ }
+}
diff --git a/app/views/projects/_issuable_form.html.haml b/app/views/projects/_issuable_form.html.haml
index 402cdb44182..824460e7fed 100644
--- a/app/views/projects/_issuable_form.html.haml
+++ b/app/views/projects/_issuable_form.html.haml
@@ -7,12 +7,8 @@
.form-group.issuable-description
= f.label :description, 'Description', class: 'control-label'
.col-sm-10
- .zennable
- %input#zen-toggle-comment{ tabindex: '-1', type: 'checkbox' }
- .zen-backdrop
- = f.text_area :description, rows: 14, class: 'form-control js-gfm-input markdown-area', placeholder: 'Leave a comment'
- %label{ for: 'zen-toggle-comment', class: 'expand' } Edit in fullscreen
- %label{ for: 'zen-toggle-comment', class: 'collapse' }
+ = render 'projects/zen', f: f, attr: :description,
+ classes: 'description form-control'
.col-sm-12.hint
.pull-left
Parsed with
diff --git a/app/views/projects/_zen.html.haml b/app/views/projects/_zen.html.haml
new file mode 100644
index 00000000000..2bbc49e8eb5
--- /dev/null
+++ b/app/views/projects/_zen.html.haml
@@ -0,0 +1,7 @@
+.zennable
+ %input#zen-toggle-comment{ tabindex: '-1', type: 'checkbox' }
+ .zen-backdrop
+ - classes << ' js-gfm-input markdown-area'
+ = f.text_area attr, class: classes, placeholder: 'Leave a comment'
+ %label{ for: 'zen-toggle-comment', class: 'expand' } Edit in fullscreen
+ %label{ for: 'zen-toggle-comment', class: 'collapse' }
diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml
index 657a77eb758..64fc0160926 100644
--- a/app/views/projects/merge_requests/_new_submit.html.haml
+++ b/app/views/projects/merge_requests/_new_submit.html.haml
@@ -21,12 +21,8 @@
.form-group
.light
= f.label :description, "Description"
- .zennable
- %input#zen-toggle-comment{ tabindex: '-1', type: 'checkbox' }
- .zen-backdrop
- = f.text_area :description, class: 'form-control js-gfm-input markdown-area', rows: 10, placeholder: 'Leave a comment'
- %label{ for: 'zen-toggle-comment', class: 'expand' } Edit in fullscreen
- %label{ for: 'zen-toggle-comment', class: 'collapse' }
+ = render 'projects/zen', f: f, attr: :description,
+ classes: 'description form-control'
.clearfix.hint
.pull-left Description is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}.
.pull-right Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }.
diff --git a/app/views/projects/notes/_form.html.haml b/app/views/projects/notes/_form.html.haml
index 66b79e5026b..65d7f081545 100644
--- a/app/views/projects/notes/_form.html.haml
+++ b/app/views/projects/notes/_form.html.haml
@@ -14,13 +14,8 @@
Preview
%div
.note-write-holder
- .zennable
- %input#zen-toggle-comment{ tabindex: '-1', type: 'checkbox' }
- .zen-backdrop
- = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input markdown-area', placeholder: 'Leave a comment'
- %label{ for: 'zen-toggle-comment', class: 'expand' } Edit in fullscreen
- %label{ for: 'zen-toggle-comment', class: 'collapse' }
-
+ = render 'projects/zen', f: f, attr: :note,
+ classes: 'note_text js-note-text'
.light.clearfix
.pull-left Comments are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"),{ target: '_blank', tabindex: -1 }}
.pull-right Attach images (JPG, PNG, GIF) by dragging &amp; dropping or #{link_to "selecting them", '#', class: 'markdown-selector', tabindex: -1 }.