From 4740242a67f10749b9d8ad213d259c9f5d0eea98 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 6 Apr 2015 14:51:41 +0200 Subject: [PATCH] Change text of project creation event for imports. --- app/models/event.rb | 6 +++++- app/views/events/event/_created_project.html.haml | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/models/event.rb b/app/models/event.rb index 57f6d5cd4e0..c9a88ffa8e0 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -183,7 +183,11 @@ class Event < ActiveRecord::Base elsif commented? "commented on" elsif created_project? - "created" + if project.import? + "imported" + else + "created" + end else "opened" end diff --git a/app/views/events/event/_created_project.html.haml b/app/views/events/event/_created_project.html.haml index 3c7153d235f..552525f4a07 100644 --- a/app/views/events/event/_created_project.html.haml +++ b/app/views/events/event/_created_project.html.haml @@ -18,10 +18,10 @@ %a.twitter-share-button{ | href: "https://twitter.com/share", | "data-url" => event.project.web_url, | - "data-text" => "I just created a new project in GitLab! GitLab is version control on your server.", | + "data-text" => "I just #{event.project.imported? ? "imported" : "created"} a new project in GitLab! GitLab is version control on your server.", | "data-size" => "medium", | "data-related" => "gitlab", | "data-hashtags" => "gitlab", | "data-count" => "none"} Tweet - %script{src: "//platform.twitter.com/widgets.js"} \ No newline at end of file + %script{src: "//platform.twitter.com/widgets.js"}