/
show.html.haml
85 lines (76 loc) · 3.19 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
- content_for :javascripts, include_javascripts(:preview)
#template-view
// Left Column
%section#left.rounded-all
%h2 Code Viewer
.holder-content
// Template
#source_code.loading{:'data-url' => @template.source_url}
// Right Column
%section#right.rounded-all
.corner
// Template's Name
%h2
= link_to @template.title, download_url(@template)
.author
by
= link_to @template.githubber.name, "http://github.com/#{@template.githubber.login}"
.holder-content
- unless @template.description.blank?
// Template's Descrition
%p= @template.description
.line-divisor.rounded-all
#downloads
%h3 Downloads
.holder-content.rounded-all
= link_to download_url(@template), download_url(@template)
%span.notice Copied to Clipboard!
#d_clip_button{ :title => "Copy to Clipboard"}
= pluralize(@template.download_counter, "person has downloaded it", "people have downloaded it")
.line-divisor.rounded-all
= render :partial => 'like_status', :locals => { :template => @template }
.line-divisor.rounded-all
#working_status
%h3 Did it work for you?
%ul
-if githubber_signed_in?
%li
.link-default.rounded-all= link_to 'Yes', template_works_path(@template, :work => true), :method => :POST, :id => 'work_button', :remote => true
%li
.holder-content.rounded-all
= render :partial => 'working_stats', :locals => { :template => @template }
%li
.link-default.rounded-all= link_to "No", template_works_path(@template), :method => :POST, :id => 'not_work_button', :remote => true
- else
%li
.link-default.rounded-all= link_to 'Yes', new_githubber_session_path, :id => 'work_button'
%li
.holder-content.rounded-all
= render :partial => 'working_stats', :locals => { :template => @template }
%li
.link-default.rounded-all= link_to 'No', new_githubber_session_path, :id => 'not_work_button'
.line-divisor.rounded-all
.break
#tag_list
%h3 Tags
= @template.tags.map { |t| link_to(t, "#") }.join(", ").html_safe
.line-divisor.rounded-all
.break
#commentaries
%h3 Comments
.comments-list
- if @template.commentaries.size > 0
- @template.commentaries.reverse.each do |commentary|
.commentary= render :partial => "commentary", :object => commentary
- else
%p.notice Be the first to comment about this template!
- if current_githubber
- semantic_form_for @commentary, :url => template_commentaries_path(@template), :remote => true, :html => { "data-type" => "html" } do |form|
- form.inputs do
= form.input :commentary, :label => "What you think about it?", :required => false
- form.buttons do
%li
= form.submit 'Comment!', :class => "rounded-all"
- else
%p
= link_to "Log in to comment this template", new_githubber_session_path