-
Notifications
You must be signed in to change notification settings - Fork 15
/
show.html.haml
91 lines (86 loc) · 3.57 KB
/
show.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
%article.issue#content.content-wide-sidebar
%header
%h1= @issue.title
- if permitted_to? [:edit, :destroy], @issue
%menu.tools
%ul
- if permitted_to?(:edit, @issue)
%li= link_to t(".edit_issue"), edit_issue_path(@issue)
- if permitted_to?(:destroy, @issue)
%li= link_to t(".delete_issue"), issue_path(@issue), data: { confirm: t(".confirm_delete") }, method: :delete
.main
%section.voting
.votes
- if current_user && current_user.voted_for?(@issue.model)
= link_to t(".cancel_vote"), vote_clear_issue_path(@issue), method: :put, class: "up selected"
- else
= link_to t(".vote_up"), vote_up_issue_path(@issue), method: :put, class: "up"
.vote-count
%span= @issue.plusminus
= t(".votes", count: @issue.plusminus)
- if current_user && current_user.voted_against?(@issue.model)
= link_to t(".cancel_vote"), vote_clear_issue_path(@issue), method: :put, class: "down selected"
- else
= link_to t(".vote_down"), vote_down_issue_path(@issue), method: :put, class: "down"
- if not permitted_to? :vote_up, :issues
.access-denied= t(".sign_in_to_vote_html", sign_in_link: link_to_sign_in)
%section.meta
%p
- if permitted_to? :view_profile, @issue.created_by
- profile_link = link_to_profile @issue.created_by
- else
- profile_link = @issue.created_by.display_name_or_anon
= t ".added_by_html", name: profile_link, time: formatted_created_at(@issue)
%section.tags
= @tag_panel.render
%section.description
= @issue.description
- if @issue.deadline
%section.deadline
%h3= t ".deadline"
= @issue.formatted_deadline.to_formatted_s(:long_ordinal)
= render partial: "shared/deadline", locals: {deadline: @issue.deadline}
- if @issue.external_url
%section.external_url
= link_to @issue.external_url, @issue.external_url
%section.map
%h2= t ".location"
.pull-right
= check_box_tag('collisions')
= label_tag 'collisions', t('.show_collisions')
%div{id: 'map'}
.hidden
.map-data{"data-center" => location_to_geojson(@issue.location),
"data-opts" => { collisions: true, feature: item_to_geojson(@issue), photos: true }.to_json}
= link_to t(".issues-nearby"), issues_path(anchor: 'map-pane', issue_id: @issue.id), class: "btn-green"
%aside#sidebar.wide
- if permitted_to? :create, :issue_message_threads
= link_to t(".new_thread", count: @issue.threads.count), new_issue_thread_path(@issue), class: "btn-green", rel: "#overlay"
%section.social
= tweet_button text: @issue.title, link: issue_url(@issue)
= facebook_like issue_url(@issue)
%section.threads
%header
%h2= t ".threads"
- if @threads.empty?
%p= t ".no_threads_yet"
- unless current_user
%p= t ".sign_in_to_discuss_html", sign_in_link: link_to(t(".sign_in"), new_user_session_path)
- else
%ul.sidebar-threadlist
= render partial: "message_threads/compact", collection: @threads, as: :thread
- if @issue.photo
%section.photos
= link_to issue_photo_path(@issue), rel: "#overlay" do
= @issue.standard_photo_image
:javascript
$( document ).ready(function() {
var mapCollision = $("span:contains('Collisions')").prev();
var checkboxCollision = $('#collisions');
mapCollision.change(function() {
checkboxCollision.prop('checked', this.checked);
})
checkboxCollision.change(function() {
mapCollision.click();
})
})