Skip to content

Commit

Permalink
changes to make bootstrap compatible with webapps plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
agmps17 committed Jul 8, 2014
1 parent 7e6ae79 commit 1bc8796
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 59 deletions.
18 changes: 9 additions & 9 deletions app/views/webapps/_form.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
:ok_icon_path => theme_image_path('ok.png'), \
:error_icon_path => theme_image_path('stop.png') \
}, \
:class => 'webapp create-form', \
:class => 'webapp create-form form-horizontal', \
:id => 'webapp-new' \
} do |f|

fieldset
legend   #{t 'create_a_new_webapp'}  
.create-inside
.control-group
.controls= f.text_field :name, :size => 16, :maxlength => 20, :value=>'', :placeholder => t('name')
.control-group.form-group
.controls= f.text_field :name, :size => 16, :maxlength => 20, :value=>'', :placeholder => t('name'), :class=>'form-control'

.control-group
.controls= f.text_field :path, :size => 16, :maxlength => 64, :value=>'', :placeholder => t('root_path').html_safe
.control-group.form-group
.controls= f.text_field :path, :size => 16, :maxlength => 64, :value=>'', :placeholder => t('root_path').html_safe, :class=>'form-control'
b="/html"
.control-group.create-btn
.controls
.control-group.form-group.create-btn
.controls.col-xs-offset-2.col-xs-10
= spinner
= button_tag t('create'), :type => 'submit', :id => 'webapp_create_button', :class => 'btn btn-create'
= link_to t('cancel'), '#', :class => 'close-area cancel-link', :data => {:related => '#new-webapp-to-step1'}
= button_tag t('create'), :type => 'submit', :id => 'webapp_create_button', :class => 'btnn btn-create btn btn-info'
= link_to t('cancel'), '#', :class => 'close-area cancel-link btn btn-primary left-margin-10', :data => {:related => '#new-webapp-to-step1'}
2 changes: 1 addition & 1 deletion app/views/webapps/_list.html.slim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#webapps-table
.settings-table
- if @webapps.size > 0
table.settings
table.settings.table
thead
tr
th.settings-col1.webapps-col1 scope="col" = t 'name'
Expand Down
4 changes: 2 additions & 2 deletions app/views/webapps/_name.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ a.click_change = h(@webapp.name)
:name => :name,
:method => :put,
:remote => true,
:form_css_class => "edit_form form_hidden",
:cancel_class => "cancel_link"
:form_css_class => "edit_form form_hidden form-horizontal",
:cancel_class => "cancel_link btn-primary btn left-margin-10 btn-sm "
4 changes: 2 additions & 2 deletions app/views/webapps/_path.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ a.click_change = h(@webapp.path)
:name => :path,
:method => :put,
:remote => true,
:form_css_class => "edit_form form_hidden",
:cancel_class => "cancel_link"
:form_css_class => "edit_form form_hidden form-horizontal",
:cancel_class => "cancel_link btn-primary btn left-margin-10 btn-sm"
6 changes: 3 additions & 3 deletions app/views/webapps/_permission_webapp.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
- uid = @webapp.id.to_s
- @users_allowed = WebappAccess.find_or_create(@webapp.id).getUsers
div.webapp[id="whole_webapp_#{uid}"]
table.settings.stretchtoggle id="webapp_row_#{uid}"
table.settings.table.stretchtoggle id="webapp_row_#{uid}"
tr
td.settings-col1.webapps-col1
td.settings-col1.webapps-col1.settings-col1-pad
= link_to(@webapp.name, '')
td.settings-col2.webapps-col2 id="webapp_url_#{uid}"
a href=("http://#{webapp.name}") target="_blank"
Expand All @@ -18,7 +18,7 @@ div.webapp[id="whole_webapp_#{uid}"]
b= h(@webapp.name)
|  
.settings-fields
table
table.table
-for item in @users
-@user = item
tr[id="permission_webapp#{@webapp.id}_user#{@user.id}"]
Expand Down
8 changes: 4 additions & 4 deletions app/views/webapps/_user_permissions.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ td
= link_to("[x]",webapps_engine.remove_permission_webapp_path(:id => @user.id,:webapp_id=>@webapp.id), {:remote=>true, :method=>:delete, :class=>'edit_form user_access_delete_icon'})
- else
a.click_change Add access password
form.edit_form.form_hidden action=webapps_engine.add_permission_webapp_path(:id => @user.id,:webapp_id=>@webapp.id) data-remote="true" method="post" style=("display: none;")
input name="password" type="password" placeholder="Enter User login password"
button.btn.btn-create.margin-for-message type="submit"
form.edit_form.form_hidden.form-inline action=webapps_engine.add_permission_webapp_path(:id => @user.id,:webapp_id=>@webapp.id) data-remote="true" method="post" style=("display: none;")
input.form-control.input-sm name="password" type="password" placeholder="Enter User login password"
button.btn.btn-create.margin-for-message.btn-info.left-margin-10.btn-sm type="submit"
span = t('add')
a.cancel_link Cancel
a.cancel_link.btn-primary.btn.left-margin-10.btn-sm Cancel
span.spinner.theme-image style=("display: none")
.messages

