New projects page
This commit is contained in:
parent
9f1a5f415a
commit
6de7dc1e67
6 changed files with 111 additions and 77 deletions
23
app/views/projects/_show.html.haml
Normal file
23
app/views/projects/_show.html.haml
Normal file
|
@ -0,0 +1,23 @@
|
|||
%h4
|
||||
= @project.name
|
||||
%hr
|
||||
%div
|
||||
%a.btn.info{:href => tree_project_ref_path(@project, @project.root_ref)} Browse code
|
||||
|
||||
%a.btn{:href => project_commits_path(@project)} Commits
|
||||
%strong.right
|
||||
= link_to project_path(@project) do
|
||||
Switch to project →
|
||||
%hr
|
||||
.alert-message.block-message.warning
|
||||
.input
|
||||
.input-prepend
|
||||
%span.add-on git clone
|
||||
= text_field_tag :project_clone, @project.url_to_repo, :class => "xlarge one_click_select git_clone_url"
|
||||
|
||||
= simple_format @project.description
|
||||
- unless @events.blank?
|
||||
%h5.cgray Recent Activity
|
||||
.content_list= render @events
|
||||
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
- @projects.in_groups_of(3, false) do |projects|
|
||||
.row
|
||||
- projects.each_with_index do |project, i|
|
||||
%div.project_tile
|
||||
.title
|
||||
= link_to project_path(project) do
|
||||
%h3= truncate(project.name, :length => 28)
|
||||
.data
|
||||
%p
|
||||
%input{ :value => project.url_to_repo, :class => ['git-url', 'one_click_select', 'text', 'project_list_url'], :readonly => 'readonly' }
|
||||
.buttons
|
||||
%a.btn.info{:href => tree_project_ref_path(project, project.root_ref)} Browse code
|
||||
%a.btn{:href => project_commits_path(project)} Commits
|
|
@ -7,17 +7,33 @@
|
|||
New Project
|
||||
%hr
|
||||
- unless @projects.empty?
|
||||
%div.content_list= render "tile"
|
||||
.row
|
||||
.span5
|
||||
%div.content_list.projects_list
|
||||
- @projects.each do |project|
|
||||
= link_to project_path(project), :remote => true, :class => dom_class(project) do
|
||||
%h4
|
||||
%span.ico.project
|
||||
= truncate(project.name, :length => 26)
|
||||
.span11.right.show_holder
|
||||
.loading
|
||||
|
||||
-# If projects requris paging
|
||||
-# We add ajax loader & init script
|
||||
- if @projects.count == @limit
|
||||
.loading{ :style => "display:none;"}
|
||||
%center= image_tag "ajax-loader.gif"
|
||||
|
||||
:javascript
|
||||
$(function(){
|
||||
Pager.init(#{@limit});
|
||||
});
|
||||
- else
|
||||
%h2 Nothing here
|
||||
|
||||
|
||||
:javascript
|
||||
$(function(){
|
||||
$("a.project").live("ajax:before", function() {
|
||||
$(".show_holder").html("<div class='loading'>");
|
||||
$('a.project').removeClass("active");
|
||||
$(this).addClass("active");
|
||||
});
|
||||
$('a.project:first-child').trigger("click");
|
||||
});
|
||||
|
||||
- if @projects.count == @limit
|
||||
:javascript
|
||||
$(function(){
|
||||
Pager.init(#{@limit});
|
||||
});
|
||||
|
|
7
app/views/projects/show.js.haml
Normal file
7
app/views/projects/show.js.haml
Normal file
|
@ -0,0 +1,7 @@
|
|||
- if @project.repo_exists? && @project.has_commits?
|
||||
:plain
|
||||
$(".show_holder").html("#{escape_javascript(render(:partial => 'projects/show'))}");
|
||||
- else
|
||||
:plain
|
||||
$(".show_holder").html("#{escape_javascript(render(:template => 'projects/empty'))}");
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue