diff options
author | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-10-13 05:00:00 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-10-13 05:00:00 +0400 |
commit | d3784687943e0bd699d73d82a6bc6cac39689473 (patch) | |
tree | 5640c4b74d656618c08d90862c4e222b8f359081 /app/views | |
parent | 0f43e98ef8c2da8908b1107f75b67cda2572c2c4 (diff) |
v1.0
Diffstat (limited to 'app/views')
96 files changed, 1668 insertions, 0 deletions
diff --git a/app/views/admin/_top_menu.html.haml b/app/views/admin/_top_menu.html.haml new file mode 100644 index 00000000000..d63caa7e8ee --- /dev/null +++ b/app/views/admin/_top_menu.html.haml @@ -0,0 +1,6 @@ +%div.top_project_menu + %span= link_to "Users", admin_users_path, :style => "width:50px;", :class => controller.controller_name == "users" ? "current" : nil + %span= link_to "Projects", admin_projects_path, :style => "width:50px;", :class => controller.controller_name == "projects" ? "current" : nil + %span= link_to "Teams", admin_team_members_path, :style => "width:50px;", :class => controller.controller_name == "team_members" ? "current" : nil + %span= link_to "Emails", admin_emails_path, :style => "width:50px;", :class => controller.controller_name == "mailer" ? "current" : nil + diff --git a/app/views/admin/mailer/preview.html.haml b/app/views/admin/mailer/preview.html.haml new file mode 100644 index 00000000000..7b723cb8021 --- /dev/null +++ b/app/views/admin/mailer/preview.html.haml @@ -0,0 +1,29 @@ +%p This is page with preview for all system emails that are sent to user +%p Email previews built based on existing Project/Commit/Issue base - so some preview maybe unavailable unless object appear in system + +#accordion + %h3 + %a New user + %div + %iframe{ :src=> admin_mailer_preview_user_new_path, :width=>"100%", :height=>"350"} + %h3 + %a New issue + %div + %iframe{ :src=> admin_mailer_preview_issue_new_path, :width=>"100%", :height=>"350"} + %h3 + %a Commit note + %div + %iframe{ :src=> admin_mailer_preview_note_path(:type => "Commit"), :width=>"100%", :height=>"350"} + %h3 + %a Issue note + %div + %iframe{ :src=> admin_mailer_preview_note_path(:type => "Issue"), :width=>"100%", :height=>"350"} + %h3 + %a Wall note + %div + %iframe{ :src=> admin_mailer_preview_note_path(:type => "Wall"), :width=>"100%", :height=>"350"} + + +:javascript + $(function() { + $( "#accordion" ).accordion(); }); diff --git a/app/views/admin/projects/_form.html.haml b/app/views/admin/projects/_form.html.haml new file mode 100644 index 00000000000..9823e594e1a --- /dev/null +++ b/app/views/admin/projects/_form.html.haml @@ -0,0 +1,30 @@ += form_for [:admin, @admin_project] do |f| + -if @admin_project.errors.any? + #error_explanation + %h2= "#{pluralize(@admin_project.errors.count, "error")} prohibited this admin_project from being saved:" + %ul + - @admin_project.errors.full_messages.each do |msg| + %li= msg + + .span-24 + .span-12 + .field + = f.label :name + %br + = f.text_field :name + .field + = f.label :code + %br + = f.text_field :code + .field + = f.label :path + %br + = f.text_field :path + .span-10 + .field + = f.label :description + %br + = f.text_area :description + .clear + .actions + = f.submit 'Save', :class => "lbutton" diff --git a/app/views/admin/projects/edit.html.haml b/app/views/admin/projects/edit.html.haml new file mode 100644 index 00000000000..9d9a1ee0a3f --- /dev/null +++ b/app/views/admin/projects/edit.html.haml @@ -0,0 +1,5 @@ += render 'form' + += link_to 'Show', [:admin, @admin_project] +\| += link_to 'Back', admin_projects_path diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml new file mode 100644 index 00000000000..55c41ec31bb --- /dev/null +++ b/app/views/admin/projects/index.html.haml @@ -0,0 +1,26 @@ +%table + %tr + %th Name + %th Code + %th Path + %th Team Members + %th Last Commit + %th + %th + %th + + - @admin_projects.each do |project| + %tr + %td= project.name + %td= project.code + %td= project.path + %td= project.users_projects.count + %td= last_commit(project) + %td= link_to 'Show', [:admin, project] + %td= link_to 'Edit', edit_admin_project_path(project), :id => "edit_#{dom_id(project)}" + %td= link_to 'Destroy', [:admin, project], :confirm => 'Are you sure?', :method => :delete + +%br + += paginate @admin_projects += link_to 'New Project', new_admin_project_path diff --git a/app/views/admin/projects/new.html.haml b/app/views/admin/projects/new.html.haml new file mode 100644 index 00000000000..3a4d50e19f9 --- /dev/null +++ b/app/views/admin/projects/new.html.haml @@ -0,0 +1,5 @@ +%h1 New project + += render 'form' + += link_to 'Back', admin_projects_path diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml new file mode 100644 index 00000000000..6891894122c --- /dev/null +++ b/app/views/admin/projects/show.html.haml @@ -0,0 +1,45 @@ +%p#notice= notice + +.span-8.colborder + %h2= @admin_project.name + + %p + %b Name: + = @admin_project.name + %p + %b Code: + = @admin_project.code + %p + %b Path: + = @admin_project.path + %p + %b Description: + = @admin_project.description + + = link_to 'Edit', edit_admin_project_path(@admin_project) + \| + = link_to 'Back', admin_projects_path + +.span-14 + + %h2 Team + + %table.round-borders + %tr + %th Name + %th Added + %th Web + %th Git + %th Admin + %th + + - @admin_project.users_projects.each do |tm| + %tr + %td= link_to tm.user_name, admin_team_member_path(tm) + %td= time_ago_in_words(tm.updated_at) + " ago" + %td= check_box_tag "read", 1, @admin_project.readers.include?(tm.user), :disabled => :disabled + %td= check_box_tag "commit", 1, @admin_project.writers.include?(tm.user), :disabled => :disabled + %td.span-2= check_box_tag "admin", 1, @admin_project.admins.include?(tm.user), :disabled => :disabled + %td= link_to 'Destroy', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete + + = link_to 'New Team Member', new_admin_team_member_path(:team_member => {:project_id => @admin_project.id}) diff --git a/app/views/admin/team_members/_form.html.haml b/app/views/admin/team_members/_form.html.haml new file mode 100644 index 00000000000..ab48c513a86 --- /dev/null +++ b/app/views/admin/team_members/_form.html.haml @@ -0,0 +1,34 @@ += form_for @admin_team_member, :as => :team_member, :url => @admin_team_member.new_record? ? admin_team_members_path(@admin_team_member) : admin_team_member_path(@admin_team_member) do |f| + -if @admin_team_member.errors.any? + #error_explanation + %h2= "#{pluralize(@admin_team_member.errors.count, "error")} prohibited this admin_project from being saved:" + %ul + - @admin_team_member.errors.full_messages.each do |msg| + %li= msg + + .span-10 + - if @admin_team_member.new_record? + .field + = f.label :user_id + %br + = f.select :user_id, User.all.map { |user| [user.name, user.id] } + .field + = f.label :project_id + %br + = f.select :project_id, Project.all.map { |user| [user.name, user.id] } + + .span-10 + .span-6 + %b Access: + .span-8 + = f.check_box :read + Web Access (Browse Repo) + .span-8 + = f.check_box :write + Git Access (User will be added to commiters list) + .span-6.append-bottom + = f.check_box :admin + Admin (Can manage project) + %hr + .actions + = f.submit 'Save' diff --git a/app/views/admin/team_members/edit.html.haml b/app/views/admin/team_members/edit.html.haml new file mode 100644 index 00000000000..d0362812834 --- /dev/null +++ b/app/views/admin/team_members/edit.html.haml @@ -0,0 +1,5 @@ += render 'form' + += link_to 'Show', admin_team_member_path(@admin_team_member) +\| += link_to 'Back', admin_team_members_path diff --git a/app/views/admin/team_members/index.html.haml b/app/views/admin/team_members/index.html.haml new file mode 100644 index 00000000000..4076917da64 --- /dev/null +++ b/app/views/admin/team_members/index.html.haml @@ -0,0 +1,30 @@ +- @admin_team_members.group_by(&:project).sort.each do |project, members| + %h3= link_to project.name, [:admin, project] + %table + %tr + %th Name + %th Email + %th Read + %th Git + %th Manage + %th Added + %th + %th + %th + - members.each do |tm| + - user = tm.user + %tr + %td.span-6= tm.user_name + %td.span-6= tm.user_email + %td.span-1= check_box_tag "read", 1, project.readers.include?(user), :disabled => :disabled + %td.span-1= check_box_tag "commit", 1, project.writers.include?(user), :disabled => :disabled + %td.span-2= check_box_tag "admin", 1, project.admins.include?(user), :disabled => :disabled + %td.span-3= time_ago_in_words(tm.updated_at) + " ago" + %td= link_to 'Show', admin_team_member_path(tm) + %td= link_to 'Edit', edit_admin_team_member_path(tm), :id => "edit_#{dom_id(tm)}" + %td= link_to 'Destroy', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete + +%br + += paginate @admin_team_members += link_to 'New Team Member', new_admin_team_member_path diff --git a/app/views/admin/team_members/new.html.haml b/app/views/admin/team_members/new.html.haml new file mode 100644 index 00000000000..1321f42e7db --- /dev/null +++ b/app/views/admin/team_members/new.html.haml @@ -0,0 +1,5 @@ +%h1 New team member + += render 'form' + += link_to 'Back', admin_team_members_path diff --git a/app/views/admin/team_members/show.html.haml b/app/views/admin/team_members/show.html.haml new file mode 100644 index 00000000000..bd30c7b0e6c --- /dev/null +++ b/app/views/admin/team_members/show.html.haml @@ -0,0 +1,32 @@ +%p#notice= notice + +.span-10 + %p + %b Name: + = @admin_team_member.user_name + %p + %b Project: + = @admin_team_member.project.name + %p + %b Since: + = @admin_team_member.updated_at + + +.span-10 + .span-6 + %b Access: + .span-8 + = check_box_tag "read", 1, @admin_team_member.read, :disabled => :disabled + Web Access (Browse Repo) + .span-8 + = check_box_tag "commit", 1, @admin_team_member.write, :disabled => :disabled + Git Access (User will be added to commiters list) + .span-6.append-bottom + = check_box_tag "admin", 1, @admin_team_member.admin, :disabled => :disabled + Admin (Can manage project) + +%hr + += link_to 'Edit', edit_admin_team_member_path(@admin_project) +\| += link_to 'Back', admin_team_members_path diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml new file mode 100644 index 00000000000..17be416fa1d --- /dev/null +++ b/app/views/admin/users/_form.html.haml @@ -0,0 +1,38 @@ +.user_new + = form_for [:admin, @admin_user] do |f| + -if @admin_user.errors.any? + #error_explanation + %h2= "#{pluralize(@admin_user.errors.count, "error")} prohibited this admin_user from being saved:" + %ul + - @admin_user.errors.full_messages.each do |msg| + %li= msg + + .span-24 + .span-11.colborder + .field + = f.label :name + %br + = f.text_field :name + .field + = f.label :email + %br + = f.text_field :email + .field + = f.label :password + %br + = f.password_field :password + .field + = f.label :password_confirmation + %br + = f.password_field :password_confirmation + .span-11 + .field.prepend-top.append-bottom + = f.check_box :admin + = f.label :admin + .field.prepend-top + = f.text_field :projects_limit, :class => "small_input" + = f.label :projects_limit + .clear + %br + .actions + = f.submit 'Save', :class => "lbutton" diff --git a/app/views/admin/users/edit.html.haml b/app/views/admin/users/edit.html.haml new file mode 100644 index 00000000000..fac995175fe --- /dev/null +++ b/app/views/admin/users/edit.html.haml @@ -0,0 +1,4 @@ += render 'form' + += link_to 'Show', [:admin, @admin_user], :class => "right lbutton" += link_to 'Back', admin_users_path, :class => "right lbutton" diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml new file mode 100644 index 00000000000..db60a613bce --- /dev/null +++ b/app/views/admin/users/index.html.haml @@ -0,0 +1,24 @@ +%table + %tr + %th Admin + %th Name + %th Email + %th Projects + %th + %th + %th + + - @admin_users.each do |user| + %tr + %td= check_box_tag "admin", 1, user.admin, :disabled => :disabled + %td= user.name + %td= user.email + %td= user.users_projects.count + %td= link_to 'Show', [:admin, user] + %td= link_to 'Edit', edit_admin_user_path(user), :id => "edit_#{dom_id(user)}" + %td= link_to 'Destroy', [:admin, user], :confirm => 'Are you sure?', :method => :delete + +%br + += paginate @admin_users += link_to 'New User', new_admin_user_path diff --git a/app/views/admin/users/new.html.haml b/app/views/admin/users/new.html.haml new file mode 100644 index 00000000000..cec6e3e188c --- /dev/null +++ b/app/views/admin/users/new.html.haml @@ -0,0 +1,6 @@ +%h1 New user + += render 'form' + + += link_to 'Back', admin_users_path, :class => "right lbutton" diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml new file mode 100644 index 00000000000..b1d110bec27 --- /dev/null +++ b/app/views/admin/users/show.html.haml @@ -0,0 +1,45 @@ +%p#notice= notice + +.span-8.colborder + %p + %b Name: + = @admin_user.name + %p + %b Email: + = @admin_user.email + %p + %b Admin: + = @admin_user.admin + %p + %b Projects limit: + = @admin_user.projects_limit + + .clear + = link_to 'Edit', edit_admin_user_path(@admin_user) + \| + = link_to 'Back', admin_users_path + +.span-14 + %h2 Projects + + %table.round-borders + %tr + %th Name + %th Added + %th Web + %th Git + %th Admin + %th + + - @admin_user.users_projects.each do |tm| + - project = tm.project + %tr + %td= link_to project.name, admin_project_path(project) + %td= time_ago_in_words(tm.updated_at) + " ago" + %td= check_box_tag "read", 1, project.readers.include?(@admin_user), :disabled => :disabled + %td= check_box_tag "commit", 1, project.writers.include?(@admin_usertm), :disabled => :disabled + %td.span-2= check_box_tag "admin", 1, project.admins.include?(@admin_user), :disabled => :disabled + %td= link_to 'Edit', edit_admin_team_member_path(tm) + %td= link_to 'Cancel', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete + + = link_to 'Add To Another Project', new_admin_team_member_path(:team_member => {:user_id => @admin_user.id}) diff --git a/app/views/commits/_commits.html.haml b/app/views/commits/_commits.html.haml new file mode 100644 index 00000000000..4eebb83aa15 --- /dev/null +++ b/app/views/commits/_commits.html.haml @@ -0,0 +1,22 @@ +- @commits.group_by { |c| c.committed_date.to_date }.each do |day, commits| + .day-commits-table + .day-header + %h3= day.stamp("28 Aug, 2010") + %ul + - commits.each do |commit| + %li{ :class => "commit", :url => project_commit_path(@project, :id => commit.id) } + - if commit.author.email + = image_tag gravatar_icon(commit.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" + - else + = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" + %p + %strong + = commit.message.length > 60 ? (commit.message[0..59] + "...") : commit.message + = link_to "Browse Code", tree_project_path(@project, :commit_id => commit.id), :class => "lite_button", :style => "float:right" + = link_to truncate(commit.id.to_s, :length => 16), project_commit_path(@project, :id => commit.id), :class => "lite_button", :style => "width:120px;float:right" + %span + %span + [ #{commit.author} ] + = time_ago_in_words(commit.committed_date) + ago += more_commits_link if @commits.size > 99 diff --git a/app/views/commits/_diff.html.haml b/app/views/commits/_diff.html.haml new file mode 100644 index 00000000000..dff99bf12f0 --- /dev/null +++ b/app/views/commits/_diff.html.haml @@ -0,0 +1,58 @@ +- require "utils" +.file_stats + - @commit.diffs.each do |diff| + - if diff.deleted_file + %span.removed_file + %a{:href => "##{diff.a_path}"} + = diff.a_path + = image_tag "blueprint_delete.png" + - elsif diff.renamed_file + %span.moved_file + %a{:href => "##{diff.b_path}"} + = diff.a_path + = "->" + = diff.b_path + = image_tag "blueprint_notice.png" + - elsif diff.new_file + %span.new_file + %a{:href => "##{diff.b_path}"} + = diff.b_path + = image_tag "blueprint_add.png" + - else + %span.edit_file + %a{:href => "##{diff.b_path}"} + = diff.b_path + = image_tag "blueprint_info.png" +- @commit.diffs.each do |diff| + - next if diff.diff.empty? + - file = (@commit.tree / diff.b_path) + - next unless file + .diff_file + .diff_file_header + - if diff.deleted_file + %strong{:id => "#{diff.b_path}"}= diff.a_path + - else + %strong{:id => "#{diff.b_path}"}= diff.b_path + %br/ + .diff_file_content + - if file.mime_type =~ /application|text/ && !Utils.binary?(file.data) + - lines_arr = diff.diff.lines.to_a + - line_old = lines_arr[2].match(/-(\d)/)[0].to_i.abs rescue 0 + - line_new = lines_arr[2].match(/\+(\d)/)[0].to_i.abs rescue 0 + - lines = lines_arr[3..-1].join + - lines.each_line do |line| + = diff_line(line, line_new, line_old) + - if line[0] == "+" + - line_new += 1 + - elsif + - line[0] == "-" + - line_old += 1 + - else + - line_new += 1 + - line_old += 1 + - elsif file.mime_type =~ /image/ + .diff_file_content_image + %img{:src => "data:image/jpeg;base64,#{Base64.encode64(file.data)}"} + - else + %p + %center No preview for this file type diff --git a/app/views/commits/_index.html.haml b/app/views/commits/_index.html.haml new file mode 100644 index 00000000000..e4c9cc6e83c --- /dev/null +++ b/app/views/commits/_index.html.haml @@ -0,0 +1,9 @@ += 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/
\ No newline at end of file diff --git a/app/views/commits/index.html.haml b/app/views/commits/index.html.haml new file mode 100644 index 00000000000..95579119aee --- /dev/null +++ b/app/views/commits/index.html.haml @@ -0,0 +1,13 @@ +%div + %h3 + .left + = form_tag project_commits_path(@project), :method => :get do + = select_tag "branch", options_for_select(@repo.heads.map(&:name), @branch), :onchange => "this.form.submit();", :class => "", :prompt => "Branches" + + .left.prepend-1 + = form_tag project_commits_path(@project), :method => :get do + = select_tag "tag", options_for_select(@project.tags, @branch), :onchange => "this.form.submit();", :class => "", :prompt => "Tags" + = text_field_tag "ssh", @project.url_to_repo, :class => ["ssh_project_url", "one_click_select"] + .clear + %div{:id => dom_id(@project)} + = render "commits" diff --git a/app/views/commits/index.js.erb b/app/views/commits/index.js.erb new file mode 100644 index 00000000000..94daa396c5c --- /dev/null +++ b/app/views/commits/index.js.erb @@ -0,0 +1,2 @@ +$("#more-commits-link").remove(); +$('#<%= dom_id(@project)%>').append('<%= escape_javascript(render("commits")) %>'); diff --git a/app/views/commits/show.html.haml b/app/views/commits/show.html.haml new file mode 100644 index 00000000000..147aaafb855 --- /dev/null +++ b/app/views/commits/show.html.haml @@ -0,0 +1,39 @@ +%h3 + = "[ #{@commit.committer} ] #{truncate @commit.message, :length => 80}" +-#= link_to 'Back', project_commits_path(@project), :class => "button" +%table.round-borders + %tr + %td ID + %td= @commit.id + %tr + %td Author + %td= @commit.author + %tr + %td Commiter + %td= @commit.committer + %tr + %td Commited Date + %td= @commit.committed_date + %tr + %td Message + %td= @commit.message + %tr + %td Tree + %td= link_to 'Browse Code', tree_project_path(@project, :commit_id => @commit.id) +.clear + +#tabs + %ul + %li + %a{ :href => "#tabs-1" } Diff + %li + %a{ :href => "#tabs-2" } Comments + %span{ :class => "notes_count" }= @notes.count + %hr + #tabs-1 + = render "commits/diff" + #tabs-2 + = render "notes/notes" + +:javascript + $(function() { $( "#tabs" ).tabs(); }); diff --git a/app/views/commits/show.js.haml b/app/views/commits/show.js.haml new file mode 100644 index 00000000000..2c46689b1ed --- /dev/null +++ b/app/views/commits/show.js.haml @@ -0,0 +1,6 @@ +:plain + $("#side-commit-preview").remove(); + var side = $("<div id='side-commit-preview'></div>"); + side.html("#{escape_javascript(render "commits/show")}"); + $("##{dom_id(@project)}").parent().append(side); + $("##{dom_id(@project)}").addClass("span-14"); diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml new file mode 100644 index 00000000000..f4ce9a17d82 --- /dev/null +++ b/app/views/dashboard/index.html.haml @@ -0,0 +1 @@ +timeline diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb new file mode 100644 index 00000000000..b7ae403caa5 --- /dev/null +++ b/app/views/devise/confirmations/new.html.erb @@ -0,0 +1,12 @@ +<h2>Resend confirmation instructions</h2> + +<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %> + <%= devise_error_messages! %> + + <div><%= f.label :email %><br /> + <%= f.email_field :email %></div> + + <div><%= f.submit "Resend confirmation instructions" %></div> +<% end %> + +<%= render :partial => "devise/shared/links" %>
\ No newline at end of file diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb new file mode 100644 index 00000000000..a6ea8ca17e8 --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -0,0 +1,5 @@ +<p>Welcome <%= @resource.email %>!</p> + +<p>You can confirm your account through the link below:</p> + +<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p> diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb new file mode 100644 index 00000000000..ae9e888abb9 --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -0,0 +1,8 @@ +<p>Hello <%= @resource.email %>!</p> + +<p>Someone has requested a link to change your password, and you can do this through the link below.</p> + +<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p> + +<p>If you didn't request this, please ignore this email.</p> +<p>Your password won't change until you access the link above and create a new one.</p> diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb new file mode 100644 index 00000000000..2263c219522 --- /dev/null +++ b/app/views/devise/mailer/unlock_instructions.html.erb @@ -0,0 +1,7 @@ +<p>Hello <%= @resource.email %>!</p> + +<p>Your account has been locked due to an excessive amount of unsuccessful sign in attempts.</p> + +<p>Click the link below to unlock your account:</p> + +<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p> diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb new file mode 100644 index 00000000000..e75c937101a --- /dev/null +++ b/app/views/devise/passwords/edit.html.erb @@ -0,0 +1,16 @@ +<h2>Change your password</h2> + +<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %> + <%= devise_error_messages! %> + <%= f.hidden_field :reset_password_token %> + + <div><%= f.label :password, "New password" %><br /> + <%= f.password_field :password %></div> + + <div><%= f.label :password_confirmation, "Confirm new password" %><br /> + <%= f.password_field :password_confirmation %></div> + + <div><%= f.submit "Change my password" %></div> +<% end %> + +<%= render :partial => "devise/shared/links" %>
\ No newline at end of file diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb new file mode 100644 index 00000000000..bccf0181769 --- /dev/null +++ b/app/views/devise/passwords/new.html.erb @@ -0,0 +1,15 @@ +<h2>Forgot your password?</h2> + +<div class="span-12 colborder"> + <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %> + <%= devise_error_messages! %> + + <div><%= f.label :email %><br /> + <%= f.email_field :email %></div> + + <div><%= f.submit "Send me reset password instructions", :class => "lbutton vm" %></div> + <% end %> +</div> +<div> + <%= render :partial => "devise/shared/links" %> +</div> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb new file mode 100644 index 00000000000..dd26e8a47b8 --- /dev/null +++ b/app/views/devise/registrations/edit.html.erb @@ -0,0 +1,28 @@ +<h2>Edit <%= resource_name.to_s.humanize %></h2> + +<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %> + <%= devise_error_messages! %> + + <div><%= f.label :email %><br /> + <%= f.email_field :email %></div> + + <div><%= f.label :name %><br /> + <%= f.text_field :name %></div> + + <div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br /> + <%= f.password_field :password %></div> + + <div><%= f.label :password_confirmation %><br /> + <%= f.password_field :password_confirmation %></div> + + <div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br /> + <%= f.password_field :current_password %></div> + +<div><%= f.submit "Update", :class => "input_button" %></div> +<% end %> + +<h3>Cancel my account</h3> + +<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.</p> + +<%= link_to "Back", :back %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb new file mode 100644 index 00000000000..4ac617c5912 --- /dev/null +++ b/app/views/devise/registrations/new.html.erb @@ -0,0 +1,18 @@ +<h2>Sign up</h2> + +<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %> + <%= devise_error_messages! %> + + <div><%= f.label :email %><br /> + <%= f.email_field :email %></div> + + <div><%= f.label :password %><br /> + <%= f.password_field :password %></div> + + <div><%= f.label :password_confirmation %><br /> + <%= f.password_field :password_confirmation %></div> + +<div><%= f.submit "Sign up", :class => "input_button" %></div> +<% end %> + +<%= render :partial => "devise/shared/links" %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb new file mode 100644 index 00000000000..21de54f0c4c --- /dev/null +++ b/app/views/devise/sessions/new.html.erb @@ -0,0 +1,20 @@ +<h2>Sign in</h2> + +<div class="span-12 colborder"> + <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> + <div><%= f.label :email %><br /> + <%= f.text_field :email %></div> + + <div><%= f.label :password %><br /> + <%= f.password_field :password %></div> + + <% if devise_mapping.rememberable? -%> + <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div> + <% end -%> + <br/> + <div><%= f.submit "Sign in", :class => "lbutton vm" %></div> + <% end %> +</div> +<div> + <%= render :partial => "devise/shared/links" %> +</div> diff --git a/app/views/devise/shared/_links.erb b/app/views/devise/shared/_links.erb new file mode 100644 index 00000000000..eab783a4c92 --- /dev/null +++ b/app/views/devise/shared/_links.erb @@ -0,0 +1,25 @@ +<%- if controller_name != 'sessions' %> + <%= link_to "Sign in", new_session_path(resource_name) %><br /> +<% end -%> + +<%- if devise_mapping.registerable? && controller_name != 'registrations' %> + <%= link_to "Sign up", new_registration_path(resource_name) %><br /> +<% end -%> + +<%- if devise_mapping.recoverable? && controller_name != 'passwords' %> + <%= link_to "Forgot your password?", new_password_path(resource_name) %><br /> +<% end -%> + +<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> + <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br /> +<% end -%> + +<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> + <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br /> +<% end -%> + +<%- if devise_mapping.omniauthable? %> + <%- resource_class.omniauth_providers.each do |provider| %> + <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br /> + <% end -%> +<% end -%>
\ No newline at end of file diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb new file mode 100644 index 00000000000..c6cdcfe51ce --- /dev/null +++ b/app/views/devise/unlocks/new.html.erb @@ -0,0 +1,12 @@ +<h2>Resend unlock instructions</h2> + +<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %> + <%= devise_error_messages! %> + + <div><%= f.label :email %><br /> + <%= f.email_field :email %></div> + + <div><%= f.submit "Resend unlock instructions" %></div> +<% end %> + +<%= render :partial => "devise/shared/links" %>
\ No newline at end of file diff --git a/app/views/issues/_form.html.haml b/app/views/issues/_form.html.haml new file mode 100644 index 00000000000..71acdba1895 --- /dev/null +++ b/app/views/issues/_form.html.haml @@ -0,0 +1,24 @@ +%div + = form_for [@project, @issue], :remote => "true" do |f| + -if @issue.errors.any? + %ul + - @issue.errors.full_messages.each do |msg| + %li= msg + + .span-6 + = f.label :title + = f.text_field :title, :style => "width:450px" + .span-6 + = f.label :content + = f.text_area :content, :style => "width:450px; height:130px" + .span-6.append-bottom + = f.label :assignee_id + = f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) + - unless @issue.new_record? + .span-3.right + = f.label :closed + %br + = f.check_box :closed + %hr + .span-6 + = f.submit 'Save', :class => "lbutton vm" diff --git a/app/views/issues/_issues.html.haml b/app/views/issues/_issues.html.haml new file mode 100644 index 00000000000..d3e21940346 --- /dev/null +++ b/app/views/issues/_issues.html.haml @@ -0,0 +1,10 @@ +%table.round-borders#issues-table + %tr + %th Assignee + %th ID + %th Title + %th Closed? + %th + + - @issues.each do |issue| + = render(:partial => 'show', :locals => {:issue => issue}) diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml new file mode 100644 index 00000000000..131d0d4c8a2 --- /dev/null +++ b/app/views/issues/_show.html.haml @@ -0,0 +1,18 @@ +%tr{ :id => dom_id(issue), :class => "issue", :url => project_issue_path(@project, issue) } + %td + = image_tag gravatar_icon(issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;" + = truncate issue.assignee.name, :lenght => 20 + %td ##{issue.id} + %td= html_escape issue.title + %td + - if can? current_user, :write_issue, @project + = form_for([@project, issue], :remote => true) do |f| + = f.check_box :closed, :onclick => "$(this).parent().submit();" + = hidden_field_tag :status_only, true + - else + = check_box_tag "closed", 1, issue.closed, :disabled => true + %td + - if can?(current_user, :admin_issue, @project) || issue.author == current_user + = link_to 'Edit', edit_project_issue_path(@project, issue), :class => "lbutton positive", :remote => true + - if can?(current_user, :admin_issue, @project) || issue.author == current_user + = link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-issue negative", :id => "destroy_issue_#{issue.id}" diff --git a/app/views/issues/create.js.haml b/app/views/issues/create.js.haml new file mode 100644 index 00000000000..3713a8aff41 --- /dev/null +++ b/app/views/issues/create.js.haml @@ -0,0 +1,9 @@ +- if @issue.valid? + :plain + $("#new_issue_dialog").dialog("close"); + $.ajax({type: "GET", url: location.href, dataType: "script"}); +- else + :plain + $("#new_issue_dialog").empty(); + $("#new_issue_dialog").append("#{escape_javascript(render('form'))}"); + $('select#issue_assignee_id').selectmenu({width:300}); diff --git a/app/views/issues/edit.js.haml b/app/views/issues/edit.js.haml new file mode 100644 index 00000000000..f08e3217a89 --- /dev/null +++ b/app/views/issues/edit.js.haml @@ -0,0 +1,12 @@ +:plain + var edit_issue_dialog = $("<div id='edit_issue_dialog'></div>"); + edit_issue_dialog.html("#{escape_javascript(render('form'))}"); + $(edit_issue_dialog).dialog({ + width: 500, + resizable: false, + draggable: false, + title: "Issue ##{@issue.id} #{"[CLOSED]" if @issue.closed}", + close: function(event, ui) { $("#edit_issue_dialog").remove();}, + modal: true + }); + $('select#issue_assignee_id').selectmenu({width:300}); diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml new file mode 100644 index 00000000000..7157d2c385d --- /dev/null +++ b/app/views/issues/index.html.haml @@ -0,0 +1,24 @@ +%div + - if can? current_user, :write_issue, @project + .left= link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm" + .right + = form_tag project_issues_path(@project), :method => :get do + .span-2 + = radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues" + = label_tag "open_issues","Open" + .span-2 + = radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues" + = label_tag "closed_issues","Closed" + .span-2 + = radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues" + = label_tag "my_issues","To Me" + + .span-2 + = radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues" + = label_tag "all_issues","All" + + #issues-table-holder= render "issues" + %br +:javascript + $('.delete-issue').live('ajax:success', function() { + $(this).closest('tr').fadeOut(); }); diff --git a/app/views/issues/index.js.haml b/app/views/issues/index.js.haml new file mode 100644 index 00000000000..1f051309233 --- /dev/null +++ b/app/views/issues/index.js.haml @@ -0,0 +1,2 @@ +:plain + $('#issues-table-holder').html("#{escape_javascript(render('issues'))}"); diff --git a/app/views/issues/new.js.haml b/app/views/issues/new.js.haml new file mode 100644 index 00000000000..530641440a7 --- /dev/null +++ b/app/views/issues/new.js.haml @@ -0,0 +1,12 @@ +:plain + var new_issue_dialog = $("<div id='new_issue_dialog'></div>"); + new_issue_dialog.html("#{escape_javascript(render('form'))}"); + $(new_issue_dialog).dialog({ + width: 500, + resizable: false, + draggable: false, + title: "Add new issue", + modala: true, + close: function(event, ui) { $("#new_issue_dialog").remove();} + }); + $('select#issue_assignee_id').selectmenu({width:300}); diff --git a/app/views/issues/show.html.haml b/app/views/issues/show.html.haml new file mode 100644 index 00000000000..199c80c8617 --- /dev/null +++ b/app/views/issues/show.html.haml @@ -0,0 +1,44 @@ +%h2 + = "Issue ##{@issue.id} - #{@issue.title}" + +.span-15 + = simple_format html_escape(@issue.content) + .issue_notes= render "notes/notes" +.span-8.right + .span-8 + - if @issue.closed + %center.success Closed + - else + %center.error Open + %table.round-borders + %tr + %td Title: + %td + = truncate html_escape(@issue.title) + %tr + %td Project + %td + %strong= @issue.project.name + %tr + %td Author: + %td + = image_tag gravatar_icon(@issue.author.email), :class => "left", :width => 40, :style => "padding:0 5px;" + = @issue.author.name + %tr + %td Assignee: + %td + = image_tag gravatar_icon(@issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;" + = @issue.assignee.name + %tr + %td Closed? + %td + - if can? current_user, :write_issue, @project + = form_for([@project, @issue]) do |f| + = f.check_box :closed, :onclick => "$(this).parent().submit();" + = hidden_field_tag :status_only, true + - else + = check_box_tag "closed", 1, @issue.closed, :disabled => true + + +.clear + diff --git a/app/views/issues/update.js.haml b/app/views/issues/update.js.haml new file mode 100644 index 00000000000..c365c3f5d55 --- /dev/null +++ b/app/views/issues/update.js.haml @@ -0,0 +1,14 @@ +- if params[:status_only] + - if @issue.valid? + :plain + $("##{dom_id(@issue)}").fadeOut(); +- else + - if @issue.valid? + :plain + $("#edit_issue_dialog").dialog("close"); + $.ajax({type: "GET", url: location.href, dataType: "script"}); + - else + :plain + $("#edit_issue_dialog").empty(); + $("#edit_issue_dialog").append("#{escape_javascript(render('form'))}"); + $('select#issue_assignee_id').selectmenu({width:300}); diff --git a/app/views/keys/_form.html.haml b/app/views/keys/_form.html.haml new file mode 100644 index 00000000000..7d3e14efc1e --- /dev/null +++ b/app/views/keys/_form.html.haml @@ -0,0 +1,16 @@ +%div + = form_for @key, :remote => true do |f| + -if @key.errors.any? + %ul + - @key.errors.full_messages.each do |msg| + %li= msg + + .span-6 + = f.label :title + = f.text_field :title, :style => "width:300px" + .span-6 + = f.label :key + = f.text_area :key, :style => "width:300px; height:130px" + .span-6 + = f.submit 'Save', :class => "lbutton vm" + diff --git a/app/views/keys/_show.html.haml b/app/views/keys/_show.html.haml new file mode 100644 index 00000000000..a4e236256d3 --- /dev/null +++ b/app/views/keys/_show.html.haml @@ -0,0 +1,4 @@ +%tr + %td= truncate key.title, :lenght => 12 + %td= truncate key.key, :lenght => 1114 + %td= link_to 'Cancel', key, :confirm => 'Are you sure?', :method => :delete, :class => "lbutton negative delete-key", :id => "destroy_key_#{key.id}", :remote => true diff --git a/app/views/keys/create.js.haml b/app/views/keys/create.js.haml new file mode 100644 index 00000000000..7b92be77180 --- /dev/null +++ b/app/views/keys/create.js.haml @@ -0,0 +1,8 @@ +- if @key.valid? + :plain + $("#new_key_dialog").dialog("close"); + $("#keys-table").append("#{escape_javascript(render(:partial => 'show', :locals => {:key => @key} ))}"); +- else + :plain + $("#new_key_dialog").empty(); + $("#new_key_dialog").append("#{escape_javascript(render('form'))}"); diff --git a/app/views/keys/edit.html.haml b/app/views/keys/edit.html.haml new file mode 100644 index 00000000000..60a3afedddc --- /dev/null +++ b/app/views/keys/edit.html.haml @@ -0,0 +1,7 @@ +%h1 Editing key + += render 'form' + += link_to 'Show', @key +\| += link_to 'Back', keys_path diff --git a/app/views/keys/index.html.haml b/app/views/keys/index.html.haml new file mode 100644 index 00000000000..416ae8f8f95 --- /dev/null +++ b/app/views/keys/index.html.haml @@ -0,0 +1,15 @@ +%div#new-key-holder + = link_to "Add new", new_key_path, :remote => true, :class => "lbutton vm" + +%table.round-borders#keys-table + %tr + %th title + %th key + %th Actions + - @keys.each do |key| + = render(:partial => 'show', :locals => {:key => key}) + +:javascript + $('.delete-key').live('ajax:success', function() { + $(this).closest('tr').fadeOut(); }); + diff --git a/app/views/keys/new.html.haml b/app/views/keys/new.html.haml new file mode 100644 index 00000000000..fed448b4e09 --- /dev/null +++ b/app/views/keys/new.html.haml @@ -0,0 +1,5 @@ +%h1 New key + += render 'form' + += link_to 'Back', keys_path diff --git a/app/views/keys/new.js.haml b/app/views/keys/new.js.haml new file mode 100644 index 00000000000..86e9db030c5 --- /dev/null +++ b/app/views/keys/new.js.haml @@ -0,0 +1,11 @@ +:plain + var new_key_dialog = $("<div id='new_key_dialog'></div>"); + new_key_dialog.html("#{escape_javascript(render('form'))}"); + $(new_key_dialog).dialog({ + width: 350, + resizable: false, + draggable: false, + title: "Add new public key", + close: function(event, ui) { $("#new_key_dialog").remove();}, + modal: true + }); diff --git a/app/views/layouts/_flash.html.haml b/app/views/layouts/_flash.html.haml new file mode 100644 index 00000000000..4b6eb2b500e --- /dev/null +++ b/app/views/layouts/_flash.html.haml @@ -0,0 +1,18 @@ +- if alert || notice + - text = alert || notice + %div{:style => "display:none", :id => "flash_container"} + .container + %center + %h4= text + :javascript + $(function(){ + $("#flash_container").slideDown("slow"); + $("#flash_container").click(function(){ + $(this).slideUp("slow"); + }); + setTimeout("hideFlash()",2000); + }); + + function hideFlash(){ + $("#flash_container").slideUp("slow"); + } diff --git a/app/views/layouts/_head_panel.html.erb b/app/views/layouts/_head_panel.html.erb new file mode 100644 index 00000000000..f32e4bc2b71 --- /dev/null +++ b/app/views/layouts/_head_panel.html.erb @@ -0,0 +1,34 @@ +<div id="header-panel"> + <div class="container"> + <div class="span-24"> + <div class="span-10"> + <%#= image_tag "git.png", :height => 40, :class => "left" %> + <%#= link_to "gitlab", root_path, :id => "logo" %> + <span class="search-holder"> + <%= text_field_tag "search", nil, :placeholder => "Search" %> + </span> + </div> + <div class="right"> + <%= link_to truncate(@project.name, :length => 20), project_path(@project), :class => "current button" if @project && !@project.new_record? %> + <%= link_to 'Home', root_path, :class => current_page?(root_url) ? "current button" : "button" %> + <%= link_to 'Projects', projects_path, :class => current_page?(projects_path) ? "current button" : "button" %> + <%= link_to 'Profile', profile_path, :class => (controller.controller_name == "keys") ? "current button" : "button" %> + <%= link_to('Admin', admin_root_path, :class => admin_namespace? ? "current button" : "button" ) if current_user.is_admin? %> + <%#= link_to 'Profile', edit_user_registration_path, :class => "button" %> + <%= link_to 'Logout', destroy_user_session_path, :class => "button", :method => :delete %> + </div> + </div> + </div> +</div> + + +<% if current_user %> + <%= javascript_tag do %> + $(function() { + $("#search" ).autocomplete({ + source: <%= raw search_autocomplete_source %>, + select: function(event, ui) { location.href = ui.item.url } + }); + }); + <% end %> +<% end %> diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml new file mode 100644 index 00000000000..3eb99da61e5 --- /dev/null +++ b/app/views/layouts/application.html.haml @@ -0,0 +1,29 @@ +!!! +%html + %head + %title + GitLab #{" - #{@project.name}" if @project && !@project.new_record?} + = stylesheet_link_tag 'blueprint/screen', :media => "screen, projection" + = stylesheet_link_tag 'blueprint/print', :media => "print" + = stylesheet_link_tag 'blueprint/plugins/buttons/screen', :media => "screen, projection" + = stylesheet_link_tag 'blueprint/plugins/link-icons/screen', :media => "screen, projection" + = stylesheet_link_tag 'jquery_ui/jquery-ui-1.8.16.custom', :media => "screen, projection" + = stylesheet_link_tag "application" + = javascript_include_tag "application" + = csrf_meta_tags + %link{:href => "/assets/favicon.png", :rel => "icon", :type => "image/png"}/ + = javascript_tag do + REQ_URI = "#{request.env["REQUEST_URI"]}"; + REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; + %body#thebody + = render :partial => "layouts/flash" + - if user_signed_in? + = render :partial => "layouts/head_panel" + .top_bar.container + = render :partial => "projects/top_menu" if @project && !@project.new_record? + = render :partial => "projects/projects_top_menu" if (controller.controller_name == "projects" && ["index", "new", "create"].include?(controller.action_name)) && !admin_namespace? + = render :partial => "profile/top_menu" if ["keys", "profile"].include?(controller.controller_name) + = render :partial => "admin/top_menu" if admin_namespace? + #content-container.container + .span-24 + = yield diff --git a/app/views/layouts/notify.html.haml b/app/views/layouts/notify.html.haml new file mode 100644 index 00000000000..0cef736c80a --- /dev/null +++ b/app/views/layouts/notify.html.haml @@ -0,0 +1,36 @@ +%html{:lang => "en"} + %head + %meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"} + %title + gitlabhq + :css + .header h1 {color: #BBBBBB !important; font: bold 32px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 40px;} + .header p {color: #c6c6c6; font: normal 12px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 18px;} + .content h2 {color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; } + .content p {color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif;} + .content a {color: #0eb6ce; text-decoration: none;} + .footer p {font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;} + .footer a {color: #0eb6ce; text-decoration: none;} + %body{:bgcolor => "#EAEAEA", :style => "margin: 0; padding: 0; background: #EAEAEA"} + %table{:align => "center", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "padding: 35px 0; background: #EAEAEA;", :width => "100%"} + %tr + %td{:align => "center", :style => "margin: 0; padding: 0; background: #EAEAEA;"} + %table.header{:align => "center", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "font-family: Helvetica, Arial, sans-serif; background:#333", :width => "600"} + %tr + %td{:style => "font-size: 0px;", :width => "20"} + \ + %td{:align => "left", :style => "padding: 18px 0 10px;", :width => "580"} + %h1{:style => "color: #BBBBBB; font: normal 32px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 40px;"} + gitlab + - if @project + | #{@project.name} + %table{:align => "center", :bgcolor => "#fff", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "font-family: Helvetica, Arial, sans-serif; background: #fff;", :width => "600"} + %tr= yield + %tr + %td{:align => "left", :colspan => "2", :height => "3", :style => "padding: font-size: 0; line-height: 0; height: 3px;", :width => "600"} + %table.footer{:align => "center", :border => "0", :cellpadding => "0", :cellspacing => "0", :style => "font-family: Helvetica, Arial, sans-serif; line-height: 10px;", :width => "600"} + %tr + %td{:align => "center", :style => "padding: 5px 0 10px; font-size: 11px; color:#7d7a7a; margin: 0; line-height: 1.2;font-family: Helvetica, Arial, sans-serif;", :valign => "top"} + %br + %p{:style => "font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;"} + You're receiving this newsletter because you are in project team. diff --git a/app/views/notes/_form.html.haml b/app/views/notes/_form.html.haml new file mode 100644 index 00000000000..ccb159f128c --- /dev/null +++ b/app/views/notes/_form.html.haml @@ -0,0 +1,28 @@ +%div + = form_for [@project, @note], :remote => "true", :multipart => true do |f| + -if @note.errors.any? + .errors.error + - @note.errors.full_messages.each do |msg| + %div= msg + + = f.hidden_field :noteable_id + = f.hidden_field :noteable_type + + %div + = f.label :note + %cite (255 symbols only) + %br + = f.text_area :note, :style => "width:97%;height:100px", :size => 255 + + %div + = f.label :attachment + %cite (less than 10 MB) + %br + = f.file_field :attachment + + = check_box_tag :notify, 1, true + = label_tag :notify, "Notify project team about your note" + + .clear + %br + = f.submit 'Add note', :class => "lbutton vm" diff --git a/app/views/notes/_notes.html.haml b/app/views/notes/_notes.html.haml new file mode 100644 index 00000000000..457bb8db763 --- /dev/null +++ b/app/views/notes/_notes.html.haml @@ -0,0 +1,14 @@ +%ul#notes-list + - @notes.each do |note| + = render :partial => "notes/show", :locals => {:note => note} + +%br +%br +- if can? current_user, :write_note, @project + = render "notes/form" + +:javascript + $('.delete-note').live('ajax:success', function() { + $(this).closest('li').fadeOut(); }); + + diff --git a/app/views/notes/_show.html.haml b/app/views/notes/_show.html.haml new file mode 100644 index 00000000000..2b0a6d2ebcd --- /dev/null +++ b/app/views/notes/_show.html.haml @@ -0,0 +1,19 @@ +%li{:id => dom_id(note)} + %div.note_author + = image_tag gravatar_icon(note.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" + %div.note_content + = simple_format(html_escape(note.note)) + - if note.attachment.url + Attachment: + = link_to note.attachment_identifier, note.attachment.url + %br + %span + %span + [ #{note.author.name} ] + + = time_ago_in_words(note.updated_at) + ago + %br + - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) + = link_to 'Remove', [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-note right negative" + .clear diff --git a/app/views/notes/create.js.haml b/app/views/notes/create.js.haml new file mode 100644 index 00000000000..47cff1d8834 --- /dev/null +++ b/app/views/notes/create.js.haml @@ -0,0 +1,8 @@ +- if @note.valid? + :plain + $("#new_note .errors").remove(); + $("#notes-list").append("#{escape_javascript(render(:partial => 'show', :locals => {:note => @note} ))}"); + $('#note_note').val(""); +- else + :plain + $("#new_note").replaceWith("#{escape_javascript(render('form'))}"); diff --git a/app/views/notify/new_issue_email.html.haml b/app/views/notify/new_issue_email.html.haml new file mode 100644 index 00000000000..213a73796cf --- /dev/null +++ b/app/views/notify/new_issue_email.html.haml @@ -0,0 +1,18 @@ +%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} + %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} + %tr + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{:align => "left", :style => "padding: 20px 0 0;"} + %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + Hi #{@user.name}! New Issue was created and assigned to you. + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %tr + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{:align => "left", :style => "padding: 20px 0 0;"} + %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + = link_to project_issue_url(@project, @issue) do + = "Issue ##{@issue.id.to_s}" + = truncate(@issue.title, :length => 45) + %br + %cite{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + = @issue.content diff --git a/app/views/notify/new_user_email.html.haml b/app/views/notify/new_user_email.html.haml new file mode 100644 index 00000000000..969ea7e5298 --- /dev/null +++ b/app/views/notify/new_user_email.html.haml @@ -0,0 +1,23 @@ +%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} + %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} + %tr + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{:align => "left", :style => "padding: 20px 0 0;"} + %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + Hi #{@user.name}! + %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + Administrator created account for you. Now you are a member of company gitlab application. + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %tr + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{:style => "padding: 15px 0 15px;", :valign => "top"} + %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "} + login.......................................... + %code= @user.email + %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "} + password.................................. + %code= @password + %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + = link_to "Click here to login", root_url + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + diff --git a/app/views/notify/note_commit_email.html.haml b/app/views/notify/note_commit_email.html.haml new file mode 100644 index 00000000000..09ae54ac629 --- /dev/null +++ b/app/views/notify/note_commit_email.html.haml @@ -0,0 +1,23 @@ +%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} + %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} + %tr + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{:align => "left", :style => "padding: 20px 0 0;"} + %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + New comment for commmit + = link_to truncate(@commit.id.to_s, :length => 16), project_commit_url(@project, :id => @commit.id) + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %tr + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{:style => "padding: 15px 0 15px;", :valign => "top"} + %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author.name} + left next message: + %br + %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} + %tr + %td{:valign => "top"} + %cite{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + = @note.note + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + diff --git a/app/views/notify/note_issue_email.html.haml b/app/views/notify/note_issue_email.html.haml new file mode 100644 index 00000000000..54982af6286 --- /dev/null +++ b/app/views/notify/note_issue_email.html.haml @@ -0,0 +1,25 @@ +%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} + %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} + %tr + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{:align => "left", :style => "padding: 20px 0 0;"} + %h2{:style => "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + New comment - + = link_to project_issue_url(@project, @issue) do + = "Issue ##{@issue.id.to_s}" + = truncate(@issue.title, :length => 35) + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %tr + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{:style => "padding: 15px 0 15px;", :valign => "top"} + %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author.name} + left next message: + %br + %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} + %tr + %td{:valign => "top"} + %cite{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + = @note.note + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + diff --git a/app/views/notify/note_wall_email.html.haml b/app/views/notify/note_wall_email.html.haml new file mode 100644 index 00000000000..285fc763613 --- /dev/null +++ b/app/views/notify/note_wall_email.html.haml @@ -0,0 +1,22 @@ +%td.content{:align => "left", :style => "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", :valign => "top", :width => "600"} + %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :style => "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", :width => "600"} + %tr + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{:align => "left", :style => "padding: 20px 0 0;"} + %h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "} + New message on + = link_to "Project Wall", wall_project_url(@project) + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %tr + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} + %td{:style => "padding: 15px 0 15px;", :valign => "top"} + %p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + %a{:href => "#", :style => "color: #0eb6ce; text-decoration: none;"} #{@note.author.name} + left next message: + %br + %table{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "558"} + %tr + %td{:valign => "top"} + %cite{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "} + = @note.note + %td{:style => "font-size: 1px; line-height: 1px;", :width => "21"} diff --git a/app/views/profile/_top_menu.html.haml b/app/views/profile/_top_menu.html.haml new file mode 100644 index 00000000000..6bf3b09f499 --- /dev/null +++ b/app/views/profile/_top_menu.html.haml @@ -0,0 +1,5 @@ +%div.top_project_menu + %span= link_to "Profile", profile_path, :class => current_page?(:controller => "profile", :action => :show) ? "current" : nil + %span= link_to "Password", profile_password_path, :style => "width:70px;", :class => current_page?(:controller => "profile", :action => :password) ? "current" : nil + %span= link_to "Keys", keys_path, :class => controller.controller_name == "keys" ? "current" : nil + diff --git a/app/views/profile/index.html.haml b/app/views/profile/index.html.haml new file mode 100644 index 00000000000..84174ac5be7 --- /dev/null +++ b/app/views/profile/index.html.haml @@ -0,0 +1 @@ +%h1 Profile diff --git a/app/views/profile/password.html.haml b/app/views/profile/password.html.haml new file mode 100644 index 00000000000..f77d3855364 --- /dev/null +++ b/app/views/profile/password.html.haml @@ -0,0 +1,20 @@ +%p Note: after success password update you will be redirected to login page where you should login with new password += form_for @user, :url => profile_password_path, :method => :put do |f| + -if @user.errors.any? + #error_explanation + %h2= "#{pluralize(@user.errors.count, "error")} prohibited this password from being saved:" + %ul + - @user.errors.full_messages.each do |msg| + %li= msg + + .div + = f.label :password + %br + = f.password_field :password + .div + = f.label :password_confirmation + %br + = f.password_field :password_confirmation + .actions + = f.submit 'Save', :class => "lbutton vm" + diff --git a/app/views/profile/show.html.haml b/app/views/profile/show.html.haml new file mode 100644 index 00000000000..12737ba8143 --- /dev/null +++ b/app/views/profile/show.html.haml @@ -0,0 +1,8 @@ +.span-2 + = image_tag gravatar_icon(@user.email), :class => "left", :width => 60, :style => "padding-right:5px;" +%p + %b Name: + = @user.name +%p + %b Email: + = @user.email diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml new file mode 100644 index 00000000000..baa1f14fe06 --- /dev/null +++ b/app/views/projects/_form.html.haml @@ -0,0 +1,50 @@ += form_for(@project, :remote => true) do |f| + %div.form_content + - if @project.new_record? + %h1 New Project + - else + %h1 Edit Project + - if @project.errors.any? + #error_explanation + %h2 + = pluralize(@project.errors.count, "error") + prohibited this project from being saved: + %ul + - @project.errors.full_messages.each do |msg| + %li= msg + %table.round-borders + %tr + %td= f.label :name + %td= f.text_field :name, :placeholder => "Example Project" + %tr + %td + .left= f.label :path + %cite.right git@yourserver: + %td + = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record? + %tr + %td + .left= f.label :code + %cite.right http://yourserver/ + %td= f.text_field :code, :placeholder => "example (3..12 symbols only)" + .field + = f.label :description + %br/ + = f.text_area :description, :style => "height:140px;width:932px;" + .clear + %hr.prepend-top + .actions + = f.submit :class => "lbutton vm" + + %div{ :class => "ajax_loader", :style => "display:none;height:200px;"} + %center + = image_tag "ajax-loader.gif", :class => "append-bottom" + - if @project.new_record? + %h3.prepend-top Creating project & repository. Please wait for few minutes + - else + %h3.prepend-top Updating project & repository. Please wait for few minutes +:javascript + $('.new_project, .edit_project').bind('ajax:before', function() { + $(this).find(".form_content").hide(); + $('.ajax_loader').show(); + }); diff --git a/app/views/projects/_list.html.haml b/app/views/projects/_list.html.haml new file mode 100644 index 00000000000..82e1948c757 --- /dev/null +++ b/app/views/projects/_list.html.haml @@ -0,0 +1,26 @@ +-#- if current_user.can_create_project? + = link_to 'New Project', new_project_path, :class => "lbutton vm" + +%table.round-borders#projects-list + %tr + %th Name + %th Path + %th Code + %th Web + %th Git + %th Admin + %th Actions + + - @projects.each do |project| + %tr{ :class => "project", :url => project_path(project) } + %td= project.name + %td= truncate project.url_to_repo + %td= project.code + %td= check_box_tag "read", 1, project.readers.include?(current_user), :disabled => :disabled + %td= check_box_tag "commit", 1, project.writers.include?(current_user), :disabled => :disabled + %td= check_box_tag "admin", 1, project.admins.include?(current_user), :disabled => :disabled + %td + -if can? current_user, :admin_project, project + = link_to 'Edit', edit_project_path(project), :class => "lbutton positive" +%br + diff --git a/app/views/projects/_projects_top_menu.html.haml b/app/views/projects/_projects_top_menu.html.haml new file mode 100644 index 00000000000..be04c57e842 --- /dev/null +++ b/app/views/projects/_projects_top_menu.html.haml @@ -0,0 +1,16 @@ +%div.top_project_menu + %span= link_to 'All', projects_path, :class => current_page?(projects_path) ? "current" : nil + %span= link_to "New Project", new_project_path, :class => current_page?(:controller => "projects", :action => "new") ? "current" : nil + %span.right + = link_to_function(image_tag("list_view_icon.jpg"), "switchProjectView()", :style => "border:none;box-shadow:none;") + +:javascript + function switchProjectView(){ + $(".tile").toggle(); + $(".list").toggle(); + if($(".tile").is(":visible")){ + $.cookie('project_view', 'tile', { expires: 14 }); + } else { + $.cookie('project_view', 'list', { expires: 14 }); + } + } diff --git a/app/views/projects/_side_panel.html.haml b/app/views/projects/_side_panel.html.haml new file mode 100644 index 00000000000..2f786b4d242 --- /dev/null +++ b/app/views/projects/_side_panel.html.haml @@ -0,0 +1,14 @@ +%h3.notice{:style => "width:235px;"} + = @project.name +%p + %b Path: + = @project.path +%p + %b Description: + = truncate @project.description +.left.append-bottom + = link_to "Tree", tree_project_path(@project), :class => "button" + = link_to "Commits", project_commits_path(@project), :class => "button" + = link_to 'Team', team_project_path(@project), :class => "button" + - if can? current_user, :admin_project, @project + = link_to 'Edit', edit_project_path(@project), :class => "button positive" diff --git a/app/views/projects/_team.html.haml b/app/views/projects/_team.html.haml new file mode 100644 index 00000000000..bb9063369c3 --- /dev/null +++ b/app/views/projects/_team.html.haml @@ -0,0 +1,18 @@ +- if can? current_user, :admin_team_member, @project + %div#new-member-holder + = link_to "Add new", new_project_team_member_path(@project), :remote => true, :class => "lbutton vm" +%table.round-borders#team-table + %tr + %th Name + %th Email + %th Web + %th Git + %th Admin + - if can? current_user, :admin_team_member, @project + %th Actions + - @project.users_projects.each do |up| + = render(:partial => 'team_members/show', :locals => {:member => up}) + +:javascript + $('.delete-team-member').live('ajax:success', function() { + $(this).closest('tr').fadeOut(); }); diff --git a/app/views/projects/_tile.html.haml b/app/views/projects/_tile.html.haml new file mode 100644 index 00000000000..037aeccb228 --- /dev/null +++ b/app/views/projects/_tile.html.haml @@ -0,0 +1,16 @@ +- @projects.in_groups_of(3, false) do |projects| + - projects.each_with_index do |project, i| + %div{ :class => "project_thumb round-borders", :style => i == 2 ? "" : "margin-right:30px;" } + %div{ :class => "project", :url => project_path(project) } + %h2 + = image_tag gravatar_icon(project.name), :class => "left", :width => 40, :style => "padding-right:5px;" + = "/" + project.code + %p= project.name + %p= project.url_to_repo + -#%p + Commit – + = last_commit(project) + %hr + = link_to "Browse Code", tree_project_path(project), :class => "lbutton" + = link_to "Commits", project_commits_path(project), :class => "lbutton", :style => "float:right;width:80px;" + .clear diff --git a/app/views/projects/_top_menu.html.haml b/app/views/projects/_top_menu.html.haml new file mode 100644 index 00000000000..b81ba6bb4d6 --- /dev/null +++ b/app/views/projects/_top_menu.html.haml @@ -0,0 +1,24 @@ +%div.top_project_menu + -#%span= link_to @project.code.capitalize, @project, :class => current_page?(:controller => "projects", :action => "show", :id => @project) ? "current" : nil + - if @project.repo_exists? + %span= link_to "Tree", tree_project_path(@project), :class => current_page?(:controller => "projects", :action => "show", :id => @project) || current_page?(:controller => "projects", :action => "tree", :id => @project) ? "current" : nil + %span= link_to "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_id => @project) ? "current" : nil + %span + = link_to team_project_path(@project), :class => current_page?(:controller => "projects", :action => "team", :id => @project) ? "current" : nil do + Team + - if @project.users_projects.count > 0 + %span{ :class => "top_menu_count" }= @project.users_projects.count + %span + = link_to project_issues_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do + Issues + - if @project.issues.opened.count > 0 + %span{ :class => "top_menu_count" }= @project.issues.opened.count + %span + = link_to wall_project_path(@project), :class => current_page?(:controller => "projects", :action => "wall", :id => @project) ? "current" : nil do + Wall + - if @project.common_notes.count > 0 + %span{ :class => "top_menu_count" }= @project.common_notes.count + + - if @commit + %span= link_to truncate(commit_name(@project,@commit), :length => 15), project_commit_path(@project, :id => @commit.id), :class => current_page?(:controller => "commits", :action => "show", :project_id => @project, :id => @commit.id) ? "current" : nil + diff --git a/app/views/projects/_tree.html.haml b/app/views/projects/_tree.html.haml new file mode 100644 index 00000000000..af3a209a8ab --- /dev/null +++ b/app/views/projects/_tree.html.haml @@ -0,0 +1,60 @@ +%h3 + .left + = form_tag tree_project_path(@project), :method => :get do + = select_tag "branch", options_for_select(@repo.heads.map(&:name), @branch), :onchange => "this.form.submit();", :class => "", :prompt => "Branches" + + .left.prepend-1 + = form_tag tree_project_path(@project), :method => :get do + = select_tag "tag", options_for_select(@project.tags, @branch), :onchange => "this.form.submit();", :class => "", :prompt => "Tags" + = text_field_tag "ssh", @project.url_to_repo, :class => ["ssh_project_url","one_click_select"] + .clear + +%h3#tree-breadcrumbs + = link_to @project.name, tree_project_path(@project, :path => nil, :commit_id => @commit.try(:id)), :remote => true + - if params[:path] + - part_path = "" + - params[:path].split("\/").each do |part| + - part_path = File.join(part_path, part) unless part_path.empty? + - if part_path.empty? + - part_path = part + \/ + = link_to truncate(part, :length => 40), tree_file_project_path(@project, :path => part_path, :commit_id => @commit.try(:id)), :remote => :true +#tree-content-holder + - if tree.is_a?(Grit::Blob) + = render :partial => "projects/tree_file", :locals => { :name => tree.name, :content => tree.data, :file => tree } + - else + - contents = tree.contents + %table#tree-slider.round-borders + %tr + %th Name + %th Last Update + %th + Last commit + = link_to "history", project_commits_path(@project, :path => params[:path]), :class => "right" + - if params[:path] + - file = File.join(params[:path], "..") + %tr{ :class => "tree-item", :url => tree_file_project_path(@project, @commit.id, file) } + %td.tree-item-file-name + = image_tag "dir.png" + = link_to "..", tree_file_project_path(@project, @commit.id, file), :remote => :true + %td + %td + + - contents.select{ |i| i.is_a?(Grit::Tree)}.each do |content| + = render :partial => "projects/tree_item", :locals => { :content => content } + - contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content| + = render :partial => "projects/tree_item", :locals => { :content => content } + +:javascript + $(function(){ + $('select#branch').selectmenu({style:'popup', width:200}); + $('select#tag').selectmenu({style:'popup', width:200}); + }); + +- if params[:path] && request.xhr? + :javascript + $(window).unbind('popstate'); + $(window).bind('popstate', function() { + if(location.pathname.search("tree") != -1) { + $.ajax({type: "GET", url: location.pathname, dataType: "script"})} + else { location.href = location.pathname;}}); diff --git a/app/views/projects/_tree_file.html.haml b/app/views/projects/_tree_file.html.haml new file mode 100644 index 00000000000..08927fc2aac --- /dev/null +++ b/app/views/projects/_tree_file.html.haml @@ -0,0 +1,21 @@ +- require "utils" +.view_file + .view_file_header + %strong + = name + -#= file.mime_type + = link_to "raw", blob_project_path(@project, :commit_id => @commit.id, :path => params[:path] ), :class => "right", :target => "_blank" + = link_to "history", project_commits_path(@project, :path => params[:path]), :class => "right", :style => "margin-right:10px;" + %br/ + - if file.mime_type =~ /application|text/ && !Utils.binary?(file.data) + .view_file_content + - ft = handle_file_type(file.name, file.mime_type) + :erb + <%= raw Albino.colorize(content, ft, :html, 'utf-8', "linenos=True") %> + - elsif file.mime_type =~ /image/ + .view_file_content_image + %img{ :src => "data:image/jpeg;base64,#{Base64.encode64(file.data)}"} + - else + %p + %center No preview for this file type + diff --git a/app/views/projects/_tree_item.html.haml b/app/views/projects/_tree_item.html.haml new file mode 100644 index 00000000000..7179368a0c3 --- /dev/null +++ b/app/views/projects/_tree_item.html.haml @@ -0,0 +1,15 @@ +- file = params[:path] ? File.join(params[:path], content.name) : content.name +- content_commit = @project.repo.log(@branch, file, :max_count => 1).last +- return unless content_commit +%tr{ :class => "tree-item", :url => tree_file_project_path(@project, @commit.id, file) } + %td.tree-item-file-name + - if content.is_a?(Grit::Blob) + = image_tag "txt.png" + - else + = image_tag "dir.png" + = link_to truncate(content.name, :length => 40), tree_file_project_path(@project, @commit.id, file), :remote => :true + %td + = time_ago_in_words(content_commit.committed_date) + ago + %td + = link_to truncate(content_commit.message, :length => 40), project_commit_path(@project, content_commit) diff --git a/app/views/projects/create.js.haml b/app/views/projects/create.js.haml new file mode 100644 index 00000000000..c457527aed4 --- /dev/null +++ b/app/views/projects/create.js.haml @@ -0,0 +1,6 @@ +- if @project.valid? + :plain + location.href = "#{project_path(@project, :notice => 'Project was successfully created.')}"; +- else + :plain + $("#new_project").replaceWith("#{escape_javascript(render('form'))}"); diff --git a/app/views/projects/edit.html.erb b/app/views/projects/edit.html.erb new file mode 100644 index 00000000000..2d3436368bd --- /dev/null +++ b/app/views/projects/edit.html.erb @@ -0,0 +1 @@ +<%= render 'form' %> diff --git a/app/views/projects/empty.html.erb b/app/views/projects/empty.html.erb new file mode 100644 index 00000000000..a8917471550 --- /dev/null +++ b/app/views/projects/empty.html.erb @@ -0,0 +1,49 @@ +<div class=""> + <div class="git-empty"> + <h2>Git global setup:</h2> +<% setup_str = <<eos +git config --global user.name "#{current_user.name}" +git config --global user.email "#{current_user.email}" +eos +%> + <%= raw Albino.colorize(setup_str, :bash) %> + <br /> + <br /> + <h2>Next steps:</h2> +<% repo_setup_str = <<eos +mkdir #{@project.path} +cd #{@project.path} +git init +touch README +git add README +git commit -m 'first commit' +git remote add origin #{@project.url_to_repo} +git push -u origin master +eos +%> + <%= raw Albino.colorize(repo_setup_str, :bash) %> + + <br /><br /> + <h2>Existing Git Repo?</h2> +<% exist_repo_setup_str = <<eos +cd existing_git_repo +git remote add origin #{@project.url_to_repo} +git push -u origin master +eos +%> + <%= raw Albino.colorize(exist_repo_setup_str, :bash) %> + + <br /><br /> + <h2>Remove this project?</h2> + <div class="error"> + <p> + Be careful! <br/> + Project cant be recovered after destroy.</p> + <%= link_to 'Destroy', @project, + :confirm => 'Are you sure?', :method => :delete, + :class => "left button negative span-6", :style => "text-align:center" %> + <div class="clear"></div> + </div> + <br/> + </div> +</div> diff --git a/app/views/projects/index.html.haml b/app/views/projects/index.html.haml new file mode 100644 index 00000000000..22af6b7551a --- /dev/null +++ b/app/views/projects/index.html.haml @@ -0,0 +1,4 @@ +%div{:class => "tile", :style => view_mode_style("tile")} + = render "tile" +%div{:class => "list", :style => view_mode_style("list")} + = render "list" diff --git a/app/views/projects/new.html.erb b/app/views/projects/new.html.erb new file mode 100644 index 00000000000..2d3436368bd --- /dev/null +++ b/app/views/projects/new.html.erb @@ -0,0 +1 @@ +<%= render 'form' %> diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml new file mode 100644 index 00000000000..0fd9c8ead19 --- /dev/null +++ b/app/views/projects/show.html.haml @@ -0,0 +1,3 @@ +%div + %div#tree-holder + = render :partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @commit.tree} diff --git a/app/views/projects/team.html.haml b/app/views/projects/team.html.haml new file mode 100644 index 00000000000..3b2c4b3ef9c --- /dev/null +++ b/app/views/projects/team.html.haml @@ -0,0 +1,3 @@ +%div + = render :partial => "team", :locals => {:project => @project} + diff --git a/app/views/projects/tree.html.erb b/app/views/projects/tree.html.erb new file mode 100644 index 00000000000..c29ed2f90d4 --- /dev/null +++ b/app/views/projects/tree.html.erb @@ -0,0 +1,5 @@ +<div> + <div id="tree-holder"> + <%= render :partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree} %> + </div> +</div> diff --git a/app/views/projects/tree.js.haml b/app/views/projects/tree.js.haml new file mode 100644 index 00000000000..60cbd199165 --- /dev/null +++ b/app/views/projects/tree.js.haml @@ -0,0 +1,5 @@ +:plain + $("#tree-holder table").hide("slide", { direction: "left" }, 150, function(){ + $("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}"); + $("#tree-holder table").show("slide", { direction: "right" }, 150); + }); diff --git a/app/views/projects/update.js.haml b/app/views/projects/update.js.haml new file mode 100644 index 00000000000..0188f083735 --- /dev/null +++ b/app/views/projects/update.js.haml @@ -0,0 +1,6 @@ +- if @project.valid? + :plain + location.href = "#{project_path(@project, :notice => 'Project was successfully updated.')}"; +- else + :plain + $(".edit_project").replaceWith("#{escape_javascript(render('form'))}"); diff --git a/app/views/projects/wall.html.haml b/app/views/projects/wall.html.haml new file mode 100644 index 00000000000..479bb3cfc5b --- /dev/null +++ b/app/views/projects/wall.html.haml @@ -0,0 +1 @@ += render "notes/notes" diff --git a/app/views/team_members/_form.html.haml b/app/views/team_members/_form.html.haml new file mode 100644 index 00000000000..d2f7fd66dce --- /dev/null +++ b/app/views/team_members/_form.html.haml @@ -0,0 +1,25 @@ +%div + = form_for @team_member, :as => :team_member, :url => project_team_members_path(@project, @team_member), :remote => "true" do |f| + -if @team_member.errors.any? + %ul + - @team_member.errors.full_messages.each do |msg| + %li= msg + + .span-6.append-bottom + %b Name + %br + = f.select(:user_id, User.not_in_project(@project).all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) + .span-6 + %b Access: + .span-6 + = f.check_box :read + Web Access + .span-6 + = f.check_box :write + Git Access + .span-6.append-bottom + = f.check_box :admin + Admin + %hr + .span-6 + = f.submit 'Save', :class => "lbutton vm" diff --git a/app/views/team_members/_show.html.haml b/app/views/team_members/_show.html.haml new file mode 100644 index 00000000000..6d310768afa --- /dev/null +++ b/app/views/team_members/_show.html.haml @@ -0,0 +1,18 @@ +- user = member.user +%tr{:id => dom_id(member)} + %td + = image_tag gravatar_icon(user.email), :class => "left", :width => 40, :style => "padding:0 5px;" + = truncate user.name, :lenght => 16 + %td= truncate user.email, :lenght => 16 + - if can? current_user, :admin_project, @project + = form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f| + %td= f.check_box :read, :onclick => "$(this.form).submit();" + %td= f.check_box :write, :onclick => "$(this.form).submit();" + %td= f.check_box :admin, :onclick => "$(this.form).submit();" + - else + %td= check_box_tag "read", 1, member.read, :disabled => :disabled + %td= check_box_tag "commit", 1, member.write, :disabled => :disabled + %td= check_box_tag "admin", 1, member.admin, :disabled => :disabled + - if can? current_user, :admin_team_member, @project + %td + = link_to 'Cancel', project_team_member_path(:project_id => @project, :id => member.id), :confirm => 'Are you sure?', :method => :delete, :class => "lbutton negative delete-team-member", :remote => true diff --git a/app/views/team_members/create.js.haml b/app/views/team_members/create.js.haml new file mode 100644 index 00000000000..74dacc2820c --- /dev/null +++ b/app/views/team_members/create.js.haml @@ -0,0 +1,9 @@ +- if @team_member.valid? + :plain + $("#new_tm_dialog").dialog("close"); + $("#team-table").append("#{escape_javascript(render(:partial => 'show', :locals => {:member => @team_member} ))}"); +- else + :plain + $("#new_tm_dialog").empty(); + $("#new_tm_dialog").append("#{escape_javascript(render('form'))}"); + $('select#team_member_user_id').selectmenu({width:300}); diff --git a/app/views/team_members/new.js.haml b/app/views/team_members/new.js.haml new file mode 100644 index 00000000000..93bebba6d5e --- /dev/null +++ b/app/views/team_members/new.js.haml @@ -0,0 +1,15 @@ +-#$("#new-member-holder").empty(); +-#$("#new-member-holder").append("#{escape_javascript(render('form'))}"); +:plain + var new_tm_dialog = $("<div id='new_tm_dialog'></div>"); + new_tm_dialog.html("#{escape_javascript(render('form'))}"); + $(new_tm_dialog).dialog({ + width: 350, + resizable: false, + draggable: false, + title: "Add new member to project team", + close: function(event, ui) { $("#new_tm_dialog").remove();}, + modal: true + + }); + $('select#team_member_user_id').selectmenu({width:300}); diff --git a/app/views/team_members/update.js.haml b/app/views/team_members/update.js.haml new file mode 100644 index 00000000000..6d7f88160de --- /dev/null +++ b/app/views/team_members/update.js.haml @@ -0,0 +1,6 @@ +- if @team_member.valid? + :plain + $("##{dom_id(@team_member)}").effect("highlight", {color: "#529214"}, 1000);; +- else + :plain + $("##{dom_id(@team_member)}").effect("highlight", {color: "#D12F19"}, 1000);; |