[UX] Added two extra themes Dark & Blue selectable via User Profile plus the standard theme
这个提交包含在:
当前提交
5f63a2ae75
共有 12 个文件被更改,包括 22231 次插入 和 8 次删除
|
|
@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
|
|||
| be upgraded / downgraded to.
|
||||
|
|
||||
*/
|
||||
$config['migration_version'] = 51;
|
||||
$config['migration_version'] = 52;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ class User extends CI_Controller {
|
|||
$data['user_locator'] = $this->input->post('user_locator');
|
||||
$data['user_timezone'] = $this->input->post('user_timezone');
|
||||
$data['user_measurement_base'] = $this->input->post('user_measurement_base');
|
||||
$data['user_stylesheet'] = $this->input->post('user_stylesheet');
|
||||
$this->load->view('user/add', $data);
|
||||
} else {
|
||||
$this->load->view('user/add', $data);
|
||||
|
|
@ -62,7 +63,7 @@ class User extends CI_Controller {
|
|||
}
|
||||
else
|
||||
{
|
||||
switch($this->user_model->add($this->input->post('user_name'), $this->input->post('user_password'), $this->input->post('user_email'), $this->input->post('user_type'), $this->input->post('user_firstname'), $this->input->post('user_lastname'), $this->input->post('user_callsign'), $this->input->post('user_locator'), $this->input->post('user_timezone'), $this->input->post('user_measurement_base'), $this->input->post('user_date_format'))) {
|
||||
switch($this->user_model->add($this->input->post('user_name'), $this->input->post('user_password'), $this->input->post('user_email'), $this->input->post('user_type'), $this->input->post('user_firstname'), $this->input->post('user_lastname'), $this->input->post('user_callsign'), $this->input->post('user_locator'), $this->input->post('user_timezone'), $this->input->post('user_measurement_base'), $this->input->post('user_date_format'), $this->input->post('user_stylesheet'))) {
|
||||
// Check for errors
|
||||
case EUSERNAMEEXISTS:
|
||||
$data['username_error'] = 'Username <b>'.$this->input->post('user_name').'</b> already in use!';
|
||||
|
|
@ -91,6 +92,7 @@ class User extends CI_Controller {
|
|||
$data['user_callsign'] = $this->input->post('user_callsign');
|
||||
$data['user_locator'] = $this->input->post('user_locator');
|
||||
$data['user_measurement_base'] = $this->input->post('user_measurement_base');
|
||||
$data['user_stylesheet'] = $this->input->post('user_stylesheet');
|
||||
$this->load->view('user/add', $data);
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
|
@ -234,13 +236,18 @@ class User extends CI_Controller {
|
|||
} else {
|
||||
$data['user_measurement_base'] = $q->user_measurement_base;
|
||||
}
|
||||
|
||||
|
||||
if($this->input->post('user_date_format')) {
|
||||
$data['user_date_format'] = $this->input->post('user_date_format', true);
|
||||
} else {
|
||||
$data['user_date_format'] = $q->user_date_format;
|
||||
}
|
||||
|
||||
if($this->input->post('user_stylesheet')) {
|
||||
$data['user_stylesheet'] = $this->input->post('user_stylesheet', true);
|
||||
} else {
|
||||
$data['user_stylesheet'] = $q->user_stylesheet;
|
||||
}
|
||||
|
||||
$this->load->view('user/edit', $data);
|
||||
$this->load->view('interface_assets/footer');
|
||||
|
|
@ -282,6 +289,7 @@ class User extends CI_Controller {
|
|||
$data['user_callsign'] = $this->input->post('user_callsign', true);
|
||||
$data['user_locator'] = $this->input->post('user_locator', true);
|
||||
$data['user_timezone'] = $this->input->post('user_timezone', true);
|
||||
$data['user_stylesheet'] = $this->input->post('user_stylesheet');
|
||||
$this->load->view('user/edit');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Migration_add_user_stylesheet extends CI_Migration {
|
||||
|
||||
public function up()
|
||||
{
|
||||
$fields = array(
|
||||
'user_stylesheet varchar(255) default "bootstrap.min.css"',
|
||||
);
|
||||
|
||||
$this->dbforge->add_column('users', $fields);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dbforge->drop_column('users', 'user_stylesheet');
|
||||
}
|
||||
}
|
||||
|
|
@ -96,7 +96,7 @@ class User_Model extends CI_Model {
|
|||
|
||||
// FUNCTION: bool add($username, $password, $email, $type)
|
||||
// Add a user
|
||||
function add($username, $password, $email, $type, $firstname, $lastname, $callsign, $locator, $timezone, $measurement, $user_date_format) {
|
||||
function add($username, $password, $email, $type, $firstname, $lastname, $callsign, $locator, $timezone, $measurement, $user_date_format, $user_stylesheet) {
|
||||
// Check that the user isn't already used
|
||||
if(!$this->exists($username)) {
|
||||
$data = array(
|
||||
|
|
@ -111,6 +111,7 @@ class User_Model extends CI_Model {
|
|||
'user_timezone' => xss_clean($timezone),
|
||||
'user_measurement_base' => xss_clean($measurement),
|
||||
'user_date_format' => xss_clean($user_date_format),
|
||||
'user_stylesheet' => xss_clean($user_stylesheet),
|
||||
);
|
||||
|
||||
// Check the password is valid
|
||||
|
|
@ -151,6 +152,7 @@ class User_Model extends CI_Model {
|
|||
'user_clublog_name' => xss_clean($fields['user_clublog_name']),
|
||||
'user_measurement_base' => xss_clean($fields['user_measurement_base']),
|
||||
'user_date_format' => xss_clean($fields['user_date_format']),
|
||||
'user_stylesheet' => xss_clean($fields['user_stylesheet']),
|
||||
);
|
||||
|
||||
// Check to see if the user is allowed to change user levels
|
||||
|
|
@ -257,6 +259,7 @@ class User_Model extends CI_Model {
|
|||
'station_profile_id' => isset($_COOKIE["station_profile_id"])?$_COOKIE["station_profile_id"]:"",
|
||||
'user_measurement_base' => $u->row()->user_measurement_base,
|
||||
'user_date_format' => $u->row()->user_date_format,
|
||||
'user_stylesheet' => $u->row()->user_stylesheet,
|
||||
);
|
||||
|
||||
$this->session->set_userdata($userdata);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,11 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/bootstrap.min.css">
|
||||
<?php if($this->session->userdata('user_stylesheet')) { ?>
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/<?php echo $this->session->userdata('user_stylesheet');?>">
|
||||
<?php } else { ?>
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/bootstrap.min.css">
|
||||
<?php } ?>
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/fontawesome/css/all.css">
|
||||
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/jquery.fancybox.min.css" />
|
||||
|
|
|
|||
|
|
@ -6,7 +6,11 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/bootstrap.min.css">
|
||||
<?php if($this->session->userdata('user_stylesheet')) { ?>
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/<?php echo $this->session->userdata('user_stylesheet');?>">
|
||||
<?php } else { ?>
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/bootstrap.min.css">
|
||||
<?php } ?>
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/fontawesome/css/all.css">
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/<?php echo $this->session->userdata('user_stylesheet');?>">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/fontawesome/css/all.css">
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/<?php echo $this->session->userdata('user_stylesheet');?>">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/fontawesome/css/all.css">
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
|
||||
|
|
|
|||
|
|
@ -108,6 +108,15 @@
|
|||
<small id="user_measurement_base_Help" class="form-text text-muted">Choose which unit distances will be shown in.</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="user_stylesheet">Theme</label>
|
||||
<select class="custom-select" id="user_stylesheet" name="user_stylesheet" required>
|
||||
<option value='bootstrap.min.css' selected="selected">Standard theme</option>
|
||||
<option value='bootstrap-dark.css'>Dark theme</option>
|
||||
<option value='bootstrap-blue.css'>Blue theme</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" />
|
||||
<button type="submit" class="btn btn-primary">Create Account</button>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -80,6 +80,25 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Theme
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label>Stylesheet</label>
|
||||
|
||||
<select class="custom-select" id="user_stylesheet" name="user_stylesheet" required>
|
||||
<option value='bootstrap.min.css' <?php if($user_stylesheet == "bootstrap.min.css") { echo "selected=\"selected\""; } ?>>Standard theme</option>
|
||||
<option value='bootstrap-dark.css' <?php if($user_stylesheet == "bootstrap-dark.css") { echo "selected=\"selected\""; } ?>>Dark theme</option>
|
||||
<option value='bootstrap-blue.css' <?php if($user_stylesheet == "bootstrap-blue.css") { echo "selected=\"selected\""; } ?>>Blue theme</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
|
|
|||
11055
assets/css/bootstrap-blue.css
vendored
普通文件
11055
assets/css/bootstrap-blue.css
vendored
普通文件
文件差异内容过多而无法显示
加载差异
11101
assets/css/bootstrap-dark.css
vendored
普通文件
11101
assets/css/bootstrap-dark.css
vendored
普通文件
文件差异内容过多而无法显示
加载差异
正在加载…
在新工单中引用