From 9dc46eee8ed31f3955f5a94731ab72e97797523a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 6 Mar 2013 22:56:48 +0200 Subject: [PATCH] Return project description back --- app/controllers/projects_controller.rb | 1 + app/views/projects/_form.html.haml | 8 ++++++++ app/views/projects/_last_commit.html.haml | 11 +++++++++++ app/views/projects/show.html.haml | 17 +++++++++++++++-- 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 app/views/projects/_last_commit.html.haml diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index f703cf6bc1d..4588536e5fc 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -59,6 +59,7 @@ class ProjectsController < ProjectResourceController format.html do if @project.repository && !@project.repository.empty? @last_push = current_user.recent_push(@project.id) + @last_commit = CommitDecorator.decorate(@project.repository.commit) render :show else render "projects/empty" diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index b78c70be18a..a7930680881 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -9,11 +9,19 @@ Project name is .input = f.text_field :name, placeholder: "Example Project", class: "xxlarge" + + - unless @repository.heads.empty? .clearfix = f.label :default_branch, "Default Branch" .input= f.select(:default_branch, @repository.heads.map(&:name), {}, style: "width:210px;") + .clearfix + = f.label :description do + Project description + %span.light (optional) + .input + = f.text_area :description, placeholder: "awesome project", class: "xxlarge", rows: 3, maxlength: 250 %fieldset.features %legend Features: diff --git a/app/views/projects/_last_commit.html.haml b/app/views/projects/_last_commit.html.haml new file mode 100644 index 00000000000..5d940417c3b --- /dev/null +++ b/app/views/projects/_last_commit.html.haml @@ -0,0 +1,11 @@ +.commit + %p + %time.committed_ago{ datetime: commit.committed_date, title: commit.committed_date.stamp("Aug 21, 2011 9:23pm") } + = time_ago_in_words(commit.committed_date) + ago +   + = commit.author_link avatar: true, size: 16 + %p + = link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id" +   + = link_to_gfm truncate(commit.title, length: 30), project_commit_path(@project, commit.id), class: "row_title" diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 2c4f55eb646..48bed5b119f 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -1,8 +1,21 @@ = render "project_head" = render 'clone_panel' = render "events/event_last_push", event: @last_push -.content_list= render @events -.loading.hide +.row + .span8 + .content_list= render @events + .loading.hide + .span4 + .ui-box.white + .padded + %h3.page_title + = @project.name + %hr + - if @project.description.present? + %p.light= @project.description + + %h5 Last commit: + = render 'last_commit', commit: @last_commit :javascript $(function(){ Pager.init(20); });