Snippets - fixed after bootstrap

Project - restyled show page, removed info page
Repository - restyled show page, added download option
Tags - added download options
This commit is contained in:
Dmitriy Zaporozhets 2012-02-08 01:00:49 +02:00
parent 3d77183c16
commit 4d89322d67
37 changed files with 298 additions and 333 deletions

View file

@ -0,0 +1,44 @@
var Pager = {
ref:null,
limit:0,
offset:0,
init:
function(ref, limit) {
this.ref=ref;
this.limit=limit;
this.offset=limit;
this.initLoadMore();
$('.loading').show();
},
getOld:
function() {
$('.loading').show();
$.ajax({
type: "GET",
url: location.href,
data: "limit=" + this.limit + "&offset=" + this.offset,
complete: function(){ $('.loading').hide()},
dataType: "script"});
},
append:
function(count, html) {
$(".content_list").append(html);
if(count > 0) {
this.offset += count;
this.initLoadMore();
}
},
initLoadMore:
function() {
$(window).bind('scroll', function(){
if($(window).scrollTop() == $(document).height() - $(window).height()){
$(window).unbind('scroll');
Pager.getOld();
}
});
}
}

View file

@ -97,7 +97,7 @@ $blue_link: "#2fa0bb";
min-width:$min_app_width; min-width:$min_app_width;
max-width:$max_app_width; max-width:$max_app_width;
margin:auto; margin:auto;
margin-top:51px; margin-top:52px;
} }
.container-fluid > .sidebar { .container-fluid > .sidebar {
@ -113,7 +113,7 @@ $blue_link: "#2fa0bb";
aside a { aside a {
display:block; display:block;
position:relative; position:relative;
padding:15px 10px; padding:12px 10px;
margin:10px 0 0 0; margin:10px 0 0 0;
font-size:13px; font-size:13px;
font-weight:bold; font-weight:bold;
@ -169,6 +169,7 @@ img.lil_av {
p { padding-top:5px;} p { padding-top:5px;}
} }
.visible_link,
.author_link { .author_link {
color: $active_link_color; color: $active_link_color;
} }

View file

@ -17,6 +17,7 @@ td.code,
td.linenos{ td.linenos{
padding:0; padding:0;
margin:0; margin:0;
border-top:0;
vertical-align:top; vertical-align:top;
} }

View file

@ -191,3 +191,13 @@ a.project-update.titled {
} }
} }
input.git_clone_url {
width:475px;
}
.team_member_row {
img {
width:60px;
}
}

View file

