Commit Graph

72 Commits

Author SHA1 Message Date
lonerz abde152d9c eslint: change array-callback-return from warning to error. 2016-12-05 21:21:19 -08:00
lonerz dc6849952b eslint: change space-before-function-paren from warning to error.
Also fix violations.
2016-12-05 09:50:37 -08:00
AZtheAsian 5e9918135b eslint: change quote-props from off to error and fix violations. 2016-12-02 18:35:53 -08:00
Krzysztof Zbudniewek b8fc3f0e65 eslint: change space-before-blocks from warning to error and fix violations 2016-12-02 17:40:09 -08:00
AZtheAsian 9c0ebc7359 eslint: change no-else-return to error and fix violations 2016-12-02 14:43:09 -08:00
Tommy Ip b3f4feb996 eslint: change max-len from warning to error and fix violations. 2016-12-02 14:16:33 +00:00
kevv87 e6369fc29b eslint: change no-plusplus from warning to 2 and fix violations. 2016-12-01 14:27:17 -08:00
Vladislav Manchev d7e1e4a2c0 Add initial implementation of custom realm filters.
This PR was abandoned by Vladislav and then substantially modified by
Igor Tokarev and Tim Abbott to complete it and fix a number of bugs.

Fixes #544.
2016-11-17 17:11:25 -08:00
Steve Howell 26857ac3aa admin: Use helpers when opening user form. 2016-11-15 09:37:47 -08:00
Steve Howell 7656c31769 Extract admin.get_email_for_user_row(). 2016-11-15 09:37:47 -08:00
Steve Howell 33a87492e2 admin: Remove obsolete active_user_row class. 2016-11-15 09:37:47 -08:00
Steve Howell ecfac010fc Extract admin.set_up_deactivate_user_modal().
This sets us up to eliminate the "active_user_row" hacks in
our next commit.
2016-11-15 09:37:47 -08:00
Steve Howell dcfb5c30c6 admin users: Fix real-time-sync for full names.
When an ordinary user changes their name, the admin sees the change
when they open the edit form now.
2016-11-15 09:37:47 -08:00
umkay f4c621ffe3 admin: Enable admins to toggle supported auth methods via UI.
Add a table to the administration page that will allow realm admins to
activate and deactivate the supported authentication methods for that
realm.
2016-11-06 16:29:35 -08:00
Brock Whittaker fd9a3f4609 admin: Remove values from emoji form input on success.
This removes the values after successfully creating a new realm emoji.
2016-10-25 17:01:03 -07:00
Rishi Gupta b6da450b96 admin.js: Use RealmAlias instead of Realm to show the restricted domains.
Passes the allowed domains for a realm to the frontend, via
page_params.domains. Groundwork for allowing users to add and
remove domains via the admin setting page, rather than via the
realm_alias.py management command.
2016-10-25 10:07:20 -07:00
Umair Khan 36c6a5d758 Add support for changing user's name by admin.
Fixes: #1553
2016-10-11 16:36:48 -07:00
Brock Whittaker 3a4fff837f Identify if an emoji URL is invalid and signal an error.
Previously, no error would display in the UI if the link to the emoji
image was invalid. This would happen for instance if you put in
“invalid” for the Emoji URL. No alerts would pop up but it would refuse
to add the emoji.

This catches the error and displays a notification that looks like
“Failed: Enter a valid URL.”

Fixes #1116.
2016-09-26 20:52:45 -07:00
Brock Whittaker 706f422c3a Massively refactor settings page templates and styling.
This restructures the styling for the Zulip settings and
administration pages to minimize use of Bootstrap and use a consistent
styling library for similar elements.

While it is basically a wash in terms of the page's visuals, it will
make our life a lot easier for future work on improving the settings
pages section of the site.
2016-09-19 21:55:06 -07:00
Brock Whittaker e52d618f1b Switching from $.parseJSON to JSON.parse.
There are no modern browsers that do not have built in JSON parsing
abilities. We do not need $.parseJSON as it now just serves as a call
to JSON.parse.
2016-08-25 14:22:48 -07:00
ukhan dced137f6f Fix function formatting in admin.js 2016-08-09 17:52:25 -07:00
Rag Sagar 2fef36f15a Add realm-level default language setting.
Adds a new field default language in the zerver_realm model.
This realm level default language will be used as default language
for newly created users. Realm level default language can be
changed from the administration page.

Fixes #1372.
2016-08-09 17:38:29 -07:00
Tim Abbott 469df75ab7 Fix admin.update_default_streams_table errors if tab not open.
It turns out that our logic for updating the default streams table
crashed in the case where the administration tab was not open.

Fixes: #1540.
2016-08-09 11:59:32 -07:00
Rishi Gupta d529a94e4d Add realm setting to time-limit editing of message content.
This is controlled through the admin tab and a new field in the Realms table.
Notes:
* The admin tab setting takes a value in minutes, whereas the backend stores it
  in seconds.
* This setting is unused when allow_message_editing is false.
* There is some generosity in how the limit is enforced. For instance, if the
  user sees the hovering edit button, we ensure they have at least 5 seconds to
  click it, and if the user gets to the message edit form, we ensure they have
  at least 10 seconds to make the edit, by relaxing the limit.
* This commit also includes a countdown timer in the message edit form.