Expand Down
38 changes: 10 additions & 28 deletions app/views/webapps/_webapp.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
- uid = webapp.id.to_s
- return if webapp.nil?
div.webapp[id="whole_webapp_#{uid}"]
table.settings.stretchtoggle id="webapp_row_#{uid}"
table.settings.table.stretchtoggle.table-condensed id="webapp_row_#{uid}"
tr
td.settings-col1.webapps-col1
td.settings-col1.webapps-col1.settings-col1-pad
= link_to(webapp.name, '')
td.settings-col2.webapps-col2 id="webapp_url_#{uid}"
a href=("http://#{webapp.name}") target="_blank"
Expand All @@ -27,9 +27,9 @@ div.webapp[id="whole_webapp_#{uid}"]
:method => :delete,
:id => "delete-webapp-#{webapp.id}",
:data => { :confirm => "Are you sure you want to delete "+ webapp.name},
:class => 'btn-delete delete_webapp remote-btn'
:class => 'btn btn-primary btn-sm btn-delete navbar-right delete_webapp remote-btn'
.settings-fields
table
table.table.table-condensed
tr
td
= t 'name'
Expand All @@ -41,21 +41,15 @@ div.webapp[id="whole_webapp_#{uid}"]

- else
= h webapp.name
tr
td  
td  
td  

tr
td
= t 'aliases'
td  
td
= render :partial => 'webapp_aliases', :locals => { :@webapp => webapp }
td
tr
td  
td  
td  

tr
td
= t('root_path').html_safe
Expand All @@ -67,10 +61,7 @@ div.webapp[id="whole_webapp_#{uid}"]
- else
= h(webapp.path)
| /html/
tr
td  
td  
td  

tr
td
= t 'logs'
Expand All @@ -79,10 +70,7 @@ div.webapp[id="whole_webapp_#{uid}"]
td
= h(webapp.path)
| /logs/
tr
td  
td  
td  

tr
td
= t 'url'
Expand All @@ -91,21 +79,15 @@ div.webapp[id="whole_webapp_#{uid}"]
td
a href=("http://#{h webapp.name}") target="_"
| http://#{h webapp.name}
tr
td  
td  
td  

tr
td
= t 'access'

td  
td valign="top"
= render :partial => 'login_required', :locals => { :webapp => webapp }
tr
td  
td  
td  

tr
td
= t 'created'
Expand Down
4 changes: 2 additions & 2 deletions app/views/webapps/_webapp_aliases.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ div id="webapp_aliases_#{uid}"
:name => :name,
:method => :post,
:remote => true,
:form_css_class => "edit_form form_hidden",
:cancel_class => "cancel_link"
:form_css_class => "edit_form form_hidden form-horizontal",
:cancel_class => "cancel_link btn-primary btn left-margin-10 btn-sm"
.messages


Expand Down
2 changes: 1 addition & 1 deletion app/views/webapps/permissions.html.slim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#webapps-table
.settings-table
- if @webapps.size > 0
table.settings
table.settings.table
thead
tr
th.settings-col1.webapps-col1 scope="col" = t 'name'
Expand Down
8 changes: 1 addition & 7 deletions lib/webapps/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ class Engine < ::Rails::Engine
initializer :assets do |config|
Rails.application.config.assets.paths << root.join("app", "assets", "images")
end
initializer :append_migrations do |app|
unless app.root.to_s.match root.to_s
config.paths["db/migrate"].expanded.each do |expanded_path|
app.config.paths["db/migrate"] << expanded_path
end
end
end

end
end

0 comments on commit 1bc8796

Please sign in to comment.