PageRenderTime 49ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/gitlab/email/message/in_product_marketing/create.rb

https://gitlab.com/aarongraham9/gitlab-ce
Ruby | 105 lines | 100 code | 4 blank | 1 comment | 1 complexity | 25cb7cbc0d69eac1cbad08729ade0d21 MD5 | raw file
  1. # frozen_string_literal: true
  2. module Gitlab
  3. module Email
  4. module Message
  5. module InProductMarketing
  6. class Create < Base
  7. def subject_line
  8. [
  9. s_('InProductMarketing|Create a project in GitLab in 5 minutes'),
  10. s_('InProductMarketing|Import your project and code from GitHub, Bitbucket and others'),
  11. s_('InProductMarketing|Understand repository mirroring')
  12. ][series]
  13. end
  14. def tagline
  15. [
  16. s_('InProductMarketing|Get started today'),
  17. s_('InProductMarketing|Get our import guides'),
  18. s_('InProductMarketing|Need an alternative to importing?')
  19. ][series]
  20. end
  21. def title
  22. [
  23. s_('InProductMarketing|Take your first steps with GitLab'),
  24. s_('InProductMarketing|Start by importing your projects'),
  25. s_('InProductMarketing|How (and why) mirroring makes sense')
  26. ][series]
  27. end
  28. def subtitle
  29. [
  30. s_('InProductMarketing|Dig in and create a project and a repo'),
  31. s_("InProductMarketing|Here's what you need to know"),
  32. s_('InProductMarketing|Try it out')
  33. ][series]
  34. end
  35. def body_line1
  36. [
  37. s_("InProductMarketing|To understand and get the most out of GitLab, start at the beginning and %{project_link}. In GitLab, repositories are part of a project, so after you've created your project you can go ahead and %{repo_link}.") % { project_link: project_link, repo_link: repo_link },
  38. s_("InProductMarketing|Making the switch? It's easier than you think to import your projects into GitLab. Move %{github_link}, or import something %{bitbucket_link}.") % { github_link: github_link, bitbucket_link: bitbucket_link },
  39. s_("InProductMarketing|Sometimes you're not ready to make a full transition to a new tool. If you're not ready to fully commit, %{mirroring_link} gives you a safe way to try out GitLab in parallel with your current tool.") % { mirroring_link: mirroring_link }
  40. ][series]
  41. end
  42. def body_line2
  43. [
  44. s_("InProductMarketing|That's all it takes to get going with GitLab, but if you're new to working with Git, check out our %{basics_link} for helpful tips and tricks for getting started.") % { basics_link: basics_link },
  45. s_("InProductMarketing|Have a different instance you'd like to import? Here's our %{import_link}.") % { import_link: import_link },
  46. s_("InProductMarketing|It's also possible to simply %{external_repo_link} in order to take advantage of GitLab's CI/CD.") % { external_repo_link: external_repo_link }
  47. ][series]
  48. end
  49. def cta_text
  50. [
  51. s_('InProductMarketing|Create your first project!'),
  52. s_('InProductMarketing|Master the art of importing!'),
  53. s_('InProductMarketing|Understand your project options')
  54. ][series]
  55. end
  56. def invite_members?
  57. user.can?(:admin_group_member, group)
  58. end
  59. private
  60. def project_link
  61. link(s_('InProductMarketing|create a project'), help_page_url('gitlab-basics/create-project'))
  62. end
  63. def repo_link
  64. link(s_('InProductMarketing|set up a repo'), help_page_url('user/project/repository/index', anchor: 'create-a-repository'))
  65. end
  66. def github_link
  67. link(s_('InProductMarketing|GitHub Enterprise projects to GitLab'), help_page_url('integration/github'))
  68. end
  69. def bitbucket_link
  70. link(s_('InProductMarketing|from Bitbucket'), help_page_url('user/project/import/bitbucket_server'))
  71. end
  72. def mirroring_link
  73. link(s_('InProductMarketing|repository mirroring'), help_page_url('user/project/repository/repository_mirroring'))
  74. end
  75. def basics_link
  76. link(s_('InProductMarketing|Git basics'), help_page_url('gitlab-basics/index'))
  77. end
  78. def import_link
  79. link(s_('InProductMarketing|comprehensive guide'), help_page_url('user/project/import/index'))
  80. end
  81. def external_repo_link
  82. link(s_('InProductMarketing|connect an external repository'), new_project_url(anchor: 'cicd_for_external_repo'))
  83. end
  84. end
  85. end
  86. end
  87. end
  88. end