42 Commits

Author SHA1 Message Date
James Valleroy
3fa243ef5b
Cleanup hostname change fix and clarify log message 2016-11-02 22:08:33 -04:00
mridulnagpal
063190a00c
Set current domainname again after hostname change 2016-11-02 21:49:35 -04:00
Sunil Mohan Adapa
ad61028a3a
menu: Sort menu items for all locales
Currently menu items are shown in alphabetical order in applications and
no clear order in system configuration.  This is done using static
weights for menu items based on English names that does not work for
other locales.

Sorting can't be done at the time of adding menu items as users of
multiple locales may use the interface at the same time.

Implement a sorting mechanism based on existing order as well as labels
of menu item.  This allows the flexiblity of grouping menu items in
future as it may be need for system configuration.  In case of help menu

Remove sort order for all modules except for help menu as here we want
that specific order.
2016-06-06 17:44:59 -04:00
Sunil Mohan Adapa
f04e1c1657
Minor PEP8 & spelling fixes in various modules 2016-02-28 19:38:53 +05:30
Sunil Mohan Adapa
d72abb8539
config: Don't restrict supported languages
- There is no reason to limit the number of languages supported by the
  application.  This is what happens when LANGUAGES is set during Django
  configuration.  Users should be able to set a language using browser
  preferences and see at least the Django translated messages even if
  Plinth messages are not translated (example user create/edit form).

- If we wish to limit the number of language options shown duing
  language selection (for quality perception reasons), we should perform
  the limiting at the time of configuration.

- Note that when a new language is requested in translation tool, we
  create an empty file and that may lead to language being shown but
  with few strings actually translated.  This will have poor impact on
  user experience.  I wonder if we should filter language at all,
  keeping this in mind.
2016-02-26 00:46:09 +05:30
Sunil Mohan Adapa
38bf4d4549
firewall: Use new setup mechanism
- Also reorganize module to separate out views.
2016-02-13 13:50:57 +05:30
Sunil Mohan Adapa
9d1a940d7c
config: Use new setup mechanism 2016-02-13 13:50:39 +05:30
Sunil Mohan Adapa
7f4c5f7410
Make app names as module identifiers
- The last part of the module import path is the module name.  This also
  becomes the Django app name.  Apps names have to be unique.  Hence,
  there is no scope for two different modules with same name but
  different load path to exist in the project.

- Most uses of list of loaded modules are dealing with app names instead
  of full module load path.  This is due to the fact that Django deals
  with app names and not module paths.

- It is also somewhat clumsy to access a loaded module as we are
  re-importing every time to get access module.

- Simplify all of the above by using app names are module identifiers
  and maintaing an ordered dictionary of app names to loadded modules.

- Remove unused imports.

- Minor styling fixes.
2016-02-13 13:49:23 +05:30
Caly
15312fe595
Update messages for simplicity/consistency/grammer
- Closes #375 and #380.

- More use of configurable brand name.
2016-01-24 12:14:25 +05:30
James Valleroy
48295abccc Use ugettext_lazy during init of config and power modules. 2015-12-19 18:31:37 -05:00
Sunil Mohan Adapa
a69f419c3c Make Django urlpatterns list of url()s
- Support for legacy pattern() mechanism will be removed in Django
  1.10.  Currently we see a warning for each Plinth module.
2015-12-05 09:33:23 -05:00
James Valleroy
e0bfd1401f Name Services module 2015-11-25 15:22:27 +01:00
James Valleroy
af6ebff5ca minor styling fix 2015-11-22 11:20:29 -05:00
fonfon
027dd528db Fix KeyError on first run when no language is set 2015-11-22 10:34:58 +01:00
fonfon
aeaa6ab800 Adds a 'language' dropdown field to the system configuration
- The language choice is stored with the session, not persistently
- This removes confirmation messages if nothing was changed
2015-11-18 18:29:54 +01:00
Sunil Mohan Adapa
cc181c79c3 Minor styling fixes for domain name validator 2015-11-16 22:00:25 +05:30
Joel Valleroy
e7fb549349 Updated domain name validation and unit tests 2015-11-16 22:00:25 +05:30
Sunil Mohan Adapa
c985fdae56 Update config form for hostnames and domainnames
- Make minimum length 1 for the fields.

- Write tests.

