Skip to content

Add wiki templates

What does this MR do?

It adds Wiki Templates as proposed in https://gitlab.com/gitlab-org/gitlab-ce/issues/25182 by making WikiPage a little similar to an Issuable (MergeRequest and Issue) and reusing the Issuable's templating logic existing code. As @smcgivern commented out https://gitlab.com/gitlab-org/gitlab-ce/issues/25182#note_20543250 the templates goes into the wiki's repo inside .gitlab/wiki_templates folder.

Are there points in the code the reviewer needs to double check?

Some thoughts that crossed my mind while I was coding:

  • Extracting another module (probably called Templatable) from Issuable maybe better semantically due WikiPage not being an Issuable
  • Extracting copy_wiki_repo and copy_repo similarities into a better method.
  • I'm pretty sure format isn't the best label for template and markdown.

Why was this MR needed?

Because it's a step to enhance built-in wiki functionality.

Screenshots

Before

Screen_Shot_2017-01-07_at_7.46.47_PM

After

Edit

New without template files

new_no_template

New with template and small

Screen_Shot_2017-01-14_at_9.24.47_PM

New with template and medium

Screen_Shot_2017-01-14_at_9.24.32_PM

New with template and large

Screen_Shot_2017-01-14_at_9.24.17_PM

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/25182

Merge request reports