Skip to content
Snippets Groups Projects
Commit 4d89322d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Snippets - fixed after bootstrap

Project - restyled show page, removed info page
Repository - restyled show page, added download option
Tags - added download options
parent 3d77183c
No related branches found
No related tags found
No related merge requests found
Showing
with 150 additions and 147 deletions
= render "project_head"
- @activities.each do |update|
.entry
= link_to dashboard_feed_path(@project, update) do
- if update.kind_of? Note
%p
%strong
- if update.target
= update.target.class.name.titleize
= truncate update.target.id.to_s, :length => 10
commented
- else
Project wall
–
= 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
–
= image_tag gravatar_icon(update.author_email), :class => "", :width => 16
= truncate dashboard_feed_title(update), :length => 50
%h3
= @project.name
%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
%h5.cgray Recent Activity
.content_list= render "feed"
= 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}
 
- if @project.valid?
:plain
location.href = "#{info_project_path(@project, :notice => 'Project was successfully updated.')}";
location.href = "#{edit_project_path(@project, :notice => 'Project was successfully updated.')}";
- else
:plain
$(".edit_project").replaceWith("#{escape_javascript(render('form'))}");
Loading
Loading
Loading
Loading
@@ -4,10 +4,10 @@
%p
%strong
= commit.head.name
–
= truncate(commit.id.to_s, :length => 10)
%br
%code= commit.id.to_s[0..10]
= image_tag gravatar_icon(commit.author_email), :class => "", :width => 16
= truncate(commit.safe_message, :length => 40)
%span.right
%span.right.cgray
= time_ago_in_words(commit.committed_date)
ago
= 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
- @activities.each do |update|
= render "repositories/feed", :update => update, :project => @project
Loading
Loading
= render "head"
- unless @tags.empty?
%div.update-data.ui-box.ui-box-small
.data
- @tags.each do |tag|
%a.update-item{:href => project_commits_path(@project, :ref => tag.name)}
%span.update-title{:style => "margin-bottom:0px;"}
= tag.name
%span.update-author.right
= time_ago_in_words(tag.commit.committed_date)
ago
- @tags.each do |tag|
.row
.span7
.entry
= tag.name
%code= tag.commit.id.to_s[0..10]
%span.update-author.right
= time_ago_in_words(tag.commit.committed_date)
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
%h3 No tags
%h3= @snippet.new_record? ? "New Snippet" : "Edit Snippet ##{@snippet.id}"
%hr
= 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
-if @snippet.errors.any?
%tr
%td{:colspan => 2}
#error_explanation
- @snippet.errors.full_messages.each do |msg|
%span= msg
%br
.alert-message.block-message.error
%ul
- @snippet.errors.full_messages.each do |msg|
%li= msg
 
%tr
%td= f.label :title
%td= f.text_field :title, :placeholder => "Example Snippet"
%tr
%td= f.label :file_name
%td= f.text_field :file_name, :placeholder => "example.rb"
%tr
%td= f.label "Lifetime"
%td= f.select :expires_at, lifetime_select_options, {}, :style => "width:200px;"
%tr
%td{:colspan => 2}
= f.label :content, "Code"
%br
%br
= f.text_area :content
.clearfix
= f.label :title
.input= f.text_field :title, :placeholder => "Example Snippet"
.clearfix
= f.label :file_name
.input= f.text_field :file_name, :placeholder => "example.rb"
.clearfix
= f.label "Lifetime"
.input= f.select :expires_at, lifetime_select_options, {}, :style => "width:200px;"
.clearfix
= f.label :content, "Code"
= f.text_area :content, :class => "xxlarge"
 
.merge-tabs
= f.submit 'Save', :class => "positive-button"
.actions
= f.submit 'Save', :class => "primary btn"
= link_to "Cancel", project_snippets_path(@project), :class => " btn"
- 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}"
 
 
 
Loading
Loading
%a.update-item{:href => project_snippet_path(snippet.project, snippet)}
= image_tag gravatar_icon(snippet.author_email), :class => "left", :width => 40
%span.update-title
= truncate(snippet.title, :length => 60)
%span.update-author
%strong= snippet.author_name
authored
= time_ago_in_words(snippet.created_at)
ago
.right
%span.tag.commit= snippet.file_name
%li.entry
%a{:href => project_snippet_path(snippet.project, snippet)}
%p
%strong
= truncate(snippet.title, :length => 60)
%span.right.cgray
= snippet.file_name
= render "projects/project_head"
= render "snippets/form"
= 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?
%div{ :class => "update-data ui-box ui-box-small ui-box-big" }
.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
%ul.unstyled= render @snippets.fresh
= render "projects/project_head"
= render "snippets/form"
%div
%span.entity-info
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
= link_to edit_project_snippet_path(@project, @snippet) do
.entity-button
Edit Snippet
%i
- 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")
= render "projects/project_head"
%h3
= @snippet.title
%small= @snippet.file_name
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
= link_to "Edit", edit_project_snippet_path(@project, @snippet), :class => "btn small right"
 
%hr
 
Loading
Loading
%h3= "New Team member"
%hr
= 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?
%ul.errors_holder
- @team_member.errors.full_messages.each do |msg|
%li= msg
.alert-message.block-message.error
%ul
- @team_member.errors.full_messages.each do |msg|
%li= msg
.clearfix
= f.label :user_id, "Name"
.input= f.select(:user_id, User.not_in_project(@project).all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }, { :style => "width:300px" })
.clearfix
= f.label :project_access, "Project Access"
.input= f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, :class => "project-access-select"
.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"
 
.span-6.append-bottom
%b Name
.span-6
= 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"
.actions
= f.submit 'Save', :class => "btn primary"
= link_to "Cancel", team_project_path(@project), :class => "btn"
 
.span-6
%b Repository Access:
.span-6
= 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"
:css
form select {
width:300px;
}
 
:javascript
$('select#team_member_user_id').chosen();
$('select#team_member_repo_access').chosen();
$('select#team_member_project_access').chosen();
- user = member.user
- 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
= image_tag gravatar_icon(user.email, 90), :class => "thumbnail"
= image_tag gravatar_icon(user.email, 60), :class => "thumbnail"
.row
.span6
.span8
%h4
= truncate(user.name, :lenght => 24)
%small= truncate user.email, :lenght => 24
Loading
Loading
Loading
Loading
@@ -46,7 +46,6 @@ Gitlab::Application.routes.draw do
get "team"
get "wall"
get "graph"
get "info"
get "files"
end
 
Loading
Loading
@@ -54,6 +53,7 @@ Gitlab::Application.routes.draw do
member do
get "branches"
get "tags"
get "archive"
end
end
 
Loading
Loading
Loading
Loading
@@ -141,7 +141,7 @@ describe "Projects" do
end
 
it "should be correct path" do
current_path.should == info_project_path(@project)
current_path.should == edit_project_path(@project)
end
 
it "should show project" do
Loading
Loading
Loading
Loading
@@ -73,7 +73,7 @@ describe "Snippets" do
:author => @user,
:project => project
visit project_snippet_path(project, @snippet)
click_link "Edit Snippet"
click_link "Edit"
end
 
it "should open edit page" do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment