Merge branch 'issue-184' into dev
Conflicts: app/views/layouts/project.html.haml app/views/projects/_form.html.haml
This commit is contained in:
commit
1d85197b08
9 changed files with 81 additions and 39 deletions
|
@ -40,3 +40,19 @@ $(document).ready(function(){
|
||||||
function focusSearch() {
|
function focusSearch() {
|
||||||
$("#search").focus();
|
$("#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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,4 +27,18 @@
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
text-shadow: none;
|
text-shadow: none;
|
||||||
font-weight: bold;
|
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;
|
||||||
}
|
}
|
15
app/helpers/tags_helper.rb
Normal file
15
app/helpers/tags_helper.rb
Normal file
|
@ -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
|
|
@ -1,30 +1,39 @@
|
||||||
= form_for [:admin, @admin_project] do |f|
|
= form_for [:admin, @admin_project] do |f|
|
||||||
-if @admin_project.errors.any?
|
-if @admin_project.errors.any?
|
||||||
#error_explanation
|
#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
|
%ul
|
||||||
- @admin_project.errors.full_messages.each do |msg|
|
- @admin_project.errors.full_messages.each do |msg|
|
||||||
%li= msg
|
%li= msg
|
||||||
|
|
||||||
.span-24
|
.form-row
|
||||||
.span-12
|
= f.label :name
|
||||||
.field
|
%br
|
||||||
= f.label :name
|
= f.text_field :name
|
||||||
%br
|
.form-row
|
||||||
= f.text_field :name
|
= f.label :code
|
||||||
.field
|
%br
|
||||||
= f.label :code
|
= f.text_field :code
|
||||||
%br
|
.form-row
|
||||||
= f.text_field :code
|
= f.label :path
|
||||||
.field
|
%br
|
||||||
= f.label :path
|
= f.text_field :path
|
||||||
%br
|
|
||||||
= f.text_field :path
|
|
||||||
.span-10
|
.form-row
|
||||||
.field
|
= f.label :tag_list
|
||||||
= f.label :description
|
%br
|
||||||
%br
|
= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field
|
||||||
= f.text_area :description
|
|
||||||
|
.form-row
|
||||||
|
= f.label :description
|
||||||
|
%br
|
||||||
|
= f.text_area :description
|
||||||
.clear
|
.clear
|
||||||
.actions
|
.actions
|
||||||
= f.submit 'Save', :class => "lbutton"
|
= f.submit 'Save', :class => "lbutton"
|
||||||
|
|
||||||
|
:javascript
|
||||||
|
$(function(){
|
||||||
|
taggifyForm();
|
||||||
|
})
|
||||||
|
|
|
@ -40,5 +40,7 @@
|
||||||
- if @commit
|
- 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
|
= 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
|
.project-content
|
||||||
= yield
|
= yield
|
||||||
|
|
|
@ -55,16 +55,5 @@
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$(function(){
|
$(function(){
|
||||||
var tag_field = $('#tag_field').tagify();
|
taggifyForm();
|
||||||
|
|
||||||
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;
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -12,9 +12,8 @@
|
||||||
%tr{ :class => "project", :url => project_path(project) }
|
%tr{ :class => "project", :url => project_path(project) }
|
||||||
%td
|
%td
|
||||||
= project.name
|
= project.name
|
||||||
.small-tags
|
.small-tags= tag_list project
|
||||||
- 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
|
||||||
|
|
|
@ -13,9 +13,7 @@
|
||||||
- last_note = project.notes.last
|
- last_note = project.notes.last
|
||||||
= last_note ? last_note.created_at.stamp("24 Aug, 2011") : "Never"
|
= last_note ? last_note.created_at.stamp("24 Aug, 2011") : "Never"
|
||||||
|
|
||||||
%p.small-tags
|
%p.small-tags= tag_list project
|
||||||
- project.tag_list.each do |tag|
|
|
||||||
= link_to tag, "/tags/#{tag}"
|
|
||||||
|
|
||||||
.buttons
|
.buttons
|
||||||
%a.browse-code.button.yellow{:href => tree_project_path(project)} Browse code
|
%a.browse-code.button.yellow{:href => tree_project_path(project)} Browse code
|
||||||
|
|
|
@ -7,5 +7,5 @@
|
||||||
|
|
||||||
.tags-list
|
.tags-list
|
||||||
- @tags.all.each do |tag|
|
- @tags.all.each do |tag|
|
||||||
= link_to "#{tag.name}(#{tag.count})", "/tags/#{tag.name}"
|
= link_to "#{tag.name}(#{tag.count})", tag_path(name)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue