summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAleksei Kvitinskii <aleksei.wm@gmail.com>2011-11-08 23:19:42 +0200
committerAleksei Kvitinskii <aleksei.wm@gmail.com>2011-11-08 23:19:42 +0200
commit1d85197b08346c99e6015cb25b31f8fd10f4100f (patch)
tree619a753c0a08c97f055f15abc98794fc769776ca /app
parent5b1634cd4b1bdd29b6bdd2141cd24b6dffc2fb3e (diff)
parent1fa01cbcc9f8fb5a9dbf5974496d029f1d189cfc (diff)
downloadgitlab-ce-1d85197b08346c99e6015cb25b31f8fd10f4100f.tar.gz
Merge branch 'issue-184' into dev
Conflicts: app/views/layouts/project.html.haml app/views/projects/_form.html.haml
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/projects.js16
-rw-r--r--app/assets/stylesheets/tags.css.css14
-rw-r--r--app/helpers/tags_helper.rb15
-rw-r--r--app/views/admin/projects/_form.html.haml49
-rw-r--r--app/views/layouts/project.html.haml2
-rw-r--r--app/views/projects/_form.html.haml13
-rw-r--r--app/views/projects/_list.html.haml5
-rw-r--r--app/views/projects/_tile.html.haml4
-rw-r--r--app/views/tags/index.html.haml2
9 files changed, 81 insertions, 39 deletions
diff --git a/app/assets/javascripts/projects.js b/app/assets/javascripts/projects.js
index 87be2f07303..b4521fabd92 100644
--- a/app/assets/javascripts/projects.js
+++ b/app/assets/javascripts/projects.js
@@ -40,3 +40,19 @@ $(document).ready(function(){
function focusSearch() {
$("#search").focus();
}
+
+function taggifyForm(){
+ 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;
+ });
+}
+
diff --git a/app/assets/stylesheets/tags.css.css b/app/assets/stylesheets/tags.css.css
index afd458fd5d4..e65918ea5a4 100644
--- a/app/assets/stylesheets/tags.css.css
+++ b/app/assets/stylesheets/tags.css.css
@@ -27,4 +27,18 @@
color: #FFF;
text-shadow: none;
font-weight: bold;
+}
+
+
+.medium-tags a{
+ font-size: 12px;
+
+ display: inline-block;
+ padding: 3px 4px 2px 4px;
+ margin: 0px 7px 8px 0px;
+ border-radius: 3px;
+ background-color: #72bbdf;
+ color: #FFF;
+ text-shadow: none;
+ font-weight: bold;
} \ No newline at end of file
diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb
new file mode 100644
index 00000000000..5c1ecc8689b
--- /dev/null
+++ b/app/helpers/tags_helper.rb
@@ -0,0 +1,15 @@
+module TagsHelper
+ def tag_path tag
+ "/tags/#{tag}"
+ end
+
+ def tag_list project
+ html = ''
+ project.tag_list.each do |tag|
+ html += link_to tag, tag_path(tag)
+ end
+
+ html.html_safe
+ end
+
+end
diff --git a/app/views/admin/projects/_form.html.haml b/app/views/admin/projects/_form.html.haml
index 9823e594e1a..f64e10fdfbf 100644
--- a/app/views/admin/projects/_form.html.haml
+++ b/app/views/admin/projects/_form.html.haml
@@ -1,30 +1,39 @@
= 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:"
+ %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
+ .form-row
+ = f.label :name
+ %br
+ = f.text_field :name
+ .form-row
+ = f.label :code
+ %br
+ = f.text_field :code
+ .form-row
+ = f.label :path
+ %br
+ = f.text_field :path
+
+
+ .form-row
+ = f.label :tag_list
+ %br
+ = f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field
+
+ .form-row
+ = f.label :description
+ %br
+ = f.text_area :description
.clear
.actions
= f.submit 'Save', :class => "lbutton"
+
+:javascript
+ $(function(){
+ taggifyForm();
+ })
diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml
index 2bcc7bbeb39..0550d89e207 100644
--- a/app/views/layouts/project.html.haml
+++ b/app/views/layouts/project.html.haml
@@ -40,5 +40,7 @@
- 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
+ .medium-tags{:style => 'padding: 10px 0 0 10px; width: 210px;'}= tag_list @project
+
.project-content
= yield
diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml
index d909cf2a7b2..cc7a933b574 100644
--- a/app/views/projects/_form.html.haml
+++ b/app/views/projects/_form.html.haml
@@ -55,16 +55,5 @@
: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;
- });
+ taggifyForm();
})
diff --git a/app/views/projects/_list.html.haml b/app/views/projects/_list.html.haml
index 7976b11fa1c..f41fb3e4ef2 100644
--- a/app/views/projects/_list.html.haml
+++ b/app/views/projects/_list.html.haml
@@ -12,9 +12,8 @@
%tr{ :class => "project", :url => project_path(project) }
%td
= project.name
- .small-tags
- - project.tag_list.each do |tag|
- = link_to tag, "/tags/#{tag}"
+ .small-tags= tag_list project
+
%td= truncate project.url_to_repo
%td= project.code
diff --git a/app/views/projects/_tile.html.haml b/app/views/projects/_tile.html.haml
index cc891f63bf0..1f2a4a9761f 100644
--- a/app/views/projects/_tile.html.haml
+++ b/app/views/projects/_tile.html.haml
@@ -13,9 +13,7 @@
- last_note = project.notes.last
= last_note ? last_note.created_at.stamp("24 Aug, 2011") : "Never"
- %p.small-tags
- - project.tag_list.each do |tag|
- = link_to tag, "/tags/#{tag}"
+ %p.small-tags= tag_list project
.buttons
%a.browse-code.button.yellow{:href => tree_project_path(project)} Browse code
diff --git a/app/views/tags/index.html.haml b/app/views/tags/index.html.haml
index c83d62c7eae..ba16b92bfcd 100644
--- a/app/views/tags/index.html.haml
+++ b/app/views/tags/index.html.haml
@@ -7,5 +7,5 @@
.tags-list
- @tags.all.each do |tag|
- = link_to "#{tag.name}(#{tag.count})", "/tags/#{tag.name}"
+ = link_to "#{tag.name}(#{tag.count})", tag_path(name)