forked from joaomiguelpereira/n2
/
new.html.haml
165 lines (143 loc) · 7.06 KB
/
new.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
- content_for :head_content do
:javascript
$(function() {
var wizard = $('#wizard');
$("ul.arrows", wizard).tabs("div.panes > div", function(event, index) {
if (index > 0) {
var title = $("#article_content_attributes_title");
if (title.val() == '') {
title.siblings("label").addClass("wizard-errors")
return false;
}
title.siblings("label").removeClass("wizard-errors");
var body = $("#article_body");
if (body.val() == '') {
body.siblings("label").addClass("wizard-errors")
return false;
}
body.siblings("label").removeClass("wizard-errors");
}
});
var api = $("ul.arrows", wizard).data("tabs");
// "next tab" button
$("input.form-btn.next", wizard).click(function(event) {
event.preventDefault();
api.next();
});
// "previous tab" button
$("input.form-btn.prev", wizard).click(function() {
event.preventDefault();
api.prev();
});
$('.toggle-embed-video').click(function(event) {
event.preventDefault();
$('textarea.embed-video', $(this).parents('fieldset.inputs')).removeClass('hide').show();
$(this).remove();
});
});
- content_for :sub_nav do
= render :partial => 'shared/subnav/news_subnav'
#col_full
.panel_3
.panelBar
%h2= t '.header'
.formBox
#wizard
#flowplayer-block
%ul.arrows
%li
%a{:href => "#"}= t('wizard.compose')
%li
%a{:href => "#"}= t('wizard.details')
%li
%a{:href => "#"}= t('wizard.images')
%li
%a{:href => "#"}= t('wizard.more')
- semantic_form_for @article, :url => articles_path, :html => { :multipart => true, :class => "post_article" } do |form|
.panes
.panel1
- form.inputs do
- form.semantic_fields_for :content do |content_form|
- content_form.inputs do
= content_form.input :title
%p= form.input :body
- form.buttons do
= form.commit_button t('wizard.continue'), :class => 'float_right', :button_html => { :class => 'form-btn next' }
.panel2
- form.semantic_fields_for :content do |content_form|
- content_form.inputs do
= content_form.input :url, :required => false, :label => t('article_url_label'), :hint => t('article_url_hint')
= content_form.input :tags_string, :required => false, :hint => t('tags_hint')
= render :partial => 'shared/forms/wall_postable', :locals => { :form => content_form }
#article_status= label_tag :status, t('articles.status')
= select_tag :is_draft, options_for_select( { t('articles.draft') => 1, t('articles.publish') => 0 }, (@article.is_draft ? 1 : 0) )
- form.buttons do
= form.commit_button t('wizard.continue'), :class => 'float_right', :button_html => { :class => 'form-btn next' }
= form.commit_button t('wizard.post_now'), :class => 'float_right', :button_html => { :class => 'form-btn' }
= form.commit_button t('wizard.back'), :class => 'float_left', :button_html => { :class => 'form-btn prev' }
.panel3
- form.semantic_fields_for :content do |content_form|
= render :partial => 'shared/forms/images_simple', :locals => { :form => content_form, :item => @article.content }
#scrollbox
%a.prev.browse.left_scroll
.scrollable
.items
%a.next.browse.right_scroll
- form.buttons do
= form.commit_button t('wizard.continue'), :class => 'float_right', :button_html => { :class => 'form-btn next' }
= form.commit_button t('wizard.post_now'), :class => 'float_right', :button_html => { :class => 'form-btn' }
= form.commit_button t('wizard.back'), :class => 'float_left', :button_html => { :class => 'form-btn prev' }
.panel4
- form.semantic_fields_for :content do |content_form|
= render :partial => 'shared/forms/media_items_simple', :locals => { :form => content_form, :item => @article.content }
- form.buttons do
= form.commit_button t('wizard.post_now'), :class => 'float_right', :button_html => { :class => 'form-btn' }
= form.commit_button t('wizard.back'), :class => 'float_left', :button_html => { :class => 'form-btn prev' }
= stylesheet_link_tag 'jquery.wysiwyg'
= javascript_include_tag 'jquery.wysiwyg'
:javascript
(function($)
{
$('textarea#article_body').wysiwyg({
controls: {
strikeThrough : { visible : true },
underline : { visible : true },
separator00 : { visible : false },
justifyLeft : { visible : true },
justifyCenter : { visible : true },
justifyRight : { visible : true },
justifyFull : { visible : true },
separator01 : { visible : false },
indent : { visible : true },
outdent : { visible : true },
separator02 : { visible : false },
subscript : { visible : true },
superscript : { visible : true },
separator03 : { visible : false },
undo : { visible : true },
redo : { visible : true },
separator04 : { visible : false },
insertOrderedList : { visible : true },
insertUnorderedList : { visible : true },
insertHorizontalRule : { visible : true },
createLink : {
visible : true,
},
insertImage : {
visible : false,
},
separator05 : { visible : false },
separator06 : { visible : false },
h4mozilla : { visible : true && $.browser.mozilla, className : 'h4', command : 'heading', arguments : ['h4'], tags : ['h4'], tooltip : "Header 4" },
h5mozilla : { visible : true && $.browser.mozilla, className : 'h5', command : 'heading', arguments : ['h5'], tags : ['h5'], tooltip : "Header 5" },
h6mozilla : { visible : true && $.browser.mozilla, className : 'h6', command : 'heading', arguments : ['h6'], tags : ['h6'], tooltip : "Header 6" },
h4 : { visible : true && !( $.browser.mozilla ), className : 'h4', command : 'formatBlock', arguments : ['<H4>'], tags : ['h4'], tooltip : "Header 4" },
h5 : { visible : true && !( $.browser.mozilla ), className : 'h5', command : 'formatBlock', arguments : ['<H5>'], tags : ['h5'], tooltip : "Header 5" },
h6 : { visible : true && !( $.browser.mozilla ), className : 'h6', command : 'formatBlock', arguments : ['<H6>'], tags : ['h6'], tooltip : "Header 6" },
separator07 : { visible : false },
cut : { visible : true },
copy : { visible : true },
paste : { visible : true }
}
});
})(jQuery);