- Update description to reflect the new conditions.
2015-11-15 10:59:27 +05:30
Joel Valleroy
45fff7057b Allow hyphens in hostname and domainname. Fixes #275. 2015-11-14 17:23:06 -05:00
Sunil Mohan Adapa
3df1a88824 Switch to Django i18n for code strings
Django i18n layer is on top of gettext and provide may crucial features
such as per-request locales, lazy translations etc.
2015-11-13 22:08:43 +05:30
Sunil Mohan Adapa
02cd89b60d Internationalize strings in template files 2015-11-13 22:02:17 +05:30
Sunil Mohan Adapa
91eaf3301d datetime: Move time zone to date time module
- It is more appropriate to have the time zone setting in date time
  module.
2015-09-04 19:53:46 +05:30
Sunil Mohan Adapa
da3e92312c config: Handle miscellaneous time zones also
- In appears that in Debian it is possible to set the timezones from one
  of the listed items in zonetab.info or addtitional timezones from the
  directory /usr/share/zoneinfo/Etc/.  Add these too.

- By default all FreedomBox images have Etc/UTC as time zone.  This is
  now properly listed.
2015-09-04 19:27:16 +05:30
Sunil Mohan Adapa
cc365fb2eb config: Hide time zone not-set option normally
- After a time zone is set, don't show the option 'No time zone set' any
  more.

- Change the label to 'no time zone set'

- Update the help text to 'time zone' instead of 'timezone'.
2015-07-23 08:58:30 +05:30
Bharath Chava
d93fbba51f Issue 88: When no timezone is set, Plinth shows first one in list. 2015-07-22 22:56:28 +05:30
fonfon
824a9091c1 use django-stronghold for authentication handling (instead of @login_required) 2015-07-01 00:01:02 +05:30
Bob Girard
d64ce6cc01 Bundle tests with applications
- For each application, add ./tests directory and __init__.py file
  within it.

- Modify test controllers (coverage.py, runtests.py) to find the new
  test directories for testing and coverage analysis.

- Move existing application-specific test modules (test_pagekite.py) to
  the newly created directories.
2015-06-26 12:05:48 +05:30
Sunil Mohan Adapa
b62f6746f4 Handle arguments to actions properly
- Don't allow strings to be sent as arguments.  The mixup with
  lists/tuples could be dangerous.

- Don't escape arguments.  subprocess.Popen takes care that arguments
  are passed on nicely to the actions.

- Update tests.
2015-05-01 18:52:17 +05:30
fonfon
a8cde77d5f system configuration: make domain optional 2015-02-11 10:28:29 +05:30
James Valleroy
3d7de0778b Allow user to change domain name, then determine the FQDN from it. 2015-01-03 14:43:51 +05:30
James Valleroy
87b860bff4 Add a configuration field to change FQDN. 2015-01-03 14:43:50 +05:30
James Valleroy
298938de73 Signal xmpp module before and after hostname is changed. 2015-01-03 14:43:50 +05:30
James Valleroy
6fc721a727 Convert xmpp-hostname-change to python, merge into xmpp action file. 2015-01-03 14:43:50 +05:30
Sunil Mohan Adapa
61fefcff01 Minor styling and doc updates related to module cleanup 2014-12-14 17:27:11 +05:30
Sunil Mohan Adapa
90203986f2 Remove modules 'expert_mode' and 'lib'.
The login/logout URLs are now in the 'users' module.
2014-12-14 17:26:05 +05:30
fonfon
96a14e3d0d moved 'in-app menu' from the sidebar to the top of the content; some template block renaming 2014-12-06 17:08:37 +05:30
Sunil Mohan Adapa
6a1f96d7c2 Bootstrap change .btn-primary -> .btn .btn-primary
Only then the full intended style will apply.  This is a change from
Bootstrap 2 to Bootstrap 3.
2014-11-23 14:08:13 +05:30
fonfon
f0582e7a94 replaced bootstrap2 by bootstrap3 2014-11-11 19:06:47 +01:00
Sunil Mohan Adapa
cc549fff61 Load modules using explict paths instead of config file name 2014-10-04 13:41:27 +05:30
fonfon
e1440a5ee5 formatting strings: %s automatically applies the str() method 2014-09-03 04:56:31 +02:00
Sunil Mohan Adapa
06a50c6985 Use open().read() instead of slurp() 2014-08-30 22:17:07 +05:30
Sunil Mohan Adapa
65fa648d9f Reorganize python sources into 'plinth' package 2014-08-29 12:57:27 +05:30