@ -3,7 +3,7 @@ body header {
width:100%; width:100%;
padding:0; padding:0;
margin:0; margin:0;
top:0; top:1px;
left:0; left:0;
background: #F1F1F1; /* for non-css3 browsers */ background: #F1F1F1; /* for non-css3 browsers */
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
@ -23,12 +23,13 @@ body header {
.project_name { .project_name {
float:left; float:left;
width:235px; width:400px;
margin-right:30px; margin-right:30px;
font-size:16px; font-size:16px;
font-weight:bold; font-weight:bold;
padding:8px; padding:8px;
color:#333; color:#333;
text-shadow: 0 1px 1px #FFF;
} }
.git_url_wrapper { .git_url_wrapper {

View file

@ -57,7 +57,7 @@ class ProjectsController < ApplicationController
def update def update
respond_to do |format| respond_to do |format|
if project.update_attributes(params[:project]) if project.update_attributes(params[:project])
format.html { redirect_to info_project_path(project), :notice => 'Project was successfully updated.' } format.html { redirect_to edit_project_path(project), :notice => 'Project was successfully updated.' }
format.js format.js
else else
format.html { render action: "edit" } format.html { render action: "edit" }
@ -69,17 +69,13 @@ class ProjectsController < ApplicationController
def show def show
return render "projects/empty" unless @project.repo_exists? && @project.has_commits? return render "projects/empty" unless @project.repo_exists? && @project.has_commits?
limit = (params[:limit] || 10).to_i limit = (params[:limit] || 10).to_i
@activities = @project.activities(limit)
@activities = @project.activities(limit)#updates_wo_repo(limit)
end end
def files def files
@notes = @project.notes.where("attachment != 'NULL'").order("created_at DESC").limit(100) @notes = @project.notes.where("attachment != 'NULL'").order("created_at DESC").limit(100)
end end
def info
end
# #
# Wall # Wall
# #

View file

@ -19,4 +19,28 @@ class RepositoriesController < ApplicationController
def tags def tags
@tags = @project.repo.tags.sort_by(&:name).reverse @tags = @project.repo.tags.sort_by(&:name).reverse
end end
def archive
unless can?(current_user, :download_code, @project)
render_404 and return
end
ref = params[:ref] || @project.root_ref
commit = @project.commit(ref)
render_404 and return unless commit
# Build file path
file_name = @project.code + "-" + commit.id.to_s + ".tar.gz"
storage_path = File.join(Rails.root, "tmp", "repositories", @project.code)
file_path = File.join(storage_path, file_name)
# Create file if not exists
unless File.exists?(file_path)
FileUtils.mkdir_p storage_path
file = @project.repo.archive_to_file(ref, nil, file_path)
end
# Send file to user
send_file file_path
end
end end

View file

@ -59,6 +59,7 @@ class SnippetsController < ApplicationController
@snippet = @project.snippets.find(params[:id]) @snippet = @project.snippets.find(params[:id])
@notes = @snippet.notes @notes = @snippet.notes
@note = @project.notes.new(:noteable => @snippet) @note = @project.notes.new(:noteable => @snippet)
render_full_content
end end
def destroy def destroy

View file

@ -17,7 +17,7 @@ module ProjectsHelper
end end
def project_tab_class def project_tab_class
[:show, :files, :team, :edit, :update, :info].each do |action| [:show, :files, :team, :edit, :update].each do |action|
return "current" if current_page?(:controller => "projects", :action => action, :id => @project) return "current" if current_page?(:controller => "projects", :action => action, :id => @project)
end end

View file

@ -40,6 +40,10 @@ class Ability
:admin_note :admin_note
] if project.allow_admin_for?(user) ] if project.allow_admin_for?(user)
rules << [
:download_code,
] if project.allow_pull_for?(user)
rules.flatten rules.flatten
end end

View file

@ -233,6 +233,10 @@ class Project < ActiveRecord::Base
!users_projects.where(:user_id => user.id, :project_access => [PROJECT_RWA]).empty? || owner_id == user.id !users_projects.where(:user_id => user.id, :project_access => [PROJECT_RWA]).empty? || owner_id == user.id
end end
def allow_pull_for?(user)
!users_projects.where(:user_id => user.id, :repo_access => [Repository::REPO_R, Repository::REPO_RW]).empty?
end
def root_ref def root_ref
default_branch || "master" default_branch || "master"
end end

View file

@ -1,8 +1,7 @@
%li.entry %li.entry
= link_to project_commit_path(@project, :id => commit.id) do = link_to project_commit_path(@project, :id => commit.id) do
%div %div
%strong %code= commit.id.to_s[0..10]
= truncate commit.id.to_s, :length => 10
&ndash; &ndash;
= image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16
= truncate(commit.safe_message, :length => 50) = truncate(commit.safe_message, :length => 50)

View file

@ -1,9 +0,0 @@
= form_tag project_commits_path(@project), :method => :get do
%h3
= @project.name
[ #{select_tag "branch", options_for_select(@repo.heads.map(&:name), @branch), :onchange => "this.form.submit();", :class => "small"} ]
= link_to 'Back', project_path(@project), :class => "button"
%h1 Listing commits
%div{:id => dom_id(@project)}
= render "commits"
%br/

View file

@ -1,17 +1,11 @@
.commit .commit
%span.commit-info = link_to tree_project_ref_path(@project, @commit.id), :class => "btn right small" do
= link_to tree_project_ref_path(@project, @commit.id), :class => "btn right" do Browse Code »
Browse Code » = image_tag gravatar_icon(@commit.author_email), :class => "avatar"
- if @commit.author_email %code= @commit.id.to_s
= image_tag gravatar_icon(@commit.author_email), :class => "left", :width => 40, :style => "padding-right:5px;" %h5
- else = @commit.author_name
= image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" %small= @commit.created_at.stamp("Aug 21, 2011 9:23pm")
%span.commit-title
%strong
= truncate(@commit.id.to_s, :length => 60)
%span.commit-author
%strong= @commit.author_name
= @commit.created_at.stamp("Aug 21, 2011 9:23pm")
%hr %hr
%pre.commit_message %pre.commit_message

View file

@ -8,9 +8,7 @@
- if project_layout - if project_layout
.project_name .project_name
= truncate @project.name, :length => 28 = truncate @project.name, :length => 35
.git_url_wrapper
%input.git-url.text{:id => "", :name => "", :readonly => "", :type => "text", :value => @project.url_to_repo, :class => "one_click_select"}
.account-box .account-box

View file

@ -6,8 +6,12 @@
- if @project.repo_exists? - if @project.repo_exists?
= link_to "Repository", project_repository_path(@project), :class => repository_tab_class = link_to "Repository", project_repository_path(@project), :class => repository_tab_class
= link_to "Code", tree_project_ref_path(@project, @project.root_ref), :class => tree_tab_class %ul
= link_to "Commits", project_commits_path(@project), :class => (controller.controller_name == "commits") ? "current" : nil %li
= link_to "Code", tree_project_ref_path(@project, @project.root_ref), :class => tree_tab_class
%li
= link_to "Commits", project_commits_path(@project), :class => (controller.controller_name == "commits") ? "current" : nil
= link_to "Network", graph_project_path(@project), :class => current_page?(:controller => "projects", :action => "graph", :id => @project) ? "current" : nil = link_to "Network", graph_project_path(@project), :class => current_page?(:controller => "projects", :action => "graph", :id => @project) ? "current" : nil
- if @project.issues_enabled - if @project.issues_enabled
= link_to project_issues_filter_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do = link_to project_issues_filter_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do

View file

@ -1,29 +1,23 @@
%li.wll - @activities.each do |update|
.row .entry
.span9 = link_to dashboard_feed_path(@project, update) do
= image_tag gravatar_icon(update.author_email), :class => "avatar thumb" - if update.kind_of? Note
%p %p
%strong.author= update.author_name %strong
%span - if update.target
= update.target.class.name.titleize
= truncate update.target.id.to_s, :length => 10
commented
- else
Project wall
&ndash; &ndash;
authored = image_tag gravatar_icon(update.author_email), :class => "", :width => 16
= time_ago_in_words(update.created_at) = truncate dashboard_feed_title(update), :length => 50
ago
- if update.kind_of? MergeRequest
= link_to project_merge_request_path(@project, update) do
= "Opened merge request ##{update.id}."
%span.label= update.source_branch
&rarr;
%span.label= update.target_branch
- elsif update.kind_of? Issue
= link_to project_issue_path(@project, update) do
Opened new
%span.label.important= "issue ##{update.id}"
= truncate update.title
- else - else
= link_to [@project, update.target] do %p
%p %strong
= update.target.class.name.titleize = update.class.name.titleize
= truncate(update.target.id.to_s, :length => 10) = truncate update.id.to_s
&nbsp; &ndash;
= dashboard_feed_title(update) = image_tag gravatar_icon(update.author_email), :class => "", :width => 16
= truncate dashboard_feed_title(update), :length => 50

View file

@ -10,13 +10,17 @@
.clearfix .clearfix
= f.label :path do = f.label :path do
Path Path
%cite= "git@#{GIT_HOST["host"]}:" .input
.input= f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record? .input-prepend
%span.add-on= "git@#{GIT_HOST["host"]}:"
= f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record?
.clearfix .clearfix
= f.label :code do = f.label :code do
Code Code
%cite= "http://#{GIT_HOST["host"]}/" .input
.input= f.text_field :code, :placeholder => "example" .input-prepend
%span.add-on= "http://#{GIT_HOST["host"]}/"
= f.text_field :code, :placeholder => "example"
- unless @project.new_record? || @project.heads.empty? - unless @project.new_record? || @project.heads.empty?
.clearfix .clearfix

View file

@ -1,30 +1,18 @@
%ul.tabs %ul.tabs
%li{ :class => "#{'active' if current_page?(project_path(@project)) }" } %li{ :class => "#{'active' if current_page?(project_path(@project)) }" }
= link_to project_path(@project), :class => "activities-tab tab" do = link_to project_path(@project), :class => "activities-tab tab" do
Activities Show
%li{ :class => "#{'active' if current_page?(info_project_path(@project)) || current_page?(edit_project_path(@project)) }" } - if can? current_user, :admin_project, @project
= link_to info_project_path(@project), :class => "stat-tab tab " do %li{ :class => "#{'active' if current_page?(edit_project_path(@project)) }" }
Info = link_to edit_project_path(@project), :class => "stat-tab tab " do
Edit
%li{ :class => " #{'active' if current_page?(team_project_path(@project)) }" } %li{ :class => " #{'active' if (controller.controller_name == "team_members") || current_page?(team_project_path(@project)) }" }
= link_to team_project_path(@project), :class => "team-tab tab" do = link_to team_project_path(@project), :class => "team-tab tab" do
Team Team
%li{ :class => "#{'active' if current_page?(files_project_path(@project)) }" } %li{ :class => "#{'active' if current_page?(files_project_path(@project)) }" }
= link_to files_project_path(@project), :class => "files-tab tab " do = link_to files_project_path(@project), :class => "files-tab tab " do
Files Files
%li{ :class => " #{'active' if current_page?(project_snippets_path(@project)) }" } %li{ :class => " #{'active' if (controller.controller_name == "snippets") }" }
= link_to project_snippets_path(@project), :class => "snippets-tab tab" do = link_to project_snippets_path(@project), :class => "snippets-tab tab" do
Snippets Snippets
- if current_page?(project_snippets_path(@project))
- if can? current_user, :write_snippet, @project
%li
= link_to new_project_snippet_path(@project), :class => "add_new", :title => "New Snippet" do
Add new
- if current_page?(team_project_path(@project))
- if can? current_user, :admin_team_member, @project
%li
= link_to new_project_team_member_path(@project), :class => "add_new", :title => "New Team Member" do
Add New

View file

@ -1,96 +0,0 @@
= render "project_head"
.entry
%h3= @project.name
%br
%pre
= "git clone #{@project.url_to_repo}"
%h4 Details:
%table
%tr
%td Name
%td= @project.name
%tr
%td Slug
%td= @project.code
%tr
%td Path
%td= @project.path
%tr
%td Owner
%td= link_to @project.owner.name, project_team_member_path(@project, @project.team_member_by_id(@project.owner))
%tr
%td Last commit
%td
= time_ago_in_words(@project.commit.committed_date)
ago
%tr
%td Team
%td
= @project.users_projects.count
users
%tr
%td Open Issues
%td
= @project.issues.opened.count
%tr
%td Merge Requests
%td
= @project.merge_requests.opened.count
%tr
%td Created
%td= @project.created_at.stamp("Aug 21, 2011")
%tr
%td{:colspan => 2}= simple_format @project.description
%h4 Features:
%table
%tr
%td Issues
%td
- if @project.issues_enabled
.alert-message.success
Enabled
- else
.alert-message.error
Disabled
%tr
%td Merge Requests
%td
- if @project.merge_requests_enabled
.alert-message.success
Enabled
- else
.alert-message.error
Disabled
%tr
%td Wall
%td
- if @project.wall_enabled
.alert-message.success
Enabled
- else
.alert-message.error
Disabled
.actions
= link_to "Edit", edit_project_path(@project), :class => "btn"

View file

@ -1,24 +1,16 @@
= render "project_head" = render "project_head"
- @activities.each do |update| %h3
.entry = @project.name
= link_to dashboard_feed_path(@project, update) do %hr
- if update.kind_of? Note .alert-message.block-message.warning
%p .input
%strong .input-prepend
- if update.target %span.add-on git clone
= update.target.class.name.titleize = text_field_tag :project_clone, @project.url_to_repo, :class => "xlarge one_click_select git_clone_url"
= truncate update.target.id.to_s, :length => 10
commented = simple_format @project.description
- else
Project wall %h5.cgray Recent Activity
&ndash; .content_list= render "feed"
= image_tag gravatar_icon(update.author_email), :class => "", :width => 16
= truncate dashboard_feed_title(update), :length => 50
- else
%p
%strong
= update.class.name.titleize
= truncate update.id.to_s
&ndash;
= image_tag gravatar_icon(update.author_email), :class => "", :width => 16
= truncate dashboard_feed_title(update), :length => 50

View file

@ -1,3 +1,12 @@
= render "project_head" = render "project_head"
- if can? current_user, :admin_team_member, @project
.alert-message.block-message
= link_to new_project_team_member_path(@project), :class => "btn small right", :title => "New Team Member" do
New Team Member
Manage project team from this page.
%br
To open team member profile - click on avatar.
= render :partial => "team", :locals => {:project => @project} = render :partial => "team", :locals => {:project => @project}

View file

@ -1,6 +1,6 @@
- if @project.valid? - if @project.valid?
:plain :plain
location.href = "#{info_project_path(@project, :notice => 'Project was successfully updated.')}"; location.href = "#{edit_project_path(@project, :notice => 'Project was successfully updated.')}";
- else - else
:plain :plain
$(".edit_project").replaceWith("#{escape_javascript(render('form'))}"); $(".edit_project").replaceWith("#{escape_javascript(render('form'))}");

View file

@ -4,10 +4,10 @@
%p %p
%strong %strong
= commit.head.name = commit.head.name
&ndash; %br
= truncate(commit.id.to_s, :length => 10) %code= commit.id.to_s[0..10]
= image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16
= truncate(commit.safe_message, :length => 40) = truncate(commit.safe_message, :length => 40)
%span.right %span.right.cgray
= time_ago_in_words(commit.committed_date) = time_ago_in_words(commit.committed_date)
ago ago

View file

@ -1,4 +1,31 @@
= render "head" = render "head"
%h3
= @project.name
- if can? current_user, :download_code, @project
= link_to "Download", archive_project_repository_path(@project), :class => "btn small right"
%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"
%p
Last commit was
%small
%code= @activities.first.commit.id.to_s[0..10]
= time_ago_in_words(@activities.first.commit.committed_date)
ago to
= link_to project_commits_path(@project, :ref => @activities.first.head.name), :class => "visible_link" do
= @activities.first.head.name
%h4.cgray
Recent Branches
%ul.unstyled %ul.unstyled
- @activities.each do |update| - @activities.each do |update|
= render "repositories/feed", :update => update, :project => @project = render "repositories/feed", :update => update, :project => @project

View file

@ -1,13 +1,17 @@
= render "head" = render "head"
- unless @tags.empty? - unless @tags.empty?
%div.update-data.ui-box.ui-box-small - @tags.each do |tag|
.data .row
- @tags.each do |tag| .span7
%a.update-item{:href => project_commits_path(@project, :ref => tag.name)} .entry
%span.update-title{:style => "margin-bottom:0px;"} = tag.name
= tag.name %code= tag.commit.id.to_s[0..10]
%span.update-author.right %span.update-author.right
= time_ago_in_words(tag.commit.committed_date) = time_ago_in_words(tag.commit.committed_date)
ago ago
.span3
- if can? current_user, :download_code, @project
= link_to "Download", archive_project_repository_path(@project, :ref => tag.name), :class => "btn small"
= link_to "Commits", project_commits_path(@project, :ref => tag.name), :class => "btn small"
- else - else
%h3 No tags %h3 No tags

View file

@ -1,48 +1,31 @@
%h3= @snippet.new_record? ? "New Snippet" : "Edit Snippet ##{@snippet.id}"
%hr
= form_for [@project, @snippet] do |f| = form_for [@project, @snippet] do |f|
%div
%span.entity-info
- if @snippet.new_record?
= link_to project_snippets_path(@project) do
.entity-button
Snippets
%i
- else
= link_to project_snippet_path(@project, @snippet) do
.entity-button
Show Snippet
%i
%h2= @snippet.new_record? ? "New Snippet" : "Edit Snippet ##{@snippet.id}"
%hr
%table.no-borders %table.no-borders
-if @snippet.errors.any? -if @snippet.errors.any?
%tr .alert-message.block-message.error
%td{:colspan => 2} %ul
#error_explanation - @snippet.errors.full_messages.each do |msg|
- @snippet.errors.full_messages.each do |msg| %li= msg
%span= msg
%br
%tr .clearfix
%td= f.label :title = f.label :title
%td= f.text_field :title, :placeholder => "Example Snippet" .input= f.text_field :title, :placeholder => "Example Snippet"
%tr .clearfix
%td= f.label :file_name = f.label :file_name
%td= f.text_field :file_name, :placeholder => "example.rb" .input= f.text_field :file_name, :placeholder => "example.rb"
%tr .clearfix
%td= f.label "Lifetime" = f.label "Lifetime"
%td= f.select :expires_at, lifetime_select_options, {}, :style => "width:200px;" .input= f.select :expires_at, lifetime_select_options, {}, :style => "width:200px;"
%tr .clearfix
%td{:colspan => 2} = f.label :content, "Code"
= f.label :content, "Code" = f.text_area :content, :class => "xxlarge"
%br
%br
= f.text_area :content
.merge-tabs .actions
= f.submit 'Save', :class => "positive-button" = f.submit 'Save', :class => "primary btn"
= link_to "Cancel", project_snippets_path(@project), :class => " btn"
- unless @snippet.new_record? - unless @snippet.new_record?
.right= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "red-button delete-snippet", :id => "destroy_snippet_#{@snippet.id}" .right= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "btn right danger delete-snippet", :id => "destroy_snippet_#{@snippet.id}"

View file

@ -1,12 +1,7 @@
%a.update-item{:href => project_snippet_path(snippet.project, snippet)} %li.entry
= image_tag gravatar_icon(snippet.author_email), :class => "left", :width => 40 %a{:href => project_snippet_path(snippet.project, snippet)}
%span.update-title %p
= truncate(snippet.title, :length => 60) %strong
%span.update-author = truncate(snippet.title, :length => 60)
%strong= snippet.author_name %span.right.cgray
authored = snippet.file_name
= time_ago_in_words(snippet.created_at)
ago
.right
%span.tag.commit= snippet.file_name

View file

@ -1 +1,2 @@
= render "projects/project_head"
= render "snippets/form" = render "snippets/form"

View file

@ -1,12 +1,12 @@
= render "projects/project_head" = render "projects/project_head"
- if can? current_user, :write_snippet, @project
.alert-message.block-message
= link_to new_project_snippet_path(@project), :class => "btn small add_new right", :title => "New Snippet" do
Add new snippet
Share code pastes with others if it cant be in a git repository
%br
To add new snippet - click on button.
- unless @snippets.fresh.empty? - unless @snippets.fresh.empty?
%div{ :class => "update-data ui-box ui-box-small ui-box-big" } %ul.unstyled= render @snippets.fresh
.data
= render @snippets.fresh
- else
.notice_holder
%li Snippets do not exist yet.
- if can? current_user, :write_snippet, @project
%li You can add a new one by clicking on "Add New" button

View file

@ -1 +1,2 @@
= render "projects/project_head"
= render "snippets/form" = render "snippets/form"

View file

@ -1,20 +1,10 @@
%div = render "projects/project_head"
%span.entity-info
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user %h3
= link_to edit_project_snippet_path(@project, @snippet) do = @snippet.title
.entity-button %small= @snippet.file_name
Edit Snippet - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
%i = link_to "Edit", edit_project_snippet_path(@project, @snippet), :class => "btn small right"
- if @snippet.author_email
= image_tag gravatar_icon(@snippet.author_email), :class => "left", :width => 40, :style => "padding-right:5px;"
- else
= image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;"
%span.commit-title
%strong
= truncate(@snippet.title, :length => 60)
%span.commit-author
%strong= @snippet.author_name
= @snippet.created_at.stamp("Aug 21, 2011 9:23pm")
%hr %hr

View file

@ -1,33 +1,34 @@
%h3= "New Team member"
%hr
= form_for @team_member, :as => :team_member, :url => project_team_members_path(@project, @team_member) do |f| = form_for @team_member, :as => :team_member, :url => project_team_members_path(@project, @team_member) do |f|
%div
%span.entity-info
- if request.xhr?
= link_to project_team_members_path(@project) do
.entity-button
Team List
%i
%h3= "New Team member"
%hr
-if @team_member.errors.any? -if @team_member.errors.any?
%ul.errors_holder .alert-message.block-message.error
- @team_member.errors.full_messages.each do |msg| %ul
%li= msg - @team_member.errors.full_messages.each do |msg|
%li= msg
.span-6.append-bottom .clearfix
%b Name = f.label :user_id, "Name"
.span-6 .input= f.select(:user_id, User.not_in_project(@project).all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }, { :style => "width:300px" })
= f.select(:user_id, User.not_in_project(@project).all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }, { :style => "width:300px" })
.span-6
%b Project Access:
.span-6
= f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, :class => "project-access-select"
.span-6 .clearfix
%b Repository Access: = f.label :project_access, "Project Access"
.span-6 .input= f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, :class => "project-access-select"
= f.select :repo_access, options_for_select(Repository.access_options, @team_member.repo_access), {}, :class => "repo-access-select"
%br
.merge-tabs
= f.submit 'Save', :class => "grey-button"
.clearfix
= f.label :repo_access, "Repository Access"
.input= f.select :repo_access, options_for_select(Repository.access_options, @team_member.repo_access), {}, :class => "repo-access-select"
.actions
= f.submit 'Save', :class => "btn primary"
= link_to "Cancel", team_project_path(@project), :class => "btn"
:css
form select {
width:300px;
}
:javascript
$('select#team_member_user_id').chosen();
$('select#team_member_repo_access').chosen();
$('select#team_member_project_access').chosen();

View file

@ -1,10 +1,10 @@
- user = member.user - user = member.user
- allow_admin = can? current_user, :admin_project, @project - allow_admin = can? current_user, :admin_project, @project
%li{:id => dom_id(member)} %li{:id => dom_id(member), :class => "team_member_row"}
= link_to project_team_member_path(@project, member), :title => user.name do = link_to project_team_member_path(@project, member), :title => user.name do
= image_tag gravatar_icon(user.email, 90), :class => "thumbnail" = image_tag gravatar_icon(user.email, 60), :class => "thumbnail"
.row .row
.span6 .span8
%h4 %h4
= truncate(user.name, :lenght => 24) = truncate(user.name, :lenght => 24)
%small= truncate user.email, :lenght => 24 %small= truncate user.email, :lenght => 24

View file

@ -46,7 +46,6 @@ Gitlab::Application.routes.draw do
get "team" get "team"
get "wall" get "wall"
get "graph" get "graph"
get "info"
get "files" get "files"
end end
@ -54,6 +53,7 @@ Gitlab::Application.routes.draw do
member do member do
get "branches" get "branches"
get "tags" get "tags"
get "archive"
end end
end end

View file

@ -141,7 +141,7 @@ describe "Projects" do
end end
it "should be correct path" do it "should be correct path" do
current_path.should == info_project_path(@project) current_path.should == edit_project_path(@project)
end end
it "should show project" do it "should show project" do

View file

@ -73,7 +73,7 @@ describe "Snippets" do
:author => @user, :author => @user,
:project => project :project => project
visit project_snippet_path(project, @snippet) visit project_snippet_path(project, @snippet)
click_link "Edit Snippet" click_link "Edit"
end end
it "should open edit page" do it "should open edit page" do