forked from consuldemocracy/consuldemocracy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from rockandror/ciudades-abiertas/installation…
…-wizard Ciudades abiertas/installation wizard
- Loading branch information
Showing
33 changed files
with
523 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,4 @@ | |
@import "autocomplete_overrides"; | ||
@import "jquery-ui/sortable"; | ||
@import "leaflet"; | ||
@import "wizard"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
.wizard { | ||
h3 { | ||
margin-bottom: 0; | ||
} | ||
|
||
h3, | ||
.current-step { | ||
display: inline-block; | ||
padding: .7em 0; | ||
} | ||
|
||
.current-step { | ||
@include breakpoint(medium) { | ||
margin-left: $line-height; | ||
} | ||
} | ||
|
||
.btn-back-step { | ||
margin-right: $line-height; | ||
} | ||
|
||
.btn-back-step i { | ||
position: relative; | ||
&:before { | ||
position: absolute; | ||
top: 2px; | ||
left: -20px; | ||
} | ||
} | ||
|
||
.v-aligner { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.button { | ||
margin-bottom: 0; | ||
} | ||
|
||
@include breakpoint(small) { | ||
input.button { | ||
padding: 1em 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
class Admin::Wizards::InstallerController < Admin::BaseController | ||
layout "wizard" | ||
|
||
before_action :set_total_steps | ||
before_action :set_settings, only: :show | ||
|
||
def new | ||
end | ||
|
||
def show | ||
render params[:id] | ||
end | ||
|
||
private | ||
|
||
def set_total_steps | ||
@total_steps = 7 | ||
end | ||
|
||
def set_settings | ||
case params[:id] | ||
when "general_settings" | ||
@settings = [Setting.find_by(key: "org_name"), | ||
Setting.find_by(key: "min_age_to_participate")] | ||
when "participation_process" | ||
@settings = [[Setting.find_by(key: "process.debates"), | ||
Setting.find_by(key: "process.proposals"), | ||
Setting.find_by(key: "votes_for_proposal_success"), | ||
Setting.find_by(key: "process.polls"), | ||
Setting.find_by(key: "process.budgets")]] | ||
when "map" | ||
@settings = [[Setting.find_by(key: "feature.map"), | ||
Setting.find_by(key: "map.latitude"), | ||
Setting.find_by(key: "map.longitude"), | ||
Setting.find_by(key: "map.zoom")]] | ||
when "smtp" | ||
@settings = [Setting.find_by(key: "feature.smtp_configuration"), | ||
Setting.find_by(key: "smtp.address"), | ||
Setting.find_by(key: "smtp.port"), | ||
Setting.find_by(key: "smtp.domain"), | ||
Setting.find_by(key: "smtp.username"), | ||
Setting.find_by(key: "smtp.password"), | ||
Setting.find_by(key: "smtp.authentication"), | ||
Setting.find_by(key: "smtp.enable_starttls_auto")] | ||
when "regional" | ||
all_settings = Setting.all.group_by { |setting| setting.type } | ||
@settings = [all_settings["regional.default_locale"]] + [all_settings["regional.available_locale"]] + [all_settings["regional.time_zone"]] | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class Admin::WizardsController < Admin::BaseController | ||
|
||
def index | ||
@wizards = ["installation"].freeze | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<div class="columns padding v-aligner"> | ||
<div class="medium-6 columns"> | ||
<h3><%= t("wizard.header.title") %></h3> | ||
<span class="current-step"><%= t("wizard.header.step") %> <%= current_step %> <%= t("wizard.header.step_of") %> <%= total_steps %></span> | ||
</div> | ||
|
||
<div class="medium-6 columns text-right"> | ||
<% if defined?(back_step) %> | ||
<%= link_to back_step, class: "btn-back-step" do %> | ||
<i class="icon-arrow-left"></i> | ||
<%= t("wizard.header.back_step") %> | ||
<% end %> | ||
<% end %> | ||
<% if defined?(next_step) %> | ||
<%= link_to t("wizard.header.next_step"), next_step, class: "button" %> | ||
<% end %> | ||
</div> | ||
</div> | ||
<hr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<tr id="<%= wizard %>-section"> | ||
<td class="small-9"> | ||
<strong><%= t("wizard.admin.module_title") %></strong> | ||
<br> | ||
<span class="small"> | ||
<%= t("wizard.admin.description") %> | ||
</span> | ||
</td> | ||
<td class="small-3"> | ||
<%= link_to t("admin.actions.configure"), new_admin_wizards_installer_path, class: "button hollow" %> | ||
</td> | ||
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<h2><%= t("wizard.admin.title") %></h2> | ||
<div> | ||
<table> | ||
<tbody> | ||
<%= render partial: "wizard", collection: @wizards %> | ||
</tbody> | ||
</table> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<%= render "admin/wizards/header_steps", current_step: 7, | ||
total_steps: @total_steps, | ||
back_step: admin_wizards_installer_path(:regional) %> | ||
|
||
<div class="medium-12 columns"> | ||
<div class="columns"> | ||
<h2><%= t("wizard.finish.title") %></h2> | ||
<p><%= t("wizard.finish.description_html") %></p> | ||
<%= link_to t("wizard.finish.btn_finish"), admin_root_path, class: "button" %> | ||
</div> | ||
</div> |
12 changes: 12 additions & 0 deletions
12
app/views/admin/wizards/installer/general_settings.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<%= render "admin/wizards/header_steps", current_step: 2, | ||
total_steps: @total_steps, | ||
back_step: new_admin_wizards_installer_path, | ||
next_step: admin_wizards_installer_path(:participation_process) %> | ||
|
||
<div class="medium-12 columns"> | ||
<div id="installer-general-settings" class="columns"> | ||
<h2><%= t("admin.menu.settings") %></h2> | ||
<p><%= t("wizard.general_settings.description_html") %></p> | ||
<%= render "admin/settings/settings_table", settings: @settings %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<%= render "admin/wizards/header_steps", current_step: 4, | ||
total_steps: @total_steps, | ||
back_step: admin_wizards_installer_path(:participation_process), | ||
next_step: admin_wizards_installer_path(:smtp) %> | ||
|
||
<div class="medium-12 columns"> | ||
<div id="installer-map" class="columns"> | ||
<h2><%= t("admin.settings.index.map.title") %></h2> | ||
<p><%= t("wizard.map.description_html") %></p> | ||
<%#= render "admin/settings/settings_table", settings: @settings %> | ||
<% @settings.each do |setting_group| %> | ||
<%= render "admin/settings/mixed_settings_table", settings: setting_group %> | ||
<% end %> | ||
<p><%= t("admin.settings.index.map.help") %></p> | ||
<%= render "admin/settings/map_form" %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<%= render "admin/wizards/header_steps", current_step: 1, | ||
total_steps: @total_steps %> | ||
|
||
<div class="medium-12 columns"> | ||
<div class="columns"> | ||
<h2><%= t("wizard.new.title") %></h2> | ||
<p><%= t("wizard.new.description_html") %></p> | ||
<%= link_to t("wizard.new.btn_start"), admin_wizards_installer_path(:general_settings), class: "button" %> | ||
</div> | ||
</div> |
14 changes: 14 additions & 0 deletions
14
app/views/admin/wizards/installer/participation_process.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<%= render "admin/wizards/header_steps", current_step: 3, | ||
total_steps: @total_steps, | ||
back_step: admin_wizards_installer_path(:general_settings), | ||
next_step: admin_wizards_installer_path(:map) %> | ||
|
||
<div class="medium-12 columns"> | ||
<div id="installer-participation-process" class="columns"> | ||
<h2><%= t("admin.settings.index.process.title") %></h2> | ||
<p><%= t("wizard.partecipation_process.description_html") %></p> | ||
<% @settings.each do |setting_group| %> | ||
<%= render "admin/settings/mixed_settings_table", settings: setting_group %> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<%= render "admin/wizards/header_steps", current_step: 6, | ||
total_steps: @total_steps, | ||
back_step: admin_wizards_installer_path(:smtp), | ||
next_step: admin_wizards_installer_path(:finish) %> | ||
|
||
<div class="medium-12 columns"> | ||
<div id="installer-regional" class="columns"> | ||
<h2><%= t("wizard.regional.title") %></h2> | ||
<p><%= t("wizard.regional.description_html") %></p> | ||
<% @settings.each do |setting_group| %> | ||
<h3><%= t("admin.settings.index.regional.#{setting_group.first.key.split(".").second}") %></h3> | ||
<%= render "admin/settings/mixed_settings_table", settings: setting_group %> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<%= render "admin/wizards/header_steps", current_step: 5, | ||
total_steps: @total_steps, | ||
back_step: admin_wizards_installer_path(:map), | ||
next_step: admin_wizards_installer_path(:regional) %> | ||
|
||
<div class="medium-12 columns"> | ||
<div id="installer-smtp" class="columns"> | ||
<h2><%= t("wizard.smtp.title") %></h2> | ||
<p><%= t("wizard.smtp.description_html") %></p> | ||
<%= render "admin/settings/mixed_settings_table", settings: @settings %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<html lang="es"> | ||
|
||
<head> | ||
<%= render "layouts/common_head", default_title: "Admin" %> | ||
<%= content_for :head %> | ||
</head> | ||
|
||
<body class="admin" data-watch-form-message="<%= I18n.t("layouts.admin.watch_form_message") %>"> | ||
<div class="off-canvas-wrapper"> | ||
<div class="off-canvas-wrapper-inner" data-off-canvas-wrapper> | ||
<div class="off-canvas-content" data-off-canvas-content> | ||
<%= render "layouts/admin_header" %> | ||
|
||
<div class="no-margin-top row expanded collapse" data-equalizer> | ||
<div class="wizard" data-equalizer-watch> | ||
<%= render "layouts/flash" %> | ||
<%= yield %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.