[#369] commits index page
This commit is contained in:
parent
f1b6192c5c
commit
0c1d0fc133
|
@ -1,4 +1,6 @@
|
|||
class Projects::Git::CommitsController < Projects::Git::BaseController
|
||||
layout 'bootstrap', only: [:index]
|
||||
|
||||
def index
|
||||
if @path.present?
|
||||
@commits = @project.repo.log(@treeish, @path)
|
||||
|
|
|
@ -56,6 +56,13 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def alert_class(type)
|
||||
"alert-#{type.to_s == 'error' ? 'danger' : type}"
|
||||
case type
|
||||
when 'error'
|
||||
'alert-danger'
|
||||
when 'notice'
|
||||
'alert-success'
|
||||
else
|
||||
"alert-#{type}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
= display_meta_tags site: APP_CONFIG['project_name'], reverse: true, separator: '-'
|
||||
- if user_signed_in?
|
||||
= auto_discovery_link_tag :atom, atom_activity_feeds_path(format: 'atom', token: current_user.authentication_token), title: t("layout.atom_link_tag_title", nickname: current_user.uname, app_name: APP_CONFIG['project_name'])
|
||||
= stylesheet_link_tag 'new_application'
|
||||
|
||||
%body{ 'ng-app' => 'RosaABF', 'ng-controller' => 'RosaABFController',
|
||||
'ng-init' => "init('#{I18n.locale}', #{!!current_user.try(:sound_notifications)})" }
|
||||
|
@ -26,7 +27,6 @@
|
|||
%article.container-fluid.offset20
|
||||
= yield
|
||||
= render 'layouts/menu/new_bottom'
|
||||
= stylesheet_link_tag 'new_application'
|
||||
= javascript_include_tag 'new_application'
|
||||
- if I18n.locale == :ru
|
||||
= javascript_include_tag 'moment/ru.js'
|
||||
|
|
|
@ -6,24 +6,7 @@
|
|||
|
||||
%h3= t 'layout.projects.last_commit'
|
||||
- GitPresenters::CommitAsMessagePresenter.present(@commit, project: @project) do |presenter|
|
||||
=# render 'shared/feed_message', presenter: presenter, item_no: 1
|
||||
|
||||
.panel.panel-default
|
||||
.panel-body
|
||||
.pull-left.roffset5
|
||||
%img{ alt: 'avatar', src: presenter.image }
|
||||
.pull-left
|
||||
%strong= presenter.header
|
||||
= "(#{datetime_moment(presenter.date, tag: :strong)})".html_safe
|
||||
.clearfix
|
||||
%span= presenter.caption
|
||||
- if presenter.expandable? and presenter.content?
|
||||
%span.glyphicon.glyphicon-chevron-down{ 'data-toggle' => 'collapse', 'data-target' => '#commit_message' }
|
||||
.clearfix
|
||||
- if presenter.content?
|
||||
#commit_message.collapse
|
||||
= preserve do
|
||||
= markdown(presenter.content)
|
||||
|
||||
.panel-body= render 'shared/feed_commit', presenter: presenter, item_no: 1
|
||||
.clearfix
|
||||
= yield
|
||||
|
|
|
@ -3,16 +3,14 @@
|
|||
- counter = 1
|
||||
|
||||
- commits.each_pair do |year, by_month|
|
||||
- if year != cur_year
|
||||
.year= "#{year} #{t("layout.year")}"
|
||||
|
||||
- by_month.each_pair do |month, by_day|
|
||||
- by_day.each_pair do |day, commits|
|
||||
.date-block
|
||||
.date= raw l(commits.first.authored_date, format: :date_block_format)
|
||||
.messages
|
||||
.panel.panel-info
|
||||
.panel-heading
|
||||
%h3.panel-title= raw l(commits.first.authored_date, format: :date_block_format)
|
||||
%ul.list-group
|
||||
- commits.each_with_index do |commit|
|
||||
%li.list-group-item
|
||||
- GitPresenters::CommitAsMessagePresenter.present(commit, project: @project) do |presenter|
|
||||
= render 'shared/feed_message', presenter: presenter, item_no: counter
|
||||
= render 'shared/feed_commit', presenter: presenter, item_no: counter
|
||||
- counter += 1
|
||||
.both
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
.pagination.tmargin30
|
||||
- prev_text, next_text = t('will_paginate.previous_label'), t('will_paginate.next_label')
|
||||
%ul.pager
|
||||
- if @page == 1
|
||||
%span.previous_page.disabled= t('will_paginate.previous_label')
|
||||
%li.disabled
|
||||
%a= prev_text
|
||||
- else
|
||||
%a.previous_page{rel: "prev", href: commits_path(@project, treeish: @treeish, page: (@page - 1))}= t('will_paginate.previous_label')
|
||||
|
||||
%li
|
||||
%a{ href: commits_path(@project, treeish: @treeish, page: (@page - 1))}= prev_text
|
||||
%li
|
||||
- if @last_page
|
||||
%span.next_page.disabled= t('will_paginate.next_label')
|
||||
%a= next_text
|
||||
- else
|
||||
%a.next_page{rel: "next", href: commits_path(@project, treeish: @treeish, page: (@page + 1))}= t('will_paginate.next_label')
|
||||
%a{ href: commits_path(@project, treeish: @treeish, page: (@page + 1))}= next_text
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
-set_meta_tags title: [title_object(@project), "#{t '.title'} #{t('at') if @branch} #{@branch.try :name}"]
|
||||
= render 'submenu'
|
||||
.container
|
||||
.row
|
||||
= render 'repo_block', project: @project
|
||||
|
||||
.offset20
|
||||
= render partial: 'commits', object: @commits
|
||||
= render 'paginate' if @path.blank?
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
.pull-left.roffset5
|
||||
%img{ alt: 'avatar', src: presenter.image }
|
||||
.pull-left
|
||||
%strong= presenter.header
|
||||
= "(#{datetime_moment(presenter.date, tag: :strong)})".html_safe
|
||||
.clearfix
|
||||
%span= presenter.caption
|
||||
- if presenter.expandable? and presenter.content?
|
||||
%span.glyphicon.glyphicon-chevron-down{ 'data-toggle' => 'collapse', 'data-target' => "#commit_message_#{item_no}" }
|
||||
.clearfix
|
||||
- if presenter.content?
|
||||
.collapse{ id: "commit_message_#{item_no}" }
|
||||
= preserve do
|
||||
= markdown(presenter.content)
|
|
@ -1,4 +1,4 @@
|
|||
en:
|
||||
time:
|
||||
formats:
|
||||
date_block_format: "%B<br />%d"
|
||||
date_block_format: "%B %d, %Y"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ru:
|
||||
time:
|
||||
formats:
|
||||
date_block_format: "%d<br />%B"
|
||||
date_block_format: "%d %B, %Y"
|
||||
|
|
Loading…
Reference in New Issue