Commit cb6c842b42c4eb63da83da0075b0d4fd7f98a330
1 parent
1e455329
Exists in
master
and in
29 other branches
ActionItem166: form de insercao de comentario melhorado
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1473 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
8 changed files
with
106 additions
and
55 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -126,28 +126,6 @@ module ApplicationHelper | @@ -126,28 +126,6 @@ module ApplicationHelper | ||
126 | link_to text, homepage_path(:profile => doc.profile.identifier , :page => path) | 126 | link_to text, homepage_path(:profile => doc.profile.identifier , :page => path) |
127 | end | 127 | end |
128 | 128 | ||
129 | - def shortcut_header_links | ||
130 | -# search_link = ( lightbox_link_to content_tag('span', _('Search')), { :controller => 'search', :action => 'popup' }, { :id => 'open_search'} ) | ||
131 | -# | ||
132 | -# if logged_in? | ||
133 | -# [ | ||
134 | -# ( link_to_homepage '<img src="' + | ||
135 | -# ( (current_user.person.image)? current_user.person.image.public_filename(:icon) : "/images/icons-bar/photo.png" ) + | ||
136 | -# '" alt="Photo" title="" height="20" border="0"/>'+ current_user.login, | ||
137 | -# current_user.login, :id=>"link_go_home" ), | ||
138 | -# ( link_to_myprofile( content_tag('span', _('control panel')), {}, nil, { :id => 'link_edit_profile'} ) ), | ||
139 | -# ( link_to content_tag('span', _('Admin')), { :controller => 'admin_panel' }, :id => 'link_admin_panel' if current_user.person.is_admin?), | ||
140 | -# ( lightbox_link_to content_tag('span', _('Logout')), { :controller => 'account', :action => 'logout_popup'}, :id => 'link_logout'), | ||
141 | -# search_link, | ||
142 | -# ] | ||
143 | -# else | ||
144 | -# [ | ||
145 | -# ( lightbox_link_to content_tag('span', _('Login')), { :controller => 'account', :action => 'login_popup' }, :id => 'link_login' ), | ||
146 | -# search_link, | ||
147 | -# ] | ||
148 | -# end.join(" ") | ||
149 | - end | ||
150 | - | ||
151 | def link_if_permitted(link, permission = nil, target = nil) | 129 | def link_if_permitted(link, permission = nil, target = nil) |
152 | if permission.nil? || current_user.person.has_permission?(permission, target) | 130 | if permission.nil? || current_user.person.has_permission?(permission, target) |
153 | link | 131 | link |
app/views/content_viewer/_comment_form.rhtml
1 | -<h3><%= _('Post a comment') %></h3> | 1 | +<% |
2 | + comment_form_id = 'comment_form'+ rand(9999).to_s | ||
3 | +%> | ||
4 | +<div | ||
5 | + class="post_comment_box closed" | ||
6 | + onclick="f=$(<%= comment_form_id %>); f.style.display='block'; | ||
7 | + this.className = this.className.replace(/closed/,'opened'); | ||
8 | + f.commit.focus(); f['comment[title]'].focus()"> | ||
2 | 9 | ||
3 | -<% form_tag do %> | 10 | +<h4><%= _('Post a comment') %></h4> |
11 | + | ||
12 | +<% form_tag( {}, { :id => comment_form_id, :style => 'display:none' } ) do %> | ||
4 | 13 | ||
5 | <% unless logged_in? %> | 14 | <% unless logged_in? %> |
6 | 15 | ||
@@ -14,8 +23,10 @@ | @@ -14,8 +23,10 @@ | ||
14 | <% end %> | 23 | <% end %> |
15 | 24 | ||
16 | <%= labelled_form_field(_('Title'), text_field(:comment, :title)) %> | 25 | <%= labelled_form_field(_('Title'), text_field(:comment, :title)) %> |
17 | - <%= labelled_form_field(_('Enter your comment'), text_area(:comment, :body)) %> | 26 | + <%= labelled_form_field(_('Enter your comment'), text_area(:comment, :body, :rows => 5)) %> |
18 | <% button_bar do %> | 27 | <% button_bar do %> |
19 | - <%= submit_button('post', _('Post comment')) %> | 28 | + <%= submit_button('add', _('Post comment')) %> |
20 | <% end %> | 29 | <% end %> |
21 | <% end %> | 30 | <% end %> |
31 | + | ||
32 | +</div><!-- end class="post_comment_box" --> |
app/views/layouts/application.rhtml
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | stylesheet_import is better then stylesheet_link_tag because the stylesheet | 13 | stylesheet_import is better then stylesheet_link_tag because the stylesheet |
14 | must be loaded before the page show. | 14 | must be loaded before the page show. |
15 | %> | 15 | %> |
16 | - <%= stylesheet_import %w( common help menu button search blocks forms login-box ) %> | 16 | + <%= stylesheet_import %w( common help menu article button search blocks forms login-box ) %> |
17 | <%= import_blocks_stylesheets %> | 17 | <%= import_blocks_stylesheets %> |
18 | <%= | 18 | <%= |
19 | # Load the controller's css file if it exists: | 19 | # Load the controller's css file if it exists: |
app/views/shared/user_menu.rhtml
1 | <div id="user_menu" class="top_extra_menu AOM_paddingBottom_6"> | 1 | <div id="user_menu" class="top_extra_menu AOM_paddingBottom_6"> |
2 | 2 | ||
3 | <% if logged_in? %> | 3 | <% if logged_in? %> |
4 | - <%= | ||
5 | - link_to_homepage '<img src="' + ( | ||
6 | - (current_user.person.image)? current_user.person.image.public_filename(:icon) : "/images/icons-bar/photo.png" | ||
7 | - ) + | ||
8 | - '" alt="'+ current_user.login() +' Icon-Photo" title="" height="20" border="0"/>'+ | ||
9 | - current_user.login, current_user.login, :id=>'link_go_home', :class => 'user_menu_first_link' | ||
10 | - %> | 4 | + |
5 | + <div id="user_menu_head"> | ||
6 | + <img src="<%= | ||
7 | + (current_user.person.image)? | ||
8 | + current_user.person.image.public_filename(:icon) : "/images/icons-bar/photo.png" | ||
9 | + %>" alt="<%= current_user.login %> Icon-Photo" title="" height="20" border="0"/> | ||
10 | + <span><%= _("%s's Menu") % current_user.login %></span> | ||
11 | + </div> | ||
12 | + | ||
11 | <div id="user_menu_ul"> | 13 | <div id="user_menu_ul"> |
12 | <ul> | 14 | <ul> |
13 | 15 | ||
14 | - <li><a href="#"><span class="icon-menu-blog"></span> Meu Blog</a></li> | 16 | + <li><a href="<%= homepage_path(:profile => current_user.login) %>"><span class="icon-menu-home"></span><%= _('My Home Page') %></a></li> |
17 | + | ||
18 | + <!-- li><a href="#"><span class="icon-menu-blog"></span> Meu Blog</a></li --> | ||
15 | 19 | ||
16 | <li><%= link_to_myprofile( '<span class="icon-menu-ctrl-panel"></span>'+ _('control panel'), | 20 | <li><%= link_to_myprofile( '<span class="icon-menu-ctrl-panel"></span>'+ _('control panel'), |
17 | {}, nil, :id => 'link_edit_profile' ) %></li> | 21 | {}, nil, :id => 'link_edit_profile' ) %></li> |
18 | 22 | ||
19 | - <li><%= link_to( '<span class="icon-menu-edit"></span>'+_('Edit Profile'), | ||
20 | - :controller => 'profile_editor', :profile => user.identifier, :action => 'edit' ) %></li> | ||
21 | - | ||
22 | - <li><%= link_to( '<span class="icon-menu-product"></span>'+_('Consumed Products'), | ||
23 | - :profile => user.identifier, :controller => 'consumed_products' ) %></li> | ||
24 | <%= | 23 | <%= |
25 | '<li>'+ link_to( '<span class="icon-menu-"></span>'+ _('Admin'), | 24 | '<li>'+ link_to( '<span class="icon-menu-"></span>'+ _('Admin'), |
26 | { :controller => 'admin_panel' }, :id => 'link_admin_panel' ) + | 25 | { :controller => 'admin_panel' }, :id => 'link_admin_panel' ) + |
27 | '</li>' if user.is_admin? | 26 | '</li>' if user.is_admin? |
28 | %> | 27 | %> |
29 | 28 | ||
30 | - <li><%= link_to( '<span class="icon-menu-ed-design"></span>'+_('Edit Visual Design'), | ||
31 | - :controller => 'profile_design', :profile => user.identifier ) %></li> | ||
32 | - | ||
33 | - <li><%= link_to( '<span class="icon-menu-"></span>'+_('Manage Content'), | ||
34 | - :controller => 'cms', :profile => user.identifier) %></li> | ||
35 | - | ||
36 | <li><%= lightbox_link_to( '<span class="icon-menu-logout"></span>'+ _('Logout'), | 29 | <li><%= lightbox_link_to( '<span class="icon-menu-logout"></span>'+ _('Logout'), |
37 | { :controller => 'account', :action => 'logout_popup'}, :id => 'link_logout' ) %></li> | 30 | { :controller => 'account', :action => 'logout_popup'}, :id => 'link_logout' ) %></li> |
38 | 31 | ||
@@ -43,7 +36,7 @@ | @@ -43,7 +36,7 @@ | ||
43 | 36 | ||
44 | <%= lightbox_link_to '<span class="icon-menu-login"></span>'+ _('Login'), | 37 | <%= lightbox_link_to '<span class="icon-menu-login"></span>'+ _('Login'), |
45 | { :controller => 'account', :action => 'login_popup' }, | 38 | { :controller => 'account', :action => 'login_popup' }, |
46 | - :id => 'link_login', :class => 'user_menu_first_link' %> | 39 | + :id => 'link_login' %> |
47 | 40 | ||
48 | <% end %> | 41 | <% end %> |
49 | 42 |
156 Bytes
public/designs/icons/default/style.css
@@ -24,6 +24,7 @@ | @@ -24,6 +24,7 @@ | ||
24 | .icon-help32on { background-image: url(help-on-32x32-HC.gif) } | 24 | .icon-help32on { background-image: url(help-on-32x32-HC.gif) } |
25 | .icon-help32off { background-image: url(help-off-32x32-HC.gif) } | 25 | .icon-help32off { background-image: url(help-off-32x32-HC.gif) } |
26 | .icon-menu- { background-image: url(menu-without-ico-HC.gif) } | 26 | .icon-menu- { background-image: url(menu-without-ico-HC.gif) } |
27 | +.icon-menu-home { background-image: url(home-HC.gif) } | ||
27 | .icon-menu-blog { background-image: url(blog-HC.gif) } | 28 | .icon-menu-blog { background-image: url(blog-HC.gif) } |
28 | .icon-menu-album { background-image: url(album-HC.gif) } | 29 | .icon-menu-album { background-image: url(album-HC.gif) } |
29 | .icon-menu-product { background-image: url(product-HC.gif) } | 30 | .icon-menu-product { background-image: url(product-HC.gif) } |
@@ -0,0 +1,50 @@ | @@ -0,0 +1,50 @@ | ||
1 | +/* | ||
2 | +** Style for Article Related Elements | ||
3 | +*/ | ||
4 | + | ||
5 | +.post_comment_box { | ||
6 | + text-align: center; | ||
7 | + padding: 0px 15px 5px 15px; | ||
8 | + margin: 10px; | ||
9 | +} | ||
10 | + | ||
11 | +.post_comment_box h4 { | ||
12 | + padding: 1px 20px; | ||
13 | + margin: 0px; | ||
14 | + background: #B8CFE7; | ||
15 | +} | ||
16 | + | ||
17 | +.post_comment_box.closed h4 { | ||
18 | + display: inline; | ||
19 | + border: 1px solid #729FCF; | ||
20 | + cursor: pointer; | ||
21 | +} | ||
22 | + | ||
23 | +.post_comment_box.opened { | ||
24 | + border: 1px solid #729FCF; | ||
25 | + background: #B8CFE7; | ||
26 | +} | ||
27 | + | ||
28 | +.post_comment_box form { | ||
29 | + text-align: left; | ||
30 | + margin: -10px 0px 0px 0px; | ||
31 | +} | ||
32 | + | ||
33 | +.post_comment_box .formfield * { | ||
34 | + width: 99%; | ||
35 | +} | ||
36 | + | ||
37 | +.post_comment_box .button-bar { | ||
38 | + text-align: center; | ||
39 | +} | ||
40 | + | ||
41 | +.post_comment_box input.button { | ||
42 | + position: relative; | ||
43 | + float: none; | ||
44 | + margin: auto; | ||
45 | +} | ||
46 | + | ||
47 | +.post_comment_box .button-bar br { | ||
48 | + display: none; | ||
49 | +} | ||
50 | + |
public/stylesheets/menu.css
@@ -172,7 +172,6 @@ body.category4 #assets_menu_layout_iten { background: url(/images/top-bar/assets | @@ -172,7 +172,6 @@ body.category4 #assets_menu_layout_iten { background: url(/images/top-bar/assets | ||
172 | #assets_menu_list { | 172 | #assets_menu_list { |
173 | padding: 0px 0px 6px 5px; | 173 | padding: 0px 0px 6px 5px; |
174 | background: url(/images/top-bar/assets-menu-bg-azul.gif) 0% 100%; | 174 | background: url(/images/top-bar/assets-menu-bg-azul.gif) 0% 100%; |
175 | - Xborder-right: 1px solid #2A5896; | ||
176 | } | 175 | } |
177 | body.category1 #assets_menu_list { background-image: url(/images/top-bar/assets-menu-bg-laranja.gif) } | 176 | body.category1 #assets_menu_list { background-image: url(/images/top-bar/assets-menu-bg-laranja.gif) } |
178 | body.category2 #assets_menu_list { background-image: url(/images/top-bar/assets-menu-bg-verde.gif) } | 177 | body.category2 #assets_menu_list { background-image: url(/images/top-bar/assets-menu-bg-verde.gif) } |
@@ -194,8 +193,9 @@ body.category4 #assets_menu_list { background-image: url(/images/top-bar/assets- | @@ -194,8 +193,9 @@ body.category4 #assets_menu_list { background-image: url(/images/top-bar/assets- | ||
194 | list-style: none; | 193 | list-style: none; |
195 | } | 194 | } |
196 | 195 | ||
196 | +#user_menu_head, | ||
197 | #user_box a, | 197 | #user_box a, |
198 | -/*#assets_menu a,*/ | 198 | +#assets_menu a, |
199 | .top_extra_menu a { | 199 | .top_extra_menu a { |
200 | font-size: 12px; | 200 | font-size: 12px; |
201 | font-weight: bold; | 201 | font-weight: bold; |
@@ -208,13 +208,21 @@ body.category4 #assets_menu_list { background-image: url(/images/top-bar/assets- | @@ -208,13 +208,21 @@ body.category4 #assets_menu_list { background-image: url(/images/top-bar/assets- | ||
208 | overflow: hidden; | 208 | overflow: hidden; |
209 | position: relative; | 209 | position: relative; |
210 | } | 210 | } |
211 | +body.category1 #user_menu_head, | ||
211 | body.category1 #user_box a, | 212 | body.category1 #user_box a, |
213 | +body.category1 #assets_menu a, | ||
212 | body.category1 .top_extra_menu a { color: #FDD79E } | 214 | body.category1 .top_extra_menu a { color: #FDD79E } |
215 | +body.category2 #user_menu_head, | ||
213 | body.category2 #user_box a, | 216 | body.category2 #user_box a, |
217 | +body.category2 #assets_menu a, | ||
214 | body.category2 .top_extra_menu a { color: #C4F099 } | 218 | body.category2 .top_extra_menu a { color: #C4F099 } |
219 | +body.category3 #user_menu_head, | ||
215 | body.category3 #user_box a, | 220 | body.category3 #user_box a, |
221 | +body.category3 #assets_menu a, | ||
216 | body.category3 .top_extra_menu a { color: #D6BFD3 } | 222 | body.category3 .top_extra_menu a { color: #D6BFD3 } |
223 | +body.category4 #user_menu_head, | ||
217 | body.category4 #user_box a, | 224 | body.category4 #user_box a, |
225 | +body.category4 #assets_menu a, | ||
218 | body.category4 .top_extra_menu a { color: #F79494 } | 226 | body.category4 .top_extra_menu a { color: #F79494 } |
219 | #user_box a:hover, | 227 | #user_box a:hover, |
220 | .top_extra_menu a:hover { | 228 | .top_extra_menu a:hover { |
@@ -235,7 +243,7 @@ body.category3 .top_extra_menu a:hover { background: #75507B; color: #FFF } | @@ -235,7 +243,7 @@ body.category3 .top_extra_menu a:hover { background: #75507B; color: #FFF } | ||
235 | body.category4 #user_box a:hover, | 243 | body.category4 #user_box a:hover, |
236 | body.category4 .top_extra_menu a:hover { background: #CC0000; color: #FFF } | 244 | body.category4 .top_extra_menu a:hover { background: #CC0000; color: #FFF } |
237 | 245 | ||
238 | -#user_box a img, | 246 | +#user_box img, |
239 | #user_box a span, | 247 | #user_box a span, |
240 | .top_extra_menu a span { | 248 | .top_extra_menu a span { |
241 | position: absolute; | 249 | position: absolute; |
@@ -250,18 +258,18 @@ body.category4 .top_extra_menu a:hover { background: #CC0000; color: #FFF } | @@ -250,18 +258,18 @@ body.category4 .top_extra_menu a:hover { background: #CC0000; color: #FFF } | ||
250 | opacity: 0.7; | 258 | opacity: 0.7; |
251 | filter: alpha(opacity=70); | 259 | filter: alpha(opacity=70); |
252 | } | 260 | } |
253 | -.msie5 #user_box a img, | 261 | +/*.msie5 #user_box img,*/ |
254 | .msie5 #user_box a span, | 262 | .msie5 #user_box a span, |
255 | .msie5 .top_extra_menu a span { | 263 | .msie5 .top_extra_menu a span { |
256 | display: none; | 264 | display: none; |
257 | } | 265 | } |
258 | -#user_box a img, | 266 | +#user_box img, |
259 | #user_box a:hover span, | 267 | #user_box a:hover span, |
260 | .top_extra_menu a:hover span { | 268 | .top_extra_menu a:hover span { |
261 | opacity: 1; | 269 | opacity: 1; |
262 | filter: alpha(opacity=100); | 270 | filter: alpha(opacity=100); |
263 | } | 271 | } |
264 | -#user_box a img { | 272 | +#user_box img { |
265 | border: none; | 273 | border: none; |
266 | top: -1px; | 274 | top: -1px; |
267 | left: -1px; | 275 | left: -1px; |
@@ -297,11 +305,21 @@ body.category4 .top_extra_menu a:hover { background: #CC0000; color: #FFF } | @@ -297,11 +305,21 @@ body.category4 .top_extra_menu a:hover { background: #CC0000; color: #FFF } | ||
297 | width: 170px; | 305 | width: 170px; |
298 | } | 306 | } |
299 | 307 | ||
300 | -#user_box a.user_menu_first_link { | 308 | +#user_menu_head { |
309 | + overflow: visible; | ||
310 | + cursor: default; | ||
311 | +} | ||
312 | +#user_menu_head span { | ||
313 | + position: relative; | ||
314 | + top: 1px; | ||
315 | +} | ||
316 | + | ||
317 | +#user_menu_head, | ||
318 | +#user_box a#link_login { | ||
301 | margin-left: 25px; | 319 | margin-left: 25px; |
302 | display: inline; | 320 | display: inline; |
303 | } | 321 | } |
304 | -#user_menu .user_menu_first_link:hover { | 322 | +#user_menu a#link_login:hover { |
305 | background: none; | 323 | background: none; |
306 | } | 324 | } |
307 | 325 |