Resolves #903.
2016-07-15 13:55:49 -07:00
Rishi Gupta 235162e000 admin.js: Rename overloaded variable.
We were using data for both the request and response data in
$(".administration").on("submit", "form.admin-realm-form".
Left the request data as data to be consistent with the rest of the
file, renamed the response data to response_data.
2016-07-12 17:41:48 -07:00
Rishi Gupta 43c2f35776 Add realm setting to disable message editing.
This is controlled through the admin tab and a new field in the Realms
table.  This mirrors the behavior of the old hardcoded setting
feature_flags.disable_message_editing.  Partially resolves #903.
2016-07-10 11:57:24 -07:00
Umair Khan 939ebbbc98 Mark report_error arguments translatable. 2016-06-23 16:23:01 -07:00
Umair Khan 4da1a3ecd6 Mark report_success arguments translatable. 2016-06-23 16:23:01 -07:00
Umair Khan c61a3dfbcc Ensure translations are loaded.
Since i18next loads translations asynchronously we need to make sure
that they are loaded before we call the JS code which depends on them.

Fixes #982
2016-06-20 11:31:28 -07:00
Umair Khan 6fb0baaa25 Mark strings translatable.
Following strings are marked translatable:
- All strings which are passed to `button.text` or which affect the
    text of buttons.
- All strings passed to `placeholder`.
- All strings passed to `compose_error`.

Fixes #969
2016-06-13 09:03:56 -07:00
Vishnu Ks f9f31b79d0 Make default_streams web controllable.
Fixes: #665
2016-06-09 15:24:32 -07:00
Tim Abbott c35781d505 lint: Require folding of } on same line as else statements. 2016-06-09 14:02:49 -07:00
Tim Abbott 0c1b5006f7 lint: Check for space after if in javascript. 2016-06-09 13:47:12 -07:00
Aristeidis Fkiaras 3ee210d9e8 Add setting to only allow admins create new streams.
Fixes: #691.

Thanks to Preston Hansen for work on this feature!
2016-05-18 18:53:13 -07:00
Tim Abbott 5bd94c15c7 Use camo to avoid mixed content warnings when displaying emoji. 2016-05-02 17:21:31 -07:00
Tim Abbott 4241e01854 realm emoji: Fix realm-time updating of admin emoji table.
Previously the realm emoji table on the admin page didn't update
properly in the event that another user added or removed emoji.
2016-05-02 17:00:47 -07:00
Vladislav Manchev f5e6176aea Add custom realm emoji UI to administration page. 2016-04-26 13:15:54 -07:00
Vladislav Manchev 753ccf67b1 Fix regression when saving organization settings on administration page.
Saving the organization settings form in the administration did not
work due to a trivial form name mismatch caused by following
revisions: 472898c and 58aba59.
2016-03-17 18:29:04 -07:00
Tim Abbott ae04744606 admin: Refactor to remove unnecessary selections of active_user_row. 2015-11-04 08:15:55 -08:00
Tim Abbott 958ada9f44 admin: Fix deactivating bot users.
The previous code was using the same codepath as for real users, which
was unfortunate in two ways:
* It hit the wrong endpoint on the server and thus failed
* It popped up the "remove a user prompt" which described a bunch of
  things not relevant to bots.
2015-11-04 08:03:28 -08:00
Tim Abbott 5161891fbd admin: Fix reactivating bot users.
Because the `owner` field had the class email, we were sending the
concatination of the user and owner email addresses as the email
address in the reactivate requests.

Fixes #243.
2015-11-04 08:03:17 -08:00
Tim Abbott eff0d31dcd Fix existing tab-based whitespace in the codebase.
(imported from commit 3bd8f51d1bb303455597d238af47b1b5541aed04)
2015-09-19 23:23:02 -07:00
Tim Abbott 176e3f4a54 Fix buggy yellow alert bar at top of admin page.
One of the alert rows Was missing a "-status" at the end.

While we're fixing this, make it more robust by adding .expectOne().

(imported from commit 8cb0a560701e2ee48f78471ef8fe5cfa060782af)
2015-09-19 23:23:01 -07:00
David Roe 5b7f3466ba Add feature where only admins can invite new users.
This is controlled through the admin tab and a new field in the Realms table.

(imported from commit e78a6f48160e2a1bbc68d278beb726fe31515266)
2015-08-20 15:29:46 -07:00
Tim Abbott dc5a5ce1de Fix lint error.
(imported from commit 4c0897d109ddb229989afd8e4b4db270569e558a)
2015-08-19 23:24:56 -07:00
David Roe 472898cfc6 Allow adding users to realms more easily in Dev VM.
Include new field on Realm to control whether e-mail invitations are required
separately from whether the e-mail domain must match.
Allow control of these fields from admin panel.
Update logic in registration page to use these fields.

(imported from commit edc7f0a4c43b57361d9349e258ad4f217b426f88)
2015-08-19 22:24:53 -07:00
Steve Howell 50bc5401a4 Moved loading_indicator functions to loading.js.
util.make_loading_indicator -> loading.make_indicator
util.destroy_loading_indicator -> loading.destroy_indicator

(imported from commit 8a171622a6096476dd040912d3f1460d53159f20)
2014-03-14 20:48:52 -04:00
Waseem Daher 98737a012e Properly prepopulate realm name on admin page.
Also, don't call it that.

(imported from commit baacd95be5b01373aa9423071ca72d917480e341)
2014-02-13 13:18:18 -05:00
Steve Howell eea8c0d1d5 Allow admins to change the realm's name in the UI.
(imported from commit 2873f872069a41c91beb87728f64fa526dd8a326)
2014-02-04 11:33:19 -05:00
Jessica McKellar 7085dca1ce Fix the Admin page not working for newly-knighted users.
Previously, while you'd get the event saying you'd been knighted,
which would make the Administration tab visible, clicking on the tab
would error out because the admin page HTML was never sent over on
page load (since you weren't an admin at that point).

(imported from commit 90ad351533515bebece630d67baf4b142d320754)
2014-01-29 12:41:22 -05:00