Commit 1d85197b08346c99e6015cb25b31f8fd10f4100f
Exists in
master
and in
4 other branches
Merge branch 'issue-184' into dev
Conflicts: app/views/layouts/project.html.haml app/views/projects/_form.html.haml
Showing
9 changed files
with
81 additions
and
39 deletions
Show diff stats
app/assets/javascripts/projects.js
| @@ -40,3 +40,19 @@ $(document).ready(function(){ | @@ -40,3 +40,19 @@ $(document).ready(function(){ | ||
| 40 | function focusSearch() { | 40 | function focusSearch() { |
| 41 | $("#search").focus(); | 41 | $("#search").focus(); |
| 42 | } | 42 | } |
| 43 | + | ||
| 44 | +function taggifyForm(){ | ||
| 45 | + var tag_field = $('#tag_field').tagify(); | ||
| 46 | + | ||
| 47 | + tag_field.tagify('inputField').autocomplete({ | ||
| 48 | + source: '/tags.json' | ||
| 49 | + }); | ||
| 50 | + | ||
| 51 | + | ||
| 52 | + $('form').submit( function() { | ||
| 53 | + var tag_field = $('#tag_field') | ||
| 54 | + tag_field.val( tag_field.tagify('serialize') ); | ||
| 55 | + return true; | ||
| 56 | + }); | ||
| 57 | +} | ||
| 58 | + |
app/assets/stylesheets/tags.css.css
| @@ -27,4 +27,18 @@ | @@ -27,4 +27,18 @@ | ||
| 27 | color: #FFF; | 27 | color: #FFF; |
| 28 | text-shadow: none; | 28 | text-shadow: none; |
| 29 | font-weight: bold; | 29 | font-weight: bold; |
| 30 | +} | ||
| 31 | + | ||
| 32 | + | ||
| 33 | +.medium-tags a{ | ||
| 34 | + font-size: 12px; | ||
| 35 | + | ||
| 36 | + display: inline-block; | ||
| 37 | + padding: 3px 4px 2px 4px; | ||
| 38 | + margin: 0px 7px 8px 0px; | ||
| 39 | + border-radius: 3px; | ||
| 40 | + background-color: #72bbdf; | ||
| 41 | + color: #FFF; | ||
| 42 | + text-shadow: none; | ||
| 43 | + font-weight: bold; | ||
| 30 | } | 44 | } |
| 31 | \ No newline at end of file | 45 | \ No newline at end of file |
app/views/admin/projects/_form.html.haml
| 1 | = form_for [:admin, @admin_project] do |f| | 1 | = form_for [:admin, @admin_project] do |f| |
| 2 | -if @admin_project.errors.any? | 2 | -if @admin_project.errors.any? |
| 3 | #error_explanation | 3 | #error_explanation |
| 4 | - %h2= "#{pluralize(@admin_project.errors.count, "error")} prohibited this admin_project from being saved:" | 4 | + %h2= "#{pluralize(@admin_project.errors.count, "error")} prohibited this admin_project from being saved:" |
| 5 | %ul | 5 | %ul |
| 6 | - @admin_project.errors.full_messages.each do |msg| | 6 | - @admin_project.errors.full_messages.each do |msg| |
| 7 | %li= msg | 7 | %li= msg |
| 8 | 8 | ||
| 9 | - .span-24 | ||
| 10 | - .span-12 | ||
| 11 | - .field | ||
| 12 | - = f.label :name | ||
| 13 | - %br | ||
| 14 | - = f.text_field :name | ||
| 15 | - .field | ||
| 16 | - = f.label :code | ||
| 17 | - %br | ||
| 18 | - = f.text_field :code | ||
| 19 | - .field | ||
| 20 | - = f.label :path | ||
| 21 | - %br | ||
| 22 | - = f.text_field :path | ||
| 23 | - .span-10 | ||
| 24 | - .field | ||
| 25 | - = f.label :description | ||
| 26 | - %br | ||
| 27 | - = f.text_area :description | 9 | + .form-row |
| 10 | + = f.label :name | ||
| 11 | + %br | ||
| 12 | + = f.text_field :name | ||
| 13 | + .form-row | ||
| 14 | + = f.label :code | ||
| 15 | + %br | ||
| 16 | + = f.text_field :code | ||
| 17 | + .form-row | ||
| 18 | + = f.label :path | ||
| 19 | + %br | ||
| 20 | + = f.text_field :path | ||
| 21 | + | ||
| 22 | + | ||
| 23 | + .form-row | ||
| 24 | + = f.label :tag_list | ||
| 25 | + %br | ||
| 26 | + = f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field | ||
| 27 | + | ||
| 28 | + .form-row | ||
| 29 | + = f.label :description | ||
| 30 | + %br | ||
| 31 | + = f.text_area :description | ||
| 28 | .clear | 32 | .clear |
| 29 | .actions | 33 | .actions |
| 30 | = f.submit 'Save', :class => "lbutton" | 34 | = f.submit 'Save', :class => "lbutton" |
| 35 | + | ||
| 36 | +:javascript | ||
| 37 | + $(function(){ | ||
| 38 | + taggifyForm(); | ||
| 39 | + }) |
app/views/layouts/project.html.haml
| @@ -40,5 +40,7 @@ | @@ -40,5 +40,7 @@ | ||
| 40 | - if @commit | 40 | - if @commit |
| 41 | = 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 | 41 | = 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 |
| 42 | 42 | ||
| 43 | + .medium-tags{:style => 'padding: 10px 0 0 10px; width: 210px;'}= tag_list @project | ||
| 44 | + | ||
| 43 | .project-content | 45 | .project-content |
| 44 | = yield | 46 | = yield |
app/views/projects/_form.html.haml
| @@ -55,16 +55,5 @@ | @@ -55,16 +55,5 @@ | ||
| 55 | 55 | ||
| 56 | :javascript | 56 | :javascript |
| 57 | $(function(){ | 57 | $(function(){ |
| 58 | - var tag_field = $('#tag_field').tagify(); | ||
| 59 | - | ||
| 60 | - tag_field.tagify('inputField').autocomplete({ | ||
| 61 | - source: '/tags.json' | ||
| 62 | - }); | ||
| 63 | - | ||
| 64 | - | ||
| 65 | - $('form').submit( function() { | ||
| 66 | - var tag_field = $('#tag_field') | ||
| 67 | - tag_field.val( tag_field.tagify('serialize') ); | ||
| 68 | - return true; | ||
| 69 | - }); | 58 | + taggifyForm(); |
| 70 | }) | 59 | }) |
app/views/projects/_list.html.haml
| @@ -12,9 +12,8 @@ | @@ -12,9 +12,8 @@ | ||
| 12 | %tr{ :class => "project", :url => project_path(project) } | 12 | %tr{ :class => "project", :url => project_path(project) } |
| 13 | %td | 13 | %td |
| 14 | = project.name | 14 | = project.name |
| 15 | - .small-tags | ||
| 16 | - - project.tag_list.each do |tag| | ||
| 17 | - = link_to tag, "/tags/#{tag}" | 15 | + .small-tags= tag_list project |
| 16 | + | ||
| 18 | 17 | ||
| 19 | %td= truncate project.url_to_repo | 18 | %td= truncate project.url_to_repo |
| 20 | %td= project.code | 19 | %td= project.code |
app/views/projects/_tile.html.haml
| @@ -13,9 +13,7 @@ | @@ -13,9 +13,7 @@ | ||
| 13 | - last_note = project.notes.last | 13 | - last_note = project.notes.last |
| 14 | = last_note ? last_note.created_at.stamp("24 Aug, 2011") : "Never" | 14 | = last_note ? last_note.created_at.stamp("24 Aug, 2011") : "Never" |
| 15 | 15 | ||
| 16 | - %p.small-tags | ||
| 17 | - - project.tag_list.each do |tag| | ||
| 18 | - = link_to tag, "/tags/#{tag}" | 16 | + %p.small-tags= tag_list project |
| 19 | 17 | ||
| 20 | .buttons | 18 | .buttons |
| 21 | %a.browse-code.button.yellow{:href => tree_project_path(project)} Browse code | 19 | %a.browse-code.button.yellow{:href => tree_project_path(project)} Browse code |
app/views/tags/index.html.haml