diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index db077048b6cf8283420984a9caf1acb8eaf7f7de..5de76d7d28df829a16b424589bdbb372fa06e612 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -484,13 +484,6 @@ li.note { margin-right: 12px; } -.gitlab-promo { - a { - color: #aaa; - margin-right: 30px; - } -} - pre { &.clean { background: none; diff --git a/app/assets/stylesheets/gitlab_bootstrap/typography.scss b/app/assets/stylesheets/gitlab_bootstrap/typography.scss index e74a0de125bedfe09942352c434df1bd193a11e1..2411ac0d9d12eaa91345f062ba20917b616373f5 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 0000000000000000000000000000000000000000..f16e83a59f2e74849ddc479de6a91ad1538e17f1 --- /dev/null +++ b/app/controllers/about_controller.rb @@ -0,0 +1,11 @@ +class AboutController < ApplicationController + + layout 'about' + + def index + @contribution_guide = File.read(Rails.root.join("CONTRIBUTING.md")) + @gitlab_version = "#{Gitlab::Version.squish}@#{Gitlab::Revision}" + @gitolite_version = Gitlab::Gitolite.version + @ruby_version = "#{RUBY_ENGINE}-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" + end +end diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index b22280d2fd202e9edd25bb6c1382e0b49d3b631d..28596b428a291bf8b0a51702ec1ff4b47ac5a4e2 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -1,4 +1,3 @@ class HelpController < ApplicationController - def index - end + layout 'about' end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6478982cdad3737a1a5957c7695f1225c98808fc..c6af559ea3c598c9feade7f969241ba2d8003f79 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 0000000000000000000000000000000000000000..e221ef512d5d62f587428bc9e68dbece1e95b237 --- /dev/null +++ b/app/views/about/index.html.haml @@ -0,0 +1,57 @@ +%section + %h2 You are using GitLab + %p + GitLab is a fast, secure and stable open source code hosting solution built on Ruby on Rails & Gitolite. + It's distributed under the MIT License. + + .row + .span4 + %strong GitLab version: + %pre= @gitlab_version + .span4 + %strong Gitolite version: + %pre= @gitolite_version + .span4 + %strong Ruby version: + %pre= @ruby_version + +%section + %h3 Getting Help + + =render 'help/help_pages' + + + +%section.row + .span12 + %h3 Help us make GitLab more awesome + + .span8 + .file_holder + .file_content.wiki + = preserve do + = markdown @contribution_guide + + .span4 + .ui-box + .title + %h5 Find us on the internet + %ul.well-list + %li + Visit our website + = link_to "gitlabhq.com", "http://gitlabhq.com/" + %li + Reach out to + = link_to "@gitlabhq", "https://twitter.com/gitlabhq" + on + %i.icon-twitter + Twitter + %li + Join the + = link_to "Support Forum", "https://groups.google.com/forum/#!forum/gitlabhq" + %li + Fork us on + = link_to "https://github.com/gitlabhq/gitlabhq" do + %i.icon-github + GitHub + diff --git a/app/views/dashboard/_sidebar.html.haml b/app/views/dashboard/_sidebar.html.haml index 9830cdf4f6b85ee1d1d46116edd240a7945c02e3..b00a9c8232fe034405053ff3136496f4f39097d4 100644 --- a/app/views/dashboard/_sidebar.html.haml +++ b/app/views/dashboard/_sidebar.html.haml @@ -7,8 +7,3 @@ = image_tag "rss_ui.png", title: "feed" %strong News Feed -%hr -.gitlab-promo - = link_to "Homepage", "http://gitlab.org" - = link_to "Blog", "http://blog.gitlab.org" - = link_to "@gitlabhq", "https://twitter.com/gitlabhq" diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index 84dd17c045deb11ca973a407578360e66e791ea1..914d778208a925b59f6b72e7d316601ab106aad3 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -19,11 +19,5 @@ = image_tag "rss_ui.png", title: "feed" %strong News Feed - %hr - .gitlab-promo - = link_to "Homepage", "http://gitlabhq.com" - = link_to "Blog", "http://blog.gitlabhq.com" - = link_to "@gitlabhq", "https://twitter.com/gitlabhq" - :javascript $(function(){ Pager.init(20, true); }); diff --git a/app/views/help/index.html.haml b/app/views/help/_help_pages.html.haml similarity index 90% rename from app/views/help/index.html.haml rename to app/views/help/_help_pages.html.haml index 28791b321f1e1808b87a18ba06406ac3f3101b0e..4e7c4a119f431364a0a4cd18cd7c48be83055af8 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/_help_pages.html.haml @@ -1,16 +1,3 @@ -%h3.page_title - GITLAB - .right - %span= Gitlab::Version - %small= Gitlab::Revision -%hr -%p.lead - Self Hosted Git Management - %br - Fast, secure and stable solution based on Ruby on Rails & Gitolite. - -%br - .row .span4 .ui-box diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index f4b2228a41babd38710f022486a7a406c4b46918..a28a8ce3dcf0cdfa2d52cc1267df2b508caa1076 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/about.html.haml b/app/views/layouts/about.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..417074fdba8238ee0f651f054bbbb948b9a45192 --- /dev/null +++ b/app/views/layouts/about.html.haml @@ -0,0 +1,24 @@ +!!! 5 +%html{ lang: "en"} + = render "layouts/head", title: "About GitLab" + %body{class: "#{app_theme} application"} + = render "layouts/flash" + = render "layouts/head_panel", title: "About GitLab" + .container + %ul.main_menu + = nav_link(path: 'dashboard#index', html_options: {class: 'home'}) do + = link_to "Home", root_path, title: "Home" + = nav_link(path: 'dashboard#issues') do + = link_to dashboard_issues_path do + Issues + %span.count= current_user.assigned_issues.opened.count + = nav_link(path: 'dashboard#merge_requests') do + = link_to dashboard_merge_requests_path do + Merge Requests + %span.count= current_user.cared_merge_requests.opened.count + = nav_link(path: 'search#show') do + = link_to "Search", search_path + = nav_link(path: 'about#index') do + = link_to "About GitLab", about_path + + .content= yield diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 88da5c98c78e0a5873d5a1d61ba71d2a44cd5595..1b5adb8440dc9b349a85e08b76a5b378d6f43c37 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 26bd0696946c9f408003f62c9aa5ecdd7f8d70ee..aca9935ba5f6dae18c7559baf800964373915f90 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -28,6 +28,8 @@ gitlab: ## Email settings # Email address used in the "From" field in mails sent by GitLab email_from: gitlab@localhost + # Email address of your support contanct (default: same as email_from) + 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 4e31b65fab0e9d4a362aa18f3d6345da2ea66f5f..a1afa5b22c4f434b5fd1ff65ace51c387f7fa307 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -49,6 +49,7 @@ 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.email_from 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 00ff3f637521a792ab603588a3cc85ae545a080f..b31bd003033d4789b784e21b34c884de15e775f9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -26,7 +26,7 @@ Gitlab::Application.routes.draw do # # Help # - get 'help' => 'help#index' + get 'help' => 'about#index' get 'help/api' => 'help#api' get 'help/markdown' => 'help#markdown' get 'help/permissions' => 'help#permissions' @@ -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 6715ea269c7cc8fd06660d2918bee01a0bda87f3..eb56dd954b926ad8f8d20f449c0e429d7ab531e9 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 41ecc48c0d3e7b1d50c22bd631a03dbaee546e74..9aaf46183c59b4c751f7e5793522817e1a465587 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 c046c4e63e68f3100b0636bc351029026972f9d1..5e78f2cc176de2af5f00d027fffe467aaaf72a43 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/lib/gitlab/backend/gitolite.rb b/lib/gitlab/backend/gitolite.rb index 3b8a2090f737a072d1fe9c984e609a842bdaa836..d99dc56153acfba46923977758006abb2fec204a 100644 --- a/lib/gitlab/backend/gitolite.rb +++ b/lib/gitlab/backend/gitolite.rb @@ -51,6 +51,19 @@ module Gitlab end end + class << self + def version + return @gitolite_version if @gitolite_version + + gitolite_user_home = File.expand_path("~#{Gitlab.config.gitolite.ssh_user}") + gitolite_version_file = "#{gitolite_user_home}/gitolite/src/VERSION" + @gitolite_version = if File.readable?(gitolite_version_file) + File.read(gitolite_version_file) + end + @gitolite_version ||= "unknown" + end + end + alias_method :create_repository, :update_repository end end diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake index 826b78ec5b1bc8ff175efa78704215aab5f773ba..66ba31e80ccfb64836affd6ede5b27bc3c5cd34f 100644 --- a/lib/tasks/gitlab/check.rake +++ b/lib/tasks/gitlab/check.rake @@ -859,10 +859,7 @@ namespace :gitlab do end def gitolite_version - gitolite_version_file = "#{gitolite_user_home}/gitolite/src/VERSION" - if File.readable?(gitolite_version_file) - File.read(gitolite_version_file) - end + Gitlab::Gitolite.version end def has_gitolite3? diff --git a/spec/routing/routing_spec.rb b/spec/routing/routing_spec.rb index 57fd70e7497cd912e774b7a011c617f7ca7d5faa..e1b301f28d3c93e1d7a0b3339b10ea799035cee9 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