Skip to content

Commit

Permalink
manners now working correctly in my redmine, still lots of open todos…
Browse files Browse the repository at this point in the history
… like removal of prototype and drying this up
  • Loading branch information
steffen.jurrack committed Sep 14, 2012
1 parent 2be63d4 commit 324af30
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 29 deletions.
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
source 'https://rubygems.org'

gem 'haml-rails'
gem 'haml-rails'

group :development do
gem "debugger"
end
9 changes: 9 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ GEM
i18n (~> 0.6)
multi_json (~> 1.0)
builder (3.0.0)
columnize (0.3.6)
debugger (1.1.4)
columnize (>= 0.3.1)
debugger-linecache (~> 1.1.1)
debugger-ruby_core_source (~> 1.1.3)
debugger-linecache (1.1.2)
debugger-ruby_core_source (>= 1.1.1)
debugger-ruby_core_source (1.1.3)
erubis (2.7.0)
haml (3.1.6)
haml-rails (0.3.4)
Expand Down Expand Up @@ -58,4 +66,5 @@ PLATFORMS
ruby

DEPENDENCIES
debugger
haml-rails
5 changes: 1 addition & 4 deletions app/views/banner/_after_top_menu.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
= render :partial=>'banner/body_bottom'
:javascript
document.observe("dom:loaded", function() {
new Insertion.After($('header'), $('.banner_area'));
});
jQuery(document).ready(function(){$('#top-menu').after("#{escape_javascript(render(:partial=>'banner/body_bottom'))}");});
9 changes: 9 additions & 0 deletions app/views/banner/_banner.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.project_banner_area.banner_area
.banner_content{:class=>"banner banner_#{banner.style}"}
=textilizable banner.banner_description
-if authorize_for(:banner, :edit)
.banner_edit
= link_to(l(:button_edit),
{:controller => 'projects', :action => "settings", :id => @project, :tab => 'banner'},
{:class => 'icon banner-icon-edit', :title => l(:button_edit)})
%a.icon.banner-icon-off{:href=>"#", :title=>"#{l(:banner_off)}", :onclick=>"banner_off();"}= l(:button_off)
2 changes: 1 addition & 1 deletion app/views/banner/_body_bottom.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.banner_edit
= link_to l(:button_edit), {:controller => 'settings', :action => 'plugin', :id => 'redmine_banner'},
{:class => 'icon banner-icon-edit', :title => l(:button_edit)}
%a.icon.banner-icon-off{:href=>"#", :onclick=>"", :title=>"#{l(:banner_off)}"}= l(:button_off)
%a.icon.banner-icon-off{:href=>"#", :onclick=>"", :title=>"#{l(:banner_off)}"}= l(:button_off)

:javascript
function banner_off_moderate(){
Expand Down
16 changes: 2 additions & 14 deletions app/views/banner/_project_body_bottom.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,10 @@
-display_part = banner.display_part
-return '' unless BannerHelper.is_action_to_display?(@_controller, display_part)

.project_banner_area.banner_area
.banner_content{:class=>"banner banner_#{banner.style}"}
=textilizable banner.banner_description

-if authorize_for(:banner, :edit)
.banner_edit
= link_to(l(:button_edit),
{:controller => 'projects', :action => "settings", :id => @project, :tab => 'banner'},
{:class => 'icon banner-icon-edit', :title => l(:button_edit)})
%a.icon.banner-icon-off{:href=>"#", :title=>"#{l(:banner_off)}", :onclick=>"banner_off();"}= l(:button_off)

:javascript
document.observe("dom:loaded", function() {
new Insertion.Top($('content'), $('project_banner_area'));
jQuery(document).ready(function(){
$('#content h2').after('#{escape_javascript(render('banner/banner', :banner=>banner))}')
});

function banner_off(){
if (confirm('#{l(:text_are_you_sure)}')) {
new Ajax.Updater(
Expand Down
17 changes: 8 additions & 9 deletions app/views/settings/_redmine_banner.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
:javascript
Event.observe(window, 'load', function() {
jQuery(document).ready(function() {
var confirm_msg = "#{l(:text_are_you_sure)}";
var date_range_error_msg = "#{l(:error_banner_date_range)}";
Event.observe("plugin", "submit", function(event) {checkDateRange(event, confirm_msg, date_range_error_msg);})
jQuery('#plugin').bind('submit', function(e){checkDateRange(event, confirm_msg, date_range_error_msg);});
jQuery('span.use_timer input').bind('change',(function(e){$('#banner_timer_setting').toggle();}));
});

%p
Expand Down Expand Up @@ -42,26 +43,24 @@
#banner_description_preview.wiki
%p
=content_tag(:label, l(:label_use_timer))
%span.use_timer=check_box_tag 'settings[use_timer]', true, @settings['use_timer'] == "true" , :onclick => "changeView(this);"
%span.use_timer=check_box_tag 'settings[use_timer]', true, @settings['use_timer'] == "true"
#banner_timer_setting{:style=>"display:#{@settings['use_timer'] == 'true' ? 'block' : 'none'}"}
%p
=content_tag(:label, l(:label_start_datetime))
= text_field_tag 'settings[start_ymd]', @start_datetime.strftime("%Y-%m-%d"), :size => 10
= select_hour @start_datetime, :prefix => 'settings', :field_name => 'start_hour',
:time_separator => ':', :include_seconds => false
:
=':'
= select_minute @start_datetime, :prefix => 'settings', :field_name => 'start_min', :time_separator => ':', :include_seconds => false
= calendar_for('settings_start_ymd')
(exp. 2012-12-31 11:00)
%br
%p
=content_tag(:label, l(:label_end_datetime))
%p
=content_tag(:label, l(:label_end_datetime))
= text_field_tag 'settings[end_ymd]', @end_datetime.strftime("%Y-%m-%d"), :size => 10
= select_hour @end_datetime, :prefix => 'settings',:field_name => 'end_hour',
:time_separator => ':', :include_seconds => false,:disabled => !@settings['use_timer'] == "true"
:
=':'
= select_minute @end_datetime, :prefix => 'settings',:field_name => 'end_min',
:time_separator => ':', :include_seconds => false,:disabled => !@settings['use_timer'] == "true"
= calendar_for('settings_end_ymd')
(exp. 2013-01-01 11:00)
%br

0 comments on commit 324af30

Please sign in to comment.