From ba6ac249d1e4d72e807c802548d829ab11cdef3b Mon Sep 17 00:00:00 2001 From: Johannes Schleifenbaum Date: Sat, 8 Dec 2012 10:56:46 +0100 Subject: [PATCH] added about page --- .../gitlab_bootstrap/typography.scss | 6 ++ app/controllers/about_controller.rb | 13 ++++ app/helpers/application_helper.rb | 1 + app/views/about/index.html.haml | 61 +++++++++++++++++ app/views/dashboard/_sidebar.html.haml | 1 + app/views/help/_help_pages.html.haml | 66 +++++++++++++++++++ app/views/help/index.html.haml | 66 +------------------ app/views/layouts/_head_panel.html.haml | 3 + app/views/layouts/application.html.haml | 4 +- config/gitlab.yml.example | 3 + config/initializers/1_settings.rb | 2 + config/routes.rb | 5 ++ features/dashboard/active_tab.feature | 6 +- .../steps/dashboard/dashboard_active_tab.rb | 4 ++ features/steps/shared/paths.rb | 4 ++ spec/routing/routing_spec.rb | 7 ++ 16 files changed, 182 insertions(+), 70 deletions(-) create mode 100644 app/controllers/about_controller.rb create mode 100644 app/views/about/index.html.haml create mode 100644 app/views/help/_help_pages.html.haml diff --git a/app/assets/stylesheets/gitlab_bootstrap/typography.scss b/app/assets/stylesheets/gitlab_bootstrap/typography.scss index e74a0de125b..2411ac0d9d1 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/typography.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/typography.scss @@ -26,6 +26,12 @@ pre { &.dark { background: #333; color: #f5f5f5; + a { + color: #E1E1E1; + &:hover { + color: #fff; + } + } } } diff --git a/app/controllers/about_controller.rb b/app/controllers/about_controller.rb new file mode 100644 index 00000000000..8ef3ab78b9d --- /dev/null +++ b/app/controllers/about_controller.rb @@ -0,0 +1,13 @@ +class AboutController < ApplicationController + def index + + # check Gitolite version + gitolite_home = File.expand_path("~#{Gitlab.config.gitolite.ssh_user}") + gitolite_version_file = "#{gitolite_home}/gitolite/src/VERSION" + @gitolite_version = if File.exists?(gitolite_version_file) && File.readable?(gitolite_version_file) + File.read(gitolite_version_file) + end + @gitolite_version ||= "unknown" + + end +end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6478982cdad..c6af559ea3c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -80,6 +80,7 @@ module ApplicationHelper { label: "My SSH Keys", url: keys_path }, { label: "My Dashboard", url: root_path }, { label: "Admin Section", url: admin_root_path }, + { label: "About GitLab", url: about_path }, ] help_nav = [ diff --git a/app/views/about/index.html.haml b/app/views/about/index.html.haml new file mode 100644 index 00000000000..a2ca1e2b416 --- /dev/null +++ b/app/views/about/index.html.haml @@ -0,0 +1,61 @@ +%p.lead You are using GitLab. GitLab is an open source code hosting solution built around Git. + + + +%h2 About this Installation + +%div.row + - unless Gitlab.config.gitlab.admin_email.empty? + %div.span3 + %p Admin E-Mail: + %pre.dark #{mail_to(Gitlab.config.gitlab.admin_email)} + %div.span3 + %p GitLab Version: + %pre.dark #{link_to "#{Gitlab::Version.squish}@#{Gitlab::Revision}", "https://github.com/gitlabhq/gitlabhq/commit/#{Gitlab::Revision}"} + %div.span3 + %p Gitolite Version: + %pre.dark #{@gitolite_version} + %div.span3 + %p Ruby Version: + %pre.dark #{RUBY_ENGINE}-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} + + + +%h2 Getting Help + +=render 'help/help_pages' + + + +%h2 Help us make GitLab more awesome + +#contribute.accordion + .accordion-group + .accordion-heading + %a.accordion-toggle{"data-parent" => "#contribute", "data-toggle" => "collapse", :href => "#contribute_content"} + Contribution Guide + #contribute_content.accordion-body.collapse + .accordion-inner + .file_content.wiki + = preserve do + = markdown File.read(Rails.root.join("CONTRIBUTING.md")) + + + +%h2 About GitLab + +%p Fast, secure and stable solution based on Rails & Gitolite. Free and open-source. Distributed under the MIT License. + +%div.row + %div.span3 + %p Visit the official Website: + %pre.dark #{link_to "gitlabhq.com", 'http://gitlabhq.com/'} + %div.span3 + %p Follow us on Twitter: + %pre.dark #{link_to "GitLab @ twitter", 'https://twitter.com/gitlabhq'} + %div.span3 + %p Visit the Support Forum: + %pre.dark #{link_to "GitLab @ Google Groups", 'https://groups.google.com/forum/#!forum/gitlabhq'} + %div.span3 + %p Browse the known issues: + %pre.dark #{link_to "GitLab @ GitHub", 'https://github.com/gitlabhq/gitlabhq'} diff --git a/app/views/dashboard/_sidebar.html.haml b/app/views/dashboard/_sidebar.html.haml index 9830cdf4f6b..6256e1bfeb7 100644 --- a/app/views/dashboard/_sidebar.html.haml +++ b/app/views/dashboard/_sidebar.html.haml @@ -12,3 +12,4 @@ = link_to "Homepage", "http://gitlab.org" = link_to "Blog", "http://blog.gitlab.org" = link_to "@gitlabhq", "https://twitter.com/gitlabhq" + = link_to "About GitLab", about_path diff --git a/app/views/help/_help_pages.html.haml b/app/views/help/_help_pages.html.haml new file mode 100644 index 00000000000..2d2236ef69d --- /dev/null +++ b/app/views/help/_help_pages.html.haml @@ -0,0 +1,66 @@ +.row + .span4 + .ui-box + .title + %h5 Quick help + %ul.well-list + %li + Email your + = mail_to Gitlab.config.gitlab.support_email, "support contact" + %li + Use the + = link_to "search bar", '#', onclick: "$("#search").focus();" + on the top of this page + %li + Ask in our + = link_to "support forum", "https://groups.google.com/forum/#!forum/gitlabhq" + %li + Browse our + = link_to "issue tracker", "https://github.com/gitlabhq/gitlabhq/issues" + .span4 + .ui-box + .title + %h5 User documentation + %ul.well-list + %li + %strong= link_to "Workflow", help_workflow_path + %p Learn how to use Git and GitLab together. + + %li + %strong= link_to "SSH keys", help_ssh_path + %p Setup secure access to your projects. + + %li + %strong= link_to "GitLab Markdown", help_markdown_path + %p Learn what you can do with GitLab's advanced formatting system. + + %li + %strong= link_to "Permissions", help_permissions_path + %p Get familiar with GitLab's permission levels. + + %li + %strong= link_to "API", help_api_path + %p Explore how you can access GitLab via a simple and powerful API. + + %li + %strong= link_to "Web Hooks", help_web_hooks_path + %p Let GitLab notify you when new code has been pushed to your project. + + .span4 + .ui-box + .title + %h5 Admin documentation + %ul.well-list + + %li + %strong= link_to "Rake Tasks", help_raketasks_path + %p Explore what GitLab has in store for you to make administration easier. + + %li + %strong= link_to "System Hooks", help_system_hooks_path + %p Let GitLab notify you when certain management tasks need to be carried out. + + %li + %strong= link_to "Public Access", help_public_access_path + %p Learn how you can allow public access to a project. + diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index 28791b321f1..0386e993ff6 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -11,68 +11,4 @@ %br -.row - .span4 - .ui-box - .title - %h5 Quick help - %ul.well-list - %li - Email your - = mail_to Gitlab.config.gitlab.support_email, "support contact" - %li - Use the - = link_to "search bar", '#', onclick: "$("#search").focus();" - on the top of this page - %li - Ask in our - = link_to "support forum", "https://groups.google.com/forum/#!forum/gitlabhq" - %li - Browse our - = link_to "issue tracker", "https://github.com/gitlabhq/gitlabhq/issues" - .span4 - .ui-box - .title - %h5 User documentation - %ul.well-list - %li - %strong= link_to "Workflow", help_workflow_path - %p Learn how to use Git and GitLab together. - - %li - %strong= link_to "SSH keys", help_ssh_path - %p Setup secure access to your projects. - - %li - %strong= link_to "GitLab Markdown", help_markdown_path - %p Learn what you can do with GitLab's advanced formatting system. - - %li - %strong= link_to "Permissions", help_permissions_path - %p Get familiar with GitLab's permission levels. - - %li - %strong= link_to "API", help_api_path - %p Explore how you can access GitLab via a simple and powerful API. - - %li - %strong= link_to "Web Hooks", help_web_hooks_path - %p Let GitLab notify you when new code has been pushed to your project. - - .span4 - .ui-box - .title - %h5 Admin documentation - %ul.well-list - - %li - %strong= link_to "Rake Tasks", help_raketasks_path - %p Explore what GitLab has in store for you to make administration easier. - - %li - %strong= link_to "System Hooks", help_system_hooks_path - %p Let GitLab notify you when certain management tasks need to be carried out. - - %li - %strong= link_to "Public Access", help_public_access_path - %p Learn how you can allow public access to a project. += render 'help_pages' \ No newline at end of file diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index f4b2228a41b..a28a8ce3dcf 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -19,6 +19,9 @@ %li = link_to profile_path, title: "Your Profile", class: 'has_bottom_tooltip', 'data-original-title' => 'Your profile' do %i.icon-user + %li + = link_to about_path, title: "About GitLab", class: 'has_bottom_tooltip', 'data-original-title' => 'About GitLab' do + %i.icon-question-sign %li.separator %li = render "layouts/search" diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 88da5c98c78..1b5adb8440d 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -18,7 +18,7 @@ %span.count= current_user.cared_merge_requests.opened.count = nav_link(path: 'search#show') do = link_to "Search", search_path - = nav_link(controller: :help) do - = link_to "Help", help_path + = nav_link(path: 'about#index') do + = link_to "About GitLab", about_path .content= yield diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 26bd0696946..fb2a4eb660e 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -28,6 +28,9 @@ gitlab: ## Email settings # Email address used in the "From" field in mails sent by GitLab email_from: gitlab@localhost + # Will be displayed on the about page + admin_email: admin@localhost + support_email: support@localhost ## Project settings default_projects_limit: 10 diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 4e31b65fab0..37c11a05035 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -49,6 +49,8 @@ Settings.gitlab['port'] ||= Settings.gitlab.https ? 443 : 80 Settings.gitlab['relative_url_root'] ||= '' Settings.gitlab['protocol'] ||= Settings.gitlab.https ? "https" : "http" Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}" +Settings.gitlab['support_email'] ||= "" +Settings.gitlab['admin_email'] ||= "" Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url) Settings.gitlab['user'] ||= 'gitlab' Settings.gitlab['signup_enabled'] ||= false diff --git a/config/routes.rb b/config/routes.rb index 00ff3f63752..22119a1c5b8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -45,6 +45,11 @@ Gitlab::Application.routes.draw do root to: "projects#index" end + # + # About + # + get 'about' => 'about#index' + # # Admin Area # diff --git a/features/dashboard/active_tab.feature b/features/dashboard/active_tab.feature index 6715ea269c7..eb56dd954b9 100644 --- a/features/dashboard/active_tab.feature +++ b/features/dashboard/active_tab.feature @@ -22,7 +22,7 @@ Feature: Dashboard active tab Then the active main tab should be Search And no other main tabs should be active - Scenario: On Dashboard Help - Given I visit dashboard help page - Then the active main tab should be Help + Scenario: On Dashboard About GitLab + Given I visit dashboard about page + Then the active main tab should be About GitLab And no other main tabs should be active diff --git a/features/steps/dashboard/dashboard_active_tab.rb b/features/steps/dashboard/dashboard_active_tab.rb index 41ecc48c0d3..9aaf46183c5 100644 --- a/features/steps/dashboard/dashboard_active_tab.rb +++ b/features/steps/dashboard/dashboard_active_tab.rb @@ -22,4 +22,8 @@ class DashboardActiveTab < Spinach::FeatureSteps Then 'the active main tab should be Help' do ensure_active_main_tab('Help') end + + Then 'the active main tab should be About GitLab' do + ensure_active_main_tab('About GitLab') + end end diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index c046c4e63e6..5e78f2cc176 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -49,6 +49,10 @@ module SharedPaths visit help_path end + Given 'I visit dashboard about page' do + visit about_path + end + # ---------------------------------------- # Profile # ---------------------------------------- diff --git a/spec/routing/routing_spec.rb b/spec/routing/routing_spec.rb index 57fd70e7497..e1b301f28d3 100644 --- a/spec/routing/routing_spec.rb +++ b/spec/routing/routing_spec.rb @@ -72,6 +72,13 @@ describe HelpController, "routing" do end end +# about GET /about(.:format) about#index +describe AboutController, "routing" do + it "to #index" do + get("/about").should route_to('about#index') + end +end + # errors_githost GET /errors/githost(.:format) errors#githost describe ErrorsController, "routing" do it "to #githost" do -- GitLab