Commit b8ca1d62 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'dev'

Conflicts:
	app/assets/images/ajax-loader.gif
	public/favicon.ico
parents 23187d60 1d1b5186
...@@ -5,7 +5,7 @@ gem 'rails', '3.1.0' ...@@ -5,7 +5,7 @@ gem 'rails', '3.1.0'
gem 'sqlite3' gem 'sqlite3'
gem 'devise', "1.4.7" gem 'devise', "1.4.7"
gem 'stamp' gem 'stamp'
gem 'will_paginate', '~> 3.0' gem 'kaminari'
gem 'haml-rails' gem 'haml-rails'
gem 'jquery-rails' gem 'jquery-rails'
gem 'grit', :git => 'git://github.com/gitlabhq/grit.git' gem 'grit', :git => 'git://github.com/gitlabhq/grit.git'
...@@ -16,10 +16,12 @@ gem 'faker' ...@@ -16,10 +16,12 @@ gem 'faker'
gem 'seed-fu', :git => 'git://github.com/mbleigh/seed-fu.git' gem 'seed-fu', :git => 'git://github.com/mbleigh/seed-fu.git'
gem "inifile" gem "inifile"
gem "pygments.rb", "0.2.3" gem "pygments.rb", "0.2.3"
gem "kaminari"
gem "thin" gem "thin"
gem "git" gem "git"
gem "acts_as_list" gem "acts_as_list"
gem 'rdiscount'
gem 'acts-as-taggable-on', '~>2.1.0'
group :assets do group :assets do
gem 'sass-rails', " ~> 3.1.0" gem 'sass-rails', " ~> 3.1.0"
...@@ -28,13 +30,14 @@ group :assets do ...@@ -28,13 +30,14 @@ group :assets do
end end
group :development do group :development do
gem 'letter_opener'
gem 'rails-footnotes', '>= 3.7.5.rc4' gem 'rails-footnotes', '>= 3.7.5.rc4'
gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git' gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'
end end
group :development, :test do group :development, :test do
gem 'rspec-rails' gem 'rspec-rails'
gem 'shoulda' gem "shoulda", "~> 3.0.0.beta2"
gem 'capybara' gem 'capybara'
gem 'autotest' gem 'autotest'
gem 'autotest-rails' gem 'autotest-rails'
......
...@@ -54,6 +54,8 @@ GEM ...@@ -54,6 +54,8 @@ GEM
activesupport (= 3.1.0) activesupport (= 3.1.0)
activesupport (3.1.0) activesupport (3.1.0)
multi_json (~> 1.0) multi_json (~> 1.0)
acts-as-taggable-on (2.1.1)
rails
acts_as_list (0.1.4) acts_as_list (0.1.4)
addressable (2.2.6) addressable (2.2.6)
ansi (1.3.0) ansi (1.3.0)
...@@ -119,6 +121,8 @@ GEM ...@@ -119,6 +121,8 @@ GEM
rails (>= 3.0.0) rails (>= 3.0.0)
launchy (2.0.5) launchy (2.0.5)
addressable (~> 2.2.6) addressable (~> 2.2.6)
letter_opener (0.0.2)
launchy
libv8 (3.3.10.2) libv8 (3.3.10.2)
linecache19 (0.5.12) linecache19 (0.5.12)
ruby_core_source (>= 0.1.4) ruby_core_source (>= 0.1.4)
...@@ -161,6 +165,7 @@ GEM ...@@ -161,6 +165,7 @@ GEM
rdoc (~> 3.4) rdoc (~> 3.4)
thor (~> 0.14.6) thor (~> 0.14.6)
rake (0.9.2) rake (0.9.2)
rdiscount (1.6.8)
rdoc (3.9.4) rdoc (3.9.4)
rspec (2.6.0) rspec (2.6.0)
rspec-core (~> 2.6.0) rspec-core (~> 2.6.0)
...@@ -200,7 +205,11 @@ GEM ...@@ -200,7 +205,11 @@ GEM
ffi (>= 1.0.7) ffi (>= 1.0.7)
json_pure json_pure
rubyzip rubyzip
shoulda (2.11.3) shoulda (3.0.0.beta2)
shoulda-context (~> 1.0.0.beta1)
shoulda-matchers (~> 1.0.0.beta1)
shoulda-context (1.0.0.beta1)
shoulda-matchers (1.0.0.beta3)
simplecov (0.5.3) simplecov (0.5.3)
multi_json (~> 1.0.3) multi_json (~> 1.0.3)
simplecov-html (~> 0.5.3) simplecov-html (~> 0.5.3)
...@@ -232,7 +241,6 @@ GEM ...@@ -232,7 +241,6 @@ GEM
multi_json (>= 1.0.2) multi_json (>= 1.0.2)
warden (1.0.5) warden (1.0.5)
rack (>= 1.0) rack (>= 1.0)
will_paginate (3.0.0)
xpath (0.1.4) xpath (0.1.4)
nokogiri (~> 1.3) nokogiri (~> 1.3)
...@@ -240,6 +248,7 @@ PLATFORMS ...@@ -240,6 +248,7 @@ PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
acts-as-taggable-on (~> 2.1.0)
acts_as_list acts_as_list
annotate! annotate!
autotest autotest
...@@ -258,14 +267,16 @@ DEPENDENCIES ...@@ -258,14 +267,16 @@ DEPENDENCIES
jquery-rails jquery-rails
kaminari kaminari
launchy launchy
letter_opener
pygments.rb (= 0.2.3) pygments.rb (= 0.2.3)
rails (= 3.1.0) rails (= 3.1.0)
rails-footnotes (>= 3.7.5.rc4) rails-footnotes (>= 3.7.5.rc4)
rdiscount
rspec-rails rspec-rails
ruby-debug19 ruby-debug19
sass-rails (~> 3.1.0) sass-rails (~> 3.1.0)
seed-fu! seed-fu!
shoulda shoulda (~> 3.0.0.beta2)
simplecov simplecov
six six
sqlite3 sqlite3
...@@ -274,4 +285,3 @@ DEPENDENCIES ...@@ -274,4 +285,3 @@ DEPENDENCIES
thin thin
turn turn
uglifier uglifier
will_paginate (~> 3.0)
[Dolphin] [Dolphin]
ShowPreview=true ShowPreview=true
Timestamp=2011,9,14,20,34,18 Timestamp=2011,10,28,13,16,25
Version=2 Version=2
...@@ -5,11 +5,15 @@ ...@@ -5,11 +5,15 @@
// the compiled file. // the compiled file.
// //
//= require jquery //= require jquery
//= require jquery-ui
//= require jquery_ujs //= require jquery_ujs
//= require jquery.ui.selectmenu
//= require jquery.tagify
//= require jquery.cookie
//= require_tree . //= require_tree .
$(function(){ $(function(){
$(".one_click_select").click(function(){ $(".one_click_select").live("click", function(){
$(this).select(); $(this).select();
}); });
...@@ -17,6 +21,6 @@ $(function(){ ...@@ -17,6 +21,6 @@ $(function(){
$('select#tag').selectmenu({style:'popup', width:200}); $('select#tag').selectmenu({style:'popup', width:200});
}); });
function updatePage(){ function updatePage(data){
$.ajax({type: "GET", url: location.href, dataType: "script"}); $.ajax({type: "GET", url: location.href, data: data, dataType: "script"});
} }
This diff is collapsed.
...@@ -7,3 +7,51 @@ $(document).ready(function(){ ...@@ -7,3 +7,51 @@ $(document).ready(function(){
} }
}); });
}); });
var CommitsList = {
ref:null,
limit:0,
offset:0,
init:
function(ref, limit) {
this.ref=ref;
this.limit=limit;
this.offset=limit;
this.initLoadMore();
$('.loading').show();
},
getOld:
function() {
$('.loading').show();
$.ajax({
type: "GET",
url: location.href,
data: "limit=" + this.limit + "&offset=" + this.offset + "&ref=" + this.ref,
complete: function(){ $('.loading').hide()},
dataType: "script"});
},
append:
function(count, html) {
$("#commits_list").append(html);
if(count > 0) {
this.offset += count;
this.initLoadMore();
}
},
initLoadMore:
function() {
$(window).bind('scroll', function(){
if($(window).scrollTop() == $(document).height() - $(window).height()){
$(window).unbind('scroll');
CommitsList.getOld();
}
});
}
}
This diff is collapsed.
var NoteList = {
first_id: 0,
last_id: 0,
resource_name: null,
init:
function(resource_name, first_id, last_id) {
this.resource_name = resource_name;
this.first_id = first_id;
this.last_id = last_id;
this.initRefresh();
this.initLoadMore();
},
getOld:
function() {
$('.loading').show();
$.ajax({
type: "GET",
url: location.href,
data: "first_id=" + this.first_id,
complete: function(){ $('.loading').hide()},
dataType: "script"});
},
append:
function(id, html) {
this.first_id = id;
$("#notes-list").append(html);
this.initLoadMore();
},
replace:
function(fid, lid, html) {
this.first_id = fid;
this.last_id = lid;
$("#notes-list").html(html);
this.initLoadMore();
},
prepend:
function(id, html) {
this.last_id = id;
$("#notes-list").prepend(html);
},
getNew:
function() {
// refersh notes list
$.ajax({
type: "GET",
url: location.href,
data: "last_id=" + this.last_id,
dataType: "script"});
},
refresh:
function() {
// refersh notes list
$.ajax({
type: "GET",
url: location.href,
data: "first_id=" + this.first_id + "&last_id=" + this.last_id,
dataType: "script"});
},
initRefresh:
function() {
// init timer
var intNew = setInterval("NoteList.getNew()", 15000);
var intRefresh = setInterval("NoteList.refresh()", 90000);
},
initLoadMore:
function() {
$(window).bind('scroll', function(){
if($(window).scrollTop() == $(document).height() - $(window).height()){
$(window).unbind('scroll');
NoteList.getOld();
}
});
}
}
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
* This is a manifest file that'll automatically include all the stylesheets available in this directory * This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope. * the top of the compiled file, but it's generally better to create a new file per style scope.
*= require jquery-ui/jquery-ui
*= require jquery-ui/jquery.ui.selectmenu
*= require jquery-ui/jquery.tagify
*= require_self *= require_self
*= require_tree . *= require_tree .
*/ */
This diff is collapsed.
...@@ -53,7 +53,6 @@ table.highlighttable pre{ ...@@ -53,7 +53,6 @@ table.highlighttable pre{
text-align:left; text-align:left;
} }
.git-empty .highlight { .git-empty .highlight {
@include round-borders-all(4px); @include round-borders-all(4px);
background:#eee; background:#eee;
...@@ -74,7 +73,6 @@ table.highlighttable pre{ ...@@ -74,7 +73,6 @@ table.highlighttable pre{
box-shadow:0 5px 15px #000; box-shadow:0 5px 15px #000;
} }
.hll { background-color: #ffffff } .hll { background-color: #ffffff }
.c { color: #888888; font-style: italic } /* Comment */ .c { color: #888888; font-style: italic } /* Comment */
.err { color: #a61717; background-color: #e3d2d2 } /* Error */ .err { color: #a61717; background-color: #e3d2d2 } /* Error */
......
...@@ -52,7 +52,8 @@ ...@@ -52,7 +52,8 @@
background: #eee; background: #eee;
} }
.diff_file_content { .diff_file_content {
overflow-x: scroll; overflow:auto;
overflow-y:hidden;
background:#fff; background:#fff;
color:#333; color:#333;
font-size: 12px; font-size: 12px;
...@@ -102,54 +103,6 @@ table.round-borders { ...@@ -102,54 +103,6 @@ table.round-borders {
float:left; float:left;
} }
.day-commits-table {
@include round-borders-all(4px);
padding: 4px 0px;
margin-bottom:10px;
display:block;
width:100%;
background: #E6F1F6;
.day-header {
padding:10px;
h3 {
margin:0px;
}
}
ul {
display:block;
list-style:none;
margin:0px;
padding:0px;
li.commit {
display:list-item;
padding:8px;
margin:0px;
background: #F7FBFC;
border-top: 1px solid #E2EAEE;
&:first-child {
border-top: 1px solid #E2EAEE;
}
&:nth-child(2n+1) {
background: white;
}
a.button {
width:85px;
padding:10px;
margin:0px;
float:right;
}
p {
margin-bottom: 3px;
font-size: 13px;
}
}
}
}
@mixin panel-color { @mixin panel-color {
background: #111 !important; background: #111 !important;
background: -webkit-gradient(linear,left top,left bottom,from(#333),to(#111)) !important; background: -webkit-gradient(linear,left top,left bottom,from(#333),to(#111)) !important;
...@@ -157,7 +110,6 @@ table.round-borders { ...@@ -157,7 +110,6 @@ table.round-borders {
background: transparent 9 !important; background: transparent 9 !important;
} }
#header-panel { #header-panel {
@include panel-color; @include panel-color;
height:40px; height:40px;
...@@ -211,10 +163,6 @@ table.round-borders { ...@@ -211,10 +163,6 @@ table.round-borders {
padding:20px; padding:20px;
} }
body {
background: #eaeaea;
}
a { a {
color: #111; color: #111;
} }
...@@ -223,14 +171,13 @@ a { ...@@ -223,14 +171,13 @@ a {
.old_line, .new_line { .old_line, .new_line {
background:#ECECEC; background:#ECECEC;
color:#777; color:#777;
width:15px; width:30px;
float:left; float:left;
padding: 0px 10px; padding: 0px 5px;
border-right: 1px solid #ccc; border-right: 1px solid #ccc;
} }
} }
.view_file_content{ .view_file_content{
.old_line, .new_line { .old_line, .new_line {
background:#ECECEC; background:#ECECEC;
...@@ -281,45 +228,15 @@ input.ssh_project_url { ...@@ -281,45 +228,15 @@ input.ssh_project_url {
text-align:center; text-align:center;
} }
.day-commits-table li.commit {
cursor:pointer;
&:hover {
@include hover-color;
}
}
/*
#FFF6BF
#FFD324
*/
#tree-slider tr.tree-item {
cursor:pointer;
&:hover {
@include hover-color;
td {
@include hover-color;
}
}
}
#projects-list .project { #projects-list .project {
height:50px; height:50px;
} }
#tree-slider .tree-item,
#projects-list .project, #projects-list .project,
#snippets-table .snippet, #snippets-table .snippet,
#issues-table .issue{ #issues-table .issue{
cursor:pointer; cursor:pointer;
&:hover {
@include hover-color;
td {
@include hover-color;
}
}
} }
.clear { .clear {
...@@ -387,23 +304,19 @@ input.ssh_project_url { ...@@ -387,23 +304,19 @@ input.ssh_project_url {
border-width: 1px; border-width: 1px;
} }
tbody tr:nth-child(2n) td, tbody tr.even td {
background: none repeat scroll 0 0 #F7FBFC;
border-top: 1px solid #E2EAEE;
border-bottom: 1px solid #E2EAEE;
}
.top_menu_count { .top_menu_count {
background: none repeat scroll 0 0 #FFF6BF; background: none repeat scroll 0 0 white;
border-color: #FFD324; color: #333;
color: #514721; border-color: #4BB8D2;
border: 1px solid #DDDDDD;
padding: 2px; padding: 2px;
font-size:12px; font-size:10px;
position:relative;
top:-14px;
left:10px;
border-top:none; border-top:none;
text-align:center;
float:right;
width:25px;
} }
#logo { #logo {
...@@ -415,7 +328,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -415,7 +328,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
text-shadow: #555 1px 1px; text-shadow: #555 1px 1px;
} }
/** FALSH **/ /** FLASH **/
#flash_container { #flash_container {
height:40px; height:40px;
...@@ -433,6 +346,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -433,6 +346,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
color:#444; color:#444;
font-size:22px; font-size:22px;
padding-top:5px; padding-top:5px;
margin:2px;
} }
} }
...@@ -476,31 +390,6 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -476,31 +390,6 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
list-style:none; list-style:none;
margin:0px; margin:0px;
padding:0px; padding:0px;
li {
display:list-item;
padding:8px;
margin:0px;
background: #F7FBFC;
border-top: 1px solid #E2EAEE;
&:first-child {
border-top: none;
}
&:nth-child(2n+1) {
background: white;
}
p {
margin-bottom: 4px;
font-size: 13px;
color:#111;
}
}
cite {
&.ago {
color:#666;
}
}
} }
.notes_count { .notes_count {
...@@ -515,14 +404,6 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -515,14 +404,6 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
right: 6px; right: 6px;
top: 6px; top: 6px;
} }
.note_author {
float:left;
width:60px;
}
.note_content {
float:left;
width:650px;
}
.issue_notes { .issue_notes {
.note_content { .note_content {
...@@ -599,7 +480,6 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -599,7 +480,6 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
} }
} }
span{ span{
border: 1px solid #aaa; border: 1px solid #aaa;
color:black; color:black;
...@@ -612,8 +492,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -612,8 +492,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
} }
.commit, .commit,
.message, .message{
#notes-list{
.author { .author {
background: #eaeaea; background: #eaeaea;
color: #333; color: #333;
...@@ -630,7 +509,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -630,7 +509,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
font-size:14px; font-size:14px;
} }
.wall_page { #new_note {
#note_note { #note_note {
height:25px; height:25px;
} }
...@@ -652,6 +531,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -652,6 +531,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
@include round-borders-all(4px); @include round-borders-all(4px);
padding:2px 4px; padding:2px 4px;
border:none; border:none;
text-shadow:none;
&.high { &.high {
background: #D12F19; background: #D12F19;
...@@ -667,6 +547,10 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -667,6 +547,10 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
background: #4466cc; background: #4466cc;
color:white; color:white;
} }
&.normal {
background: #2c5ca6;
color:white;
}
&.notes { &.notes {
background: #2c5c66; background: #2c5c66;
color:white; color:white;
...@@ -681,3 +565,112 @@ tbody tr:nth-child(2n) td, tbody tr.even td { ...@@ -681,3 +565,112 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
} }
} }
} }
.top_panel_issues{
#issue_search_form {
margin:5px 0;
input {
border:1px solid #D3D3D3;
padding: 3px;
height: 28px;
width: 300px;
-webkit-appearance:none;
box-sizing: border-box;
-moz-box-sizing: border-box;
&:focus {
border-color:#c2e1ef;
}
}
}
}
.left {
float:left;
}
.right {
float:right;
}
.width-50p{
width:50%;
}
.width-49p{
width:49%;
}
.width-30p{
width:30%;
}
.width-65p{
width:65%;
}
pre.commit_message {
white-space: pre-wrap;
}
#container {
min-height:100%;
}
.ui-selectmenu{
@include round-borders-all(4px);
margin-right:10px;
font-size:1.5em;
height:auto;
font-weight:bold;
.ui-selectmenu-status {
padding:3px 10px;
}
}
td.code {
width: 100%;
.highlight {
margin-left: 55px;
overflow:auto;
overflow-y:hidden;
}
}
.highlight pre {
white-space: pre;
word-wrap:normal;
}
.highlighttable tr:hover {
background:white;
}
table.highlighttable pre{
line-height:16px !important;
font-size:12px !important;
}
.project-refs-form {
span {
background: none !important;
position:static !important;
width:auto !important;
height: auto !important;
}
}
.project-refs-select {
width:200px;
}
.issues_filter {
margin-top:10px;
.left {
margin-right:15px;
}
}
.cgray { color:gray; }
.cred { color:#D12F19; }
.cgreen { color:#44aa22; }
body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
body.project-page #notes-list .note img{float: left; margin-right: 10px;}
body.project-page #notes-list .note span.note-title{display: block;}
body.project-page #notes-list .note span.note-title{margin-bottom: 10px}
body.project-page #notes-list .note span.note-author{color: #999; font-weight: normal; font-style: italic;}
body.project-page #notes-list .note span.note-author strong{font-weight: bold; font-style: normal;}
This diff is collapsed.
.tags-list {
padding : 0px 10px 10px 10px;
}
.tags-list a {
display: inline-block;
padding: 8px 11px 8px 11px;
margin: 1px 5px 0px 0px;
border-radius: 4px;
border: 1px solid #72bbdf;
background-color: #72bbdf;
color: #0f326d;
font-weight: bold;
font-size: 14px;
}
.small-tags a{
font-size: 9px;
display: inline-block;
padding: 2px 3px 1px 3px;
margin: 0px 3px 0px 0px;
border-radius: 2px;
background-color: #72bbdf;
color: #FFF;
text-shadow: none;
font-weight: bold;
}
\ No newline at end of file
class Admin::MailerController < ApplicationController class Admin::MailerController < ApplicationController
layout "admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :authenticate_admin! before_filter :authenticate_admin!
......
class Admin::ProjectsController < ApplicationController class Admin::ProjectsController < ApplicationController
layout "admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :authenticate_admin! before_filter :authenticate_admin!
def index def index
@admin_projects = Project.page(params[:page]) @admin_projects = Project.page(params[:page])
respond_to do |format|
format.html # index.html.erb
format.json { render json: @admin_projects }
end
end end
def show def show
@admin_project = Project.find_by_code(params[:id]) @admin_project = Project.find_by_code(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @admin_project }
end
end end
def new def new
@admin_project = Project.new @admin_project = Project.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @admin_project }
end
end end
def edit def edit
...@@ -37,28 +23,20 @@ class Admin::ProjectsController < ApplicationController ...@@ -37,28 +23,20 @@ class Admin::ProjectsController < ApplicationController
@admin_project = Project.new(params[:project]) @admin_project = Project.new(params[:project])
@admin_project.owner = current_user @admin_project.owner = current_user
respond_to do |format|
if @admin_project.save if @admin_project.save
format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully created.' } redirect_to [:admin, @admin_project], notice: 'Project was successfully created.'
format.json { render json: @admin_project, status: :created, location: @admin_project }
else else
format.html { render action: "new" } render :action => "new"
format.json { render json: @admin_project.errors, status: :unprocessable_entity }
end
end end
end end
def update def update
@admin_project = Project.find_by_code(params[:id]) @admin_project = Project.find_by_code(params[:id])
respond_to do |format|
if @admin_project.update_attributes(params[:project]) if @admin_project.update_attributes(params[:project])
format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' } redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.'
format.json { head :ok }
else else
format.html { render action: "edit" } render :action => "edit"
format.json { render json: @admin_project.errors, status: :unprocessable_entity }
end
end end
end end
...@@ -66,9 +44,6 @@ class Admin::ProjectsController < ApplicationController ...@@ -66,9 +44,6 @@ class Admin::ProjectsController < ApplicationController
@admin_project = Project.find_by_code(params[:id]) @admin_project = Project.find_by_code(params[:id])
@admin_project.destroy @admin_project.destroy
respond_to do |format| redirect_to admin_projects_url
format.html { redirect_to admin_projects_url }
format.json { head :ok }
end
end end
end end
class Admin::TeamMembersController < ApplicationController class Admin::TeamMembersController < ApplicationController
layout "admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :authenticate_admin! before_filter :authenticate_admin!
def index def index
@admin_team_members = UsersProject.page(params[:page]).per(100).order("project_id DESC") @admin_team_members = UsersProject.page(params[:page]).per(100).order("project_id DESC")
respond_to do |format|
format.html # index.html.erb
format.json { render json: @admin_team_members }
end
end end
def show def show
@admin_team_member = UsersProject.find(params[:id]) @admin_team_member = UsersProject.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @admin_team_member }
end
end end
def new def new
@admin_team_member = UsersProject.new(params[:team_member]) @admin_team_member = UsersProject.new(params[:team_member])
respond_to do |format|
format.html # new.html.erb
format.json { render json: @admin_team_member }
end
end end
def edit def edit
...@@ -37,14 +23,10 @@ class Admin::TeamMembersController < ApplicationController ...@@ -37,14 +23,10 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.new(params[:team_member]) @admin_team_member = UsersProject.new(params[:team_member])
@admin_team_member.project_id = params[:team_member][:project_id] @admin_team_member.project_id = params[:team_member][:project_id]
respond_to do |format|
if @admin_team_member.save if @admin_team_member.save
format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.' } redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.'
format.json { render json: @admin_team_member, status: :created, location: @team_member }
else else
format.html { render action: "new" } render action: "new"
format.json { render json: @admin_team_member.errors, status: :unprocessable_entity }
end
end end
end end
...@@ -52,14 +34,10 @@ class Admin::TeamMembersController < ApplicationController ...@@ -52,14 +34,10 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.find(params[:id]) @admin_team_member = UsersProject.find(params[:id])
@admin_team_member.project_id = params[:team_member][:project_id] @admin_team_member.project_id = params[:team_member][:project_id]
respond_to do |format|
if @admin_team_member.update_attributes(params[:team_member]) if @admin_team_member.update_attributes(params[:team_member])
format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.' } redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.'
format.json { head :ok }
else else
format.html { render action: "edit" } render action: "edit"
format.json { render json: @admin_team_member.errors, status: :unprocessable_entity }
end
end end
end end
...@@ -67,9 +45,6 @@ class Admin::TeamMembersController < ApplicationController ...@@ -67,9 +45,6 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.find(params[:id]) @admin_team_member = UsersProject.find(params[:id])
@admin_team_member.destroy @admin_team_member.destroy
respond_to do |format| redirect_to admin_team_members_url
format.html { redirect_to admin_team_members_url }
format.json { head :ok }
end
end end
end end
class Admin::UsersController < ApplicationController class Admin::UsersController < ApplicationController
layout "admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :authenticate_admin! before_filter :authenticate_admin!
def index def index
@admin_users = User.page(params[:page]) @admin_users = User.page(params[:page])
respond_to do |format|
format.html # index.html.erb
format.json { render json: @admin_users }
end
end end
def show def show
@admin_user = User.find(params[:id]) @admin_user = User.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @admin_user }
end
end end
def new def new
@admin_user = User.new(:projects_limit => 10) @admin_user = User.new(:projects_limit => 10)
respond_to do |format|
format.html # new.html.erb
format.json { render json: @admin_user }
end
end end
def edit def edit
......
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :view_style
protect_from_forgery protect_from_forgery
helper_method :abilities, :can? helper_method :abilities, :can?
...@@ -8,8 +10,18 @@ class ApplicationController < ActionController::Base ...@@ -8,8 +10,18 @@ class ApplicationController < ActionController::Base
render :file => File.join(Rails.root, "public", "gitosis_error"), :layout => false render :file => File.join(Rails.root, "public", "gitosis_error"), :layout => false
end end
layout :layout_by_resource
protected protected
def layout_by_resource
if devise_controller?
"devise"
else
"application"
end
end
def abilities def abilities
@abilities ||= Six.new @abilities ||= Six.new
end end
...@@ -47,20 +59,14 @@ class ApplicationController < ActionController::Base ...@@ -47,20 +59,14 @@ class ApplicationController < ActionController::Base
end end
def load_refs def load_refs
@branch = unless params[:branch].blank? unless params[:ref].blank?
params[:branch] @ref = params[:ref]
else else
nil @branch = params[:branch].blank? ? nil : params[:branch]
end @tag = params[:tag].blank? ? nil : params[:tag]
@tag = unless params[:tag].blank?
params[:tag]
else
nil
end
@ref = @branch || @tag || "master" @ref = @branch || @tag || "master"
end end
end
def render_404 def render_404
render :file => File.join(Rails.root, "public", "404"), :layout => false, :status => "404" render :file => File.join(Rails.root, "public", "404"), :layout => false, :status => "404"
...@@ -69,4 +75,30 @@ class ApplicationController < ActionController::Base ...@@ -69,4 +75,30 @@ class ApplicationController < ActionController::Base
def require_non_empty_project def require_non_empty_project
redirect_to @project unless @project.repo_exists? redirect_to @project unless @project.repo_exists?
end end
def view_style
if params[:view_style] == "collapsed"
cookies[:view_style] = "collapsed"
elsif params[:view_style] == "fluid"
cookies[:view_style] = ""
end
@view_mode = if cookies[:view_style] == "collapsed"
:fixed
else
:fluid
end
end
def respond_with_notes
if params[:last_id] && params[:first_id]
@notes = @notes.where("id >= ?", params[:first_id])
elsif params[:last_id]
@notes = @notes.where("id > ?", params[:last_id])
elsif params[:first_id]
@notes = @notes.where("id < ?", params[:first_id])
else
nil
end
end
end end
...@@ -2,6 +2,7 @@ require "base64" ...@@ -2,6 +2,7 @@ require "base64"
class CommitsController < ApplicationController class CommitsController < ApplicationController
before_filter :project before_filter :project
layout "project"
# Authorize # Authorize
before_filter :add_project_abilities before_filter :add_project_abilities
...@@ -12,11 +13,12 @@ class CommitsController < ApplicationController ...@@ -12,11 +13,12 @@ class CommitsController < ApplicationController
load_refs # load @branch, @tag & @ref load_refs # load @branch, @tag & @ref
@repo = project.repo @repo = project.repo
limit, offset = (params[:limit] || 20), (params[:offset] || 0)
if params[:path] if params[:path]
@commits = @repo.log(@ref, params[:path], :max_count => params[:limit] || 100, :skip => params[:offset] || 0) @commits = @repo.log(@ref, params[:path], :max_count => limit, :skip => offset)
else else
@commits = @repo.commits(@ref, params[:limit] || 100, params[:offset] || 0) @commits = @repo.commits(@ref, limit, offset)
end end
respond_to do |format| respond_to do |format|
...@@ -27,12 +29,12 @@ class CommitsController < ApplicationController ...@@ -27,12 +29,12 @@ class CommitsController < ApplicationController
def show def show
@commit = project.repo.commits(params[:id]).first @commit = project.repo.commits(params[:id]).first
@notes = project.notes.where(:noteable_id => @commit.id, :noteable_type => "Commit") @notes = project.notes.where(:noteable_id => @commit.id, :noteable_type => "Commit").order("created_at DESC").limit(20)
@note = @project.notes.new(:noteable_id => @commit.id, :noteable_type => "Commit") @note = @project.notes.new(:noteable_id => @commit.id, :noteable_type => "Commit")
respond_to do |format| respond_to do |format|
format.html # show.html.erb format.html
format.js format.js { respond_with_notes }
end end
end end
end end
class DashboardController < ApplicationController class DashboardController < ApplicationController
def index def index
@projects = current_user.projects.all @projects = current_user.projects.all
@active_projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse
end end
end end
...@@ -2,6 +2,7 @@ class IssuesController < ApplicationController ...@@ -2,6 +2,7 @@ class IssuesController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :project before_filter :project
before_filter :issue, :only => [:edit, :update, :destroy, :show] before_filter :issue, :only => [:edit, :update, :destroy, :show]
layout "project"
# Authorize # Authorize
before_filter :add_project_abilities before_filter :add_project_abilities
...@@ -34,14 +35,19 @@ class IssuesController < ApplicationController ...@@ -34,14 +35,19 @@ class IssuesController < ApplicationController
end end
def show def show
@notes = @issue.notes @notes = @issue.notes.order("created_at DESC").limit(20)
@note = @project.notes.new(:noteable => @issue) @note = @project.notes.new(:noteable => @issue)
respond_to do |format|
format.html
format.js { respond_with_notes }
end
end end
def create def create
@issue = @project.issues.new(params[:issue]) @issue = @project.issues.new(params[:issue])
@issue.author = current_user @issue.author = current_user
if @issue.save if @issue.save && @issue.assignee != current_user
Notify.new_issue_email(@issue).deliver Notify.new_issue_email(@issue).deliver
end end
...@@ -57,7 +63,6 @@ class IssuesController < ApplicationController ...@@ -57,7 +63,6 @@ class IssuesController < ApplicationController
end end
end end
def destroy def destroy
return access_denied! unless can?(current_user, :admin_issue, @issue) return access_denied! unless can?(current_user, :admin_issue, @issue)
...@@ -78,6 +83,22 @@ class IssuesController < ApplicationController ...@@ -78,6 +83,22 @@ class IssuesController < ApplicationController
render :nothing => true render :nothing => true
end end
def search
terms = params['terms']
@project = Project.find(params['project'])
@issues = case params[:status].to_i
when 1 then @project.issues
when 2 then @project.issues.closed
when 3 then @project.issues.opened.assigned(current_user)
else @project.issues.opened
end
@issues = @issues.where("title LIKE ? OR content LIKE ?", "%#{terms}%", "%#{terms}%") unless terms.blank?
render :partial => 'issues'
end
protected protected
def issue def issue
......
class KeysController < ApplicationController class KeysController < ApplicationController
layout "profile"
respond_to :js respond_to :js
def index def index
......
...@@ -15,7 +15,6 @@ class NotesController < ApplicationController ...@@ -15,7 +15,6 @@ class NotesController < ApplicationController
notify if params[:notify] == '1' notify if params[:notify] == '1'
end end
respond_to do |format| respond_to do |format|
format.html {redirect_to :back} format.html {redirect_to :back}
format.js format.js
......
class ProfileController < ApplicationController class ProfileController < ApplicationController
layout "profile"
def show def show
@user = current_user @user = current_user
end end
......
class ProjectsController < ApplicationController class ProjectsController < ApplicationController
before_filter :project, :except => [:index, :new, :create] before_filter :project, :except => [:index, :new, :create]
layout :determine_layout
# Authorize # Authorize
before_filter :add_project_abilities before_filter :add_project_abilities
...@@ -9,7 +10,9 @@ class ProjectsController < ApplicationController ...@@ -9,7 +10,9 @@ class ProjectsController < ApplicationController
before_filter :require_non_empty_project, :only => [:blob, :tree] before_filter :require_non_empty_project, :only => [:blob, :tree]
def index def index
@projects = current_user.projects.all source = current_user.projects
source = source.tagged_with(params[:tag]) unless params[:tag].blank?
@projects = source.all
end end
def new def new
...@@ -85,12 +88,11 @@ class ProjectsController < ApplicationController ...@@ -85,12 +88,11 @@ class ProjectsController < ApplicationController
def wall def wall
@note = Note.new @note = Note.new
@notes = @project.common_notes.order("created_at DESC") @notes = @project.common_notes.order("created_at DESC")
@notes = @notes.fresh.limit(20)
@notes = case params[:view] respond_to do |format|
when "week" then @notes.since((Date.today - 7.days).at_beginning_of_day) format.html
when "all" then @notes.all format.js { respond_with_notes }
when "day" then @notes.since(Date.today.at_beginning_of_day)
else @notes.fresh.limit(10)
end end
end end
...@@ -152,4 +154,12 @@ class ProjectsController < ApplicationController ...@@ -152,4 +154,12 @@ class ProjectsController < ApplicationController
def project def project
@project ||= Project.find_by_code(params[:id]) @project ||= Project.find_by_code(params[:id])
end end
def determine_layout
if @project && !@project.new_record?
"project"
else
"application"
end
end
end end
class SnippetsController < ApplicationController class SnippetsController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :project before_filter :project
layout "project"
# Authorize # Authorize
before_filter :add_project_abilities before_filter :add_project_abilities
......
class TagsController < ApplicationController
def index
@tags = Project.tag_counts.order('count DESC')
@tags = @tags.where('name like ?', "%#{params[:term]}%") unless params[:term].blank?
respond_to do |format|
format.html
format.json { render json: @tags.limit(8).map {|t| t.name}}
end
end
end
class TeamMembersController < ApplicationController class TeamMembersController < ApplicationController
before_filter :project before_filter :project
layout "project"
# Authorize # Authorize
before_filter :add_project_abilities before_filter :add_project_abilities
......
...@@ -4,6 +4,14 @@ module ApplicationHelper ...@@ -4,6 +4,14 @@ module ApplicationHelper
"http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user_email)}?s=40&d=identicon" "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user_email)}?s=40&d=identicon"
end end
def body_class(default_class = nil)
main = content_for(:body_class).blank? ?
default_class :
content_for(:body_class)
[main, cookies[:view_style]].join(" ")
end
def commit_name(project, commit) def commit_name(project, commit)
if project.commit.id == commit.id if project.commit.id == commit.id
"master" "master"
...@@ -28,6 +36,21 @@ module ApplicationHelper ...@@ -28,6 +36,21 @@ module ApplicationHelper
else else
"Never" "Never"
end end
rescue
"Never"
end
def grouped_options_refs
options = [
["Branch", @repo.heads.map(&:name) ],
[ "Tag", @project.tags ]
]
grouped_options_for_select(options, @ref)
end
def markdown(text)
RDiscount.new(text, :autolink, :no_pseudo_protocols, :safelink, :smart, :filter_html).to_html.html_safe
end end
def search_autocomplete_source def search_autocomplete_source
......
module DashboardHelper module DashboardHelper
def dashboard_feed_path(project, object)
case object.class.name.to_s
when "Issue" then project_issues_path(project, project.issues.find(object.id))
when "Grit::Commit" then project_commit_path(project, project.repo.commits(object.id).first)
when "Note"
then
note = object
case note.noteable_type
when "Issue" then project_issue_path(project, note.noteable_id)
when "Snippet" then project_snippet_path(project, note.noteable_id)
when "Commit" then project_commit_path(project, :id => note.noteable_id)
else wall_project_path(project)
end
else "#"
end
rescue
"#"
end
def dashboard_feed_title(object)
title = case object.class.name.to_s
when "Note" then markdown(object.note)
when "Issue" then object.title
when "Grit::Commit" then object.safe_message
else ""
end
"[#{object.class.name}] #{truncate(sanitize(title, :tags => []), :length => 60)} "
end
end end
module SnippetsHelper module SnippetsHelper
def lifetime_select_options
options = [
['forever', nil],
['1 day', "#{Date.current + 1.day}"],
['1 week', "#{Date.current + 1.week}"],
['1 month', "#{Date.current + 1.month}"]
]
options_for_select(options)
end
end end
...@@ -10,13 +10,18 @@ class Issue < ActiveRecord::Base ...@@ -10,13 +10,18 @@ class Issue < ActiveRecord::Base
validates_presence_of :assignee_id validates_presence_of :assignee_id
validates_presence_of :author_id validates_presence_of :author_id
delegate :name,
:email,
:to => :author,
:prefix => true
validates :title, validates :title,
:presence => true, :presence => true,
:length => { :within => 0..255 } :length => { :within => 0..255 }
validates :content, #validates :content,
:presence => true, #:presence => true,
:length => { :within => 0..2000 } #:length => { :within => 0..2000 }
scope :critical, where(:critical => true) scope :critical, where(:critical => true)
scope :non_critical, where(:critical => false) scope :non_critical, where(:critical => false)
......
...@@ -8,7 +8,7 @@ class Key < ActiveRecord::Base ...@@ -8,7 +8,7 @@ class Key < ActiveRecord::Base
validates :key, validates :key,
:presence => true, :presence => true,
:uniqueness => true, :uniqueness => true,
:length => { :within => 0..1024 } :length => { :within => 0..1600 }
before_save :set_identifier before_save :set_identifier
after_save :update_gitosis after_save :update_gitosis
......
...@@ -7,13 +7,18 @@ class Note < ActiveRecord::Base ...@@ -7,13 +7,18 @@ class Note < ActiveRecord::Base
belongs_to :author, belongs_to :author,
:class_name => "User" :class_name => "User"
delegate :name,
:email,
:to => :author,
:prefix => true
attr_protected :author, :author_id attr_protected :author, :author_id
validates_presence_of :project validates_presence_of :project
validates :note, validates :note,
:presence => true, :presence => true,
:length => { :within => 0..255 } :length => { :within => 0..5000 }
validates :attachment, validates :attachment,
:file_size => { :file_size => {
......
...@@ -9,6 +9,8 @@ class Project < ActiveRecord::Base ...@@ -9,6 +9,8 @@ class Project < ActiveRecord::Base
has_many :notes, :dependent => :destroy has_many :notes, :dependent => :destroy
has_many :snippets, :dependent => :destroy has_many :snippets, :dependent => :destroy
acts_as_taggable
validates :name, validates :name,
:uniqueness => true, :uniqueness => true,
:presence => true, :presence => true,
...@@ -119,6 +121,26 @@ class Project < ActiveRecord::Base ...@@ -119,6 +121,26 @@ class Project < ActiveRecord::Base
repo rescue false repo rescue false
end end
def last_activity
updates(1).first
rescue
nil
end
def last_activity_date
last_activity.try(:created_at)
end
def updates(n = 3)
[
fresh_commits(n),
issues.last(n),
notes.fresh.limit(n)
].compact.flatten.sort do |x, y|
y.created_at <=> x.created_at
end[0...n]
end
def commit(commit_id = nil) def commit(commit_id = nil)
if commit_id if commit_id
repo.commits(commit_id).first repo.commits(commit_id).first
...@@ -131,16 +153,16 @@ class Project < ActiveRecord::Base ...@@ -131,16 +153,16 @@ class Project < ActiveRecord::Base
@heads ||= repo.heads @heads ||= repo.heads
end end
def fresh_commits def fresh_commits(n = 10)
commits = heads.map do |h| commits = heads.map do |h|
repo.commits(h.name, 10) repo.commits(h.name, n)
end.flatten.uniq { |c| c.id } end.flatten.uniq { |c| c.id }
commits.sort! do |x, y| commits.sort! do |x, y|
y.committed_date <=> x.committed_date y.committed_date <=> x.committed_date
end end
commits[0..10] commits[0...n]
end end
def commits_since(date) def commits_since(date)
......
...@@ -22,6 +22,8 @@ class Snippet < ActiveRecord::Base ...@@ -22,6 +22,8 @@ class Snippet < ActiveRecord::Base
:presence => true, :presence => true,
:length => { :within => 0..10000 } :length => { :within => 0..10000 }
scope :fresh, order("created_at DESC")
scope :non_expired, where(["expires_at IS NULL OR expires_at > ?", Time.current])
def self.content_types def self.content_types
[ [
...@@ -34,6 +36,10 @@ class Snippet < ActiveRecord::Base ...@@ -34,6 +36,10 @@ class Snippet < ActiveRecord::Base
def colorize def colorize
system_colorize(content, file_name) system_colorize(content, file_name)
end end
def expired?
expires_at && expires_at < Time.current
end
end end
# == Schema Information # == Schema Information
# #
...@@ -47,5 +53,6 @@ end ...@@ -47,5 +53,6 @@ end
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# file_name :string(255) # file_name :string(255)
# expires_at :datetime
# #
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
%div %div
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Wall"), :width=>"100%", :height=>"350"} %iframe{ :src=> admin_mailer_preview_note_path(:type => "Wall"), :width=>"100%", :height=>"350"}
:javascript :javascript
$(function() { $(function() {
$( "#accordion" ).accordion(); }); $( "#accordion" ).accordion(); });
%table %table
%tr %thead
%th Name %th Name
%th Code %th Code
%th Path %th Path
......
- @admin_team_members.group_by(&:project).sort.each do |project, members| - @admin_team_members.group_by(&:project).sort.each do |project, members|
%h3= link_to project.name, [:admin, project] %h3= link_to project.name, [:admin, project]
%table %table
%tr %thead
%th Name %th Name
%th Email %th Email
%th Read %th Read
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
%b Since: %b Since:
= @admin_team_member.updated_at = @admin_team_member.updated_at
.span-10 .span-10
.span-6 .span-6
%b Access: %b Access:
......
%table %table
%tr %thead
%th Admin %th Admin
%th Name %th Name
%th Email %th Email
......
...@@ -2,5 +2,4 @@ ...@@ -2,5 +2,4 @@
= render 'form' = render 'form'
= link_to 'Back', admin_users_path, :class => "right lbutton" = link_to 'Back', admin_users_path, :class => "right lbutton"
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
%b Twitter: %b Twitter:
= @admin_user.twitter = @admin_user.twitter
.clear .clear
= link_to 'Edit', edit_admin_user_path(@admin_user) = link_to 'Edit', edit_admin_user_path(@admin_user)
\| \|
......
- @commits.group_by { |c| c.committed_date.to_date }.each do |day, commits| - @commits.group_by { |c| c.committed_date.to_date }.each do |day, commits|
%div{ :class => "commits-date ui-box ui-box-small ui-box-big" }
.day-commits-table .day-commits-table
.day-header
%h3= day.stamp("28 Aug, 2010") %h3= day.stamp("28 Aug, 2010")
%ul .data
- commits.each do |commit| - commits.each do |commit|
%li{ :class => "commit", :url => project_commit_path(@project, :id => commit.id) } %a{ :class => "commit", :href => project_commit_path(@project, :id => commit.id) }
- if commit.author.email %span.commit-info
= image_tag gravatar_icon(commit.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" %data.commit-button
= truncate(commit.id.to_s, :length => 16)
%i
%data.commit-browse{ :onclick => "location.href='#{tree_project_path(@project, :commit_id => commit.id)}';return false;"}
Browse Code
- if commit.author_email
= image_tag gravatar_icon(commit.author_email), :class => "left", :width => 40, :style => "padding-right:5px;"
- else - else
= image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;"
%p %span.commit-title
%strong %strong
= truncate(commit.safe_message, :length => 60) = truncate(commit.safe_message, :length => 60)
= link_to "Browse Code", tree_project_path(@project, :commit_id => commit.id), :class => "lite_button", :style => "float:right" %span.commit-author
= link_to truncate(commit.id.to_s, :length => 16), project_commit_path(@project, :id => commit.id), :class => "lite_button", :style => "width:120px;float:right" %strong= commit.author_name
%span
%span.author
= commit.author
= time_ago_in_words(commit.committed_date) = time_ago_in_words(commit.committed_date)
ago ago
= more_commits_link if @commits.size > 99
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
- line_new = 0 - line_new = 0
- lines_arr = diff.diff.lines.to_a - lines_arr = diff.diff.lines.to_a
- lines_arr.each do |line| - lines_arr.each do |line|
- next if line.match(/^--- \/dev\/null/)
- next if line.match(/^--- a/) - next if line.match(/^--- a/)
- next if line.match(/^\+\+\+ b/) - next if line.match(/^\+\+\+ b/)
- if line.match(/^@@ -/) - if line.match(/^@@ -/)
......
%div - content_for(:body_class, "project-page commits-page")
%h3
.left -#%a.right.button{:href => "#"} Download
= form_tag project_commits_path(@project), :method => :get do -#-if can? current_user, :admin_project, @project
= select_tag "branch", options_for_select(@repo.heads.map(&:name), @branch), :onchange => "this.form.submit();", :class => "", :prompt => "Branches" %a.right.button.blue{:href => "#"} EDIT
&nbsp; %h2.icon
.left.prepend-1 %span
= form_tag project_commits_path(@project), :method => :get do %d
= select_tag "tag", options_for_select(@project.tags, @tag), :onchange => "this.form.submit();", :class => "", :prompt => "Tags" = link_to project_commits_path(@project) do
= text_field_tag "ssh", @project.url_to_repo, :class => ["ssh_project_url", "one_click_select"] = @project.name
.clear
- if params[:path] - if params[:path]
%h3{:style => "color:#555"} /#{params[:path]} \/
%div{:id => dom_id(@project)} %a{:href => "#"}= params[:path].split("/").join(" / ")
= render "commits"
.right= render :partial => "projects/refs", :locals => { :destination => project_commits_path(@project) }
%div{:id => dom_id(@project)}
#commits_list= render "commits"
.clear
.loading{ :style => "display:none;"}
%center= image_tag "ajax-loader.gif"
:javascript
$(function(){
CommitsList.init("#{@ref}", 20);
});
:plain
CommitsList.append(#{@commits.count}, "#{escape_javascript(render(:partial => 'commits/commits'))}");
%h3 %h3
= "[ #{@commit.committer} ] #{truncate(@commit.safe_message)}" = "[ #{@commit.author_name} ] #{truncate(@commit.safe_message, :length => 70)}"
-#= link_to 'Back', project_commits_path(@project), :class => "button" -#= link_to 'Back', project_commits_path(@project), :class => "button"
%table.round-borders %table.round-borders
%tr %tr
...@@ -7,33 +7,21 @@ ...@@ -7,33 +7,21 @@
%td= @commit.id %td= @commit.id
%tr %tr
%td Author %td Author
%td= @commit.author %td= @commit.author_name
%tr
%td Commiter
%td= @commit.committer
%tr %tr
%td Commited Date %td Commited Date
%td= @commit.committed_date %td= @commit.committed_date.stamp("21 Aug 2011, 11:15pm")
%tr %tr
%td Message %td Message
%td= @commit.safe_message %td
%pre.commit_message
= preserve @commit.safe_message
%tr %tr
%td Tree %td Tree
%td= link_to 'Browse Code', tree_project_path(@project, :commit_id => @commit.id) %td= link_to 'Browse Code', tree_project_path(@project, :commit_id => @commit.id)
.clear .clear
#tabs %br
%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 = render "commits/diff"
$(function() { $( "#tabs" ).tabs(); }); = render "notes/notes"
-#:plain = render "notes/load"
$("#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");
:plain
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
timeline - content_for(:body_class, "dashboard-page")
#dashboard-content.dashboard-content.content
%aside
%h4
- if current_user.can_create_project?
%a.button-small.button-green{:href => new_project_path} New Repository
Your Repositories
%ol.project-list
- @projects.each do |project|
%li
%a{:href => project_path(project)}
%span.arrow
%span.project-name= project.name
%span.time
%strong Last activity:
= project.last_activity_date ? time_ago_in_words(project.last_activity_date) + " ago" : "Never"
#news-feed.news-feed
%h2.icon
%span>
Dashboard
- @active_projects.first(3).each do |project|
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
%h3= project.name
.data
- project.updates.each do |update|
%a.project-update{:href => dashboard_feed_path(project, update)}
= image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
%span.update-title
= dashboard_feed_title(update)
%span.update-author
%strong= update.author_name
authored
= time_ago_in_words(update.created_at)
ago
%br
/ .project-update
/ .project-updates
/ #news-feed
/ #dashboard-content
<h2>Forgot your password?</h2> <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :class => "login-box", :method => :post }) do |f| %>
<%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %>
<div class="span-12 colborder">
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
<%= devise_error_messages! %> <%= devise_error_messages! %>
<%= f.email_field :email, :placeholder => "Email", :class => "text top" %>
<div><%= f.label :email %><br /> <br/>
<%= f.email_field :email %></div> <%= f.submit "Reset password", :class => "grey-button" %>
<div class="right"> <%= render :partial => "devise/shared/links" %></div>
<div><%= f.submit "Send me reset password instructions", :class => "lbutton vm" %></div> <% end %>
<% end %>
</div>
<div>
<%= render :partial => "devise/shared/links" %>
</div>
<h2>Sign in</h2> <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "login-box" }) do |f| %>
<%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %>
<div class="span-12 colborder"> <%= f.text_field :email, :class => "text top", :placeholder => "Email" %>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> <%= f.password_field :password, :class => "text bottom", :placeholder => "Password" %>
<div><%= f.label :email %><br />
<%= f.text_field :email %></div>
<div><%= f.label :password %><br />
<%= f.password_field :password %></div>
<% if devise_mapping.rememberable? -%> <% if devise_mapping.rememberable? -%>
<div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div> <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
<% end -%> <% end -%>
<br/> <br/>
<div><%= f.submit "Sign in", :class => "lbutton vm" %></div> <%= f.submit "Sign in", :class => "grey-button" %>
<% end %> <div class="right"> <%= render :partial => "devise/shared/links" %></div>
</div> <% end %>
<div>
<%= render :partial => "devise/shared/links" %>
</div>
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
.span-8 .span-8
= f.label :title = f.label :title
= f.text_field :title, :style => "width:450px" = f.text_area :title, :style => "width:450px; height:100px", :maxlength => 255
.span-8 -#.span-8
= f.label :content -#= f.label :content
= f.text_area :content, :style => "width:450px; height:130px" -#= f.text_area :content, :style => "width:450px; height:130px"
.span-8.append-bottom .span-8.append-bottom
= f.label :assignee_id = f.label :assignee_id
= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) = f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" })
......
%table.round-borders#issues-table %table.round-borders#issues-table
%tr %thead
- if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0" - if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0"
%th %th
%th Assignee %th Assignee
%th ID %th ID
%th Title %th Title
%th Closed? %th Closed?
%th
- @issues.critical.each do |issue| - @issues.critical.each do |issue|
= render(:partial => 'show', :locals => {:issue => issue}) = render(:partial => 'show', :locals => {:issue => issue})
......
%tr{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(@project, issue) } %tr{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(@project, issue) }
- if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0" - if can?(current_user, :admin_issue, @project) && (!params[:f] || params[:f] == "0")
%td %td
= image_tag "move.png" , :class => [:handle, :left] = image_tag "move.png" , :class => [:handle, :left]
%td %td
= image_tag gravatar_icon(issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;" = image_tag gravatar_icon(issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;"
= truncate issue.assignee.name, :lenght => 20 = issue.assignee.name
%td ##{issue.id} %td ##{issue.id}
%td %td
= html_escape issue.title = truncate(html_escape(issue.title), :length => 200)
%br
%br %br
- if issue.critical - if issue.critical
%span.tag.high critical %span.tag.high critical
- if issue.today? - if issue.today?
%span.tag.today today %span.tag.today today
.right
- if can?(current_user, :admin_issue, @project) || issue.author == current_user
= link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray", :remote => true
- if can?(current_user, :admin_issue, @project) || issue.author == current_user
&nbsp;
= link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-issue negative", :id => "destroy_issue_#{issue.id}"
-#- if issue.author == current_user -#- if issue.author == current_user
-#%span.tag.yours yours -#%span.tag.yours yours
-#- if issue.notes.count > 0 -#- if issue.notes.count > 0
...@@ -26,8 +35,3 @@ ...@@ -26,8 +35,3 @@
= hidden_field_tag :status_only, true = hidden_field_tag :status_only, true
- else - else
= check_box_tag "closed", 1, issue.closed, :disabled => true = 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}"
%div %div
.top_panel_issues
- if can? current_user, :write_issue, @project - if can? current_user, :write_issue, @project
.left= link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm" %div{:class => "left", :style => "margin-right: 10px;" }
.right = link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm"
= form_tag search_project_issues_path(@project), :method => :get, :remote => true, :class => :left, :id => "issue_search_form" do
= hidden_field_tag :project_id, @project.id, { :id => 'project_id' }
= search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' }
.right.issues_filter
= form_tag project_issues_path(@project), :method => :get do = form_tag project_issues_path(@project), :method => :get do
.span-2 .left
= radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues" = radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues", :class => "status"
= label_tag "open_issues","Open" = label_tag "open_issues","Open"
.span-2 .left
= radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues" = radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues", :class => "status"
= label_tag "closed_issues","Closed" = label_tag "closed_issues","Closed"
.span-2 .left
= radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues" = radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues", :class => "status"
= label_tag "my_issues","To Me" = label_tag "my_issues","To Me"
.left
.span-2 = radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues", :class => "status"
= radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues"
= label_tag "all_issues","All" = label_tag "all_issues","All"
#issues-table-holder= render "issues" #issues-table-holder= render "issues"
%br %br
:javascript :javascript
var href = $('.issue_search').parent().attr('action');
var last_terms = '';
$('.issue_search').keyup(function() {
var terms = $(this).val();
var project_id = $('#project_id').val();
var status = $('.status:checked').val();
if (terms != last_terms) {
last_terms = terms;
if (terms.length >= 2 || terms.length == 0) {
$.get(href, { 'status': status, 'terms': terms, project: project_id }, function(response) {
$('#issues-table').html(response);
setSortable();
});
}
}
});
$('.delete-issue').live('ajax:success', function() { $('.delete-issue').live('ajax:success', function() {
$(this).closest('tr').fadeOut(); }); $(this).closest('tr').fadeOut(); updatePage();});
function setSortable(){ function setSortable(){
$('#issues-table>tbody').sortable({ $('#issues-table>tbody').sortable({
......
%h2 %h2
= "Issue ##{@issue.id} - #{@issue.title}" %strong
Issue
.span-15 = "##{@issue.id}"
= simple_format html_escape(@issue.content) &ndash;
= html_escape(@issue.title)
.left.width-65p
.issue_notes= render "notes/notes" .issue_notes= render "notes/notes"
.span-8.right
.loading{ :style => "display:none;"}
%center= image_tag "ajax-loader.gif"
.right.width-30p
.span-8 .span-8
- if @issue.closed
%center.success Closed
- else
%center.error Open
%table.round-borders %table.round-borders
%tr
%td Title:
%td
= truncate html_escape(@issue.title)
%tr
%td Project
%td
%strong= @issue.project.name
%tr %tr
%td Author: %td Author:
%td %td
...@@ -29,10 +22,20 @@ ...@@ -29,10 +22,20 @@
%td %td
= image_tag gravatar_icon(@issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;" = image_tag gravatar_icon(@issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;"
= @issue.assignee.name = @issue.assignee.name
%tr
%td Tags
%td
- if @issue.critical
%span.tag.high critical
- else
%span.tag.normal normal
- if @issue.today?
%span.tag.today today
%tr %tr
%td Closed? %td Closed?
%td %td
- if can? current_user, :write_issue, @project - if can? current_user, :write_issue, @issue
= form_for([@project, @issue]) do |f| = form_for([@project, @issue]) do |f|
= f.check_box :closed, :onclick => "$(this).parent().submit();" = f.check_box :closed, :onclick => "$(this).parent().submit();"
= hidden_field_tag :status_only, true = hidden_field_tag :status_only, true
...@@ -40,5 +43,9 @@ ...@@ -40,5 +43,9 @@
= check_box_tag "closed", 1, @issue.closed, :disabled => true = check_box_tag "closed", 1, @issue.closed, :disabled => true
- if can?(current_user, :write_issue, @issue)
.clear
%br
= link_to 'Edit', edit_project_issue_path(@project, @issue), :class => "lbutton positive", :remote => true
.right= link_to 'Destroy', [@project, @issue], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-issue negative", :id => "destroy_issue_#{@issue.id}"
.clear .clear
:plain = render "notes/load"
$("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
- if @issue.valid? - if @issue.valid?
:plain :plain
$("#edit_issue_dialog").dialog("close"); $("#edit_issue_dialog").dialog("close");
$.ajax({type: "GET", url: location.href, dataType: "script"}); updatePage();
- else - else
:plain :plain
$("#edit_issue_dialog").empty(); $("#edit_issue_dialog").empty();
......
<div id="header-panel"> <!-- Page Header -->
<div class="container"> <header>
<div class="span-24"> <h1 class="logo">
<div class="span-10"> <a href="/">GITLAB</a>
<%#= image_tag "git.png", :height => 40, :class => "left" %> </h1>
<%#= link_to "gitlab", root_path, :id => "logo" %> <div class="account-box">
<span class="search-holder"> <%= link_to profile_path, :class => "pic" do %>
<%= 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 'Projects', projects_path, :class => current_page?(projects_path) ? "current button" : "button" %>
<%= link_to('Admin', admin_root_path, :class => admin_namespace? ? "current button" : "button" ) if current_user.is_admin? %>
<%= link_to profile_path, :class => ((controller.controller_name == "keys" || controller.controller_name == "profile") ? "current button" : "button") do %>
<%= image_tag gravatar_icon(current_user.email) %> <%= image_tag gravatar_icon(current_user.email) %>
<%= current_user.name.split(" ").first %>
<% end %> <% end %>
<%= link_to 'Logout', destroy_user_session_path, :style => "border-left: 1px solid #666;", :class => "button", :method => :delete %>
</div> <a href="#" class="arrow-up"></a>
<div class="account-links">
<%= link_to profile_path, :class => "username" do %>
<%#= current_user.name %>
Your profile
<% end %>
<%= link_to "Fluid layout", url_for( :view_style => 'fluid' ) if cookies[:view_style] == "collapsed"%>
<%= link_to "Fixed layout", url_for( :view_style => 'collapsed' ) unless cookies[:view_style] == "collapsed"%>
<%= link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete %>
</div> </div>
</div><!-- .account-box -->
<div class="search">
<%= text_field_tag "search", nil, :placeholder => "Search", :class => "search-input" %>
</div> </div>
</div> <!-- .login-top -->
<nav>
<%= link_to dashboard_path, :class => current_page?(root_path) ? "current dashboard" : "dashboard" do %>
<span></span>Dashboard
<% end %>
<%= link_to projects_path, :class => current_page?(projects_path) ? "current project" : "project" do %>
<span></span>Projects
<% end %>
<%= link_to((current_user.is_admin? ? admin_root_path : "#"), :class => (admin_namespace? ? "current admin" : "admin")) do %>
<span></span>Admin
<% end %>
</nav>
</header>
<!-- eo Page Header -->
<% if current_user %> <% if current_user %>
<%= javascript_tag do %> <%= javascript_tag do %>
......
- if content_for?(:page_title)
= yield :page_title
!!!
%html
%head
%title
GitLab #{" - #{@project.name}" if @project && !@project.new_record?}
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
= javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body{ :class => body_class('project-page'), :id => yield(:boyd_id)}
#container
= render :partial => "layouts/flash"
= render :partial => "layouts/head_panel"
.project-container
.project-sidebar
.fixed
%aside
= link_to "Users", admin_users_path, :class => controller.controller_name == "users" ? "current" : nil
= link_to "Projects", admin_projects_path, :class => controller.controller_name == "projects" ? "current" : nil
= link_to "Teams", admin_team_members_path, :class => controller.controller_name == "team_members" ? "current" : nil
= link_to "Emails", admin_emails_path, :class => controller.controller_name == "mailer" ? "current" : nil
.project-content
= yield
...@@ -2,28 +2,16 @@ ...@@ -2,28 +2,16 @@
%html %html
%head %head
%title %title
GitLab #{" - #{@project.name}" if @project && !@project.new_record?} GitLab
= 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" = stylesheet_link_tag "application"
= javascript_include_tag "application" = javascript_include_tag "application"
= csrf_meta_tags = csrf_meta_tags
%link{:href => "/assets/favicon.png", :rel => "icon", :type => "image/png"}/
= javascript_tag do = javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}"; REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body#thebody %body{ :class => body_class, :id => yield(:boyd_id)}
#container
= render :partial => "layouts/flash" = render :partial => "layouts/flash"
- if user_signed_in?
= render :partial => "layouts/head_panel" = render :partial => "layouts/head_panel"
.top_bar.container = render :partial => "layouts/page_title"
= 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 = yield
!!!
%html
%head
%title
GitLab #{" - #{@project.name}" if @project && !@project.new_record?}
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
= javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body.login-page
= render :partial => "layouts/flash"
= yield
!!!
%html
%head
%title
GitLab #{" - #{@project.name}" if @project && !@project.new_record?}
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
= javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body{ :class => body_class('project-page'), :id => yield(:boyd_id)}
#container
= render :partial => "layouts/flash"
= render :partial => "layouts/head_panel"
.project-container
.project-sidebar
.fixed
%aside
= link_to "Profile", profile_path, :class => current_page?(:controller => "profile", :action => :show) ? "current" : nil
= link_to "Password", profile_password_path, :class => current_page?(:controller => "profile", :action => :password) ? "current" : nil
= link_to keys_path, :class => controller.controller_name == "keys" ? "current" : nil do
Keys
- unless current_user.keys.empty?
%span{ :class => "number" }= current_user.keys.count
.project-content
= yield
!!!
%html
%head
%title
GitLab #{" - #{@project.name}" if @project && !@project.new_record?}
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
= javascript_tag do
REQ_URI = "#{request.env["REQUEST_URI"]}";
REQ_REFFER = "#{request.env["HTTP_REFERER"]}";
%body{ :class => body_class('project-page'), :id => yield(:boyd_id)}
#container
= render :partial => "layouts/flash"
= render :partial => "layouts/head_panel"
.project-container
.project-sidebar
.fixed
%input.git-url.text{:id => "", :name => "", :readonly => "", :type => "text", :value => @project.url_to_repo}
%aside
= link_to "History", project_path(@project), :class => current_page?(:controller => "projects", :action => "show", :id => @project) ? "current" : nil
= link_to "Tree", tree_project_path(@project), :class => current_page?(:controller => "projects", :action => "tree", :id => @project) ? "current" : nil
= link_to "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_id => @project) ? "current" : nil
= link_to team_project_path(@project), :class => (current_page?(:controller => "projects", :action => "team", :id => @project) || controller.controller_name == "team_members") ? "current" : nil do
Team
- if @project.users_projects.count > 0
%span{ :class => "number" }= @project.users_projects.count
= link_to project_issues_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do
Issues
- if @project.issues.opened.count > 0
%span{ :class => "number" }= @project.issues.opened.count
= 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 => "number" }= @project.common_notes.count
= link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do
Snippets
- if @project.snippets.count > 0
%span{ :class => "number" }= @project.snippets.non_expired.count
- if @commit
= 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
.project-content
= yield
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
%div %div
= f.label :note = f.label :note
%cite (255 symbols only) %cite
%br %br
= f.text_area :note, :size => 255 = f.text_area :note, :size => 255
......
- unless @notes.blank?
- if params[:last_id] && params[:first_id]
:plain
NoteList.replace(#{@notes.last.id}, #{@notes.first.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}");
- elsif params[:last_id]
:plain
NoteList.prepend(#{@notes.first.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}");
- elsif params[:first_id]
:plain
NoteList.append(#{@notes.last.id}, "#{escape_javascript(render(:partial => 'notes/notes_list'))}");
- else
:plain
- if controller.action_name == "wall" - if can? current_user, :write_note, @project
%ul#notes-list= render "notes/notes_list"
- else
%ul#notes-list= render "notes/notes_list"
%br
%br
- if can? current_user, :write_note, @project
= render "notes/form" = render "notes/form"
.clear
%hr
%ul#notes-list= render "notes/notes_list"
:javascript :javascript
$('.delete-note').live('ajax:success', function() { $('.delete-note').live('ajax:success', function() {
...@@ -20,9 +16,11 @@ ...@@ -20,9 +16,11 @@
$("#submit_note").removeAttr("disabled"); $("#submit_note").removeAttr("disabled");
}) })
- if ["issues", "projects"].include?(controller.controller_name)
:javascript
$(function(){ $(function(){
var int =self.setInterval("updatePage()", 20000); $("#note_note").live("click", function(){
$(this).css("height", "100px");
$('.attach_holder').show();
});
NoteList.init("wall", #{@notes.last.try(:id) || 0}, #{@notes.first.try(:id) || 0});
}); });
%li{:id => dom_id(note)} %li{:id => dom_id(note), :class => "note"}
%div.note_author
= image_tag gravatar_icon(note.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" = image_tag gravatar_icon(note.author.email), :class => "left", :width => 40, :style => "padding-right:5px;"
%div.note_content.left %div.note-author
= simple_format(html_escape(note.note)) %strong= note.author_name
- if note.attachment.url %cite.cgray
Attachment:
= link_to note.attachment_identifier, note.attachment.url, :target => "_blank"
%br
%span.author= note.author.name
%cite.ago
= time_ago_in_words(note.updated_at) = time_ago_in_words(note.updated_at)
ago ago
%br
- if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) - 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" = link_to "Remove", [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-note right"
%div.note-title
= markdown(note.note)
- if note.attachment.url
.right
%span.file
= link_to note.attachment_identifier, note.attachment.url, :target => "_blank"
.clear .clear
- if @note.valid? - if @note.valid?
:plain :plain
$("#new_note .errors").remove(); $("#new_note .errors").remove();
updatePage();
$('#note_note').val(""); $('#note_note').val("");
NoteList.prepend(#{@note.id}, "#{escape_javascript(render :partial => "notes/show", :locals => {:note => @note})}");
- else - else
:plain :plain
$("#new_note").replaceWith("#{escape_javascript(render('form'))}"); $("#new_note").replaceWith("#{escape_javascript(render('form'))}");
......
...@@ -25,6 +25,11 @@ ...@@ -25,6 +25,11 @@
.left= f.label :code .left= f.label :code
%cite.right http://yourserver/ %cite.right http://yourserver/
%td= f.text_field :code, :placeholder => "example" %td= f.text_field :code, :placeholder => "example"
%tr
%td= f.label :tag_list
%td= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field
.field .field
= f.label :description = f.label :description
%br/ %br/
...@@ -41,8 +46,25 @@ ...@@ -41,8 +46,25 @@
%h3.prepend-top Creating project &amp; repository. Please wait for few minutes %h3.prepend-top Creating project &amp; repository. Please wait for few minutes
- else - else
%h3.prepend-top Updating project &amp; repository. Please wait for few minutes %h3.prepend-top Updating project &amp; repository. Please wait for few minutes
:javascript :javascript
$('.new_project, .edit_project').bind('ajax:before', function() { $('.new_project, .edit_project').bind('ajax:before', function() {
$(this).find(".form_content").hide(); $(this).find(".form_content").hide();
$('.ajax_loader').show(); $('.ajax_loader').show();
}); });
:javascript
$(function(){
var tag_field = $('#tag_field').tagify();
tag_field.tagify('inputField').autocomplete({
source: '/tags.json'
});
$('form').submit( function() {
var tag_field = $('#tag_field')
tag_field.val( tag_field.tagify('serialize') );
return true;
});
})
...@@ -10,7 +10,12 @@ ...@@ -10,7 +10,12 @@
- @projects.each do |project| - @projects.each do |project|
%tr{ :class => "project", :url => project_path(project) } %tr{ :class => "project", :url => project_path(project) }
%td= project.name %td
= project.name
.small-tags
- project.tag_list.each do |tag|
= link_to tag, "/tags/#{tag}"
%td= truncate project.url_to_repo %td= truncate project.url_to_repo
%td= project.code %td= project.code
%td= check_box_tag "read", 1, project.readers.include?(current_user), :disabled => :disabled %td= check_box_tag "read", 1, project.readers.include?(current_user), :disabled => :disabled
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment